diff --git a/assets/index-D48Pnf4D.js b/assets/index-fUa_PWin.js similarity index 81% rename from assets/index-D48Pnf4D.js rename to assets/index-fUa_PWin.js index 8c90435f..b22a4bfd 100644 --- a/assets/index-D48Pnf4D.js +++ b/assets/index-fUa_PWin.js @@ -1,4 +1,4 @@ -function Vte(n,e){for(var t=0;tr[s]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const l of o.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function t(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(s){if(s.ep)return;s.ep=!0;const o=t(s);fetch(s.href,o)}})();var Vl=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Xy(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function __(n){if(n.__esModule)return n;var e=n.default;if(typeof e=="function"){var t=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(n).forEach(function(r){var s=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:function(){return n[r]}})}),t}var Z9={exports:{}},HR={},e8={exports:{}},Bs={};/** +function jte(n,e){for(var t=0;tr[s]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const l of o.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function t(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(s){if(s.ep)return;s.ep=!0;const o=t(s);fetch(s.href,o)}})();var Vl=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Xy(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function __(n){if(n.__esModule)return n;var e=n.default;if(typeof e=="function"){var t=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(n).forEach(function(r){var s=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:function(){return n[r]}})}),t}var e8={exports:{}},HR={},t8={exports:{}},Bs={};/** * @license React * react.production.min.js * @@ -6,7 +6,7 @@ function Vte(n,e){for(var t=0;t>>1,Te=J[fe];if(0>>1;fes(Je,ie))Res(Qe,Je)?(J[fe]=Qe,J[Re]=ie,fe=Re):(J[fe]=Je,J[Ie]=ie,fe=Ie);else if(Res(Qe,ie))J[fe]=Qe,J[Re]=ie,fe=Re;else break e}}return re}function s(J,re){var ie=J.sortIndex-re.sortIndex;return ie!==0?ie:J.id-re.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;n.unstable_now=function(){return o.now()}}else{var l=Date,u=l.now();n.unstable_now=function(){return l.now()-u}}var h=[],f=[],g=1,y=null,b=3,w=!1,C=!1,M=!1,A=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,L=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function P(J){for(var re=t(f);re!==null;){if(re.callback===null)r(f);else if(re.startTime<=J)r(f),re.sortIndex=re.expirationTime,e(h,re);else break;re=t(f)}}function D(J){if(M=!1,P(J),!C)if(t(h)!==null)C=!0,ge(z);else{var re=t(f);re!==null&&we(D,re.startTime-J)}}function z(J,re){C=!1,M&&(M=!1,k(H),H=-1),w=!0;var ie=b;try{for(P(re),y=t(h);y!==null&&(!(y.expirationTime>re)||J&&!Z());){var fe=y.callback;if(typeof fe=="function"){y.callback=null,b=y.priorityLevel;var Te=fe(y.expirationTime<=re);re=n.unstable_now(),typeof Te=="function"?y.callback=Te:y===t(h)&&r(h),P(re)}else r(h);y=t(h)}if(y!==null)var Fe=!0;else{var Ie=t(f);Ie!==null&&we(D,Ie.startTime-re),Fe=!1}return Fe}finally{y=null,b=ie,w=!1}}var U=!1,V=null,H=-1,oe=5,le=-1;function Z(){return!(n.unstable_now()-leJ||125fe?(J.sortIndex=ie,e(f,J),t(h)===null&&J===t(f)&&(M?(k(H),H=-1):M=!0,we(D,ie-fe))):(J.sortIndex=Te,e(h,J),C||w||(C=!0,ge(z))),J},n.unstable_shouldYield=Z,n.unstable_wrapCallback=function(J){var re=b;return function(){var ie=b;b=re;try{return J.apply(this,arguments)}finally{b=ie}}}})(h8);c8.exports=h8;var fne=c8.exports;/** + */(function(n){function e(J,re){var se=J.length;J.push(re);e:for(;0>>1,Te=J[fe];if(0>>1;fes(qe,se))Res(Ze,qe)?(J[fe]=Ze,J[Re]=se,fe=Re):(J[fe]=qe,J[Ie]=se,fe=Ie);else if(Res(Ze,se))J[fe]=Ze,J[Re]=se,fe=Re;else break e}}return re}function s(J,re){var se=J.sortIndex-re.sortIndex;return se!==0?se:J.id-re.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;n.unstable_now=function(){return o.now()}}else{var l=Date,u=l.now();n.unstable_now=function(){return l.now()-u}}var h=[],f=[],g=1,y=null,b=3,w=!1,C=!1,M=!1,A=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,L=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function P(J){for(var re=t(f);re!==null;){if(re.callback===null)r(f);else if(re.startTime<=J)r(f),re.sortIndex=re.expirationTime,e(h,re);else break;re=t(f)}}function D(J){if(M=!1,P(J),!C)if(t(h)!==null)C=!0,ge(z);else{var re=t(f);re!==null&&we(D,re.startTime-J)}}function z(J,re){C=!1,M&&(M=!1,k(H),H=-1),w=!0;var se=b;try{for(P(re),y=t(h);y!==null&&(!(y.expirationTime>re)||J&&!Z());){var fe=y.callback;if(typeof fe=="function"){y.callback=null,b=y.priorityLevel;var Te=fe(y.expirationTime<=re);re=n.unstable_now(),typeof Te=="function"?y.callback=Te:y===t(h)&&r(h),P(re)}else r(h);y=t(h)}if(y!==null)var Fe=!0;else{var Ie=t(f);Ie!==null&&we(D,Ie.startTime-re),Fe=!1}return Fe}finally{y=null,b=se,w=!1}}var U=!1,V=null,H=-1,oe=5,le=-1;function Z(){return!(n.unstable_now()-leJ||125fe?(J.sortIndex=se,e(f,J),t(h)===null&&J===t(f)&&(M?(k(H),H=-1):M=!0,we(D,se-fe))):(J.sortIndex=Te,e(h,J),C||w||(C=!0,ge(z))),J},n.unstable_shouldYield=Z,n.unstable_wrapCallback=function(J){var re=b;return function(){var se=b;b=re;try{return J.apply(this,arguments)}finally{b=se}}}})(d8);h8.exports=d8;var pne=h8.exports;/** * @license React * react-dom.production.min.js * @@ -30,25 +30,25 @@ function Vte(n,e){for(var t=0;t"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ON=Object.prototype.hasOwnProperty,pne=/^[: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]*$/,Rz={},kz={};function mne(n){return ON.call(kz,n)?!0:ON.call(Rz,n)?!1:pne.test(n)?kz[n]=!0:(Rz[n]=!0,!1)}function gne(n,e,t,r){if(t!==null&&t.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:t!==null?!t.acceptsBooleans:(n=n.toLowerCase().slice(0,5),n!=="data-"&&n!=="aria-");default:return!1}}function _ne(n,e,t,r){if(e===null||typeof e>"u"||gne(n,e,t,r))return!0;if(r)return!1;if(t!==null)switch(t.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function bp(n,e,t,r,s,o,l){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=s,this.mustUseProperty=t,this.propertyName=n,this.type=e,this.sanitizeURL=o,this.removeEmptyString=l}var of={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(n){of[n]=new bp(n,0,!1,n,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(n){var e=n[0];of[e]=new bp(e,1,!1,n[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(n){of[n]=new bp(n,2,!1,n.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(n){of[n]=new bp(n,2,!1,n,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(n){of[n]=new bp(n,3,!1,n.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(n){of[n]=new bp(n,3,!0,n,null,!1,!1)});["capture","download"].forEach(function(n){of[n]=new bp(n,4,!1,n,null,!1,!1)});["cols","rows","size","span"].forEach(function(n){of[n]=new bp(n,6,!1,n,null,!1,!1)});["rowSpan","start"].forEach(function(n){of[n]=new bp(n,5,!1,n.toLowerCase(),null,!1,!1)});var GB=/[\-:]([a-z])/g;function WB(n){return n[1].toUpperCase()}"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(n){var e=n.replace(GB,WB);of[e]=new bp(e,1,!1,n,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(n){var e=n.replace(GB,WB);of[e]=new bp(e,1,!1,n,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(n){var e=n.replace(GB,WB);of[e]=new bp(e,1,!1,n,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(n){of[n]=new bp(n,1,!1,n.toLowerCase(),null,!1,!1)});of.xlinkHref=new bp("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(n){of[n]=new bp(n,1,!1,n.toLowerCase(),null,!0,!0)});function VB(n,e,t,r){var s=of.hasOwnProperty(e)?of[e]:null;(s!==null?s.type!==0:r||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ON=Object.prototype.hasOwnProperty,mne=/^[: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]*$/,Rz={},kz={};function gne(n){return ON.call(kz,n)?!0:ON.call(Rz,n)?!1:mne.test(n)?kz[n]=!0:(Rz[n]=!0,!1)}function _ne(n,e,t,r){if(t!==null&&t.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:t!==null?!t.acceptsBooleans:(n=n.toLowerCase().slice(0,5),n!=="data-"&&n!=="aria-");default:return!1}}function vne(n,e,t,r){if(e===null||typeof e>"u"||_ne(n,e,t,r))return!0;if(r)return!1;if(t!==null)switch(t.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function bp(n,e,t,r,s,o,l){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=s,this.mustUseProperty=t,this.propertyName=n,this.type=e,this.sanitizeURL=o,this.removeEmptyString=l}var of={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(n){of[n]=new bp(n,0,!1,n,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(n){var e=n[0];of[e]=new bp(e,1,!1,n[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(n){of[n]=new bp(n,2,!1,n.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(n){of[n]=new bp(n,2,!1,n,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(n){of[n]=new bp(n,3,!1,n.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(n){of[n]=new bp(n,3,!0,n,null,!1,!1)});["capture","download"].forEach(function(n){of[n]=new bp(n,4,!1,n,null,!1,!1)});["cols","rows","size","span"].forEach(function(n){of[n]=new bp(n,6,!1,n,null,!1,!1)});["rowSpan","start"].forEach(function(n){of[n]=new bp(n,5,!1,n.toLowerCase(),null,!1,!1)});var GB=/[\-:]([a-z])/g;function WB(n){return n[1].toUpperCase()}"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(n){var e=n.replace(GB,WB);of[e]=new bp(e,1,!1,n,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(n){var e=n.replace(GB,WB);of[e]=new bp(e,1,!1,n,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(n){var e=n.replace(GB,WB);of[e]=new bp(e,1,!1,n,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(n){of[n]=new bp(n,1,!1,n.toLowerCase(),null,!1,!1)});of.xlinkHref=new bp("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(n){of[n]=new bp(n,1,!1,n.toLowerCase(),null,!0,!0)});function VB(n,e,t,r){var s=of.hasOwnProperty(e)?of[e]:null;(s!==null?s.type!==0:r||!(2u||s[l]!==o[u]){var h=` -`+s[l].replace(" at new "," at ");return n.displayName&&h.includes("")&&(h=h.replace("",n.displayName)),h}while(1<=l&&0<=u);break}}}finally{L2=!1,Error.prepareStackTrace=t}return(n=n?n.displayName||n.name:"")?Ex(n):""}function vne(n){switch(n.tag){case 5:return Ex(n.type);case 16:return Ex("Lazy");case 13:return Ex("Suspense");case 19:return Ex("SuspenseList");case 0:case 2:case 15:return n=N2(n.type,!1),n;case 11:return n=N2(n.type.render,!1),n;case 1:return n=N2(n.type,!0),n;default:return""}}function PN(n){if(n==null)return null;if(typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case zS:return"Fragment";case FS:return"Portal";case LN:return"Profiler";case jB:return"StrictMode";case NN:return"Suspense";case DN:return"SuspenseList"}if(typeof n=="object")switch(n.$$typeof){case m8:return(n.displayName||"Context")+".Consumer";case p8:return(n._context.displayName||"Context")+".Provider";case YB:var e=n.render;return n=n.displayName,n||(n=e.displayName||e.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case XB:return e=n.displayName||null,e!==null?e:PN(n.type)||"Memo";case gy:e=n._payload,n=n._init;try{return PN(n(e))}catch{}}return null}function yne(n){var e=n.type;switch(n.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return n=e.render,n=n.displayName||n.name||"",e.displayName||(n!==""?"ForwardRef("+n+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return PN(e);case 8:return e===jB?"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(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function Fy(n){switch(typeof n){case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function _8(n){var e=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function bne(n){var e=_8(n)?"checked":"value",t=Object.getOwnPropertyDescriptor(n.constructor.prototype,e),r=""+n[e];if(!n.hasOwnProperty(e)&&typeof t<"u"&&typeof t.get=="function"&&typeof t.set=="function"){var s=t.get,o=t.set;return Object.defineProperty(n,e,{configurable:!0,get:function(){return s.call(this)},set:function(l){r=""+l,o.call(this,l)}}),Object.defineProperty(n,e,{enumerable:t.enumerable}),{getValue:function(){return r},setValue:function(l){r=""+l},stopTracking:function(){n._valueTracker=null,delete n[e]}}}}function XC(n){n._valueTracker||(n._valueTracker=bne(n))}function v8(n){if(!n)return!1;var e=n._valueTracker;if(!e)return!0;var t=e.getValue(),r="";return n&&(r=_8(n)?n.checked?"true":"false":n.value),n=r,n!==t?(e.setValue(n),!0):!1}function kI(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}function BN(n,e){var t=e.checked;return hc({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:t??n._wrapperState.initialChecked})}function Lz(n,e){var t=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;t=Fy(e.value!=null?e.value:t),n._wrapperState={initialChecked:r,initialValue:t,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function y8(n,e){e=e.checked,e!=null&&VB(n,"checked",e,!1)}function FN(n,e){y8(n,e);var t=Fy(e.value),r=e.type;if(t!=null)r==="number"?(t===0&&n.value===""||n.value!=t)&&(n.value=""+t):n.value!==""+t&&(n.value=""+t);else if(r==="submit"||r==="reset"){n.removeAttribute("value");return}e.hasOwnProperty("value")?zN(n,e.type,t):e.hasOwnProperty("defaultValue")&&zN(n,e.type,Fy(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(n.defaultChecked=!!e.defaultChecked)}function Nz(n,e,t){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+n._wrapperState.initialValue,t||e===n.value||(n.value=e),n.defaultValue=e}t=n.name,t!==""&&(n.name=""),n.defaultChecked=!!n._wrapperState.initialChecked,t!==""&&(n.name=t)}function zN(n,e,t){(e!=="number"||kI(n.ownerDocument)!==n)&&(t==null?n.defaultValue=""+n._wrapperState.initialValue:n.defaultValue!==""+t&&(n.defaultValue=""+t))}var xx=Array.isArray;function ow(n,e,t,r){if(n=n.options,e){e={};for(var s=0;s"+e.valueOf().toString()+"",e=KC.firstChild;n.firstChild;)n.removeChild(n.firstChild);for(;e.firstChild;)n.appendChild(e.firstChild)}});function a$(n,e){if(e){var t=n.firstChild;if(t&&t===n.lastChild&&t.nodeType===3){t.nodeValue=e;return}}n.textContent=e}var Fx={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},Tne=["Webkit","ms","Moz","O"];Object.keys(Fx).forEach(function(n){Tne.forEach(function(e){e=e+n.charAt(0).toUpperCase()+n.substring(1),Fx[e]=Fx[n]})});function w8(n,e,t){return e==null||typeof e=="boolean"||e===""?"":t||typeof e!="number"||e===0||Fx.hasOwnProperty(n)&&Fx[n]?(""+e).trim():e+"px"}function E8(n,e){n=n.style;for(var t in e)if(e.hasOwnProperty(t)){var r=t.indexOf("--")===0,s=w8(t,e[t],r);t==="float"&&(t="cssFloat"),r?n.setProperty(t,s):n[t]=s}}var Sne=hc({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 GN(n,e){if(e){if(Sne[n]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error($n(137,n));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error($n(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error($n(61))}if(e.style!=null&&typeof e.style!="object")throw Error($n(62))}}function WN(n,e){if(n.indexOf("-")===-1)return typeof e.is=="string";switch(n){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 VN=null;function KB(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var jN=null,aw=null,lw=null;function Bz(n){if(n=_C(n)){if(typeof jN!="function")throw Error($n(280));var e=n.stateNode;e&&(e=YR(e),jN(n.stateNode,n.type,e))}}function x8(n){aw?lw?lw.push(n):lw=[n]:aw=n}function $8(){if(aw){var n=aw,e=lw;if(lw=aw=null,Bz(n),e)for(n=0;n>>=0,n===0?32:31-(One(n)/Lne|0)|0}var JC=64,qC=4194304;function $x(n){switch(n&-n){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 n&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return n&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return n}}function DI(n,e){var t=n.pendingLanes;if(t===0)return 0;var r=0,s=n.suspendedLanes,o=n.pingedLanes,l=t&268435455;if(l!==0){var u=l&~s;u!==0?r=$x(u):(o&=l,o!==0&&(r=$x(o)))}else l=t&~s,l!==0?r=$x(l):o!==0&&(r=$x(o));if(r===0)return 0;if(e!==0&&e!==r&&!(e&s)&&(s=r&-r,o=e&-e,s>=o||s===16&&(o&4194240)!==0))return e;if(r&4&&(r|=t&16),e=n.entangledLanes,e!==0)for(n=n.entanglements,e&=r;0t;t++)e.push(n);return e}function mC(n,e,t){n.pendingLanes|=e,e!==536870912&&(n.suspendedLanes=0,n.pingedLanes=0),n=n.eventTimes,e=31-s0(e),n[e]=t}function Bne(n,e){var t=n.pendingLanes&~e;n.pendingLanes=e,n.suspendedLanes=0,n.pingedLanes=0,n.expiredLanes&=e,n.mutableReadLanes&=e,n.entangledLanes&=e,e=n.entanglements;var r=n.eventTimes;for(n=n.expirationTimes;0=Ux),Yz=" ",Xz=!1;function j8(n,e){switch(n){case"keyup":return dre.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Y8(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var US=!1;function pre(n,e){switch(n){case"compositionend":return Y8(e);case"keypress":return e.which!==32?null:(Xz=!0,Yz);case"textInput":return n=e.data,n===Yz&&Xz?null:n;default:return null}}function mre(n,e){if(US)return n==="compositionend"||!r3&&j8(n,e)?(n=W8(),KA=e3=Ty=null,US=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:t,offset:e-n};n=r}e:{for(;t;){if(t.nextSibling){t=t.nextSibling;break e}t=t.parentNode}t=void 0}t=Qz(t)}}function q8(n,e){return n&&e?n===e?!0:n&&n.nodeType===3?!1:e&&e.nodeType===3?q8(n,e.parentNode):"contains"in n?n.contains(e):n.compareDocumentPosition?!!(n.compareDocumentPosition(e)&16):!1:!1}function Q8(){for(var n=window,e=kI();e instanceof n.HTMLIFrameElement;){try{var t=typeof e.contentWindow.location.href=="string"}catch{t=!1}if(t)n=e.contentWindow;else break;e=kI(n.document)}return e}function i3(n){var e=n&&n.nodeName&&n.nodeName.toLowerCase();return e&&(e==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||e==="textarea"||n.contentEditable==="true")}function Ere(n){var e=Q8(),t=n.focusedElem,r=n.selectionRange;if(e!==t&&t&&t.ownerDocument&&q8(t.ownerDocument.documentElement,t)){if(r!==null&&i3(t)){if(e=r.start,n=r.end,n===void 0&&(n=e),"selectionStart"in t)t.selectionStart=e,t.selectionEnd=Math.min(n,t.value.length);else if(n=(e=t.ownerDocument||document)&&e.defaultView||window,n.getSelection){n=n.getSelection();var s=t.textContent.length,o=Math.min(r.start,s);r=r.end===void 0?o:Math.min(r.end,s),!n.extend&&o>r&&(s=r,r=o,o=s),s=Zz(t,o);var l=Zz(t,r);s&&l&&(n.rangeCount!==1||n.anchorNode!==s.node||n.anchorOffset!==s.offset||n.focusNode!==l.node||n.focusOffset!==l.offset)&&(e=e.createRange(),e.setStart(s.node,s.offset),n.removeAllRanges(),o>r?(n.addRange(e),n.extend(l.node,l.offset)):(e.setEnd(l.node,l.offset),n.addRange(e)))}}for(e=[],n=t;n=n.parentNode;)n.nodeType===1&&e.push({element:n,left:n.scrollLeft,top:n.scrollTop});for(typeof t.focus=="function"&&t.focus(),t=0;t=document.documentMode,HS=null,QN=null,Gx=null,ZN=!1;function eU(n,e,t){var r=t.window===t?t.document:t.nodeType===9?t:t.ownerDocument;ZN||HS==null||HS!==kI(r)||(r=HS,"selectionStart"in r&&i3(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Gx&&f$(Gx,r)||(Gx=r,r=FI(QN,"onSelect"),0VS||(n.current=sD[VS],sD[VS]=null,VS--)}function jl(n,e){VS++,sD[VS]=n.current,n.current=e}var zy={},Df=Jy(zy),Yp=Jy(!1),W1=zy;function Tw(n,e){var t=n.type.contextTypes;if(!t)return zy;var r=n.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var s={},o;for(o in t)s[o]=e[o];return r&&(n=n.stateNode,n.__reactInternalMemoizedUnmaskedChildContext=e,n.__reactInternalMemoizedMaskedChildContext=s),s}function Xp(n){return n=n.childContextTypes,n!=null}function UI(){mu(Yp),mu(Df)}function aU(n,e,t){if(Df.current!==zy)throw Error($n(168));jl(Df,e),jl(Yp,t)}function aV(n,e,t){var r=n.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return t;r=r.getChildContext();for(var s in r)if(!(s in e))throw Error($n(108,yne(n)||"Unknown",s));return hc({},t,r)}function HI(n){return n=(n=n.stateNode)&&n.__reactInternalMemoizedMergedChildContext||zy,W1=Df.current,jl(Df,n),jl(Yp,Yp.current),!0}function lU(n,e,t){var r=n.stateNode;if(!r)throw Error($n(169));t?(n=aV(n,e,W1),r.__reactInternalMemoizedMergedChildContext=n,mu(Yp),mu(Df),jl(Df,n)):mu(Yp),jl(Yp,t)}var sv=null,XR=!1,K2=!1;function lV(n){sv===null?sv=[n]:sv.push(n)}function Dre(n){XR=!0,lV(n)}function qy(){if(!K2&&sv!==null){K2=!0;var n=0,e=Ia;try{var t=sv;for(Ia=1;n>=l,s-=l,cv=1<<32-s0(e)+s|t<H?(oe=V,V=null):oe=V.sibling;var le=b(k,V,P[H],D);if(le===null){V===null&&(V=oe);break}n&&V&&le.alternate===null&&e(k,V),L=o(le,L,H),U===null?z=le:U.sibling=le,U=le,V=oe}if(H===P.length)return t(k,V),Fu&&i1(k,H),z;if(V===null){for(;HH?(oe=V,V=null):oe=V.sibling;var Z=b(k,V,le.value,D);if(Z===null){V===null&&(V=oe);break}n&&V&&Z.alternate===null&&e(k,V),L=o(Z,L,H),U===null?z=Z:U.sibling=Z,U=Z,V=oe}if(le.done)return t(k,V),Fu&&i1(k,H),z;if(V===null){for(;!le.done;H++,le=P.next())le=y(k,le.value,D),le!==null&&(L=o(le,L,H),U===null?z=le:U.sibling=le,U=le);return Fu&&i1(k,H),z}for(V=r(k,V);!le.done;H++,le=P.next())le=w(V,k,H,le.value,D),le!==null&&(n&&le.alternate!==null&&V.delete(le.key===null?H:le.key),L=o(le,L,H),U===null?z=le:U.sibling=le,U=le);return n&&V.forEach(function(q){return e(k,q)}),Fu&&i1(k,H),z}function A(k,L,P,D){if(typeof P=="object"&&P!==null&&P.type===zS&&P.key===null&&(P=P.props.children),typeof P=="object"&&P!==null){switch(P.$$typeof){case YC:e:{for(var z=P.key,U=L;U!==null;){if(U.key===z){if(z=P.type,z===zS){if(U.tag===7){t(k,U.sibling),L=s(U,P.props.children),L.return=k,k=L;break e}}else if(U.elementType===z||typeof z=="object"&&z!==null&&z.$$typeof===gy&&mU(z)===U.type){t(k,U.sibling),L=s(U,P.props),L.ref=UE(k,U,P),L.return=k,k=L;break e}t(k,U);break}else e(k,U);U=U.sibling}P.type===zS?(L=R1(P.props.children,k.mode,D,P.key),L.return=k,k=L):(D=rI(P.type,P.key,P.props,null,k.mode,D),D.ref=UE(k,L,P),D.return=k,k=D)}return l(k);case FS:e:{for(U=P.key;L!==null;){if(L.key===U)if(L.tag===4&&L.stateNode.containerInfo===P.containerInfo&&L.stateNode.implementation===P.implementation){t(k,L.sibling),L=s(L,P.children||[]),L.return=k,k=L;break e}else{t(k,L);break}else e(k,L);L=L.sibling}L=rO(P,k.mode,D),L.return=k,k=L}return l(k);case gy:return U=P._init,A(k,L,U(P._payload),D)}if(xx(P))return C(k,L,P,D);if(DE(P))return M(k,L,P,D);iM(k,P)}return typeof P=="string"&&P!==""||typeof P=="number"?(P=""+P,L!==null&&L.tag===6?(t(k,L.sibling),L=s(L,P),L.return=k,k=L):(t(k,L),L=nO(P,k.mode,D),L.return=k,k=L),l(k)):t(k,L)}return A}var ww=gV(!0),_V=gV(!1),vC={},a_=Jy(vC),_$=Jy(vC),v$=Jy(vC);function v1(n){if(n===vC)throw Error($n(174));return n}function f3(n,e){switch(jl(v$,e),jl(_$,n),jl(a_,vC),n=e.nodeType,n){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:HN(null,"");break;default:n=n===8?e.parentNode:e,e=n.namespaceURI||null,n=n.tagName,e=HN(e,n)}mu(a_),jl(a_,e)}function Ew(){mu(a_),mu(_$),mu(v$)}function vV(n){v1(v$.current);var e=v1(a_.current),t=HN(e,n.type);e!==t&&(jl(_$,n),jl(a_,t))}function p3(n){_$.current===n&&(mu(a_),mu(_$))}var sc=Jy(0);function XI(n){for(var e=n;e!==null;){if(e.tag===13){var t=e.memoizedState;if(t!==null&&(t=t.dehydrated,t===null||t.data==="$?"||t.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break;for(;e.sibling===null;){if(e.return===null||e.return===n)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var J2=[];function m3(){for(var n=0;nt?t:4,n(!0);var r=q2.transition;q2.transition={};try{n(!1),e()}finally{Ia=t,q2.transition=r}}function LV(){return wg().memoizedState}function zre(n,e,t){var r=Ly(n);if(t={lane:r,action:t,hasEagerState:!1,eagerState:null,next:null},NV(n))DV(e,t);else if(t=dV(n,e,t,r),t!==null){var s=dp();o0(t,n,r,s),PV(t,e,r)}}function Ure(n,e,t){var r=Ly(n),s={lane:r,action:t,hasEagerState:!1,eagerState:null,next:null};if(NV(n))DV(e,s);else{var o=n.alternate;if(n.lanes===0&&(o===null||o.lanes===0)&&(o=e.lastRenderedReducer,o!==null))try{var l=e.lastRenderedState,u=o(l,t);if(s.hasEagerState=!0,s.eagerState=u,u0(u,l)){var h=e.interleaved;h===null?(s.next=s,h3(e)):(s.next=h.next,h.next=s),e.interleaved=s;return}}catch{}finally{}t=dV(n,e,s,r),t!==null&&(s=dp(),o0(t,n,r,s),PV(t,e,r))}}function NV(n){var e=n.alternate;return n===uc||e!==null&&e===uc}function DV(n,e){Wx=KI=!0;var t=n.pending;t===null?e.next=e:(e.next=t.next,t.next=e),n.pending=e}function PV(n,e,t){if(t&4194240){var r=e.lanes;r&=n.pendingLanes,t|=r,e.lanes=t,qB(n,t)}}var JI={readContext:Sg,useCallback:wf,useContext:wf,useEffect:wf,useImperativeHandle:wf,useInsertionEffect:wf,useLayoutEffect:wf,useMemo:wf,useReducer:wf,useRef:wf,useState:wf,useDebugValue:wf,useDeferredValue:wf,useTransition:wf,useMutableSource:wf,useSyncExternalStore:wf,useId:wf,unstable_isNewReconciler:!1},Hre={readContext:Sg,useCallback:function(n,e){return K0().memoizedState=[n,e===void 0?null:e],n},useContext:Sg,useEffect:_U,useImperativeHandle:function(n,e,t){return t=t!=null?t.concat([n]):null,ZA(4194308,4,AV.bind(null,e,n),t)},useLayoutEffect:function(n,e){return ZA(4194308,4,n,e)},useInsertionEffect:function(n,e){return ZA(4,2,n,e)},useMemo:function(n,e){var t=K0();return e=e===void 0?null:e,n=n(),t.memoizedState=[n,e],n},useReducer:function(n,e,t){var r=K0();return e=t!==void 0?t(e):e,r.memoizedState=r.baseState=e,n={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:e},r.queue=n,n=n.dispatch=zre.bind(null,uc,n),[r.memoizedState,n]},useRef:function(n){var e=K0();return n={current:n},e.memoizedState=n},useState:gU,useDebugValue:b3,useDeferredValue:function(n){return K0().memoizedState=n},useTransition:function(){var n=gU(!1),e=n[0];return n=Fre.bind(null,n[1]),K0().memoizedState=n,[e,n]},useMutableSource:function(){},useSyncExternalStore:function(n,e,t){var r=uc,s=K0();if(Fu){if(t===void 0)throw Error($n(407));t=t()}else{if(t=e(),Ed===null)throw Error($n(349));j1&30||TV(r,e,t)}s.memoizedState=t;var o={value:t,getSnapshot:e};return s.queue=o,_U(wV.bind(null,r,o,n),[n]),r.flags|=2048,T$(9,SV.bind(null,r,o,t,e),void 0,null),t},useId:function(){var n=K0(),e=Ed.identifierPrefix;if(Fu){var t=hv,r=cv;t=(r&~(1<<32-s0(r)-1)).toString(32)+t,e=":"+e+"R"+t,t=y$++,0")&&(h=h.replace("",n.displayName)),h}while(1<=l&&0<=u);break}}}finally{L2=!1,Error.prepareStackTrace=t}return(n=n?n.displayName||n.name:"")?Ex(n):""}function yne(n){switch(n.tag){case 5:return Ex(n.type);case 16:return Ex("Lazy");case 13:return Ex("Suspense");case 19:return Ex("SuspenseList");case 0:case 2:case 15:return n=N2(n.type,!1),n;case 11:return n=N2(n.type.render,!1),n;case 1:return n=N2(n.type,!0),n;default:return""}}function PN(n){if(n==null)return null;if(typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case zS:return"Fragment";case FS:return"Portal";case LN:return"Profiler";case jB:return"StrictMode";case NN:return"Suspense";case DN:return"SuspenseList"}if(typeof n=="object")switch(n.$$typeof){case g8:return(n.displayName||"Context")+".Consumer";case m8:return(n._context.displayName||"Context")+".Provider";case YB:var e=n.render;return n=n.displayName,n||(n=e.displayName||e.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case XB:return e=n.displayName||null,e!==null?e:PN(n.type)||"Memo";case gy:e=n._payload,n=n._init;try{return PN(n(e))}catch{}}return null}function bne(n){var e=n.type;switch(n.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return n=e.render,n=n.displayName||n.name||"",e.displayName||(n!==""?"ForwardRef("+n+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return PN(e);case 8:return e===jB?"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(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function Fy(n){switch(typeof n){case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function v8(n){var e=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function Tne(n){var e=v8(n)?"checked":"value",t=Object.getOwnPropertyDescriptor(n.constructor.prototype,e),r=""+n[e];if(!n.hasOwnProperty(e)&&typeof t<"u"&&typeof t.get=="function"&&typeof t.set=="function"){var s=t.get,o=t.set;return Object.defineProperty(n,e,{configurable:!0,get:function(){return s.call(this)},set:function(l){r=""+l,o.call(this,l)}}),Object.defineProperty(n,e,{enumerable:t.enumerable}),{getValue:function(){return r},setValue:function(l){r=""+l},stopTracking:function(){n._valueTracker=null,delete n[e]}}}}function XC(n){n._valueTracker||(n._valueTracker=Tne(n))}function y8(n){if(!n)return!1;var e=n._valueTracker;if(!e)return!0;var t=e.getValue(),r="";return n&&(r=v8(n)?n.checked?"true":"false":n.value),n=r,n!==t?(e.setValue(n),!0):!1}function kI(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}function BN(n,e){var t=e.checked;return hc({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:t??n._wrapperState.initialChecked})}function Lz(n,e){var t=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;t=Fy(e.value!=null?e.value:t),n._wrapperState={initialChecked:r,initialValue:t,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function b8(n,e){e=e.checked,e!=null&&VB(n,"checked",e,!1)}function FN(n,e){b8(n,e);var t=Fy(e.value),r=e.type;if(t!=null)r==="number"?(t===0&&n.value===""||n.value!=t)&&(n.value=""+t):n.value!==""+t&&(n.value=""+t);else if(r==="submit"||r==="reset"){n.removeAttribute("value");return}e.hasOwnProperty("value")?zN(n,e.type,t):e.hasOwnProperty("defaultValue")&&zN(n,e.type,Fy(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(n.defaultChecked=!!e.defaultChecked)}function Nz(n,e,t){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+n._wrapperState.initialValue,t||e===n.value||(n.value=e),n.defaultValue=e}t=n.name,t!==""&&(n.name=""),n.defaultChecked=!!n._wrapperState.initialChecked,t!==""&&(n.name=t)}function zN(n,e,t){(e!=="number"||kI(n.ownerDocument)!==n)&&(t==null?n.defaultValue=""+n._wrapperState.initialValue:n.defaultValue!==""+t&&(n.defaultValue=""+t))}var xx=Array.isArray;function ow(n,e,t,r){if(n=n.options,e){e={};for(var s=0;s"+e.valueOf().toString()+"",e=KC.firstChild;n.firstChild;)n.removeChild(n.firstChild);for(;e.firstChild;)n.appendChild(e.firstChild)}});function a$(n,e){if(e){var t=n.firstChild;if(t&&t===n.lastChild&&t.nodeType===3){t.nodeValue=e;return}}n.textContent=e}var Fx={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},Sne=["Webkit","ms","Moz","O"];Object.keys(Fx).forEach(function(n){Sne.forEach(function(e){e=e+n.charAt(0).toUpperCase()+n.substring(1),Fx[e]=Fx[n]})});function E8(n,e,t){return e==null||typeof e=="boolean"||e===""?"":t||typeof e!="number"||e===0||Fx.hasOwnProperty(n)&&Fx[n]?(""+e).trim():e+"px"}function x8(n,e){n=n.style;for(var t in e)if(e.hasOwnProperty(t)){var r=t.indexOf("--")===0,s=E8(t,e[t],r);t==="float"&&(t="cssFloat"),r?n.setProperty(t,s):n[t]=s}}var wne=hc({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 GN(n,e){if(e){if(wne[n]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(Cn(137,n));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(Cn(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(Cn(61))}if(e.style!=null&&typeof e.style!="object")throw Error(Cn(62))}}function WN(n,e){if(n.indexOf("-")===-1)return typeof e.is=="string";switch(n){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 VN=null;function KB(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var jN=null,aw=null,lw=null;function Bz(n){if(n=_C(n)){if(typeof jN!="function")throw Error(Cn(280));var e=n.stateNode;e&&(e=YR(e),jN(n.stateNode,n.type,e))}}function $8(n){aw?lw?lw.push(n):lw=[n]:aw=n}function C8(){if(aw){var n=aw,e=lw;if(lw=aw=null,Bz(n),e)for(n=0;n>>=0,n===0?32:31-(Lne(n)/Nne|0)|0}var JC=64,qC=4194304;function $x(n){switch(n&-n){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 n&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return n&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return n}}function DI(n,e){var t=n.pendingLanes;if(t===0)return 0;var r=0,s=n.suspendedLanes,o=n.pingedLanes,l=t&268435455;if(l!==0){var u=l&~s;u!==0?r=$x(u):(o&=l,o!==0&&(r=$x(o)))}else l=t&~s,l!==0?r=$x(l):o!==0&&(r=$x(o));if(r===0)return 0;if(e!==0&&e!==r&&!(e&s)&&(s=r&-r,o=e&-e,s>=o||s===16&&(o&4194240)!==0))return e;if(r&4&&(r|=t&16),e=n.entangledLanes,e!==0)for(n=n.entanglements,e&=r;0t;t++)e.push(n);return e}function mC(n,e,t){n.pendingLanes|=e,e!==536870912&&(n.suspendedLanes=0,n.pingedLanes=0),n=n.eventTimes,e=31-s0(e),n[e]=t}function Fne(n,e){var t=n.pendingLanes&~e;n.pendingLanes=e,n.suspendedLanes=0,n.pingedLanes=0,n.expiredLanes&=e,n.mutableReadLanes&=e,n.entangledLanes&=e,e=n.entanglements;var r=n.eventTimes;for(n=n.expirationTimes;0=Ux),Yz=" ",Xz=!1;function Y8(n,e){switch(n){case"keyup":return fre.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function X8(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var US=!1;function mre(n,e){switch(n){case"compositionend":return X8(e);case"keypress":return e.which!==32?null:(Xz=!0,Yz);case"textInput":return n=e.data,n===Yz&&Xz?null:n;default:return null}}function gre(n,e){if(US)return n==="compositionend"||!r3&&Y8(n,e)?(n=V8(),KA=e3=Ty=null,US=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:t,offset:e-n};n=r}e:{for(;t;){if(t.nextSibling){t=t.nextSibling;break e}t=t.parentNode}t=void 0}t=Qz(t)}}function Q8(n,e){return n&&e?n===e?!0:n&&n.nodeType===3?!1:e&&e.nodeType===3?Q8(n,e.parentNode):"contains"in n?n.contains(e):n.compareDocumentPosition?!!(n.compareDocumentPosition(e)&16):!1:!1}function Z8(){for(var n=window,e=kI();e instanceof n.HTMLIFrameElement;){try{var t=typeof e.contentWindow.location.href=="string"}catch{t=!1}if(t)n=e.contentWindow;else break;e=kI(n.document)}return e}function i3(n){var e=n&&n.nodeName&&n.nodeName.toLowerCase();return e&&(e==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||e==="textarea"||n.contentEditable==="true")}function xre(n){var e=Z8(),t=n.focusedElem,r=n.selectionRange;if(e!==t&&t&&t.ownerDocument&&Q8(t.ownerDocument.documentElement,t)){if(r!==null&&i3(t)){if(e=r.start,n=r.end,n===void 0&&(n=e),"selectionStart"in t)t.selectionStart=e,t.selectionEnd=Math.min(n,t.value.length);else if(n=(e=t.ownerDocument||document)&&e.defaultView||window,n.getSelection){n=n.getSelection();var s=t.textContent.length,o=Math.min(r.start,s);r=r.end===void 0?o:Math.min(r.end,s),!n.extend&&o>r&&(s=r,r=o,o=s),s=Zz(t,o);var l=Zz(t,r);s&&l&&(n.rangeCount!==1||n.anchorNode!==s.node||n.anchorOffset!==s.offset||n.focusNode!==l.node||n.focusOffset!==l.offset)&&(e=e.createRange(),e.setStart(s.node,s.offset),n.removeAllRanges(),o>r?(n.addRange(e),n.extend(l.node,l.offset)):(e.setEnd(l.node,l.offset),n.addRange(e)))}}for(e=[],n=t;n=n.parentNode;)n.nodeType===1&&e.push({element:n,left:n.scrollLeft,top:n.scrollTop});for(typeof t.focus=="function"&&t.focus(),t=0;t=document.documentMode,HS=null,QN=null,Gx=null,ZN=!1;function eU(n,e,t){var r=t.window===t?t.document:t.nodeType===9?t:t.ownerDocument;ZN||HS==null||HS!==kI(r)||(r=HS,"selectionStart"in r&&i3(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Gx&&f$(Gx,r)||(Gx=r,r=FI(QN,"onSelect"),0VS||(n.current=sD[VS],sD[VS]=null,VS--)}function jl(n,e){VS++,sD[VS]=n.current,n.current=e}var zy={},Df=Jy(zy),Yp=Jy(!1),V1=zy;function Tw(n,e){var t=n.type.contextTypes;if(!t)return zy;var r=n.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var s={},o;for(o in t)s[o]=e[o];return r&&(n=n.stateNode,n.__reactInternalMemoizedUnmaskedChildContext=e,n.__reactInternalMemoizedMaskedChildContext=s),s}function Xp(n){return n=n.childContextTypes,n!=null}function UI(){mu(Yp),mu(Df)}function aU(n,e,t){if(Df.current!==zy)throw Error(Cn(168));jl(Df,e),jl(Yp,t)}function lV(n,e,t){var r=n.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return t;r=r.getChildContext();for(var s in r)if(!(s in e))throw Error(Cn(108,bne(n)||"Unknown",s));return hc({},t,r)}function HI(n){return n=(n=n.stateNode)&&n.__reactInternalMemoizedMergedChildContext||zy,V1=Df.current,jl(Df,n),jl(Yp,Yp.current),!0}function lU(n,e,t){var r=n.stateNode;if(!r)throw Error(Cn(169));t?(n=lV(n,e,V1),r.__reactInternalMemoizedMergedChildContext=n,mu(Yp),mu(Df),jl(Df,n)):mu(Yp),jl(Yp,t)}var sv=null,XR=!1,K2=!1;function uV(n){sv===null?sv=[n]:sv.push(n)}function Pre(n){XR=!0,uV(n)}function qy(){if(!K2&&sv!==null){K2=!0;var n=0,e=Ia;try{var t=sv;for(Ia=1;n>=l,s-=l,cv=1<<32-s0(e)+s|t<H?(oe=V,V=null):oe=V.sibling;var le=b(k,V,P[H],D);if(le===null){V===null&&(V=oe);break}n&&V&&le.alternate===null&&e(k,V),L=o(le,L,H),U===null?z=le:U.sibling=le,U=le,V=oe}if(H===P.length)return t(k,V),Fu&&s1(k,H),z;if(V===null){for(;HH?(oe=V,V=null):oe=V.sibling;var Z=b(k,V,le.value,D);if(Z===null){V===null&&(V=oe);break}n&&V&&Z.alternate===null&&e(k,V),L=o(Z,L,H),U===null?z=Z:U.sibling=Z,U=Z,V=oe}if(le.done)return t(k,V),Fu&&s1(k,H),z;if(V===null){for(;!le.done;H++,le=P.next())le=y(k,le.value,D),le!==null&&(L=o(le,L,H),U===null?z=le:U.sibling=le,U=le);return Fu&&s1(k,H),z}for(V=r(k,V);!le.done;H++,le=P.next())le=w(V,k,H,le.value,D),le!==null&&(n&&le.alternate!==null&&V.delete(le.key===null?H:le.key),L=o(le,L,H),U===null?z=le:U.sibling=le,U=le);return n&&V.forEach(function(q){return e(k,q)}),Fu&&s1(k,H),z}function A(k,L,P,D){if(typeof P=="object"&&P!==null&&P.type===zS&&P.key===null&&(P=P.props.children),typeof P=="object"&&P!==null){switch(P.$$typeof){case YC:e:{for(var z=P.key,U=L;U!==null;){if(U.key===z){if(z=P.type,z===zS){if(U.tag===7){t(k,U.sibling),L=s(U,P.props.children),L.return=k,k=L;break e}}else if(U.elementType===z||typeof z=="object"&&z!==null&&z.$$typeof===gy&&mU(z)===U.type){t(k,U.sibling),L=s(U,P.props),L.ref=UE(k,U,P),L.return=k,k=L;break e}t(k,U);break}else e(k,U);U=U.sibling}P.type===zS?(L=k1(P.props.children,k.mode,D,P.key),L.return=k,k=L):(D=rI(P.type,P.key,P.props,null,k.mode,D),D.ref=UE(k,L,P),D.return=k,k=D)}return l(k);case FS:e:{for(U=P.key;L!==null;){if(L.key===U)if(L.tag===4&&L.stateNode.containerInfo===P.containerInfo&&L.stateNode.implementation===P.implementation){t(k,L.sibling),L=s(L,P.children||[]),L.return=k,k=L;break e}else{t(k,L);break}else e(k,L);L=L.sibling}L=rO(P,k.mode,D),L.return=k,k=L}return l(k);case gy:return U=P._init,A(k,L,U(P._payload),D)}if(xx(P))return C(k,L,P,D);if(DE(P))return M(k,L,P,D);iM(k,P)}return typeof P=="string"&&P!==""||typeof P=="number"?(P=""+P,L!==null&&L.tag===6?(t(k,L.sibling),L=s(L,P),L.return=k,k=L):(t(k,L),L=nO(P,k.mode,D),L.return=k,k=L),l(k)):t(k,L)}return A}var ww=_V(!0),vV=_V(!1),vC={},a_=Jy(vC),_$=Jy(vC),v$=Jy(vC);function y1(n){if(n===vC)throw Error(Cn(174));return n}function f3(n,e){switch(jl(v$,e),jl(_$,n),jl(a_,vC),n=e.nodeType,n){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:HN(null,"");break;default:n=n===8?e.parentNode:e,e=n.namespaceURI||null,n=n.tagName,e=HN(e,n)}mu(a_),jl(a_,e)}function Ew(){mu(a_),mu(_$),mu(v$)}function yV(n){y1(v$.current);var e=y1(a_.current),t=HN(e,n.type);e!==t&&(jl(_$,n),jl(a_,t))}function p3(n){_$.current===n&&(mu(a_),mu(_$))}var sc=Jy(0);function XI(n){for(var e=n;e!==null;){if(e.tag===13){var t=e.memoizedState;if(t!==null&&(t=t.dehydrated,t===null||t.data==="$?"||t.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break;for(;e.sibling===null;){if(e.return===null||e.return===n)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var J2=[];function m3(){for(var n=0;nt?t:4,n(!0);var r=q2.transition;q2.transition={};try{n(!1),e()}finally{Ia=t,q2.transition=r}}function NV(){return wg().memoizedState}function Ure(n,e,t){var r=Ly(n);if(t={lane:r,action:t,hasEagerState:!1,eagerState:null,next:null},DV(n))PV(e,t);else if(t=fV(n,e,t,r),t!==null){var s=dp();o0(t,n,r,s),BV(t,e,r)}}function Hre(n,e,t){var r=Ly(n),s={lane:r,action:t,hasEagerState:!1,eagerState:null,next:null};if(DV(n))PV(e,s);else{var o=n.alternate;if(n.lanes===0&&(o===null||o.lanes===0)&&(o=e.lastRenderedReducer,o!==null))try{var l=e.lastRenderedState,u=o(l,t);if(s.hasEagerState=!0,s.eagerState=u,u0(u,l)){var h=e.interleaved;h===null?(s.next=s,h3(e)):(s.next=h.next,h.next=s),e.interleaved=s;return}}catch{}finally{}t=fV(n,e,s,r),t!==null&&(s=dp(),o0(t,n,r,s),BV(t,e,r))}}function DV(n){var e=n.alternate;return n===uc||e!==null&&e===uc}function PV(n,e){Wx=KI=!0;var t=n.pending;t===null?e.next=e:(e.next=t.next,t.next=e),n.pending=e}function BV(n,e,t){if(t&4194240){var r=e.lanes;r&=n.pendingLanes,t|=r,e.lanes=t,qB(n,t)}}var JI={readContext:Sg,useCallback:wf,useContext:wf,useEffect:wf,useImperativeHandle:wf,useInsertionEffect:wf,useLayoutEffect:wf,useMemo:wf,useReducer:wf,useRef:wf,useState:wf,useDebugValue:wf,useDeferredValue:wf,useTransition:wf,useMutableSource:wf,useSyncExternalStore:wf,useId:wf,unstable_isNewReconciler:!1},Gre={readContext:Sg,useCallback:function(n,e){return K0().memoizedState=[n,e===void 0?null:e],n},useContext:Sg,useEffect:_U,useImperativeHandle:function(n,e,t){return t=t!=null?t.concat([n]):null,ZA(4194308,4,IV.bind(null,e,n),t)},useLayoutEffect:function(n,e){return ZA(4194308,4,n,e)},useInsertionEffect:function(n,e){return ZA(4,2,n,e)},useMemo:function(n,e){var t=K0();return e=e===void 0?null:e,n=n(),t.memoizedState=[n,e],n},useReducer:function(n,e,t){var r=K0();return e=t!==void 0?t(e):e,r.memoizedState=r.baseState=e,n={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:e},r.queue=n,n=n.dispatch=Ure.bind(null,uc,n),[r.memoizedState,n]},useRef:function(n){var e=K0();return n={current:n},e.memoizedState=n},useState:gU,useDebugValue:b3,useDeferredValue:function(n){return K0().memoizedState=n},useTransition:function(){var n=gU(!1),e=n[0];return n=zre.bind(null,n[1]),K0().memoizedState=n,[e,n]},useMutableSource:function(){},useSyncExternalStore:function(n,e,t){var r=uc,s=K0();if(Fu){if(t===void 0)throw Error(Cn(407));t=t()}else{if(t=e(),Ed===null)throw Error(Cn(349));Y1&30||SV(r,e,t)}s.memoizedState=t;var o={value:t,getSnapshot:e};return s.queue=o,_U(EV.bind(null,r,o,n),[n]),r.flags|=2048,T$(9,wV.bind(null,r,o,t,e),void 0,null),t},useId:function(){var n=K0(),e=Ed.identifierPrefix;if(Fu){var t=hv,r=cv;t=(r&~(1<<32-s0(r)-1)).toString(32)+t,e=":"+e+"R"+t,t=y$++,0<\/script>",n=n.removeChild(n.firstChild)):typeof r.is=="string"?n=l.createElement(t,{is:r.is}):(n=l.createElement(t),t==="select"&&(l=n,r.multiple?l.multiple=!0:r.size&&(l.size=r.size))):n=l.createElementNS(n,t),n[e_]=e,n[g$]=r,jV(n,e,!1,!1),e.stateNode=n;e:{switch(l=WN(t,r),t){case"dialog":fu("cancel",n),fu("close",n),s=r;break;case"iframe":case"object":case"embed":fu("load",n),s=r;break;case"video":case"audio":for(s=0;s$w&&(e.flags|=128,r=!0,HE(o,!1),e.lanes=4194304)}else{if(!r)if(n=XI(l),n!==null){if(e.flags|=128,r=!0,t=n.updateQueue,t!==null&&(e.updateQueue=t,e.flags|=4),HE(o,!0),o.tail===null&&o.tailMode==="hidden"&&!l.alternate&&!Fu)return Ef(e),null}else 2*ch()-o.renderingStartTime>$w&&t!==1073741824&&(e.flags|=128,r=!0,HE(o,!1),e.lanes=4194304);o.isBackwards?(l.sibling=e.child,e.child=l):(t=o.last,t!==null?t.sibling=l:e.child=l,o.last=l)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=ch(),e.sibling=null,t=sc.current,jl(sc,r?t&1|2:t&1),e):(Ef(e),null);case 22:case 23:return $3(),r=e.memoizedState!==null,n!==null&&n.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?Mm&1073741824&&(Ef(e),e.subtreeFlags&6&&(e.flags|=8192)):Ef(e),null;case 24:return null;case 25:return null}throw Error($n(156,e.tag))}function Jre(n,e){switch(o3(e),e.tag){case 1:return Xp(e.type)&&UI(),n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 3:return Ew(),mu(Yp),mu(Df),m3(),n=e.flags,n&65536&&!(n&128)?(e.flags=n&-65537|128,e):null;case 5:return p3(e),null;case 13:if(mu(sc),n=e.memoizedState,n!==null&&n.dehydrated!==null){if(e.alternate===null)throw Error($n(340));Sw()}return n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 19:return mu(sc),null;case 4:return Ew(),null;case 10:return c3(e.type._context),null;case 22:case 23:return $3(),null;case 24:return null;default:return null}}var oM=!1,Of=!1,qre=typeof WeakSet=="function"?WeakSet:Set,ur=null;function KS(n,e){var t=n.ref;if(t!==null)if(typeof t=="function")try{t(null)}catch(r){Lc(n,e,r)}else t.current=null}function _D(n,e,t){try{t()}catch(r){Lc(n,e,r)}}var $U=!1;function Qre(n,e){if(eD=PI,n=Q8(),i3(n)){if("selectionStart"in n)var t={start:n.selectionStart,end:n.selectionEnd};else e:{t=(t=n.ownerDocument)&&t.defaultView||window;var r=t.getSelection&&t.getSelection();if(r&&r.rangeCount!==0){t=r.anchorNode;var s=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{t.nodeType,o.nodeType}catch{t=null;break e}var l=0,u=-1,h=-1,f=0,g=0,y=n,b=null;t:for(;;){for(var w;y!==t||s!==0&&y.nodeType!==3||(u=l+s),y!==o||r!==0&&y.nodeType!==3||(h=l+r),y.nodeType===3&&(l+=y.nodeValue.length),(w=y.firstChild)!==null;)b=y,y=w;for(;;){if(y===n)break t;if(b===t&&++f===s&&(u=l),b===o&&++g===r&&(h=l),(w=y.nextSibling)!==null)break;y=b,b=y.parentNode}y=w}t=u===-1||h===-1?null:{start:u,end:h}}else t=null}t=t||{start:0,end:0}}else t=null;for(tD={focusedElem:n,selectionRange:t},PI=!1,ur=e;ur!==null;)if(e=ur,n=e.child,(e.subtreeFlags&1028)!==0&&n!==null)n.return=e,ur=n;else for(;ur!==null;){e=ur;try{var C=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(C!==null){var M=C.memoizedProps,A=C.memoizedState,k=e.stateNode,L=k.getSnapshotBeforeUpdate(e.elementType===e.type?M:Jg(e.type,M),A);k.__reactInternalSnapshotBeforeUpdate=L}break;case 3:var P=e.stateNode.containerInfo;P.nodeType===1?P.textContent="":P.nodeType===9&&P.documentElement&&P.removeChild(P.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error($n(163))}}catch(D){Lc(e,e.return,D)}if(n=e.sibling,n!==null){n.return=e.return,ur=n;break}ur=e.return}return C=$U,$U=!1,C}function Vx(n,e,t){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&n)===n){var o=s.destroy;s.destroy=void 0,o!==void 0&&_D(e,t,o)}s=s.next}while(s!==r)}}function qR(n,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var t=e=e.next;do{if((t.tag&n)===n){var r=t.create;t.destroy=r()}t=t.next}while(t!==e)}}function vD(n){var e=n.ref;if(e!==null){var t=n.stateNode;switch(n.tag){case 5:n=t;break;default:n=t}typeof e=="function"?e(n):e.current=n}}function KV(n){var e=n.alternate;e!==null&&(n.alternate=null,KV(e)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(e=n.stateNode,e!==null&&(delete e[e_],delete e[g$],delete e[iD],delete e[Lre],delete e[Nre])),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}function JV(n){return n.tag===5||n.tag===3||n.tag===4}function CU(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||JV(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function yD(n,e,t){var r=n.tag;if(r===5||r===6)n=n.stateNode,e?t.nodeType===8?t.parentNode.insertBefore(n,e):t.insertBefore(n,e):(t.nodeType===8?(e=t.parentNode,e.insertBefore(n,t)):(e=t,e.appendChild(n)),t=t._reactRootContainer,t!=null||e.onclick!==null||(e.onclick=zI));else if(r!==4&&(n=n.child,n!==null))for(yD(n,e,t),n=n.sibling;n!==null;)yD(n,e,t),n=n.sibling}function bD(n,e,t){var r=n.tag;if(r===5||r===6)n=n.stateNode,e?t.insertBefore(n,e):t.appendChild(n);else if(r!==4&&(n=n.child,n!==null))for(bD(n,e,t),n=n.sibling;n!==null;)bD(n,e,t),n=n.sibling}var tf=null,qg=!1;function Xv(n,e,t){for(t=t.child;t!==null;)qV(n,e,t),t=t.sibling}function qV(n,e,t){if(o_&&typeof o_.onCommitFiberUnmount=="function")try{o_.onCommitFiberUnmount(GR,t)}catch{}switch(t.tag){case 5:Of||KS(t,e);case 6:var r=tf,s=qg;tf=null,Xv(n,e,t),tf=r,qg=s,tf!==null&&(qg?(n=tf,t=t.stateNode,n.nodeType===8?n.parentNode.removeChild(t):n.removeChild(t)):tf.removeChild(t.stateNode));break;case 18:tf!==null&&(qg?(n=tf,t=t.stateNode,n.nodeType===8?X2(n.parentNode,t):n.nodeType===1&&X2(n,t),h$(n)):X2(tf,t.stateNode));break;case 4:r=tf,s=qg,tf=t.stateNode.containerInfo,qg=!0,Xv(n,e,t),tf=r,qg=s;break;case 0:case 11:case 14:case 15:if(!Of&&(r=t.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){s=r=r.next;do{var o=s,l=o.destroy;o=o.tag,l!==void 0&&(o&2||o&4)&&_D(t,e,l),s=s.next}while(s!==r)}Xv(n,e,t);break;case 1:if(!Of&&(KS(t,e),r=t.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=t.memoizedProps,r.state=t.memoizedState,r.componentWillUnmount()}catch(u){Lc(t,e,u)}Xv(n,e,t);break;case 21:Xv(n,e,t);break;case 22:t.mode&1?(Of=(r=Of)||t.memoizedState!==null,Xv(n,e,t),Of=r):Xv(n,e,t);break;default:Xv(n,e,t)}}function MU(n){var e=n.updateQueue;if(e!==null){n.updateQueue=null;var t=n.stateNode;t===null&&(t=n.stateNode=new qre),e.forEach(function(r){var s=aie.bind(null,n,r);t.has(r)||(t.add(r),r.then(s,s))})}}function Ug(n,e){var t=e.deletions;if(t!==null)for(var r=0;rs&&(s=l),r&=~o}if(r=s,r=ch()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*eie(r/1960))-r,10n?16:n,Sy===null)var r=!1;else{if(n=Sy,Sy=null,ZI=0,wo&6)throw Error($n(331));var s=wo;for(wo|=4,ur=n.current;ur!==null;){var o=ur,l=o.child;if(ur.flags&16){var u=o.deletions;if(u!==null){for(var h=0;hch()-E3?I1(n,0):w3|=t),Kp(n,e)}function sj(n,e){e===0&&(n.mode&1?(e=qC,qC<<=1,!(qC&130023424)&&(qC=4194304)):e=1);var t=dp();n=vv(n,e),n!==null&&(mC(n,e,t),Kp(n,t))}function oie(n){var e=n.memoizedState,t=0;e!==null&&(t=e.retryLane),sj(n,t)}function aie(n,e){var t=0;switch(n.tag){case 13:var r=n.stateNode,s=n.memoizedState;s!==null&&(t=s.retryLane);break;case 19:r=n.stateNode;break;default:throw Error($n(314))}r!==null&&r.delete(e),sj(n,t)}var oj;oj=function(n,e,t){if(n!==null)if(n.memoizedProps!==e.pendingProps||Yp.current)Vp=!0;else{if(!(n.lanes&t)&&!(e.flags&128))return Vp=!1,Xre(n,e,t);Vp=!!(n.flags&131072)}else Vp=!1,Fu&&e.flags&1048576&&uV(e,WI,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;eI(n,e),n=e.pendingProps;var s=Tw(e,Df.current);cw(e,t),s=_3(null,e,r,n,s,t);var o=v3();return e.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,Xp(r)?(o=!0,HI(e)):o=!1,e.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,d3(e),s.updater=KR,e.stateNode=s,s._reactInternals=e,cD(e,r,n,t),e=fD(null,e,r,!0,o,t)):(e.tag=0,Fu&&o&&s3(e),ip(null,e,s,t),e=e.child),e;case 16:r=e.elementType;e:{switch(eI(n,e),n=e.pendingProps,s=r._init,r=s(r._payload),e.type=r,s=e.tag=uie(r),n=Jg(r,n),s){case 0:e=dD(null,e,r,n,t);break e;case 1:e=wU(null,e,r,n,t);break e;case 11:e=TU(null,e,r,n,t);break e;case 14:e=SU(null,e,r,Jg(r.type,n),t);break e}throw Error($n(306,r,""))}return e;case 0:return r=e.type,s=e.pendingProps,s=e.elementType===r?s:Jg(r,s),dD(n,e,r,s,t);case 1:return r=e.type,s=e.pendingProps,s=e.elementType===r?s:Jg(r,s),wU(n,e,r,s,t);case 3:e:{if(GV(e),n===null)throw Error($n(387));r=e.pendingProps,o=e.memoizedState,s=o.element,fV(n,e),YI(e,r,null,t);var l=e.memoizedState;if(r=l.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:l.cache,pendingSuspenseBoundaries:l.pendingSuspenseBoundaries,transitions:l.transitions},e.updateQueue.baseState=o,e.memoizedState=o,e.flags&256){s=xw(Error($n(423)),e),e=EU(n,e,r,t,s);break e}else if(r!==s){s=xw(Error($n(424)),e),e=EU(n,e,r,t,s);break e}else for(Rm=Ry(e.stateNode.containerInfo.firstChild),Om=e,Fu=!0,Qg=null,t=_V(e,null,r,t),e.child=t;t;)t.flags=t.flags&-3|4096,t=t.sibling;else{if(Sw(),r===s){e=yv(n,e,t);break e}ip(n,e,r,t)}e=e.child}return e;case 5:return vV(e),n===null&&aD(e),r=e.type,s=e.pendingProps,o=n!==null?n.memoizedProps:null,l=s.children,nD(r,s)?l=null:o!==null&&nD(r,o)&&(e.flags|=32),HV(n,e),ip(n,e,l,t),e.child;case 6:return n===null&&aD(e),null;case 13:return WV(n,e,t);case 4:return f3(e,e.stateNode.containerInfo),r=e.pendingProps,n===null?e.child=ww(e,null,r,t):ip(n,e,r,t),e.child;case 11:return r=e.type,s=e.pendingProps,s=e.elementType===r?s:Jg(r,s),TU(n,e,r,s,t);case 7:return ip(n,e,e.pendingProps,t),e.child;case 8:return ip(n,e,e.pendingProps.children,t),e.child;case 12:return ip(n,e,e.pendingProps.children,t),e.child;case 10:e:{if(r=e.type._context,s=e.pendingProps,o=e.memoizedProps,l=s.value,jl(VI,r._currentValue),r._currentValue=l,o!==null)if(u0(o.value,l)){if(o.children===s.children&&!Yp.current){e=yv(n,e,t);break e}}else for(o=e.child,o!==null&&(o.return=e);o!==null;){var u=o.dependencies;if(u!==null){l=o.child;for(var h=u.firstContext;h!==null;){if(h.context===r){if(o.tag===1){h=fv(-1,t&-t),h.tag=2;var f=o.updateQueue;if(f!==null){f=f.shared;var g=f.pending;g===null?h.next=h:(h.next=g.next,g.next=h),f.pending=h}}o.lanes|=t,h=o.alternate,h!==null&&(h.lanes|=t),lD(o.return,t,e),u.lanes|=t;break}h=h.next}}else if(o.tag===10)l=o.type===e.type?null:o.child;else if(o.tag===18){if(l=o.return,l===null)throw Error($n(341));l.lanes|=t,u=l.alternate,u!==null&&(u.lanes|=t),lD(l,t,e),l=o.sibling}else l=o.child;if(l!==null)l.return=o;else for(l=o;l!==null;){if(l===e){l=null;break}if(o=l.sibling,o!==null){o.return=l.return,l=o;break}l=l.return}o=l}ip(n,e,s.children,t),e=e.child}return e;case 9:return s=e.type,r=e.pendingProps.children,cw(e,t),s=Sg(s),r=r(s),e.flags|=1,ip(n,e,r,t),e.child;case 14:return r=e.type,s=Jg(r,e.pendingProps),s=Jg(r.type,s),SU(n,e,r,s,t);case 15:return zV(n,e,e.type,e.pendingProps,t);case 17:return r=e.type,s=e.pendingProps,s=e.elementType===r?s:Jg(r,s),eI(n,e),e.tag=1,Xp(r)?(n=!0,HI(e)):n=!1,cw(e,t),mV(e,r,s),cD(e,r,s,t),fD(null,e,r,!0,n,t);case 19:return VV(n,e,t);case 22:return UV(n,e,t)}throw Error($n(156,e.tag))};function aj(n,e){return O8(n,e)}function lie(n,e,t,r){this.tag=n,this.key=t,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,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 yg(n,e,t,r){return new lie(n,e,t,r)}function M3(n){return n=n.prototype,!(!n||!n.isReactComponent)}function uie(n){if(typeof n=="function")return M3(n)?1:0;if(n!=null){if(n=n.$$typeof,n===YB)return 11;if(n===XB)return 14}return 2}function Ny(n,e){var t=n.alternate;return t===null?(t=yg(n.tag,e,n.key,n.mode),t.elementType=n.elementType,t.type=n.type,t.stateNode=n.stateNode,t.alternate=n,n.alternate=t):(t.pendingProps=e,t.type=n.type,t.flags=0,t.subtreeFlags=0,t.deletions=null),t.flags=n.flags&14680064,t.childLanes=n.childLanes,t.lanes=n.lanes,t.child=n.child,t.memoizedProps=n.memoizedProps,t.memoizedState=n.memoizedState,t.updateQueue=n.updateQueue,e=n.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},t.sibling=n.sibling,t.index=n.index,t.ref=n.ref,t}function rI(n,e,t,r,s,o){var l=2;if(r=n,typeof n=="function")M3(n)&&(l=1);else if(typeof n=="string")l=5;else e:switch(n){case zS:return R1(t.children,s,o,e);case jB:l=8,s|=8;break;case LN:return n=yg(12,t,e,s|2),n.elementType=LN,n.lanes=o,n;case NN:return n=yg(13,t,e,s),n.elementType=NN,n.lanes=o,n;case DN:return n=yg(19,t,e,s),n.elementType=DN,n.lanes=o,n;case g8:return ZR(t,s,o,e);default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case p8:l=10;break e;case m8:l=9;break e;case YB:l=11;break e;case XB:l=14;break e;case gy:l=16,r=null;break e}throw Error($n(130,n==null?n:typeof n,""))}return e=yg(l,t,e,s),e.elementType=n,e.type=r,e.lanes=o,e}function R1(n,e,t,r){return n=yg(7,n,r,e),n.lanes=t,n}function ZR(n,e,t,r){return n=yg(22,n,r,e),n.elementType=g8,n.lanes=t,n.stateNode={isHidden:!1},n}function nO(n,e,t){return n=yg(6,n,null,e),n.lanes=t,n}function rO(n,e,t){return e=yg(4,n.children!==null?n.children:[],n.key,e),e.lanes=t,e.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},e}function cie(n,e,t,r,s){this.tag=e,this.containerInfo=n,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=P2(0),this.expirationTimes=P2(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=P2(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function A3(n,e,t,r,s,o,l,u,h){return n=new cie(n,e,t,u,h),e===1?(e=1,o===!0&&(e|=8)):e=0,o=yg(3,null,null,e),n.current=o,o.stateNode=n,o.memoizedState={element:r,isDehydrated:t,cache:null,transitions:null,pendingSuspenseBoundaries:null},d3(o),n}function hie(n,e,t){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(hj)}catch(n){console.error(n)}}hj(),u8.exports=Hm;var O3=u8.exports;const uM=Xy(O3);var DU=O3;kN.createRoot=DU.createRoot,kN.hydrateRoot=DU.hydrateRoot;var dj={exports:{}},iO={exports:{}},sO={exports:{}},oO={exports:{}},aO={exports:{}},PU;function L3(){return PU||(PU=1,function(n,e){(function(t,r){n.exports=r()})(Vl,function(){var t={},r,s,o,l,u,h,f,g,y,b,w,C,M,A,k,L,P,D,z,U,V,H,oe,le,Z,q,he,ae,ue,ge,we,J,re,ie,fe,Te,Fe,Ie,Je,Re,Qe,nt,ft,lt,ze,Ce,He,rt,it,Nt,kt,vt,Mt,At,mt,xe,se,$e,ht,St,It,pt,Ke,Le,Q,te,me,ke,Xe,Wt,Ge,tn,_t,Jt,Kt,On,ii,Pr,Ei,xr,mr,ne,Se,We,ot,zt,sn,Nn,Pe,gt,Ct,bt,Vt,Wn,rr,_r,$r,si,Br,Yr,Ss,Oa,Eo,Yl,nn,Rr,el,La,Fs,zs,Di,kr,An,Ir,Gr,yr,Pi,ws,fi,gs,tl,Na,fc,pc,Xs,Jo,Xl,gu,mh,qo,vr,xi,Dc,gh,Pc,El,_u,xl,$l,br,Tr,Kl,nl,rl,vu,Qi,_s,il,Cd,io,zu,ca,yu,or,Gn,Es,so,Uu,bu,_h,Da,ha,Hu,wr,Rs,bi,$i,da,Zr,Tu,xo,Su,sl,Bi,Ci,Vn,Mi,Xr,dd,wu,Vi,Pa,vh,hr,Qo,fd,lf,Bc,uf,Bf,Tp,Md,Jl,ks,Gu,yh,Ba,ci,Er,oo,Fa,Bo,ql,Ql,Fh,Wr,Ai,Sr,ji,fa,Eu,cf,hf,pd,Wu,ol,Fc,zh,Vu,Zl,Us,eu,Uh,zc,Uc,is,Fr,Cl,za,tu,xu,bh,Ad,pi,ye,je,Be,Ot,rn,In,Jn,vn,zr,ao,Ti,lo,al,Fi,vs,$u,qn,pa,Ks,Hs,Ua,Hh,Th,mc,Zo,Hc,Gh,Ha,Wh,gc,ju,md,ea,uo,Ml,Vh,zi,gd,Yu,nu,Gc,Id,Al,Rd,jh,ei,Ii,Sp,Ff,Il,ru,Xu,Ku,Sh,ll,ta,Rl,Wc,kl,Vc,_c,kd,Ga,Vr,ul,Zi,ma,X,xs,ga,Cr,mn,zf,cl,Ri,hi,es,ss,jc,_a,va,os,Yc,na,Od,Ld,Yh,Gs,Kn,Ws,Js,Ui,iu,Fo,xn,mi,gi,Uf,wh,co,ya,Cn,yn,hl,vc,wp,su,$o,ys,dl,as,fl,zo,Xh,Wa,ki,Nd,Xc,Kh,Uo,Co,df,Cu,Ol,_d,yc,Kr,ou,Ju,ls,Va,$s,Cs,Kc,_i,ja,bc,ff,Eh,ra,Yi,Pn,tr,Nr,ti,qr,Mo,us,ts,au,qu,Tc,Qu,qs,ho,vd,ba,Mu,Au,fo,po,Ll,Ho,Zu,ec,xh,$h,Or,bs,Os,Ya,Vs,fn,Jc,wn;r=function(i,a,p,S){if(!(i instanceof Ft)&&typeof i!="string"||`${i}`.trim()==="")throw Error('Invalid type "'+i+'". The type must be a non-empty string or a Blockly.registry.Type.');if(i=`${i}`.toLowerCase(),typeof a!="string"||a.trim()==="")throw Error('Invalid name "'+a+'". The name must be a non-empty string.');const O=a.toLowerCase();if(!p)throw Error("Can not register a null value");let j=vi[i],ve=lu[i];if(j||(j=vi[i]=Object.create(null),ve=lu[i]=Object.create(null)),s(i,p),!S&&j[O])throw Error('Name "'+O+'" with type "'+i+'" already registered.');j[O]=p,ve[O]=a},s=function(i,a){switch(i){case String(Ft.FIELD):if(typeof a.fromJson!="function")throw Error('Type "'+i+'" must have a fromJson function')}},o=function(i,a){i=`${i}`.toLowerCase(),a=a.toLowerCase();const p=vi[i];p&&p[a]?(delete vi[i][a],delete lu[i][a]):console.warn("Unable to unregister ["+a+"]["+i+"] from the registry.")},l=function(i,a,p){i=`${i}`.toLowerCase(),a=a.toLowerCase();const S=vi[i];if(!S||!S[a]){if(a="Unable to find ["+a+"]["+i+"] in the registry.",p)throw Error(a+" You must require or register a "+i+" plugin.");return console.warn(a),null}return S[a]},u=function(i,a){return i=`${i}`.toLowerCase(),a=a.toLowerCase(),(i=vi[i])?!!i[a]:!1},h=function(i,a,p){return l(i,a,p)},f=function(i,a,p){return l(i,a,p)},g=function(i,a,p){i=`${i}`.toLowerCase();var S=vi[i];if(!S){if(S=`Unable to find [${i}] in the registry.`,p)throw Error(`${S} You must require or register a ${i} plugin.`);return console.warn(S),null}if(!a)return S;i=lu[i],p=Object.create(null);for(const O of Object.keys(S))p[i[O]]=S[O];return p},y=function(i,a,p){return a=a.plugins[String(i)]||Nl,typeof a=="function"?a:h(i,a,p)},b=function(i){return tc[i]||null},w=function(){const i=[];for(const a in tc)i.push(tc[a]);return i},C=function(i){tc[i.id]=i},M=function(i){delete tc[i.id]},A=function(){return Jh},k=function(i){Jh=i},L=function(){return qc},P=function(i){qc=i},D=function(){return oi},z=function(i){oi=i},U=function(i){for(;i.options.parentWorkspace;)i=i.options.parentWorkspace;const a=i.getParentSvg(),p=i.getCachedParentSvgSize();var S=a.parentElement;if(S instanceof HTMLElement){var O=S.offsetWidth;S=S.offsetHeight,p.width!==O&&(a.setAttribute("width",O+"px"),i.setCachedParentSvgSize(O,null)),p.height!==S&&(a.setAttribute("height",S+"px"),i.setCachedParentSvgSize(null,S)),i.resize()}},V=function(i,a){const p=Object.create(null),S=i.getDescendants(!0);a&&(i=i.getNextBlock())&&(i=S.indexOf(i),S.splice(i,S.length-i));for(let O=0,j;j=S[O];O++)p[j.type]?p[j.type]++:p[j.type]=1;return p},H=function(i){return function(){this.jsonInit(i)}},oe=function(i){Qc.defineBlocksWithJsonArrayInternal(i)},le=function(i){t.defineBlocks$$module$build$src$core$common(t.createBlockDefinitionsFromJsonArray$$module$build$src$core$common(i))},t.createBlockDefinitionsFromJsonArray$$module$build$src$core$common=function(i){const a={};for(let p=0;p{setTimeout(we,0)})}catch{setTimeout(we,0)}Ec.push(i)}},we=function(){var i=J(Ec,!0);Ec.length=0;for(let p=0,S;S=i[p];p++)if(S.workspaceId){var a=b(S.workspaceId);a&&a.fireChangeListener(S)}i=new Set(i.map(p=>p.workspaceId));for(const p of i){if(!p||(i=b(p),!i))continue;i=i.getUndoStack();let S;for(a=i.length;0>>/g,i),Zh="",i=document.createElement("style"),i.id="blockly-common-style",a=document.createTextNode(a),i.appendChild(a),document.head.insertBefore(i,document.head.firstChild)))},xe=function(i,a,p,S){i=i+" was deprecated in "+a+" and will be deleted in "+p+".",S&&(i+=` -Use `+S+" instead."),g0.has(i)||(g0.add(i),console.warn(i))},se=function(i,a,p){i=document.createElementNS(Jm,`${i}`);for(const S in a)i.setAttribute(S,`${a[S]}`);return p&&p.appendChild(i),i},$e=function(i,a){return a=a.split(" "),a.every(p=>i.classList.contains(p))?!1:(i.classList.add(...a),!0)},ht=function(i,a){i.classList.remove(...a.split(" "))},St=function(i,a){return a=a.split(" "),a.every(p=>!i.classList.contains(p))?!1:(i.classList.remove(...a),!0)},It=function(i,a){return i.classList.contains(a)},pt=function(i){return i&&i.parentNode?i.parentNode.removeChild(i):null},Ke=function(i,a){const p=a.nextSibling;if(a=a.parentNode,!a)throw Error("Reference node has no parent.");p?a.insertBefore(i,p):a.appendChild(i)},Le=function(i,a){return xe("Blockly.utils.dom.containsNode","version 10","version 11",'Use native "contains" DOM method'),i.contains(a)},Q=function(i,a){i.style.transform=a,i.style["-webkit-transform"]=a},te=function(){Ka++,Dd||(Dd=Object.create(null))},me=function(){Ka--,Ka||(Dd=null)},ke=function(i){const a=i.textContent+` -`+i.className.baseVal;let p;if(Dd&&(p=Dd[a]))return p;try{p=i.getComputedTextLength()}catch{return 8*i.textContent.length}return Dd&&(Dd[a]=p),p},Xe=function(i,a,p,S){return Wt(i,a+"pt",p,S)},Wt=function(i,a,p,S){const O=i.textContent;i=O+` -`+i.className.baseVal;var j;return Dd&&(j=Dd[i])||(Ur||(j=document.createElement("canvas"),j.className="blocklyComputeCanvas",document.body.appendChild(j),Ur=j.getContext("2d")),Ur.font=p+" "+a+" "+S,j=O?Ur.measureText(O).width:0,Dd&&(Dd[i]=j)),j},Ge=function(i,a,p,S){const O=document.createElement("span");O.style.font=p+" "+a+" "+S,O.textContent=i,i=document.createElement("div"),i.style.width="1px",i.style.height="0",a=document.createElement("div"),a.style.display="flex",a.style.position="fixed",a.style.top="0",a.style.left="0",a.appendChild(O),a.appendChild(i),document.body.appendChild(a),p={height:0,baseline:0};try{a.style.alignItems="baseline",p.baseline=i.offsetTop-O.offsetTop,a.style.alignItems="flex-end",p.height=i.offsetTop-O.offsetTop}finally{document.body.removeChild(a)}return p},tn=function(i){return S_.getSizeInternal(i)},_t=function(i){if(Kt(i,"display")!=="none")return Jt(i);const a=i.style,p=a.display,S=a.visibility,O=a.position;a.visibility="hidden",a.position="absolute",a.display="inline";const j=i.offsetWidth;return i=i.offsetHeight,a.display=p,a.position=O,a.visibility=S,new eo(j,i)},Jt=function(i){return new eo(i.offsetWidth,i.offsetHeight)},Kt=function(i,a){return i=window.getComputedStyle(i),i[a]||i.getPropertyValue(a)},On=function(i){const a=new _n(0,0);i=i.getBoundingClientRect();var p=document.documentElement;return p=new _n(window.pageXOffset||p.scrollLeft,window.pageYOffset||p.scrollTop),a.x=i.left+p.x,a.y=i.top+p.y,a},ii=function(){const i=document.body,a=document.documentElement;return new _n(i.scrollLeft||a.scrollLeft,i.scrollTop||a.scrollTop)},Pr=function(i){const a=parseFloat(Kt(i,"borderLeftWidth")),p=parseFloat(Kt(i,"borderRightWidth")),S=parseFloat(Kt(i,"borderTopWidth"));return i=parseFloat(Kt(i,"borderBottomWidth")),new Oi(S,i,a,p)},Ei=function(i,a,p){i=xr(i,a,p),a.scrollLeft=i.x,a.scrollTop=i.y},xr=function(i,a,p){var S=On(i),O=On(a),j=Pr(a);const ve=S.x-O.x-j.left;return S=S.y-O.y-j.top,O=Jt(i),i=a.clientWidth-O.width,O=a.clientHeight-O.height,j=a.scrollLeft,a=a.scrollTop,p?(j+=ve-i/2,a+=S-O/2):(j+=Math.min(ve,Math.max(ve-i,0)),a+=Math.min(S,Math.max(S-O,0))),new _n(j,a)},mr=function(i){const a=new _n(0,0);var p=i.x&&i.getAttribute("x");const S=i.y&&i.getAttribute("y");return p&&(a.x=parseInt(p)),S&&(a.y=parseInt(S)),(p=(p=i.getAttribute("transform"))&&p.match(Ep))&&(a.x+=Number(p[1]),p[3]&&(a.y+=Number(p[3]))),(i=i.getAttribute("style"))&&-1`&#${a.charCodeAt(0)};`)},gt=function(i){return i?((i instanceof Element||typeof i=="string")&&(i=Br(i),i=_r(i)),Ct(i),i):null},Ct=function(i){const a=i.kind;if(i=i.contents,a&&a!==Ig&&a!==nh)throw Error("Invalid toolbox kind "+a+". Please supply either "+Ig+" or "+nh);if(!i)throw Error("Toolbox must have a contents attribute.")},bt=function(i){return i?i.contents?i.contents:Array.isArray(i)&&0 document.")}else i instanceof Element&&(a=i);return a},Yr=function(i,a,p,S,O,j){const ve=j.scrollbar&&j.scrollbar.canScrollVertically();return i.horizontal===rm.LEFT?(p=O.absoluteMetrics.left+p,ve&&j.RTL&&(p+=xa.scrollbarThickness)):(p=O.absoluteMetrics.left+O.viewMetrics.width-a.width-p,ve&&!j.RTL&&(p-=xa.scrollbarThickness)),i.vertical===Ja.TOP?i=O.absoluteMetrics.top+S:(i=O.absoluteMetrics.top+O.viewMetrics.height-a.height-S,j.scrollbar&&j.scrollbar.canScrollHorizontally()&&(i-=xa.scrollbarThickness)),new Oi(i,i+a.height,p,p+a.width)},Ss=function(i,a){return{horizontal:a.toolboxMetrics.position===dr.LEFT||i.horizontalLayout&&!i.RTL?rm.RIGHT:rm.LEFT,vertical:a.toolboxMetrics.position===dr.BOTTOM?Ja.TOP:Ja.BOTTOM}},Oa=function(i,a,p,S){const O=i.left,j=i.right-i.left,ve=i.bottom-i.top;for(let Ue=0;Ue1'),S.appendChild(p),a.push(S)),jr.variables_get){i.sort(_f.compareByName);for(let O=0,j;j=i[O];O++)p=t.createElement$$module$build$src$core$utils$xml("block"),p.setAttribute("type","variables_get"),p.setAttribute("gap","8"),p.appendChild(Xs(j)),a.push(p)}}return a},Gr=function(i){return rh.generateUniqueNameInternal(i)},yr=function(i){return Pi(sm.charAt(0),i.getAllVariableNames())},Pi=function(i,a){if(!a.length)return i;const p=sm;let S="",O=p.indexOf(i);for(;;){let j=!1;for(let ve=0;vej.getVariableModel().name);if(S&&(p=S.some(j=>j.toLowerCase()===i),S=S.some(j=>j.toLowerCase()===a),p&&S))return O.getName()}return null},pc=function(i,a,p){i=i.toLowerCase(),a=a.toLowerCase(),p=p.getAllBlocks(!1);for(const O of p){if(!Di(O))continue;p=O.getProcedureDef();var S=p[1];const j=S.some(ve=>ve.toLowerCase()===i);if(S=S.some(ve=>ve.toLowerCase()===a),j&&S)return p[0]}return null},Xs=function(i){const a=t.createElement$$module$build$src$core$utils$xml("field");return a.setAttribute("name","VAR"),a.setAttribute("id",i.getId()),a.setAttribute("variabletype",i.type),i=t.createTextNode$$module$build$src$core$utils$xml(i.name),a.appendChild(i),a},t.getOrCreateVariablePackage$$module$build$src$core$variables=function(i,a,p,S){let O=t.getVariable$$module$build$src$core$variables(i,a,p,S);return O||(O=Jo(i,a,p,S)),O},t.getVariable$$module$build$src$core$variables=function(i,a,p,S){const O=i.getPotentialVariableMap();let j=null;if(a&&(j=i.getVariableById(a),!j&&O&&(j=O.getVariableById(a)),j))return j;if(p){if(S===void 0)throw Error("Tried to look up a variable by name without a type");j=i.getVariable(p,S),!j&&O&&(j=O.getVariable(p,S))}return j},Jo=function(i,a,p,S){const O=i.getPotentialVariableMap();return p||(p=Gr(i.isFlyout?i.targetWorkspace:i)),O?O.createVariable(p,S,a):i.createVariable(p,S,a)},Xl=function(i,a){i=i.getAllVariables();const p=[];if(a.length!==i.length)for(let S=0;S{Zm=a,Cc=window.requestAnimationFrame(()=>{Pc(),a()})})),Gd)},vr=function(){return Gd||Promise.resolve()},xi=function(i){i||window.cancelAnimationFrame(Cc),Pc(i),!i&&Zm&&Zm()},Dc=function(){return on},gh=function(i){kg.add(i);const a=i.getParent();a?gh(a):Mp.add(i)},Pc=function(i){const a=i?new Set([i]):new Set([...Mp].map(O=>O.workspace)),p=[...Mp].filter(_u).filter(O=>a.has(O.workspace));for(var S of p)xl(S);for(const O of a)O.resizeContents();for(const O of p)S=O.getRelativeToSurfaceXY(),O.updateComponentLocations(S);for(const O of p)El(O);i||(Gd=null)},El=function(i){Mp.delete(i),kg.delete(i);for(const a of i.getChildren(!1))El(a)},_u=function(i){return!i.isDisposed()&&!i.getParent()},xl=function(i){if(kg.has(i)){for(const a of i.getChildren(!1))xl(a);i.renderEfficiently()}},$l=function(i,a){const p=t.createElement$$module$build$src$core$utils$xml("xml");var S=br(t.allUsedVarModels$$module$build$src$core$variables(i));S.hasChildNodes()&&p.appendChild(S),S=i.getTopComments(!0);for(let O=0;O/g,"<$1$2>")},_s=function(i){i=Qi(i).split("<");let a="";for(let p=1;p"&&(a+=" ")}return i=i.join(` -`),i=i.replace(/(<(\w+)\b[^>]*>[^\n]*)\n *<\/\2>/g,"$1"),i.replace(/^\n/,"")},il=function(i,a){return a.setResizesEnabled(!1),a.clear(),i=t.domToWorkspace$$module$build$src$core$xml(i,a),a.setResizesEnabled(!0),i},t.domToWorkspace$$module$build$src$core$xml=function(i,a){let p=0;a.RTL&&(p=a.getWidth());const S=[];te();const O=t.getGroup$$module$build$src$core$events$utils();O||t.setGroup$$module$build$src$core$events$utils(!0),a.setResizesEnabled&&a.setResizesEnabled(!1);let j=!0;try{for(let ve=0,Ue;Ue=i.childNodes[ve];ve++){const Yt=Ue.nodeName.toLowerCase(),jn=Ue;if(Yt==="block"||Yt==="shadow"&&!ae()){const bl=io(jn,a);S.push(bl.id);let Qa;const Fp=parseInt((Qa=jn.getAttribute("x"))!=null?Qa:"10",10);let HT;const GT=parseInt((HT=jn.getAttribute("y"))!=null?HT:"10",10);isNaN(Fp)||isNaN(GT)||bl.moveBy(a.RTL?p-Fp:Fp,GT,["create"]),j=!1}else{if(Yt==="shadow")throw TypeError("Shadow block cannot be a top-level block.");if(Yt==="comment")a.rendered?zl.fromXmlRendered(jn,a,p):ih.fromXml(jn,a);else if(Yt==="variables"){if(j)zu(jn,a);else throw Error("'variables' tag must exist once before block and shadow tag elements in the workspace XML, but it was found in another location.");j=!1}}}}finally{t.setGroup$$module$build$src$core$events$utils(O),a.setResizesEnabled&&a.setResizesEnabled(!0),a.rendered&&xi(),me()}return ue(new(Ie(Sa))(a)),S},Cd=function(i,a){if(!a.getBlocksBoundingBox)return t.domToWorkspace$$module$build$src$core$xml(i,a);var p=a.getBlocksBoundingBox();if(i=t.domToWorkspace$$module$build$src$core$xml(i,a),p&&p.top!==p.bottom){var S=p.bottom;p=a.RTL?p.right:p.left;var O=1/0;let j=-1/0,ve=1/0;for(let Ue=0;Uej&&(j=Yt.x)}for(S=S-ve+10,p=a.RTL?p-j:p-O,O=0;Ojn.setBubbleVisible(j),1)}},Gn=function(i,a){for(let p=0;p{Ue.disposed||Ue.setConnectionTracking(!0)},1)}return ve},Xr=function(i,a,{parentConnection:p,isShadow:S=!1}={}){if(!i.type)throw new E_(i);const O=a.newBlock(i.type,i.id);return O.setShadow(S),dd(O,i),wu(O,i),Vi(O,i),Pa(p,O,i),vh(O,i),hr(O,i),Qo(O,i),fd(O,i),Bc(O,a.rendered),O},dd=function(i,a){let p=a.x===void 0?0:a.x;a=a.y===void 0?0:a.y;const S=i.workspace;p=S.RTL?S.getWidth()-p:p,i.moveBy(p,a)},wu=function(i,a){a.collapsed&&i.setCollapsed(!0),a.deletable===!1&&i.setDeletable(!1),a.movable===!1&&i.setMovable(!1),a.editable===!1&&i.setEditable(!1),a.enabled===!1&&i.setEnabled(!1),a.inline!==void 0&&i.setInputsInline(a.inline),a.data!==void 0&&(i.data=a.data)},Vi=function(i,a){a.extraState&&(i.loadExtraState?i.loadExtraState(a.extraState):i.domToMutation&&i.domToMutation(t.textToDom$$module$build$src$core$utils$xml(a.extraState)))},Pa=function(i,a,p){if(i){if(i.getSourceBlock().isShadow()&&!a.isShadow())throw new Iv(p);if(i.type===t.inputTypes$$module$build$src$core$inputs$input_types.VALUE){var S=a.outputConnection;if(!S)throw new am("output",a,p)}else if(S=a.previousConnection,!S)throw new am("previous",a,p);if(!i.connect(S)){const O=a.workspace.connectionChecker;throw new y0(O.getErrorMessage(O.canConnectWithReason(S,i,!1),S,i),i.type===t.inputTypes$$module$build$src$core$inputs$input_types.VALUE?"output connection":"previous connection",a,p)}}},vh=function(i,a){if(a.icons){var p=Object.keys(a.icons);for(const O of p){p=a.icons[O];var S=i.getIcon(O);if(!S){if(S=h(Ft.ICON,O,!1),!S)throw new Wf(O,i,a);S=new S(i),i.addIcon(S)}wr(S)&&S.loadState(p)}}},hr=function(i,a){if(a.fields){var p=Object.keys(a.fields);for(let S=0;Sve.id!=i.id).map(ve=>ve.getRelativeToSurfaceXY());for(;Bf(_n.sum(S,O),j)||Tp(i,O,p);)a.RTL?O.translate(-p,2*p):O.translate(p,2*p);i.moveTo(_n.sum(S,O))},Bf=function(i,a){return a.some(p=>1>=Math.abs(p.x-i.x)&&1>=Math.abs(p.y-i.y))},Tp=function(i,a,p){return i.getConnections_(!1).some(S=>!!S.closest(p,a).connection)},Md=function(i){return xe("Blockly.clipboard.copy","v11","v12","myCopyable.toCopyData()"),x0.copyInternal(i)},Jl=function(i){const a=i.toCopyData();oa=a;let p;return C_=(p=i.workspace)!=null?p:null,a},ks=function(i,a,p){return i&&a?Gu(i,a,p):oa&&C_?Gu(oa,C_):null},Gu=function(i,a,p){let S;a=(S=a.getRootWorkspace())!=null?S:a;let O,j;return(j=(O=f(Ft.PASTER,i.paster,!1))==null?void 0:O.paste(i,a,p))!=null?j:null},yh=function(i){return xe("Blockly.clipboard.duplicate","v11","v12","Blockly.clipboard.paste(myCopyable.toCopyData(), myWorkspace)"),x0.duplicateInternal(i)},Ba=function(i){const a=i.toCopyData();return a?ks(a,i.workspace):null},ci=function(i,a){i.setAttribute(Rv,a)},Er=function(i,a,p){Array.isArray(p)&&(p=p.join(" ")),i.setAttribute(sb+a,`${p}`)},oo=function(){return bd},Fa=function(i){if(bd=i,i===null){let a;(a=document.querySelector("."+Yf))==null||a.remove()}},Bo=function(){document.querySelector("."+Yf)||(bd=document.createElement("div"),bd.className=Yf,(D()||document.body).appendChild(bd))},ql=function(i,a,p){Ql(),ed=i,hm=p,(i=bd)&&(i.style.direction=a?"rtl":"ltr",i.style.display="block",a=A(),Xf=a.getRenderer().getClassName(),kp=a.getTheme().getClassName(),Xf&&$e(i,Xf),kp&&$e(i,kp))},Ql=function(){if(Fh()){ed=null;var i=bd;i&&(i.style.display="none",i.style.left="",i.style.top="",hm&&hm(),hm=null,i.textContent="",Xf&&(St(i,Xf),Xf=""),kp&&(St(i,kp),kp=""),A().markFocused())}},Fh=function(){return!!ed},Wr=function(i){ed===i&&Ql()},Ai=function(i,a,p){bd.style.left=i+"px",bd.style.top=a+"px",bd.style.height=p+"px"},Sr=function(i,a,p,S){const O=fa(i,a,p);i=ji(i,a,p,S),0>O?Ai(i,0,p.height+O):Ai(i,O,p.height)},ji=function(i,a,p,S){return S?Math.min(Math.max(a.right-p.width,i.left),i.right-p.width):Math.max(Math.min(a.left,i.right-p.width),i.left)},fa=function(i,a,p){return a.bottom+p.height>=i.bottom?a.top-p.height:a.bottom},Eu=function(i){return!(i==null||!i.repositionForWindowResize)},cf=function(){Eu(ed)&&ed.repositionForWindowResize()||Ql()},hf=function(){return eg},pd=function(i){eg=i},Wu=function(i,a,p){if(ql(kv,p,Us),a.length){var S=ol(a,p);Lg=S,Fc(S,i,p),setTimeout(function(){S.focus()},1),eg=null}else Zl()},ol=function(i,a){const p=new Og;p.setRole(oh.MENU);for(let S=0;S{setTimeout(()=>{O.callback(O.scope)},0)})},{})}return p},Fc=function(i,a,p){const S=Se();a=new Oi(a.clientY+S.top,a.clientY+S.top,a.clientX+S.left,a.clientX+S.left),zh(i);const O=i.getSize();p&&(a.left+=O.width,a.right+=O.width,S.left+=O.width,S.right+=O.width),Sr(S,a,O,p),i.focus()},zh=function(i){var a=oo();if(!a)throw Error("Attempting to create a context menu when widget div is null");a=i.render(a),$e(a,"blocklyContextMenu"),Ce(a,"contextmenu",null,Vu),i.focus()},Vu=function(i){i.preventDefault(),i.stopPropagation()},Zl=function(){Wr(kv),eg=null},Us=function(){Lg&&(Lg.dispose(),Lg=null)},t.callbackFactory$$module$build$src$core$contextmenu=function(i,a){return()=>{t.disable$$module$build$src$core$events$utils();let p;try{p=a instanceof Element?io(a,i.workspace):Mi(a,i.workspace);const S=i.getRelativeToSurfaceXY();S.x=i.RTL?S.x-t.config$$module$build$src$core$config.snapRadius:S.x+t.config$$module$build$src$core$config.snapRadius,S.y+=2*t.config$$module$build$src$core$config.snapRadius,p.moveBy(S.x,S.y)}finally{t.enable$$module$build$src$core$events$utils()}return ie()&&!p.isShadow()&&ue(new(Ie(t.CREATE$$module$build$src$core$events$utils))(p)),p.select(),p}},eu=function(i){return{text:t.Msg$$module$build$src$core$msg.REMOVE_COMMENT,enabled:!0,callback:function(){t.setGroup$$module$build$src$core$events$utils(!0),i.dispose(),t.setGroup$$module$build$src$core$events$utils(!1)}}},Uh=function(i){return{text:t.Msg$$module$build$src$core$msg.DUPLICATE_COMMENT,enabled:!0,callback:function(){const a=i.toCopyData();a&&ks(a,i.workspace)}}},zc=function(i,a){const p={enabled:!0};return p.text=t.Msg$$module$build$src$core$msg.ADD_COMMENT,p.callback=function(){const S=new zl(i,t.Msg$$module$build$src$core$msg.WORKSPACE_COMMENT_DEFAULT_TEXT,zl.DEFAULT_SIZE,zl.DEFAULT_SIZE);var O=i.getInjectionDiv().getBoundingClientRect();O=new _n(a.clientX-O.left,a.clientY-O.top);const j=i.getOriginOffsetInPixels();O=_n.difference(O,j),O.scale(1/i.scale),S.moveBy(O.x,O.y),i.rendered&&(S.initSvg(),S.render(),S.select())},p},Uc=function(i){return i*Math.PI/180},is=function(i){return 180*i/Math.PI},Fr=function(i,a,p){if(pp)){var S=a.getSvgXY(i.getSvgRoot());i.outputConnection?(S.x+=(i.RTL?3:-3)*p,S.y+=13*p):i.previousConnection&&(S.x+=(i.RTL?-23:23)*p,S.y+=3*p);var O=se(Ve.CIRCLE,{cx:S.x,cy:S.y,r:0,fill:"none",stroke:"#888","stroke-width":10},a.getParentSvg());i=se(Ve.ANIMATE,{id:"animationCircle",begin:"indefinite",attributeName:"r",dur:"150ms",from:0,to:25*p},O),a=se(Ve.ANIMATE,{id:"animationOpacity",begin:"indefinite",attributeName:"opacity",dur:"150ms",from:1,to:0},O),i.beginElement(),a.beginElement(),setTimeout(()=>void pt(O),150)}},Ks=function(i){if(Ua(),i.workspace.getAudioManager().play("disconnect"),!(1>i.workspace.scale)){var a=i.getHeightWidth().height;a=Math.atan(10/a)/Math.PI*180,i.RTL||(a*=-1),F=i,Hs(i,a,new Date)}},Hs=function(i,a,p){const S=(new Date().getTime()-p.getTime())/200;let O="";1>=S&&(O=`skewX(${Math.round(Math.sin(S*Math.PI*3)*(1-S)*a)})`,R=setTimeout(Hs,10,i,a,p)),i.getSvgRoot().setAttribute("transform",`${i.getTranslation()} ${O}`)},Ua=function(){F&&(R&&(clearTimeout(R),R=null),F.getSvgRoot().setAttribute("transform",F.getTranslation()),F=null)},Hh=function(i,a){return xe("Blockly.utils.string.startsWith()","April 2022","April 2023","Use built-in string.startsWith"),i.startsWith(a)},Th=function(i){return i.length?i.reduce(function(a,p){return a.length<\/script>",n=n.removeChild(n.firstChild)):typeof r.is=="string"?n=l.createElement(t,{is:r.is}):(n=l.createElement(t),t==="select"&&(l=n,r.multiple?l.multiple=!0:r.size&&(l.size=r.size))):n=l.createElementNS(n,t),n[e_]=e,n[g$]=r,YV(n,e,!1,!1),e.stateNode=n;e:{switch(l=WN(t,r),t){case"dialog":fu("cancel",n),fu("close",n),s=r;break;case"iframe":case"object":case"embed":fu("load",n),s=r;break;case"video":case"audio":for(s=0;s$w&&(e.flags|=128,r=!0,HE(o,!1),e.lanes=4194304)}else{if(!r)if(n=XI(l),n!==null){if(e.flags|=128,r=!0,t=n.updateQueue,t!==null&&(e.updateQueue=t,e.flags|=4),HE(o,!0),o.tail===null&&o.tailMode==="hidden"&&!l.alternate&&!Fu)return Ef(e),null}else 2*ch()-o.renderingStartTime>$w&&t!==1073741824&&(e.flags|=128,r=!0,HE(o,!1),e.lanes=4194304);o.isBackwards?(l.sibling=e.child,e.child=l):(t=o.last,t!==null?t.sibling=l:e.child=l,o.last=l)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=ch(),e.sibling=null,t=sc.current,jl(sc,r?t&1|2:t&1),e):(Ef(e),null);case 22:case 23:return $3(),r=e.memoizedState!==null,n!==null&&n.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?Mm&1073741824&&(Ef(e),e.subtreeFlags&6&&(e.flags|=8192)):Ef(e),null;case 24:return null;case 25:return null}throw Error(Cn(156,e.tag))}function qre(n,e){switch(o3(e),e.tag){case 1:return Xp(e.type)&&UI(),n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 3:return Ew(),mu(Yp),mu(Df),m3(),n=e.flags,n&65536&&!(n&128)?(e.flags=n&-65537|128,e):null;case 5:return p3(e),null;case 13:if(mu(sc),n=e.memoizedState,n!==null&&n.dehydrated!==null){if(e.alternate===null)throw Error(Cn(340));Sw()}return n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 19:return mu(sc),null;case 4:return Ew(),null;case 10:return c3(e.type._context),null;case 22:case 23:return $3(),null;case 24:return null;default:return null}}var oM=!1,Of=!1,Qre=typeof WeakSet=="function"?WeakSet:Set,ur=null;function KS(n,e){var t=n.ref;if(t!==null)if(typeof t=="function")try{t(null)}catch(r){Lc(n,e,r)}else t.current=null}function _D(n,e,t){try{t()}catch(r){Lc(n,e,r)}}var $U=!1;function Zre(n,e){if(eD=PI,n=Z8(),i3(n)){if("selectionStart"in n)var t={start:n.selectionStart,end:n.selectionEnd};else e:{t=(t=n.ownerDocument)&&t.defaultView||window;var r=t.getSelection&&t.getSelection();if(r&&r.rangeCount!==0){t=r.anchorNode;var s=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{t.nodeType,o.nodeType}catch{t=null;break e}var l=0,u=-1,h=-1,f=0,g=0,y=n,b=null;t:for(;;){for(var w;y!==t||s!==0&&y.nodeType!==3||(u=l+s),y!==o||r!==0&&y.nodeType!==3||(h=l+r),y.nodeType===3&&(l+=y.nodeValue.length),(w=y.firstChild)!==null;)b=y,y=w;for(;;){if(y===n)break t;if(b===t&&++f===s&&(u=l),b===o&&++g===r&&(h=l),(w=y.nextSibling)!==null)break;y=b,b=y.parentNode}y=w}t=u===-1||h===-1?null:{start:u,end:h}}else t=null}t=t||{start:0,end:0}}else t=null;for(tD={focusedElem:n,selectionRange:t},PI=!1,ur=e;ur!==null;)if(e=ur,n=e.child,(e.subtreeFlags&1028)!==0&&n!==null)n.return=e,ur=n;else for(;ur!==null;){e=ur;try{var C=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(C!==null){var M=C.memoizedProps,A=C.memoizedState,k=e.stateNode,L=k.getSnapshotBeforeUpdate(e.elementType===e.type?M:Jg(e.type,M),A);k.__reactInternalSnapshotBeforeUpdate=L}break;case 3:var P=e.stateNode.containerInfo;P.nodeType===1?P.textContent="":P.nodeType===9&&P.documentElement&&P.removeChild(P.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Cn(163))}}catch(D){Lc(e,e.return,D)}if(n=e.sibling,n!==null){n.return=e.return,ur=n;break}ur=e.return}return C=$U,$U=!1,C}function Vx(n,e,t){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&n)===n){var o=s.destroy;s.destroy=void 0,o!==void 0&&_D(e,t,o)}s=s.next}while(s!==r)}}function qR(n,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var t=e=e.next;do{if((t.tag&n)===n){var r=t.create;t.destroy=r()}t=t.next}while(t!==e)}}function vD(n){var e=n.ref;if(e!==null){var t=n.stateNode;switch(n.tag){case 5:n=t;break;default:n=t}typeof e=="function"?e(n):e.current=n}}function JV(n){var e=n.alternate;e!==null&&(n.alternate=null,JV(e)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(e=n.stateNode,e!==null&&(delete e[e_],delete e[g$],delete e[iD],delete e[Nre],delete e[Dre])),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}function qV(n){return n.tag===5||n.tag===3||n.tag===4}function CU(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||qV(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function yD(n,e,t){var r=n.tag;if(r===5||r===6)n=n.stateNode,e?t.nodeType===8?t.parentNode.insertBefore(n,e):t.insertBefore(n,e):(t.nodeType===8?(e=t.parentNode,e.insertBefore(n,t)):(e=t,e.appendChild(n)),t=t._reactRootContainer,t!=null||e.onclick!==null||(e.onclick=zI));else if(r!==4&&(n=n.child,n!==null))for(yD(n,e,t),n=n.sibling;n!==null;)yD(n,e,t),n=n.sibling}function bD(n,e,t){var r=n.tag;if(r===5||r===6)n=n.stateNode,e?t.insertBefore(n,e):t.appendChild(n);else if(r!==4&&(n=n.child,n!==null))for(bD(n,e,t),n=n.sibling;n!==null;)bD(n,e,t),n=n.sibling}var tf=null,qg=!1;function Xv(n,e,t){for(t=t.child;t!==null;)QV(n,e,t),t=t.sibling}function QV(n,e,t){if(o_&&typeof o_.onCommitFiberUnmount=="function")try{o_.onCommitFiberUnmount(GR,t)}catch{}switch(t.tag){case 5:Of||KS(t,e);case 6:var r=tf,s=qg;tf=null,Xv(n,e,t),tf=r,qg=s,tf!==null&&(qg?(n=tf,t=t.stateNode,n.nodeType===8?n.parentNode.removeChild(t):n.removeChild(t)):tf.removeChild(t.stateNode));break;case 18:tf!==null&&(qg?(n=tf,t=t.stateNode,n.nodeType===8?X2(n.parentNode,t):n.nodeType===1&&X2(n,t),h$(n)):X2(tf,t.stateNode));break;case 4:r=tf,s=qg,tf=t.stateNode.containerInfo,qg=!0,Xv(n,e,t),tf=r,qg=s;break;case 0:case 11:case 14:case 15:if(!Of&&(r=t.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){s=r=r.next;do{var o=s,l=o.destroy;o=o.tag,l!==void 0&&(o&2||o&4)&&_D(t,e,l),s=s.next}while(s!==r)}Xv(n,e,t);break;case 1:if(!Of&&(KS(t,e),r=t.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=t.memoizedProps,r.state=t.memoizedState,r.componentWillUnmount()}catch(u){Lc(t,e,u)}Xv(n,e,t);break;case 21:Xv(n,e,t);break;case 22:t.mode&1?(Of=(r=Of)||t.memoizedState!==null,Xv(n,e,t),Of=r):Xv(n,e,t);break;default:Xv(n,e,t)}}function MU(n){var e=n.updateQueue;if(e!==null){n.updateQueue=null;var t=n.stateNode;t===null&&(t=n.stateNode=new Qre),e.forEach(function(r){var s=lie.bind(null,n,r);t.has(r)||(t.add(r),r.then(s,s))})}}function Ug(n,e){var t=e.deletions;if(t!==null)for(var r=0;rs&&(s=l),r&=~o}if(r=s,r=ch()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*tie(r/1960))-r,10n?16:n,Sy===null)var r=!1;else{if(n=Sy,Sy=null,ZI=0,wo&6)throw Error(Cn(331));var s=wo;for(wo|=4,ur=n.current;ur!==null;){var o=ur,l=o.child;if(ur.flags&16){var u=o.deletions;if(u!==null){for(var h=0;hch()-E3?R1(n,0):w3|=t),Kp(n,e)}function oj(n,e){e===0&&(n.mode&1?(e=qC,qC<<=1,!(qC&130023424)&&(qC=4194304)):e=1);var t=dp();n=vv(n,e),n!==null&&(mC(n,e,t),Kp(n,t))}function aie(n){var e=n.memoizedState,t=0;e!==null&&(t=e.retryLane),oj(n,t)}function lie(n,e){var t=0;switch(n.tag){case 13:var r=n.stateNode,s=n.memoizedState;s!==null&&(t=s.retryLane);break;case 19:r=n.stateNode;break;default:throw Error(Cn(314))}r!==null&&r.delete(e),oj(n,t)}var aj;aj=function(n,e,t){if(n!==null)if(n.memoizedProps!==e.pendingProps||Yp.current)Vp=!0;else{if(!(n.lanes&t)&&!(e.flags&128))return Vp=!1,Kre(n,e,t);Vp=!!(n.flags&131072)}else Vp=!1,Fu&&e.flags&1048576&&cV(e,WI,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;eI(n,e),n=e.pendingProps;var s=Tw(e,Df.current);cw(e,t),s=_3(null,e,r,n,s,t);var o=v3();return e.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,Xp(r)?(o=!0,HI(e)):o=!1,e.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,d3(e),s.updater=KR,e.stateNode=s,s._reactInternals=e,cD(e,r,n,t),e=fD(null,e,r,!0,o,t)):(e.tag=0,Fu&&o&&s3(e),ip(null,e,s,t),e=e.child),e;case 16:r=e.elementType;e:{switch(eI(n,e),n=e.pendingProps,s=r._init,r=s(r._payload),e.type=r,s=e.tag=cie(r),n=Jg(r,n),s){case 0:e=dD(null,e,r,n,t);break e;case 1:e=wU(null,e,r,n,t);break e;case 11:e=TU(null,e,r,n,t);break e;case 14:e=SU(null,e,r,Jg(r.type,n),t);break e}throw Error(Cn(306,r,""))}return e;case 0:return r=e.type,s=e.pendingProps,s=e.elementType===r?s:Jg(r,s),dD(n,e,r,s,t);case 1:return r=e.type,s=e.pendingProps,s=e.elementType===r?s:Jg(r,s),wU(n,e,r,s,t);case 3:e:{if(WV(e),n===null)throw Error(Cn(387));r=e.pendingProps,o=e.memoizedState,s=o.element,pV(n,e),YI(e,r,null,t);var l=e.memoizedState;if(r=l.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:l.cache,pendingSuspenseBoundaries:l.pendingSuspenseBoundaries,transitions:l.transitions},e.updateQueue.baseState=o,e.memoizedState=o,e.flags&256){s=xw(Error(Cn(423)),e),e=EU(n,e,r,t,s);break e}else if(r!==s){s=xw(Error(Cn(424)),e),e=EU(n,e,r,t,s);break e}else for(Rm=Ry(e.stateNode.containerInfo.firstChild),Om=e,Fu=!0,Qg=null,t=vV(e,null,r,t),e.child=t;t;)t.flags=t.flags&-3|4096,t=t.sibling;else{if(Sw(),r===s){e=yv(n,e,t);break e}ip(n,e,r,t)}e=e.child}return e;case 5:return yV(e),n===null&&aD(e),r=e.type,s=e.pendingProps,o=n!==null?n.memoizedProps:null,l=s.children,nD(r,s)?l=null:o!==null&&nD(r,o)&&(e.flags|=32),GV(n,e),ip(n,e,l,t),e.child;case 6:return n===null&&aD(e),null;case 13:return VV(n,e,t);case 4:return f3(e,e.stateNode.containerInfo),r=e.pendingProps,n===null?e.child=ww(e,null,r,t):ip(n,e,r,t),e.child;case 11:return r=e.type,s=e.pendingProps,s=e.elementType===r?s:Jg(r,s),TU(n,e,r,s,t);case 7:return ip(n,e,e.pendingProps,t),e.child;case 8:return ip(n,e,e.pendingProps.children,t),e.child;case 12:return ip(n,e,e.pendingProps.children,t),e.child;case 10:e:{if(r=e.type._context,s=e.pendingProps,o=e.memoizedProps,l=s.value,jl(VI,r._currentValue),r._currentValue=l,o!==null)if(u0(o.value,l)){if(o.children===s.children&&!Yp.current){e=yv(n,e,t);break e}}else for(o=e.child,o!==null&&(o.return=e);o!==null;){var u=o.dependencies;if(u!==null){l=o.child;for(var h=u.firstContext;h!==null;){if(h.context===r){if(o.tag===1){h=fv(-1,t&-t),h.tag=2;var f=o.updateQueue;if(f!==null){f=f.shared;var g=f.pending;g===null?h.next=h:(h.next=g.next,g.next=h),f.pending=h}}o.lanes|=t,h=o.alternate,h!==null&&(h.lanes|=t),lD(o.return,t,e),u.lanes|=t;break}h=h.next}}else if(o.tag===10)l=o.type===e.type?null:o.child;else if(o.tag===18){if(l=o.return,l===null)throw Error(Cn(341));l.lanes|=t,u=l.alternate,u!==null&&(u.lanes|=t),lD(l,t,e),l=o.sibling}else l=o.child;if(l!==null)l.return=o;else for(l=o;l!==null;){if(l===e){l=null;break}if(o=l.sibling,o!==null){o.return=l.return,l=o;break}l=l.return}o=l}ip(n,e,s.children,t),e=e.child}return e;case 9:return s=e.type,r=e.pendingProps.children,cw(e,t),s=Sg(s),r=r(s),e.flags|=1,ip(n,e,r,t),e.child;case 14:return r=e.type,s=Jg(r,e.pendingProps),s=Jg(r.type,s),SU(n,e,r,s,t);case 15:return UV(n,e,e.type,e.pendingProps,t);case 17:return r=e.type,s=e.pendingProps,s=e.elementType===r?s:Jg(r,s),eI(n,e),e.tag=1,Xp(r)?(n=!0,HI(e)):n=!1,cw(e,t),gV(e,r,s),cD(e,r,s,t),fD(null,e,r,!0,n,t);case 19:return jV(n,e,t);case 22:return HV(n,e,t)}throw Error(Cn(156,e.tag))};function lj(n,e){return L8(n,e)}function uie(n,e,t,r){this.tag=n,this.key=t,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,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 yg(n,e,t,r){return new uie(n,e,t,r)}function M3(n){return n=n.prototype,!(!n||!n.isReactComponent)}function cie(n){if(typeof n=="function")return M3(n)?1:0;if(n!=null){if(n=n.$$typeof,n===YB)return 11;if(n===XB)return 14}return 2}function Ny(n,e){var t=n.alternate;return t===null?(t=yg(n.tag,e,n.key,n.mode),t.elementType=n.elementType,t.type=n.type,t.stateNode=n.stateNode,t.alternate=n,n.alternate=t):(t.pendingProps=e,t.type=n.type,t.flags=0,t.subtreeFlags=0,t.deletions=null),t.flags=n.flags&14680064,t.childLanes=n.childLanes,t.lanes=n.lanes,t.child=n.child,t.memoizedProps=n.memoizedProps,t.memoizedState=n.memoizedState,t.updateQueue=n.updateQueue,e=n.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},t.sibling=n.sibling,t.index=n.index,t.ref=n.ref,t}function rI(n,e,t,r,s,o){var l=2;if(r=n,typeof n=="function")M3(n)&&(l=1);else if(typeof n=="string")l=5;else e:switch(n){case zS:return k1(t.children,s,o,e);case jB:l=8,s|=8;break;case LN:return n=yg(12,t,e,s|2),n.elementType=LN,n.lanes=o,n;case NN:return n=yg(13,t,e,s),n.elementType=NN,n.lanes=o,n;case DN:return n=yg(19,t,e,s),n.elementType=DN,n.lanes=o,n;case _8:return ZR(t,s,o,e);default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case m8:l=10;break e;case g8:l=9;break e;case YB:l=11;break e;case XB:l=14;break e;case gy:l=16,r=null;break e}throw Error(Cn(130,n==null?n:typeof n,""))}return e=yg(l,t,e,s),e.elementType=n,e.type=r,e.lanes=o,e}function k1(n,e,t,r){return n=yg(7,n,r,e),n.lanes=t,n}function ZR(n,e,t,r){return n=yg(22,n,r,e),n.elementType=_8,n.lanes=t,n.stateNode={isHidden:!1},n}function nO(n,e,t){return n=yg(6,n,null,e),n.lanes=t,n}function rO(n,e,t){return e=yg(4,n.children!==null?n.children:[],n.key,e),e.lanes=t,e.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},e}function hie(n,e,t,r,s){this.tag=e,this.containerInfo=n,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=P2(0),this.expirationTimes=P2(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=P2(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function A3(n,e,t,r,s,o,l,u,h){return n=new hie(n,e,t,u,h),e===1?(e=1,o===!0&&(e|=8)):e=0,o=yg(3,null,null,e),n.current=o,o.stateNode=n,o.memoizedState={element:r,isDehydrated:t,cache:null,transitions:null,pendingSuspenseBoundaries:null},d3(o),n}function die(n,e,t){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(dj)}catch(n){console.error(n)}}dj(),c8.exports=Hm;var O3=c8.exports;const uM=Xy(O3);var DU=O3;kN.createRoot=DU.createRoot,kN.hydrateRoot=DU.hydrateRoot;var fj={exports:{}},iO={exports:{}},sO={exports:{}},oO={exports:{}},aO={exports:{}},PU;function L3(){return PU||(PU=1,function(n,e){(function(t,r){n.exports=r()})(Vl,function(){var t={},r,s,o,l,u,h,f,g,y,b,w,C,M,A,k,L,P,D,z,U,V,H,oe,le,Z,q,he,ae,ue,ge,we,J,re,se,fe,Te,Fe,Ie,qe,Re,Ze,rt,ft,ut,ze,$e,He,it,st,Nt,kt,vt,Ct,At,gt,xe,ie,Pe,Ye,St,It,mt,Ke,Oe,Q,te,pe,Ae,Je,jt,Ge,qt,pt,Jt,Xt,xn,ii,Pr,Ei,xr,mr,ne,Se,We,at,zt,sn,Nn,De,_t,Mt,bt,Wt,Wn,rr,_r,$r,si,Br,Yr,Ss,Oa,Eo,Yl,nn,Rr,el,La,Fs,zs,Di,kr,In,Ir,Gr,yr,Pi,ws,fi,gs,tl,Na,fc,pc,Xs,Jo,Xl,gu,mh,qo,vr,xi,Dc,gh,Pc,El,_u,xl,$l,br,Tr,Kl,nl,rl,vu,Qi,_s,il,Cd,io,zu,ca,yu,or,Gn,Es,so,Uu,bu,_h,Da,ha,Hu,wr,Rs,bi,$i,da,Zr,Tu,xo,Su,sl,Bi,Ci,Vn,Mi,Xr,dd,wu,Vi,Pa,vh,hr,Qo,fd,lf,Bc,uf,Bf,Tp,Md,Jl,ks,Gu,yh,Ba,ci,Er,oo,Fa,Bo,ql,Ql,Fh,Wr,Ai,Sr,ji,fa,Eu,cf,hf,pd,Wu,ol,Fc,zh,Vu,Zl,Us,eu,Uh,zc,Uc,is,Fr,Cl,za,tu,xu,bh,Ad,pi,ye,je,Be,Ot,rn,Rn,Jn,vn,zr,ao,Ti,lo,al,Fi,vs,$u,qn,pa,Ks,Hs,Ua,Hh,Th,mc,Zo,Hc,Gh,Ha,Wh,gc,ju,md,ea,uo,Ml,Vh,zi,gd,Yu,nu,Gc,Id,Al,Rd,jh,ei,Ii,Sp,Ff,Il,ru,Xu,Ku,Sh,ll,ta,Rl,Wc,kl,Vc,_c,kd,Ga,Vr,ul,Zi,ma,X,xs,ga,Cr,mn,zf,cl,Ri,hi,es,ss,jc,_a,va,os,Yc,na,Od,Ld,Yh,Gs,Kn,Ws,Js,Ui,iu,Fo,$n,mi,gi,Uf,wh,co,ya,Mn,yn,hl,vc,wp,su,$o,ys,dl,as,fl,zo,Xh,Wa,ki,Nd,Xc,Kh,Uo,Co,df,Cu,Ol,_d,yc,Kr,ou,Ju,ls,Va,$s,Cs,Kc,_i,ja,bc,ff,Eh,ra,Yi,Pn,tr,Nr,ti,qr,Mo,us,ts,au,qu,Tc,Qu,qs,ho,vd,ba,Mu,Au,fo,po,Ll,Ho,Zu,ec,xh,$h,Or,bs,Os,Ya,Vs,fn,Jc,wn;r=function(i,a,p,S){if(!(i instanceof Ft)&&typeof i!="string"||`${i}`.trim()==="")throw Error('Invalid type "'+i+'". The type must be a non-empty string or a Blockly.registry.Type.');if(i=`${i}`.toLowerCase(),typeof a!="string"||a.trim()==="")throw Error('Invalid name "'+a+'". The name must be a non-empty string.');const O=a.toLowerCase();if(!p)throw Error("Can not register a null value");let j=vi[i],ve=lu[i];if(j||(j=vi[i]=Object.create(null),ve=lu[i]=Object.create(null)),s(i,p),!S&&j[O])throw Error('Name "'+O+'" with type "'+i+'" already registered.');j[O]=p,ve[O]=a},s=function(i,a){switch(i){case String(Ft.FIELD):if(typeof a.fromJson!="function")throw Error('Type "'+i+'" must have a fromJson function')}},o=function(i,a){i=`${i}`.toLowerCase(),a=a.toLowerCase();const p=vi[i];p&&p[a]?(delete vi[i][a],delete lu[i][a]):console.warn("Unable to unregister ["+a+"]["+i+"] from the registry.")},l=function(i,a,p){i=`${i}`.toLowerCase(),a=a.toLowerCase();const S=vi[i];if(!S||!S[a]){if(a="Unable to find ["+a+"]["+i+"] in the registry.",p)throw Error(a+" You must require or register a "+i+" plugin.");return console.warn(a),null}return S[a]},u=function(i,a){return i=`${i}`.toLowerCase(),a=a.toLowerCase(),(i=vi[i])?!!i[a]:!1},h=function(i,a,p){return l(i,a,p)},f=function(i,a,p){return l(i,a,p)},g=function(i,a,p){i=`${i}`.toLowerCase();var S=vi[i];if(!S){if(S=`Unable to find [${i}] in the registry.`,p)throw Error(`${S} You must require or register a ${i} plugin.`);return console.warn(S),null}if(!a)return S;i=lu[i],p=Object.create(null);for(const O of Object.keys(S))p[i[O]]=S[O];return p},y=function(i,a,p){return a=a.plugins[String(i)]||Nl,typeof a=="function"?a:h(i,a,p)},b=function(i){return tc[i]||null},w=function(){const i=[];for(const a in tc)i.push(tc[a]);return i},C=function(i){tc[i.id]=i},M=function(i){delete tc[i.id]},A=function(){return Jh},k=function(i){Jh=i},L=function(){return qc},P=function(i){qc=i},D=function(){return oi},z=function(i){oi=i},U=function(i){for(;i.options.parentWorkspace;)i=i.options.parentWorkspace;const a=i.getParentSvg(),p=i.getCachedParentSvgSize();var S=a.parentElement;if(S instanceof HTMLElement){var O=S.offsetWidth;S=S.offsetHeight,p.width!==O&&(a.setAttribute("width",O+"px"),i.setCachedParentSvgSize(O,null)),p.height!==S&&(a.setAttribute("height",S+"px"),i.setCachedParentSvgSize(null,S)),i.resize()}},V=function(i,a){const p=Object.create(null),S=i.getDescendants(!0);a&&(i=i.getNextBlock())&&(i=S.indexOf(i),S.splice(i,S.length-i));for(let O=0,j;j=S[O];O++)p[j.type]?p[j.type]++:p[j.type]=1;return p},H=function(i){return function(){this.jsonInit(i)}},oe=function(i){Qc.defineBlocksWithJsonArrayInternal(i)},le=function(i){t.defineBlocks$$module$build$src$core$common(t.createBlockDefinitionsFromJsonArray$$module$build$src$core$common(i))},t.createBlockDefinitionsFromJsonArray$$module$build$src$core$common=function(i){const a={};for(let p=0;p{setTimeout(we,0)})}catch{setTimeout(we,0)}Ec.push(i)}},we=function(){var i=J(Ec,!0);Ec.length=0;for(let p=0,S;S=i[p];p++)if(S.workspaceId){var a=b(S.workspaceId);a&&a.fireChangeListener(S)}i=new Set(i.map(p=>p.workspaceId));for(const p of i){if(!p||(i=b(p),!i))continue;i=i.getUndoStack();let S;for(a=i.length;0>>/g,i),Zh="",i=document.createElement("style"),i.id="blockly-common-style",a=document.createTextNode(a),i.appendChild(a),document.head.insertBefore(i,document.head.firstChild)))},xe=function(i,a,p,S){i=i+" was deprecated in "+a+" and will be deleted in "+p+".",S&&(i+=` +Use `+S+" instead."),g0.has(i)||(g0.add(i),console.warn(i))},ie=function(i,a,p){i=document.createElementNS(Jm,`${i}`);for(const S in a)i.setAttribute(S,`${a[S]}`);return p&&p.appendChild(i),i},Pe=function(i,a){return a=a.split(" "),a.every(p=>i.classList.contains(p))?!1:(i.classList.add(...a),!0)},Ye=function(i,a){i.classList.remove(...a.split(" "))},St=function(i,a){return a=a.split(" "),a.every(p=>!i.classList.contains(p))?!1:(i.classList.remove(...a),!0)},It=function(i,a){return i.classList.contains(a)},mt=function(i){return i&&i.parentNode?i.parentNode.removeChild(i):null},Ke=function(i,a){const p=a.nextSibling;if(a=a.parentNode,!a)throw Error("Reference node has no parent.");p?a.insertBefore(i,p):a.appendChild(i)},Oe=function(i,a){return xe("Blockly.utils.dom.containsNode","version 10","version 11",'Use native "contains" DOM method'),i.contains(a)},Q=function(i,a){i.style.transform=a,i.style["-webkit-transform"]=a},te=function(){Ka++,Dd||(Dd=Object.create(null))},pe=function(){Ka--,Ka||(Dd=null)},Ae=function(i){const a=i.textContent+` +`+i.className.baseVal;let p;if(Dd&&(p=Dd[a]))return p;try{p=i.getComputedTextLength()}catch{return 8*i.textContent.length}return Dd&&(Dd[a]=p),p},Je=function(i,a,p,S){return jt(i,a+"pt",p,S)},jt=function(i,a,p,S){const O=i.textContent;i=O+` +`+i.className.baseVal;var j;return Dd&&(j=Dd[i])||(Ur||(j=document.createElement("canvas"),j.className="blocklyComputeCanvas",document.body.appendChild(j),Ur=j.getContext("2d")),Ur.font=p+" "+a+" "+S,j=O?Ur.measureText(O).width:0,Dd&&(Dd[i]=j)),j},Ge=function(i,a,p,S){const O=document.createElement("span");O.style.font=p+" "+a+" "+S,O.textContent=i,i=document.createElement("div"),i.style.width="1px",i.style.height="0",a=document.createElement("div"),a.style.display="flex",a.style.position="fixed",a.style.top="0",a.style.left="0",a.appendChild(O),a.appendChild(i),document.body.appendChild(a),p={height:0,baseline:0};try{a.style.alignItems="baseline",p.baseline=i.offsetTop-O.offsetTop,a.style.alignItems="flex-end",p.height=i.offsetTop-O.offsetTop}finally{document.body.removeChild(a)}return p},qt=function(i){return S_.getSizeInternal(i)},pt=function(i){if(Xt(i,"display")!=="none")return Jt(i);const a=i.style,p=a.display,S=a.visibility,O=a.position;a.visibility="hidden",a.position="absolute",a.display="inline";const j=i.offsetWidth;return i=i.offsetHeight,a.display=p,a.position=O,a.visibility=S,new eo(j,i)},Jt=function(i){return new eo(i.offsetWidth,i.offsetHeight)},Xt=function(i,a){return i=window.getComputedStyle(i),i[a]||i.getPropertyValue(a)},xn=function(i){const a=new _n(0,0);i=i.getBoundingClientRect();var p=document.documentElement;return p=new _n(window.pageXOffset||p.scrollLeft,window.pageYOffset||p.scrollTop),a.x=i.left+p.x,a.y=i.top+p.y,a},ii=function(){const i=document.body,a=document.documentElement;return new _n(i.scrollLeft||a.scrollLeft,i.scrollTop||a.scrollTop)},Pr=function(i){const a=parseFloat(Xt(i,"borderLeftWidth")),p=parseFloat(Xt(i,"borderRightWidth")),S=parseFloat(Xt(i,"borderTopWidth"));return i=parseFloat(Xt(i,"borderBottomWidth")),new Oi(S,i,a,p)},Ei=function(i,a,p){i=xr(i,a,p),a.scrollLeft=i.x,a.scrollTop=i.y},xr=function(i,a,p){var S=xn(i),O=xn(a),j=Pr(a);const ve=S.x-O.x-j.left;return S=S.y-O.y-j.top,O=Jt(i),i=a.clientWidth-O.width,O=a.clientHeight-O.height,j=a.scrollLeft,a=a.scrollTop,p?(j+=ve-i/2,a+=S-O/2):(j+=Math.min(ve,Math.max(ve-i,0)),a+=Math.min(S,Math.max(S-O,0))),new _n(j,a)},mr=function(i){const a=new _n(0,0);var p=i.x&&i.getAttribute("x");const S=i.y&&i.getAttribute("y");return p&&(a.x=parseInt(p)),S&&(a.y=parseInt(S)),(p=(p=i.getAttribute("transform"))&&p.match(Ep))&&(a.x+=Number(p[1]),p[3]&&(a.y+=Number(p[3]))),(i=i.getAttribute("style"))&&-1`&#${a.charCodeAt(0)};`)},_t=function(i){return i?((i instanceof Element||typeof i=="string")&&(i=Br(i),i=_r(i)),Mt(i),i):null},Mt=function(i){const a=i.kind;if(i=i.contents,a&&a!==Ig&&a!==nh)throw Error("Invalid toolbox kind "+a+". Please supply either "+Ig+" or "+nh);if(!i)throw Error("Toolbox must have a contents attribute.")},bt=function(i){return i?i.contents?i.contents:Array.isArray(i)&&0 document.")}else i instanceof Element&&(a=i);return a},Yr=function(i,a,p,S,O,j){const ve=j.scrollbar&&j.scrollbar.canScrollVertically();return i.horizontal===rm.LEFT?(p=O.absoluteMetrics.left+p,ve&&j.RTL&&(p+=xa.scrollbarThickness)):(p=O.absoluteMetrics.left+O.viewMetrics.width-a.width-p,ve&&!j.RTL&&(p-=xa.scrollbarThickness)),i.vertical===Ja.TOP?i=O.absoluteMetrics.top+S:(i=O.absoluteMetrics.top+O.viewMetrics.height-a.height-S,j.scrollbar&&j.scrollbar.canScrollHorizontally()&&(i-=xa.scrollbarThickness)),new Oi(i,i+a.height,p,p+a.width)},Ss=function(i,a){return{horizontal:a.toolboxMetrics.position===dr.LEFT||i.horizontalLayout&&!i.RTL?rm.RIGHT:rm.LEFT,vertical:a.toolboxMetrics.position===dr.BOTTOM?Ja.TOP:Ja.BOTTOM}},Oa=function(i,a,p,S){const O=i.left,j=i.right-i.left,ve=i.bottom-i.top;for(let Ue=0;Ue1'),S.appendChild(p),a.push(S)),jr.variables_get){i.sort(_f.compareByName);for(let O=0,j;j=i[O];O++)p=t.createElement$$module$build$src$core$utils$xml("block"),p.setAttribute("type","variables_get"),p.setAttribute("gap","8"),p.appendChild(Xs(j)),a.push(p)}}return a},Gr=function(i){return rh.generateUniqueNameInternal(i)},yr=function(i){return Pi(sm.charAt(0),i.getAllVariableNames())},Pi=function(i,a){if(!a.length)return i;const p=sm;let S="",O=p.indexOf(i);for(;;){let j=!1;for(let ve=0;vej.getVariableModel().name);if(S&&(p=S.some(j=>j.toLowerCase()===i),S=S.some(j=>j.toLowerCase()===a),p&&S))return O.getName()}return null},pc=function(i,a,p){i=i.toLowerCase(),a=a.toLowerCase(),p=p.getAllBlocks(!1);for(const O of p){if(!Di(O))continue;p=O.getProcedureDef();var S=p[1];const j=S.some(ve=>ve.toLowerCase()===i);if(S=S.some(ve=>ve.toLowerCase()===a),j&&S)return p[0]}return null},Xs=function(i){const a=t.createElement$$module$build$src$core$utils$xml("field");return a.setAttribute("name","VAR"),a.setAttribute("id",i.getId()),a.setAttribute("variabletype",i.type),i=t.createTextNode$$module$build$src$core$utils$xml(i.name),a.appendChild(i),a},t.getOrCreateVariablePackage$$module$build$src$core$variables=function(i,a,p,S){let O=t.getVariable$$module$build$src$core$variables(i,a,p,S);return O||(O=Jo(i,a,p,S)),O},t.getVariable$$module$build$src$core$variables=function(i,a,p,S){const O=i.getPotentialVariableMap();let j=null;if(a&&(j=i.getVariableById(a),!j&&O&&(j=O.getVariableById(a)),j))return j;if(p){if(S===void 0)throw Error("Tried to look up a variable by name without a type");j=i.getVariable(p,S),!j&&O&&(j=O.getVariable(p,S))}return j},Jo=function(i,a,p,S){const O=i.getPotentialVariableMap();return p||(p=Gr(i.isFlyout?i.targetWorkspace:i)),O?O.createVariable(p,S,a):i.createVariable(p,S,a)},Xl=function(i,a){i=i.getAllVariables();const p=[];if(a.length!==i.length)for(let S=0;S{Zm=a,Cc=window.requestAnimationFrame(()=>{Pc(),a()})})),Gd)},vr=function(){return Gd||Promise.resolve()},xi=function(i){i||window.cancelAnimationFrame(Cc),Pc(i),!i&&Zm&&Zm()},Dc=function(){return on},gh=function(i){kg.add(i);const a=i.getParent();a?gh(a):Mp.add(i)},Pc=function(i){const a=i?new Set([i]):new Set([...Mp].map(O=>O.workspace)),p=[...Mp].filter(_u).filter(O=>a.has(O.workspace));for(var S of p)xl(S);for(const O of a)O.resizeContents();for(const O of p)S=O.getRelativeToSurfaceXY(),O.updateComponentLocations(S);for(const O of p)El(O);i||(Gd=null)},El=function(i){Mp.delete(i),kg.delete(i);for(const a of i.getChildren(!1))El(a)},_u=function(i){return!i.isDisposed()&&!i.getParent()},xl=function(i){if(kg.has(i)){for(const a of i.getChildren(!1))xl(a);i.renderEfficiently()}},$l=function(i,a){const p=t.createElement$$module$build$src$core$utils$xml("xml");var S=br(t.allUsedVarModels$$module$build$src$core$variables(i));S.hasChildNodes()&&p.appendChild(S),S=i.getTopComments(!0);for(let O=0;O/g,"<$1$2>")},_s=function(i){i=Qi(i).split("<");let a="";for(let p=1;p"&&(a+=" ")}return i=i.join(` +`),i=i.replace(/(<(\w+)\b[^>]*>[^\n]*)\n *<\/\2>/g,"$1"),i.replace(/^\n/,"")},il=function(i,a){return a.setResizesEnabled(!1),a.clear(),i=t.domToWorkspace$$module$build$src$core$xml(i,a),a.setResizesEnabled(!0),i},t.domToWorkspace$$module$build$src$core$xml=function(i,a){let p=0;a.RTL&&(p=a.getWidth());const S=[];te();const O=t.getGroup$$module$build$src$core$events$utils();O||t.setGroup$$module$build$src$core$events$utils(!0),a.setResizesEnabled&&a.setResizesEnabled(!1);let j=!0;try{for(let ve=0,Ue;Ue=i.childNodes[ve];ve++){const Yt=Ue.nodeName.toLowerCase(),jn=Ue;if(Yt==="block"||Yt==="shadow"&&!ae()){const bl=io(jn,a);S.push(bl.id);let Qa;const Fp=parseInt((Qa=jn.getAttribute("x"))!=null?Qa:"10",10);let GT;const WT=parseInt((GT=jn.getAttribute("y"))!=null?GT:"10",10);isNaN(Fp)||isNaN(WT)||bl.moveBy(a.RTL?p-Fp:Fp,WT,["create"]),j=!1}else{if(Yt==="shadow")throw TypeError("Shadow block cannot be a top-level block.");if(Yt==="comment")a.rendered?zl.fromXmlRendered(jn,a,p):ih.fromXml(jn,a);else if(Yt==="variables"){if(j)zu(jn,a);else throw Error("'variables' tag must exist once before block and shadow tag elements in the workspace XML, but it was found in another location.");j=!1}}}}finally{t.setGroup$$module$build$src$core$events$utils(O),a.setResizesEnabled&&a.setResizesEnabled(!0),a.rendered&&xi(),pe()}return ue(new(Ie(Sa))(a)),S},Cd=function(i,a){if(!a.getBlocksBoundingBox)return t.domToWorkspace$$module$build$src$core$xml(i,a);var p=a.getBlocksBoundingBox();if(i=t.domToWorkspace$$module$build$src$core$xml(i,a),p&&p.top!==p.bottom){var S=p.bottom;p=a.RTL?p.right:p.left;var O=1/0;let j=-1/0,ve=1/0;for(let Ue=0;Uej&&(j=Yt.x)}for(S=S-ve+10,p=a.RTL?p-j:p-O,O=0;Ojn.setBubbleVisible(j),1)}},Gn=function(i,a){for(let p=0;p{Ue.disposed||Ue.setConnectionTracking(!0)},1)}return ve},Xr=function(i,a,{parentConnection:p,isShadow:S=!1}={}){if(!i.type)throw new E_(i);const O=a.newBlock(i.type,i.id);return O.setShadow(S),dd(O,i),wu(O,i),Vi(O,i),Pa(p,O,i),vh(O,i),hr(O,i),Qo(O,i),fd(O,i),Bc(O,a.rendered),O},dd=function(i,a){let p=a.x===void 0?0:a.x;a=a.y===void 0?0:a.y;const S=i.workspace;p=S.RTL?S.getWidth()-p:p,i.moveBy(p,a)},wu=function(i,a){a.collapsed&&i.setCollapsed(!0),a.deletable===!1&&i.setDeletable(!1),a.movable===!1&&i.setMovable(!1),a.editable===!1&&i.setEditable(!1),a.enabled===!1&&i.setEnabled(!1),a.inline!==void 0&&i.setInputsInline(a.inline),a.data!==void 0&&(i.data=a.data)},Vi=function(i,a){a.extraState&&(i.loadExtraState?i.loadExtraState(a.extraState):i.domToMutation&&i.domToMutation(t.textToDom$$module$build$src$core$utils$xml(a.extraState)))},Pa=function(i,a,p){if(i){if(i.getSourceBlock().isShadow()&&!a.isShadow())throw new Iv(p);if(i.type===t.inputTypes$$module$build$src$core$inputs$input_types.VALUE){var S=a.outputConnection;if(!S)throw new am("output",a,p)}else if(S=a.previousConnection,!S)throw new am("previous",a,p);if(!i.connect(S)){const O=a.workspace.connectionChecker;throw new y0(O.getErrorMessage(O.canConnectWithReason(S,i,!1),S,i),i.type===t.inputTypes$$module$build$src$core$inputs$input_types.VALUE?"output connection":"previous connection",a,p)}}},vh=function(i,a){if(a.icons){var p=Object.keys(a.icons);for(const O of p){p=a.icons[O];var S=i.getIcon(O);if(!S){if(S=h(Ft.ICON,O,!1),!S)throw new Wf(O,i,a);S=new S(i),i.addIcon(S)}wr(S)&&S.loadState(p)}}},hr=function(i,a){if(a.fields){var p=Object.keys(a.fields);for(let S=0;Sve.id!=i.id).map(ve=>ve.getRelativeToSurfaceXY());for(;Bf(_n.sum(S,O),j)||Tp(i,O,p);)a.RTL?O.translate(-p,2*p):O.translate(p,2*p);i.moveTo(_n.sum(S,O))},Bf=function(i,a){return a.some(p=>1>=Math.abs(p.x-i.x)&&1>=Math.abs(p.y-i.y))},Tp=function(i,a,p){return i.getConnections_(!1).some(S=>!!S.closest(p,a).connection)},Md=function(i){return xe("Blockly.clipboard.copy","v11","v12","myCopyable.toCopyData()"),x0.copyInternal(i)},Jl=function(i){const a=i.toCopyData();oa=a;let p;return C_=(p=i.workspace)!=null?p:null,a},ks=function(i,a,p){return i&&a?Gu(i,a,p):oa&&C_?Gu(oa,C_):null},Gu=function(i,a,p){let S;a=(S=a.getRootWorkspace())!=null?S:a;let O,j;return(j=(O=f(Ft.PASTER,i.paster,!1))==null?void 0:O.paste(i,a,p))!=null?j:null},yh=function(i){return xe("Blockly.clipboard.duplicate","v11","v12","Blockly.clipboard.paste(myCopyable.toCopyData(), myWorkspace)"),x0.duplicateInternal(i)},Ba=function(i){const a=i.toCopyData();return a?ks(a,i.workspace):null},ci=function(i,a){i.setAttribute(Rv,a)},Er=function(i,a,p){Array.isArray(p)&&(p=p.join(" ")),i.setAttribute(sb+a,`${p}`)},oo=function(){return bd},Fa=function(i){if(bd=i,i===null){let a;(a=document.querySelector("."+Yf))==null||a.remove()}},Bo=function(){document.querySelector("."+Yf)||(bd=document.createElement("div"),bd.className=Yf,(D()||document.body).appendChild(bd))},ql=function(i,a,p){Ql(),ed=i,hm=p,(i=bd)&&(i.style.direction=a?"rtl":"ltr",i.style.display="block",a=A(),Xf=a.getRenderer().getClassName(),kp=a.getTheme().getClassName(),Xf&&Pe(i,Xf),kp&&Pe(i,kp))},Ql=function(){if(Fh()){ed=null;var i=bd;i&&(i.style.display="none",i.style.left="",i.style.top="",hm&&hm(),hm=null,i.textContent="",Xf&&(St(i,Xf),Xf=""),kp&&(St(i,kp),kp=""),A().markFocused())}},Fh=function(){return!!ed},Wr=function(i){ed===i&&Ql()},Ai=function(i,a,p){bd.style.left=i+"px",bd.style.top=a+"px",bd.style.height=p+"px"},Sr=function(i,a,p,S){const O=fa(i,a,p);i=ji(i,a,p,S),0>O?Ai(i,0,p.height+O):Ai(i,O,p.height)},ji=function(i,a,p,S){return S?Math.min(Math.max(a.right-p.width,i.left),i.right-p.width):Math.max(Math.min(a.left,i.right-p.width),i.left)},fa=function(i,a,p){return a.bottom+p.height>=i.bottom?a.top-p.height:a.bottom},Eu=function(i){return!(i==null||!i.repositionForWindowResize)},cf=function(){Eu(ed)&&ed.repositionForWindowResize()||Ql()},hf=function(){return eg},pd=function(i){eg=i},Wu=function(i,a,p){if(ql(kv,p,Us),a.length){var S=ol(a,p);Lg=S,Fc(S,i,p),setTimeout(function(){S.focus()},1),eg=null}else Zl()},ol=function(i,a){const p=new Og;p.setRole(oh.MENU);for(let S=0;S{setTimeout(()=>{O.callback(O.scope)},0)})},{})}return p},Fc=function(i,a,p){const S=Se();a=new Oi(a.clientY+S.top,a.clientY+S.top,a.clientX+S.left,a.clientX+S.left),zh(i);const O=i.getSize();p&&(a.left+=O.width,a.right+=O.width,S.left+=O.width,S.right+=O.width),Sr(S,a,O,p),i.focus()},zh=function(i){var a=oo();if(!a)throw Error("Attempting to create a context menu when widget div is null");a=i.render(a),Pe(a,"blocklyContextMenu"),$e(a,"contextmenu",null,Vu),i.focus()},Vu=function(i){i.preventDefault(),i.stopPropagation()},Zl=function(){Wr(kv),eg=null},Us=function(){Lg&&(Lg.dispose(),Lg=null)},t.callbackFactory$$module$build$src$core$contextmenu=function(i,a){return()=>{t.disable$$module$build$src$core$events$utils();let p;try{p=a instanceof Element?io(a,i.workspace):Mi(a,i.workspace);const S=i.getRelativeToSurfaceXY();S.x=i.RTL?S.x-t.config$$module$build$src$core$config.snapRadius:S.x+t.config$$module$build$src$core$config.snapRadius,S.y+=2*t.config$$module$build$src$core$config.snapRadius,p.moveBy(S.x,S.y)}finally{t.enable$$module$build$src$core$events$utils()}return se()&&!p.isShadow()&&ue(new(Ie(t.CREATE$$module$build$src$core$events$utils))(p)),p.select(),p}},eu=function(i){return{text:t.Msg$$module$build$src$core$msg.REMOVE_COMMENT,enabled:!0,callback:function(){t.setGroup$$module$build$src$core$events$utils(!0),i.dispose(),t.setGroup$$module$build$src$core$events$utils(!1)}}},Uh=function(i){return{text:t.Msg$$module$build$src$core$msg.DUPLICATE_COMMENT,enabled:!0,callback:function(){const a=i.toCopyData();a&&ks(a,i.workspace)}}},zc=function(i,a){const p={enabled:!0};return p.text=t.Msg$$module$build$src$core$msg.ADD_COMMENT,p.callback=function(){const S=new zl(i,t.Msg$$module$build$src$core$msg.WORKSPACE_COMMENT_DEFAULT_TEXT,zl.DEFAULT_SIZE,zl.DEFAULT_SIZE);var O=i.getInjectionDiv().getBoundingClientRect();O=new _n(a.clientX-O.left,a.clientY-O.top);const j=i.getOriginOffsetInPixels();O=_n.difference(O,j),O.scale(1/i.scale),S.moveBy(O.x,O.y),i.rendered&&(S.initSvg(),S.render(),S.select())},p},Uc=function(i){return i*Math.PI/180},is=function(i){return 180*i/Math.PI},Fr=function(i,a,p){if(pp)){var S=a.getSvgXY(i.getSvgRoot());i.outputConnection?(S.x+=(i.RTL?3:-3)*p,S.y+=13*p):i.previousConnection&&(S.x+=(i.RTL?-23:23)*p,S.y+=3*p);var O=ie(Ve.CIRCLE,{cx:S.x,cy:S.y,r:0,fill:"none",stroke:"#888","stroke-width":10},a.getParentSvg());i=ie(Ve.ANIMATE,{id:"animationCircle",begin:"indefinite",attributeName:"r",dur:"150ms",from:0,to:25*p},O),a=ie(Ve.ANIMATE,{id:"animationOpacity",begin:"indefinite",attributeName:"opacity",dur:"150ms",from:1,to:0},O),i.beginElement(),a.beginElement(),setTimeout(()=>void mt(O),150)}},Ks=function(i){if(Ua(),i.workspace.getAudioManager().play("disconnect"),!(1>i.workspace.scale)){var a=i.getHeightWidth().height;a=Math.atan(10/a)/Math.PI*180,i.RTL||(a*=-1),F=i,Hs(i,a,new Date)}},Hs=function(i,a,p){const S=(new Date().getTime()-p.getTime())/200;let O="";1>=S&&(O=`skewX(${Math.round(Math.sin(S*Math.PI*3)*(1-S)*a)})`,R=setTimeout(Hs,10,i,a,p)),i.getSvgRoot().setAttribute("transform",`${i.getTranslation()} ${O}`)},Ua=function(){F&&(R&&(clearTimeout(R),R=null),F.getSvgRoot().setAttribute("transform",F.getTranslation()),F=null)},Hh=function(i,a){return xe("Blockly.utils.string.startsWith()","April 2022","April 2023","Use built-in string.startsWith"),i.startsWith(a)},Th=function(i){return i.length?i.reduce(function(a,p){return a.lengtha&&(a=p[S].length);var O=-1/0;let j,ve=1;do{S=O,j=i,i=[],O=p.length/ve;let Ue=1;for(let Yt=0;YtS);return j},Gh=function(i,a,p){const S=[0],O=[];for(var j=0;jS&&(S=Ue,O=ve)}return O?Ha(i,O,p):a},Wh=function(i,a){const p=[];for(let S=0;Sds&&Al()}else fr!==nr&&(clearTimeout(Et),Sn=i.pageX,lr=i.pageY,Et=setTimeout(Ff,Qf))},Id=function(){fr=nr=null,Al()},Al=function(){ir&&(ir=!1,Lu&&(Lu.style.display="none")),Et&&(clearTimeout(Et),Et=0)},Rd=function(){Al(),Io=!0},jh=function(){Io=!1},ei=function(){Lu&&nr&&(typeof Zn=="function"?Zn(Lu,nr):Ii())},Ii=function(){var i=uo(nr);i=t.wrap$$module$build$src$core$utils$string(i,xt),i=i.split(` -`);for(let a=0;ap+window.scrollY&&(O-=Lu.offsetHeight+2*Ul),i?S=Math.max($0-window.scrollX,S):S+Lu.offsetWidth>a+window.scrollX-2*$0&&(S=a-Lu.offsetWidth-2*$0),{x:S,y:O}},Ff=function(){if(!Io&&(fr=nr,Lu)){Lu.textContent="",ei();var i=nr.RTL;Lu.style.direction=i?"rtl":"ltr",Lu.style.display="block",ir=!0;var{x:a,y:p}=Sp(i);Lu.style.left=a+"px",Lu.style.top=p+"px"}},Il=function(i,a){for(const p in a)i[p]=a[p]!==null&&typeof a[p]=="object"?Il(i[p]||Object.create(null),a[p]):a[p];return i},ru=function(i){return i.bubbleIsVisible!==void 0&&i.setBubbleVisible!==void 0},Xu=function(){return ab},Ku=function(i){ab=i},Sh=function(){return ah},ll=function(i){ah=i},ta=function(i){i=`${i}`.toLowerCase().trim();var a=gT[i];if(a||(a=i.substring(0,2)==="0x"?"#"+i.substring(2):i,a=a[0]==="#"?a:"#"+a,/^#[0-9a-f]{6}$/.test(a)))return a;if(/^#[0-9a-f]{3}$/.test(a))return["#",a[1],a[1],a[2],a[2],a[3],a[3]].join("");var p=i.match(/^(?:rgb)?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/);return p&&(i=Number(p[1]),a=Number(p[2]),p=Number(p[3]),0<=i&&256>i&&0<=a&&256>a&&0<=p&&256>p)?Rl(i,a,p):null},Rl=function(i,a,p){return a=i<<16|a<<8|p,16>i?"#"+(16777216|a).toString(16).substr(1):"#"+a.toString(16)},Wc=function(i){return i=ta(i),i?(i=parseInt(i.substr(1),16),[i>>16,i>>8&255,i&255]):[0,0,0]},kl=function(i,a,p){let S=0,O=0,j=0;if(a===0)j=O=S=p;else{const ve=Math.floor(i/60),Ue=i/60-ve;i=p*(1-a);const Yt=p*(1-a*Ue);switch(a=p*(1-a*(1-Ue)),ve){case 1:S=Yt,O=p,j=i;break;case 2:S=i,O=p,j=a;break;case 3:S=i,O=Yt,j=p;break;case 4:S=a,O=i,j=p;break;case 5:S=p,O=i,j=Yt;break;case 6:case 0:S=p,O=a,j=i}}return Rl(Math.floor(S),Math.floor(O),Math.floor(j))},Vc=function(i,a,p){return i=ta(i),!i||(a=ta(a),!a)?null:(i=Wc(i),a=Wc(a),Rl(Math.round(a[0]+p*(i[0]-a[0])),Math.round(a[1]+p*(i[1]-a[1])),Math.round(a[2]+p*(i[2]-a[2]))))},_c=function(i){return kl(i,ab,255*ah)},kd=function(i,a,p){const S=[];var O=i.split("");O.push("");var j=0;i=[];let ve=null;for(let jn=0;jnds&&Al()}else fr!==nr&&(clearTimeout(Et),Sn=i.pageX,lr=i.pageY,Et=setTimeout(Ff,Qf))},Id=function(){fr=nr=null,Al()},Al=function(){ir&&(ir=!1,Lu&&(Lu.style.display="none")),Et&&(clearTimeout(Et),Et=0)},Rd=function(){Al(),Io=!0},jh=function(){Io=!1},ei=function(){Lu&&nr&&(typeof Zn=="function"?Zn(Lu,nr):Ii())},Ii=function(){var i=uo(nr);i=t.wrap$$module$build$src$core$utils$string(i,xt),i=i.split(` +`);for(let a=0;ap+window.scrollY&&(O-=Lu.offsetHeight+2*Ul),i?S=Math.max($0-window.scrollX,S):S+Lu.offsetWidth>a+window.scrollX-2*$0&&(S=a-Lu.offsetWidth-2*$0),{x:S,y:O}},Ff=function(){if(!Io&&(fr=nr,Lu)){Lu.textContent="",ei();var i=nr.RTL;Lu.style.direction=i?"rtl":"ltr",Lu.style.display="block",ir=!0;var{x:a,y:p}=Sp(i);Lu.style.left=a+"px",Lu.style.top=p+"px"}},Il=function(i,a){for(const p in a)i[p]=a[p]!==null&&typeof a[p]=="object"?Il(i[p]||Object.create(null),a[p]):a[p];return i},ru=function(i){return i.bubbleIsVisible!==void 0&&i.setBubbleVisible!==void 0},Xu=function(){return ab},Ku=function(i){ab=i},Sh=function(){return ah},ll=function(i){ah=i},ta=function(i){i=`${i}`.toLowerCase().trim();var a=_T[i];if(a||(a=i.substring(0,2)==="0x"?"#"+i.substring(2):i,a=a[0]==="#"?a:"#"+a,/^#[0-9a-f]{6}$/.test(a)))return a;if(/^#[0-9a-f]{3}$/.test(a))return["#",a[1],a[1],a[2],a[2],a[3],a[3]].join("");var p=i.match(/^(?:rgb)?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/);return p&&(i=Number(p[1]),a=Number(p[2]),p=Number(p[3]),0<=i&&256>i&&0<=a&&256>a&&0<=p&&256>p)?Rl(i,a,p):null},Rl=function(i,a,p){return a=i<<16|a<<8|p,16>i?"#"+(16777216|a).toString(16).substr(1):"#"+a.toString(16)},Wc=function(i){return i=ta(i),i?(i=parseInt(i.substr(1),16),[i>>16,i>>8&255,i&255]):[0,0,0]},kl=function(i,a,p){let S=0,O=0,j=0;if(a===0)j=O=S=p;else{const ve=Math.floor(i/60),Ue=i/60-ve;i=p*(1-a);const Yt=p*(1-a*Ue);switch(a=p*(1-a*(1-Ue)),ve){case 1:S=Yt,O=p,j=i;break;case 2:S=i,O=p,j=a;break;case 3:S=i,O=Yt,j=p;break;case 4:S=a,O=i,j=p;break;case 5:S=p,O=i,j=Yt;break;case 6:case 0:S=p,O=a,j=i}}return Rl(Math.floor(S),Math.floor(O),Math.floor(j))},Vc=function(i,a,p){return i=ta(i),!i||(a=ta(a),!a)?null:(i=Wc(i),a=Wc(a),Rl(Math.round(a[0]+p*(i[0]-a[0])),Math.round(a[1]+p*(i[1]-a[1])),Math.round(a[2]+p*(i[2]-a[2]))))},_c=function(i){return kl(i,ab,255*ah)},kd=function(i,a,p){const S=[];var O=i.split("");O.push("");var j=0;i=[];let ve=null;for(let jn=0;jn=Ue?(j=2,ve=Ue,(Ue=i.join(""))&&S.push(Ue),i.length=0):Ue==="{"?j=3:(i.push("%",Ue),j=0);else if(j===2)if("0"<=Ue&&"9">=Ue)ve+=Ue;else{var Yt=void 0;S.push(parseInt((Yt=ve)!=null?Yt:"",10)),jn--,j=0}else j===3&&(Ue===""?(i.splice(0,0,"%{"),jn--,j=0):Ue!=="}"?i.push(Ue):(j=i.join(""),/[A-Z]\w*/i.test(j)?(Ue=j.toUpperCase(),(Ue=Ue.startsWith("BKY_")?Ue.substring(4):null)&&Ue in t.Msg$$module$build$src$core$msg?(j=t.Msg$$module$build$src$core$msg[Ue],typeof j=="string"?Array.prototype.push.apply(S,kd(j,a,p)):a?S.push(`${j}`):S.push(j)):S.push("%{"+j+"}")):S.push("%{"+j+"}"),j=i.length=0))}for((a=i.join(""))&&S.push(a),Yt=[],i.length=0,O=0;O=p)return{hue:p,hex:kl(p,Xu(),255*Sh())};if(p=ta(a))return{hue:null,hex:p};throw p='Invalid colour: "'+a+'"',i!==a&&(p+=' (from "'+i+'")'),Error(p)},ma=function(i){return i.getProcedureModel!==void 0&&i.doProcedureUpdate!==void 0&&i.isProcedureDef!==void 0},X=function(i){return i.startPublishing!==void 0&&i.stopPublishing!==void 0},xs=function(i,a){r(Ft.FIELD,i,a)},ga=function(i){o(Ft.FIELD,i)},t.fromJson$$module$build$src$core$field_registry=function(i){return Mc.fromJsonInternal(i)},Cr=function(i){const a=f(Ft.FIELD,i.type);if(a){if(typeof a.fromJson!="function")throw new TypeError("returned Field was not a IRegistrableField");return a.fromJson(i)}return console.warn("Blockly could not create a field of type "+i.type+". The field is probably not being registered. This could be because the file is not loaded, the field does not register itself (Issue #1584), or the registration is not being reached."),null},mn=function(i){let a=!1;const p=i.map(([ve,Ue])=>typeof ve=="string"?[Vr(ve),Ue]:(a=!0,[ve.alt!==null?Object.assign({},ve,{alt:Vr(ve.alt)}):Object.assign({},ve),Ue]));if(a||2>i.length)return{options:p};var S=p.map(([ve])=>ve),O=Th(S);i=mc(S,O);const j=Zo(S,O);return!i&&!j||O<=i+j?{options:p}:(O=i?S[0].substring(0,i-1):void 0,S=j?S[0].substr(1-j):void 0,{options:zf(p,i,j),prefix:O,suffix:S})},zf=function(i,a,p){return i.map(([S,O])=>[S.substring(a,S.length-p),O])},cl=function(i){if(!Array.isArray(i))throw TypeError("FieldDropdown options must be an array.");if(!i.length)throw TypeError("FieldDropdown options must not be an empty array.");let a=!1;for(let p=0;p!S.getReturnTypes()).map(S=>[S.getName(),S.getParameters().map(O=>O.getName()),!1]);i.getBlocksByType("procedures_defnoreturn",!1).forEach(S=>{!ma(S)&&Di(S)&&a.push(S.getProcedureDef())});const p=i.getProcedureMap().getProcedures().filter(S=>!!S.getReturnTypes()).map(S=>[S.getName(),S.getParameters().map(O=>O.getName()),!0]);return i.getBlocksByType("procedures_defreturn",!1).forEach(S=>{!ma(S)&&Di(S)&&p.push(S.getProcedureDef())}),a.sort(co),p.sort(co),[a,p]},co=function(i,a){return i[0].localeCompare(a[0],void 0,{sensitivity:"base"})},t.findLegalName$$module$build$src$core$procedures=function(i,a){if(a.isInFlyout)return i;for(i=i||t.Msg$$module$build$src$core$msg.UNNAMED_KEY||"unnamed";!ya(i,a.workspace,a);){const p=i.match(/^(.*?)(\d+)$/);i=p?p[1]+(parseInt(p[2])+1):i+"2"}return i},ya=function(i,a,p){return!Cn(i,a,p)},Cn=function(i,a,p){for(const S of a.getAllBlocks(!1))if(S!==p&&Di(S)&&t.Names$$module$build$src$core$names.equals(S.getProcedureDef()[0],i))return!0;p=p&&ma(p)?p==null?void 0:p.getProcedureModel():void 0;for(const S of a.getProcedureMap().getProcedures())if(S!==p&&t.Names$$module$build$src$core$names.equals(S.getName(),i))return!0;return!1},t.rename$$module$build$src$core$procedures=function(i){var a=this.getSourceBlock();if(!a)throw new Ro;i=i.trim();const p=t.findLegalName$$module$build$src$core$procedures(i,a);ma(a)&&!a.isInsertionMarker()&&a.getProcedureModel().setName(p);const S=this.getValue();if(S!==i&&S!==p)for(i=a.workspace.getAllBlocks(!1),a=0;a$o(p,i)||kr(p)&&t.Names$$module$build$src$core$names.equals(p.getProcedureCall(),i))},$o=function(i,a){return ma(i)&&!i.isProcedureDef()&&i.getProcedureModel()&&t.Names$$module$build$src$core$names.equals(i.getProcedureModel().getName(),a)},t.mutateCallers$$module$build$src$core$procedures=function(i){const a=ae();var p=i.getProcedureDef()[0];const S=i.mutationToDom(!0);i=su(p,i.workspace);for(let j=0,ve;ve=i[j];j++){p=(p=ve.mutationToDom())&&Nn(p),ve.domToMutation&&ve.domToMutation(S);var O=ve.mutationToDom();O=O&&Nn(O),p!==O&&(he(!1),ue(new(Ie(t.CHANGE$$module$build$src$core$events$utils))(ve,"mutation",null,p,O)),he(a))}},t.getDefinition$$module$build$src$core$procedures=function(i,a){for(const p of a.getAllBlocks(!1))if(ma(p)&&p.isProcedureDef()&&t.Names$$module$build$src$core$names.equals(p.getProcedureModel().getName(),i)||Di(p)&&t.Names$$module$build$src$core$names.equals(p.getProcedureDef()[0],i))return p;return null},ys=function(i){return i.isDynamic},dl=function(i){return i.pathDown!==void 0&&i.pathUp!==void 0},as=function(i){return i.pathLeft!==void 0&&i.pathRight!==void 0},fl=function(i){let a=i.outputConnection;return(!a||i.previousConnection&&i.previousConnection.isConnected())&&(a=i.previousConnection),a},zo=function(i,a){if(!i||!a)throw Error("Cannot connect null connections.");i.targetConnection=a,a.targetConnection=i},Xh=function(i,a){let p=null;a=a.outputConnection;const S=a==null?void 0:a.getConnectionChecker();for(let O=0,j;j=i.inputList[O];O++){const ve=j.connection;let Ue;if(ve&&((Ue=S)!=null&&Ue.canConnect(a,ve,!1))){if(p)return null;p=ve}}return p},Wa=function(i,a){let p;for(;p=Xh(i,a);)if(i=p.targetBlock(),!i||i.isShadow())return p;return null},ki=function(i,a){r(Ft.RENDERER,i,a)},Nd=function(i){o(Ft.RENDERER,i)},Xc=function(i,a,p){return i=new(h(Ft.RENDERER,i))(i),i.init(a,p),i},Kh=function(i){ws(i.getTargetWorkspace(),void 0,"String")},Uo=function(i){ws(i.getTargetWorkspace(),void 0,"Number")},Co=function(i){ws(i.getTargetWorkspace(),void 0,"Colour")},df=function(i){let a=[],p=document.createElement("button");return p.setAttribute("text",t.Msg$$module$build$src$core$msg.NEW_STRING_VARIABLE),p.setAttribute("callbackKey","CREATE_VARIABLE_STRING"),a.push(p),p=document.createElement("button"),p.setAttribute("text",t.Msg$$module$build$src$core$msg.NEW_NUMBER_VARIABLE),p.setAttribute("callbackKey","CREATE_VARIABLE_NUMBER"),a.push(p),p=document.createElement("button"),p.setAttribute("text",t.Msg$$module$build$src$core$msg.NEW_COLOUR_VARIABLE),p.setAttribute("callbackKey","CREATE_VARIABLE_COLOUR"),a.push(p),i.registerButtonCallback("CREATE_VARIABLE_STRING",Kh),i.registerButtonCallback("CREATE_VARIABLE_NUMBER",Uo),i.registerButtonCallback("CREATE_VARIABLE_COLOUR",Co),i=Cu(i),a=a.concat(i)},Cu=function(i){i=i.getAllVariables();const a=[];if(0Kc(p))),a},Kc=function(i){const a={id:i.getId(),name:i.getName()};return i.getTypes().length&&(a.types=i.getTypes()),a},_i=function(i,a,p,S){if(i=new i(S,p.name,p.id).setReturnTypes(p.returnTypes),!p.parameters)return i;for(const[O,j]of p.parameters.entries())i.insertParameter(ja(a,j,S),O);return i},ja=function(i,a,p){return i=new i(p,a.name,a.id),a.types&&i.setTypes(a.types),i},bc=function(i){const a=Object.create(null),p=g(Ft.SERIALIZER,!0);for(const S in p){let O;const j=(O=p[S])==null?void 0:O.save(i);j&&(a[S]=j)}return a},ff=function(i,a,{recordUndo:p=!1}={}){var S=g(Ft.SERIALIZER,!0);if(S){S=Object.entries(S).sort((j,ve)=>ve[1].priority-j[1].priority);var O=ae();he(p),(p=t.getGroup$$module$build$src$core$events$utils())||t.setGroup$$module$build$src$core$events$utils(!0),te(),a instanceof ep&&a.setResizesEnabled(!1);for(const[,j]of S.reverse()){let ve;(ve=j)==null||ve.clear(a)}for(let[j,ve]of S.reverse())if(i[j]){let Ue;(Ue=ve)==null||Ue.load(i[j],a)}a instanceof ep&&a.setResizesEnabled(!0),me(),ue(new(Ie(Sa))(a)),t.setGroup$$module$build$src$core$events$utils(p),he(O)}},Eh=function(i,a,p){const S=p.getBoundingRectangle(),O=S.right-S.left,j=Fr(a.top,S.top,a.top+a.height-(S.bottom-S.top))-S.top;let ve=a.left;return a=a.left+a.width-O,i.RTL?ve=Math.min(a,ve):a=Math.max(ve,a),(i=Fr(ve,S.left,a)-S.left)||j?(p.moveBy(i,j,["inbounds"]),!0):!1},ra=function(i){return a=>{var p=i.getMetricsManager();if(p.hasFixedEdges()&&!i.isDragging()){var S;if(Qh.indexOf((S=a.type)!=null?S:"")!==-1){S=p.getScrollMetrics(!0);const O=Yi(i,a);O&&(p=t.getGroup$$module$build$src$core$events$utils()||!1,t.setGroup$$module$build$src$core$events$utils(a.group),Eh(i,S,O)&&!a.group&&console.warn("Moved object in bounds but there was no event group. This may break undo."),t.setGroup$$module$build$src$core$events$utils(p))}else a.type===ni&&a.scale&&a.oldScale&&a.scale>a.oldScale&&Pn(i)}}},Yi=function(i,a){let p=null;switch(a.type){case t.CREATE$$module$build$src$core$events$utils:case t.MOVE$$module$build$src$core$events$utils:(p=i.getBlockById(a.blockId))&&(p=p.getRootBlock());break;case cs:case Ta:p=i.getCommentById(a.commentId)}return p},Pn=function(i){var a=i.getMetricsManager();if(a.hasFixedEdges()&&!i.isDragging()){a=a.getScrollMetrics(!0);var p=i.getTopBoundedElements();for(let S=0,O;O=p[S];S++)Eh(i,a,O)}},tr=function(i,a){const p=[];for(const S of i.getIcons())(!ru(S)||S.bubbleIsVisible())&&(p.push({location:a,icon:S}),S.onLocationChange(a));for(const S of i.getChildren(!1))p.push(...tr(S,_n.sum(a,S.relativeCoords)));return p},Nr=function(){Li.registry.register({displayText(){return t.Msg$$module$build$src$core$msg.UNDO},preconditionFn(i){return 0a.length?Tc(a):nn(t.Msg$$module$build$src$core$msg.DELETE_ALL_BLOCKS.replace("%1",String(a.length)),function(p){p&&Tc(a)})}},scopeType:Li.ScopeType.WORKSPACE,id:"workspaceDelete",weight:6})},qs=function(){Nr(),ti(),qr(),us(),ts(),Qu()},ho=function(){Li.registry.register({displayText(){return t.Msg$$module$build$src$core$msg.DUPLICATE_BLOCK},preconditionFn(i){return i=i.block,!i.isInFlyout&&i.isDeletable()&&i.isMovable()?i.isDuplicatable()?"enabled":"disabled":"hidden"},callback(i){if(i.block){var a=i.block.toCopyData();a&&ks(a,i.block.workspace)}},scopeType:Li.ScopeType.BLOCK,id:"blockDuplicate",weight:1})},vd=function(){Li.registry.register({displayText(i){return i.block.hasIcon(nd.TYPE)?t.Msg$$module$build$src$core$msg.REMOVE_COMMENT:t.Msg$$module$build$src$core$msg.ADD_COMMENT},preconditionFn(i){return i=i.block,!i.isInFlyout&&i.workspace.options.comments&&!i.isCollapsed()&&i.isEditable()?"enabled":"hidden"},callback(i){i=i.block,i.hasIcon(nd.TYPE)?i.setCommentText(null):i.setCommentText("")},scopeType:Li.ScopeType.BLOCK,id:"blockComment",weight:2})},ba=function(){Li.registry.register({displayText(i){return i.block.getInputsInline()?t.Msg$$module$build$src$core$msg.EXTERNAL_INPUTS:t.Msg$$module$build$src$core$msg.INLINE_INPUTS},preconditionFn(i){if(i=i.block,!i.isInFlyout&&i.isMovable()&&!i.isCollapsed()){for(let a=1;a>>0,wn.propertyToPolyfillSymbol[O]=wn.IS_SYMBOL_NATIVE?wn.global.Symbol(O):wn.POLYFILL_PREFIX+p+"$"+O),wn.defineProperty(S,wn.propertyToPolyfillSymbol[O],{configurable:!0,writable:!0,value:a})))},wn.polyfill("globalThis",function(i){return i||wn.global},"es_2020","es3"),wn.arrayIteratorImpl=function(i){var a=0;return function(){return a{const i=ml.length,a=[];for(let p=0;20>p;p++)a[p]=ml.charAt(Math.random()*i);return a.join("")}},Sc=0,nc={TEST_ONLY:Zc};nc.genUid=q,nc.getNextUniqueId=Z;var Ao,Qs,ia,Ch,go,Iu,eh,wc,Go,_o,rc,Dl,vo,Pl,Xa,uu,ni,cs,qh,yd,Ta,Sa,Qh,Ec,Hf,x;Ao="",Qs=!0,ia=0,t.CREATE$$module$build$src$core$events$utils="create",t.CREATE$$module$build$src$core$events$utils,t.DELETE$$module$build$src$core$events$utils="delete",t.DELETE$$module$build$src$core$events$utils,t.CHANGE$$module$build$src$core$events$utils="change",t.CHANGE$$module$build$src$core$events$utils,Ch="block_field_intermediate_change",t.MOVE$$module$build$src$core$events$utils="move",t.MOVE$$module$build$src$core$events$utils,go="var_create",Iu="var_delete",eh="var_rename",wc="ui",Go="drag",_o="selected",rc="click",Dl="marker_move",vo="bubble_open",Pl="trashcan_open",Xa="toolbox_item_select",uu="theme_change",ni="viewport_change",cs="comment_create",qh="comment_delete",yd="comment_change",Ta="comment_move",Sa="finished_loading",Qh=[t.CREATE$$module$build$src$core$events$utils,t.MOVE$$module$build$src$core$events$utils,cs,Ta],Ec=[],Hf={FIRE_QUEUE:Ec,fireNow:we,fireInternal:ge,setGroupInternal:fe},x={BLOCK_CHANGE:t.CHANGE$$module$build$src$core$events$utils,BLOCK_CREATE:t.CREATE$$module$build$src$core$events$utils,BLOCK_DELETE:t.DELETE$$module$build$src$core$events$utils,BLOCK_DRAG:Go,BLOCK_FIELD_INTERMEDIATE_CHANGE:Ch,BLOCK_MOVE:t.MOVE$$module$build$src$core$events$utils,BUBBLE_OPEN:vo,BUMP_EVENTS:Qh,CHANGE:t.CHANGE$$module$build$src$core$events$utils,CLICK:rc,COMMENT_CHANGE:yd,COMMENT_CREATE:cs,COMMENT_DELETE:qh,COMMENT_MOVE:Ta,CREATE:t.CREATE$$module$build$src$core$events$utils,DELETE:t.DELETE$$module$build$src$core$events$utils,FINISHED_LOADING:Sa,MARKER_MOVE:Dl,MOVE:t.MOVE$$module$build$src$core$events$utils,SELECTED:_o,TEST_ONLY:Hf,THEME_CHANGE:uu,TOOLBOX_ITEM_SELECT:Xa,TRASHCAN_OPEN:Pl,UI:wc,VAR_CREATE:go,VAR_DELETE:Iu,VAR_RENAME:eh,VIEWPORT_CHANGE:ni},x.clearPendingUndo=re,x.disable=t.disable$$module$build$src$core$events$utils,x.disableOrphans=Je,x.enable=t.enable$$module$build$src$core$events$utils,x.filter=J,x.fire=ue,x.fromJson=Fe,x.get=Ie,x.getDescendantIds=Te,x.getGroup=t.getGroup$$module$build$src$core$events$utils,x.getRecordUndo=ae,x.isEnabled=ie,x.setGroup=t.setGroup$$module$build$src$core$events$utils,x.setRecordUndo=he;var d=class{constructor(){this.workspaceId=void 0,this.isUiEvent=!1,this.type="",this.group=t.getGroup$$module$build$src$core$events$utils(),this.recordUndo=ae()}toJson(){return{type:this.type,group:this.group}}static fromJson(i,a,p){return p.isBlank=!1,p.group=i.group||"",p.workspaceId=a.id,p}isNull(){return!1}run(i){}getEventWorkspace_(){let i;if(this.workspaceId&&(i=b(this.workspaceId)),!i)throw Error("Workspace is null. Event must have been generated from real Blockly events.");return i}},_=class extends d{constructor(i){super(),this.recordUndo=!1,this.isUiEvent=!0,this.isBlank=typeof i>"u",this.workspaceId=i||""}},$=class extends _{constructor(i,a,p){a=i?i.workspace.id:a,a===null&&(a=void 0),super(a),this.type=rc,this.blockId=i?i.id:void 0,this.targetType=p}toJson(){const i=super.toJson();if(!this.targetType)throw Error("The click target type is undefined. Either pass a block to the constructor, or call fromJson");return i.targetType=this.targetType,i.blockId=this.blockId,i}static fromJson(i,a,p){return a=super.fromJson(i,a,p??new $),a.targetType=i.targetType,a.blockId=i.blockId,a}},I;(function(i){i.BLOCK="block",i.WORKSPACE="workspace",i.ZOOM_CONTROLS="zoom_controls"})(I||(I={})),r(Ft.EVENT,rc,$);var B=750,W="ontouchstart"in globalThis||!!(globalThis.document&&document.documentElement&&"ontouchstart"in document.documentElement)||!(!globalThis.navigator||!globalThis.navigator.maxTouchPoints&&!globalThis.navigator.msMaxTouchPoints),de=null,Oe={mousedown:["pointerdown"],mouseenter:["pointerenter"],mouseleave:["pointerleave"],mousemove:["pointermove"],mouseout:["pointerout"],mouseover:["pointerover"],mouseup:["pointerup","pointercancel"],touchend:["pointerup"],touchcancel:["pointercancel"]},Ze=0,wt={TOUCH_ENABLED:W,TOUCH_MAP:Oe};wt.checkTouchIdentifier=ze,wt.clearTouchIdentifier=nt,wt.getTouchIdentifierFromEvent=lt,wt.longStart=Re,wt.longStop=Qe,wt.shouldHandleEvent=ft;var Qt,cn,bn,Tn,gn,Dr,Tt,Me,Ne,st;(function(i){function a(S){return p.indexOf(S.toUpperCase())!==-1}Qt=i;const p=Qt.toUpperCase();cn=a("JavaFX"),bn=a("WebKit"),Tn=a("Gecko")&&!bn,gn=a("Android"),i=globalThis.navigator&&globalThis.navigator.maxTouchPoints,Dr=a("iPad")||a("Macintosh")&&0{S.push(this.componentData.get(O))}),S.sort(function(O,j){return O.weight-j.weight}),S.forEach(function(O){p.push(O.component)})}else i.forEach(S=>{p.push(this.componentData.get(S).component)});return p}};gl.Capability=wa;var mf=!1,Zh=` +`?((a=i.join(""))&&Yt.push(a),i.length=0,Yt.push(S[O])):i.push(S[O]);return(a=i.join(""))&&Yt.push(a),i.length=0,Yt},Ga=function(i){return kd(i,!0,!0)},Vr=function(i){return typeof i!="string"?i:(i=kd(i,!1,!1),i.length?String(i[0]):"")},ul=function(i){let a=!0;const p=t.Msg$$module$build$src$core$msg,S=i.match(/%{BKY_[A-Z]\w*}/gi);if(S)for(let O=0;O=p)return{hue:p,hex:kl(p,Xu(),255*Sh())};if(p=ta(a))return{hue:null,hex:p};throw p='Invalid colour: "'+a+'"',i!==a&&(p+=' (from "'+i+'")'),Error(p)},ma=function(i){return i.getProcedureModel!==void 0&&i.doProcedureUpdate!==void 0&&i.isProcedureDef!==void 0},X=function(i){return i.startPublishing!==void 0&&i.stopPublishing!==void 0},xs=function(i,a){r(Ft.FIELD,i,a)},ga=function(i){o(Ft.FIELD,i)},t.fromJson$$module$build$src$core$field_registry=function(i){return Mc.fromJsonInternal(i)},Cr=function(i){const a=f(Ft.FIELD,i.type);if(a){if(typeof a.fromJson!="function")throw new TypeError("returned Field was not a IRegistrableField");return a.fromJson(i)}return console.warn("Blockly could not create a field of type "+i.type+". The field is probably not being registered. This could be because the file is not loaded, the field does not register itself (Issue #1584), or the registration is not being reached."),null},mn=function(i){let a=!1;const p=i.map(([ve,Ue])=>typeof ve=="string"?[Vr(ve),Ue]:(a=!0,[ve.alt!==null?Object.assign({},ve,{alt:Vr(ve.alt)}):Object.assign({},ve),Ue]));if(a||2>i.length)return{options:p};var S=p.map(([ve])=>ve),O=Th(S);i=mc(S,O);const j=Zo(S,O);return!i&&!j||O<=i+j?{options:p}:(O=i?S[0].substring(0,i-1):void 0,S=j?S[0].substr(1-j):void 0,{options:zf(p,i,j),prefix:O,suffix:S})},zf=function(i,a,p){return i.map(([S,O])=>[S.substring(a,S.length-p),O])},cl=function(i){if(!Array.isArray(i))throw TypeError("FieldDropdown options must be an array.");if(!i.length)throw TypeError("FieldDropdown options must not be an empty array.");let a=!1;for(let p=0;p!S.getReturnTypes()).map(S=>[S.getName(),S.getParameters().map(O=>O.getName()),!1]);i.getBlocksByType("procedures_defnoreturn",!1).forEach(S=>{!ma(S)&&Di(S)&&a.push(S.getProcedureDef())});const p=i.getProcedureMap().getProcedures().filter(S=>!!S.getReturnTypes()).map(S=>[S.getName(),S.getParameters().map(O=>O.getName()),!0]);return i.getBlocksByType("procedures_defreturn",!1).forEach(S=>{!ma(S)&&Di(S)&&p.push(S.getProcedureDef())}),a.sort(co),p.sort(co),[a,p]},co=function(i,a){return i[0].localeCompare(a[0],void 0,{sensitivity:"base"})},t.findLegalName$$module$build$src$core$procedures=function(i,a){if(a.isInFlyout)return i;for(i=i||t.Msg$$module$build$src$core$msg.UNNAMED_KEY||"unnamed";!ya(i,a.workspace,a);){const p=i.match(/^(.*?)(\d+)$/);i=p?p[1]+(parseInt(p[2])+1):i+"2"}return i},ya=function(i,a,p){return!Mn(i,a,p)},Mn=function(i,a,p){for(const S of a.getAllBlocks(!1))if(S!==p&&Di(S)&&t.Names$$module$build$src$core$names.equals(S.getProcedureDef()[0],i))return!0;p=p&&ma(p)?p==null?void 0:p.getProcedureModel():void 0;for(const S of a.getProcedureMap().getProcedures())if(S!==p&&t.Names$$module$build$src$core$names.equals(S.getName(),i))return!0;return!1},t.rename$$module$build$src$core$procedures=function(i){var a=this.getSourceBlock();if(!a)throw new Ro;i=i.trim();const p=t.findLegalName$$module$build$src$core$procedures(i,a);ma(a)&&!a.isInsertionMarker()&&a.getProcedureModel().setName(p);const S=this.getValue();if(S!==i&&S!==p)for(i=a.workspace.getAllBlocks(!1),a=0;a$o(p,i)||kr(p)&&t.Names$$module$build$src$core$names.equals(p.getProcedureCall(),i))},$o=function(i,a){return ma(i)&&!i.isProcedureDef()&&i.getProcedureModel()&&t.Names$$module$build$src$core$names.equals(i.getProcedureModel().getName(),a)},t.mutateCallers$$module$build$src$core$procedures=function(i){const a=ae();var p=i.getProcedureDef()[0];const S=i.mutationToDom(!0);i=su(p,i.workspace);for(let j=0,ve;ve=i[j];j++){p=(p=ve.mutationToDom())&&Nn(p),ve.domToMutation&&ve.domToMutation(S);var O=ve.mutationToDom();O=O&&Nn(O),p!==O&&(he(!1),ue(new(Ie(t.CHANGE$$module$build$src$core$events$utils))(ve,"mutation",null,p,O)),he(a))}},t.getDefinition$$module$build$src$core$procedures=function(i,a){for(const p of a.getAllBlocks(!1))if(ma(p)&&p.isProcedureDef()&&t.Names$$module$build$src$core$names.equals(p.getProcedureModel().getName(),i)||Di(p)&&t.Names$$module$build$src$core$names.equals(p.getProcedureDef()[0],i))return p;return null},ys=function(i){return i.isDynamic},dl=function(i){return i.pathDown!==void 0&&i.pathUp!==void 0},as=function(i){return i.pathLeft!==void 0&&i.pathRight!==void 0},fl=function(i){let a=i.outputConnection;return(!a||i.previousConnection&&i.previousConnection.isConnected())&&(a=i.previousConnection),a},zo=function(i,a){if(!i||!a)throw Error("Cannot connect null connections.");i.targetConnection=a,a.targetConnection=i},Xh=function(i,a){let p=null;a=a.outputConnection;const S=a==null?void 0:a.getConnectionChecker();for(let O=0,j;j=i.inputList[O];O++){const ve=j.connection;let Ue;if(ve&&((Ue=S)!=null&&Ue.canConnect(a,ve,!1))){if(p)return null;p=ve}}return p},Wa=function(i,a){let p;for(;p=Xh(i,a);)if(i=p.targetBlock(),!i||i.isShadow())return p;return null},ki=function(i,a){r(Ft.RENDERER,i,a)},Nd=function(i){o(Ft.RENDERER,i)},Xc=function(i,a,p){return i=new(h(Ft.RENDERER,i))(i),i.init(a,p),i},Kh=function(i){ws(i.getTargetWorkspace(),void 0,"String")},Uo=function(i){ws(i.getTargetWorkspace(),void 0,"Number")},Co=function(i){ws(i.getTargetWorkspace(),void 0,"Colour")},df=function(i){let a=[],p=document.createElement("button");return p.setAttribute("text",t.Msg$$module$build$src$core$msg.NEW_STRING_VARIABLE),p.setAttribute("callbackKey","CREATE_VARIABLE_STRING"),a.push(p),p=document.createElement("button"),p.setAttribute("text",t.Msg$$module$build$src$core$msg.NEW_NUMBER_VARIABLE),p.setAttribute("callbackKey","CREATE_VARIABLE_NUMBER"),a.push(p),p=document.createElement("button"),p.setAttribute("text",t.Msg$$module$build$src$core$msg.NEW_COLOUR_VARIABLE),p.setAttribute("callbackKey","CREATE_VARIABLE_COLOUR"),a.push(p),i.registerButtonCallback("CREATE_VARIABLE_STRING",Kh),i.registerButtonCallback("CREATE_VARIABLE_NUMBER",Uo),i.registerButtonCallback("CREATE_VARIABLE_COLOUR",Co),i=Cu(i),a=a.concat(i)},Cu=function(i){i=i.getAllVariables();const a=[];if(0Kc(p))),a},Kc=function(i){const a={id:i.getId(),name:i.getName()};return i.getTypes().length&&(a.types=i.getTypes()),a},_i=function(i,a,p,S){if(i=new i(S,p.name,p.id).setReturnTypes(p.returnTypes),!p.parameters)return i;for(const[O,j]of p.parameters.entries())i.insertParameter(ja(a,j,S),O);return i},ja=function(i,a,p){return i=new i(p,a.name,a.id),a.types&&i.setTypes(a.types),i},bc=function(i){const a=Object.create(null),p=g(Ft.SERIALIZER,!0);for(const S in p){let O;const j=(O=p[S])==null?void 0:O.save(i);j&&(a[S]=j)}return a},ff=function(i,a,{recordUndo:p=!1}={}){var S=g(Ft.SERIALIZER,!0);if(S){S=Object.entries(S).sort((j,ve)=>ve[1].priority-j[1].priority);var O=ae();he(p),(p=t.getGroup$$module$build$src$core$events$utils())||t.setGroup$$module$build$src$core$events$utils(!0),te(),a instanceof ep&&a.setResizesEnabled(!1);for(const[,j]of S.reverse()){let ve;(ve=j)==null||ve.clear(a)}for(let[j,ve]of S.reverse())if(i[j]){let Ue;(Ue=ve)==null||Ue.load(i[j],a)}a instanceof ep&&a.setResizesEnabled(!0),pe(),ue(new(Ie(Sa))(a)),t.setGroup$$module$build$src$core$events$utils(p),he(O)}},Eh=function(i,a,p){const S=p.getBoundingRectangle(),O=S.right-S.left,j=Fr(a.top,S.top,a.top+a.height-(S.bottom-S.top))-S.top;let ve=a.left;return a=a.left+a.width-O,i.RTL?ve=Math.min(a,ve):a=Math.max(ve,a),(i=Fr(ve,S.left,a)-S.left)||j?(p.moveBy(i,j,["inbounds"]),!0):!1},ra=function(i){return a=>{var p=i.getMetricsManager();if(p.hasFixedEdges()&&!i.isDragging()){var S;if(Qh.indexOf((S=a.type)!=null?S:"")!==-1){S=p.getScrollMetrics(!0);const O=Yi(i,a);O&&(p=t.getGroup$$module$build$src$core$events$utils()||!1,t.setGroup$$module$build$src$core$events$utils(a.group),Eh(i,S,O)&&!a.group&&console.warn("Moved object in bounds but there was no event group. This may break undo."),t.setGroup$$module$build$src$core$events$utils(p))}else a.type===ni&&a.scale&&a.oldScale&&a.scale>a.oldScale&&Pn(i)}}},Yi=function(i,a){let p=null;switch(a.type){case t.CREATE$$module$build$src$core$events$utils:case t.MOVE$$module$build$src$core$events$utils:(p=i.getBlockById(a.blockId))&&(p=p.getRootBlock());break;case cs:case Ta:p=i.getCommentById(a.commentId)}return p},Pn=function(i){var a=i.getMetricsManager();if(a.hasFixedEdges()&&!i.isDragging()){a=a.getScrollMetrics(!0);var p=i.getTopBoundedElements();for(let S=0,O;O=p[S];S++)Eh(i,a,O)}},tr=function(i,a){const p=[];for(const S of i.getIcons())(!ru(S)||S.bubbleIsVisible())&&(p.push({location:a,icon:S}),S.onLocationChange(a));for(const S of i.getChildren(!1))p.push(...tr(S,_n.sum(a,S.relativeCoords)));return p},Nr=function(){Li.registry.register({displayText(){return t.Msg$$module$build$src$core$msg.UNDO},preconditionFn(i){return 0a.length?Tc(a):nn(t.Msg$$module$build$src$core$msg.DELETE_ALL_BLOCKS.replace("%1",String(a.length)),function(p){p&&Tc(a)})}},scopeType:Li.ScopeType.WORKSPACE,id:"workspaceDelete",weight:6})},qs=function(){Nr(),ti(),qr(),us(),ts(),Qu()},ho=function(){Li.registry.register({displayText(){return t.Msg$$module$build$src$core$msg.DUPLICATE_BLOCK},preconditionFn(i){return i=i.block,!i.isInFlyout&&i.isDeletable()&&i.isMovable()?i.isDuplicatable()?"enabled":"disabled":"hidden"},callback(i){if(i.block){var a=i.block.toCopyData();a&&ks(a,i.block.workspace)}},scopeType:Li.ScopeType.BLOCK,id:"blockDuplicate",weight:1})},vd=function(){Li.registry.register({displayText(i){return i.block.hasIcon(nd.TYPE)?t.Msg$$module$build$src$core$msg.REMOVE_COMMENT:t.Msg$$module$build$src$core$msg.ADD_COMMENT},preconditionFn(i){return i=i.block,!i.isInFlyout&&i.workspace.options.comments&&!i.isCollapsed()&&i.isEditable()?"enabled":"hidden"},callback(i){i=i.block,i.hasIcon(nd.TYPE)?i.setCommentText(null):i.setCommentText("")},scopeType:Li.ScopeType.BLOCK,id:"blockComment",weight:2})},ba=function(){Li.registry.register({displayText(i){return i.block.getInputsInline()?t.Msg$$module$build$src$core$msg.EXTERNAL_INPUTS:t.Msg$$module$build$src$core$msg.INLINE_INPUTS},preconditionFn(i){if(i=i.block,!i.isInFlyout&&i.isMovable()&&!i.isCollapsed()){for(let a=1;a>>0,wn.propertyToPolyfillSymbol[O]=wn.IS_SYMBOL_NATIVE?wn.global.Symbol(O):wn.POLYFILL_PREFIX+p+"$"+O),wn.defineProperty(S,wn.propertyToPolyfillSymbol[O],{configurable:!0,writable:!0,value:a})))},wn.polyfill("globalThis",function(i){return i||wn.global},"es_2020","es3"),wn.arrayIteratorImpl=function(i){var a=0;return function(){return a{const i=ml.length,a=[];for(let p=0;20>p;p++)a[p]=ml.charAt(Math.random()*i);return a.join("")}},Sc=0,nc={TEST_ONLY:Zc};nc.genUid=q,nc.getNextUniqueId=Z;var Ao,Qs,ia,Ch,go,Iu,eh,wc,Go,_o,rc,Dl,vo,Pl,Xa,uu,ni,cs,qh,yd,Ta,Sa,Qh,Ec,Hf,x;Ao="",Qs=!0,ia=0,t.CREATE$$module$build$src$core$events$utils="create",t.CREATE$$module$build$src$core$events$utils,t.DELETE$$module$build$src$core$events$utils="delete",t.DELETE$$module$build$src$core$events$utils,t.CHANGE$$module$build$src$core$events$utils="change",t.CHANGE$$module$build$src$core$events$utils,Ch="block_field_intermediate_change",t.MOVE$$module$build$src$core$events$utils="move",t.MOVE$$module$build$src$core$events$utils,go="var_create",Iu="var_delete",eh="var_rename",wc="ui",Go="drag",_o="selected",rc="click",Dl="marker_move",vo="bubble_open",Pl="trashcan_open",Xa="toolbox_item_select",uu="theme_change",ni="viewport_change",cs="comment_create",qh="comment_delete",yd="comment_change",Ta="comment_move",Sa="finished_loading",Qh=[t.CREATE$$module$build$src$core$events$utils,t.MOVE$$module$build$src$core$events$utils,cs,Ta],Ec=[],Hf={FIRE_QUEUE:Ec,fireNow:we,fireInternal:ge,setGroupInternal:fe},x={BLOCK_CHANGE:t.CHANGE$$module$build$src$core$events$utils,BLOCK_CREATE:t.CREATE$$module$build$src$core$events$utils,BLOCK_DELETE:t.DELETE$$module$build$src$core$events$utils,BLOCK_DRAG:Go,BLOCK_FIELD_INTERMEDIATE_CHANGE:Ch,BLOCK_MOVE:t.MOVE$$module$build$src$core$events$utils,BUBBLE_OPEN:vo,BUMP_EVENTS:Qh,CHANGE:t.CHANGE$$module$build$src$core$events$utils,CLICK:rc,COMMENT_CHANGE:yd,COMMENT_CREATE:cs,COMMENT_DELETE:qh,COMMENT_MOVE:Ta,CREATE:t.CREATE$$module$build$src$core$events$utils,DELETE:t.DELETE$$module$build$src$core$events$utils,FINISHED_LOADING:Sa,MARKER_MOVE:Dl,MOVE:t.MOVE$$module$build$src$core$events$utils,SELECTED:_o,TEST_ONLY:Hf,THEME_CHANGE:uu,TOOLBOX_ITEM_SELECT:Xa,TRASHCAN_OPEN:Pl,UI:wc,VAR_CREATE:go,VAR_DELETE:Iu,VAR_RENAME:eh,VIEWPORT_CHANGE:ni},x.clearPendingUndo=re,x.disable=t.disable$$module$build$src$core$events$utils,x.disableOrphans=qe,x.enable=t.enable$$module$build$src$core$events$utils,x.filter=J,x.fire=ue,x.fromJson=Fe,x.get=Ie,x.getDescendantIds=Te,x.getGroup=t.getGroup$$module$build$src$core$events$utils,x.getRecordUndo=ae,x.isEnabled=se,x.setGroup=t.setGroup$$module$build$src$core$events$utils,x.setRecordUndo=he;var d=class{constructor(){this.workspaceId=void 0,this.isUiEvent=!1,this.type="",this.group=t.getGroup$$module$build$src$core$events$utils(),this.recordUndo=ae()}toJson(){return{type:this.type,group:this.group}}static fromJson(i,a,p){return p.isBlank=!1,p.group=i.group||"",p.workspaceId=a.id,p}isNull(){return!1}run(i){}getEventWorkspace_(){let i;if(this.workspaceId&&(i=b(this.workspaceId)),!i)throw Error("Workspace is null. Event must have been generated from real Blockly events.");return i}},_=class extends d{constructor(i){super(),this.recordUndo=!1,this.isUiEvent=!0,this.isBlank=typeof i>"u",this.workspaceId=i||""}},$=class extends _{constructor(i,a,p){a=i?i.workspace.id:a,a===null&&(a=void 0),super(a),this.type=rc,this.blockId=i?i.id:void 0,this.targetType=p}toJson(){const i=super.toJson();if(!this.targetType)throw Error("The click target type is undefined. Either pass a block to the constructor, or call fromJson");return i.targetType=this.targetType,i.blockId=this.blockId,i}static fromJson(i,a,p){return a=super.fromJson(i,a,p??new $),a.targetType=i.targetType,a.blockId=i.blockId,a}},I;(function(i){i.BLOCK="block",i.WORKSPACE="workspace",i.ZOOM_CONTROLS="zoom_controls"})(I||(I={})),r(Ft.EVENT,rc,$);var B=750,W="ontouchstart"in globalThis||!!(globalThis.document&&document.documentElement&&"ontouchstart"in document.documentElement)||!(!globalThis.navigator||!globalThis.navigator.maxTouchPoints&&!globalThis.navigator.msMaxTouchPoints),de=null,ke={mousedown:["pointerdown"],mouseenter:["pointerenter"],mouseleave:["pointerleave"],mousemove:["pointermove"],mouseout:["pointerout"],mouseover:["pointerover"],mouseup:["pointerup","pointercancel"],touchend:["pointerup"],touchcancel:["pointercancel"]},et=0,wt={TOUCH_ENABLED:W,TOUCH_MAP:ke};wt.checkTouchIdentifier=ze,wt.clearTouchIdentifier=rt,wt.getTouchIdentifierFromEvent=ut,wt.longStart=Re,wt.longStop=Ze,wt.shouldHandleEvent=ft;var Zt,cn,bn,Tn,gn,Dr,Tt,Ce,Le,ot;(function(i){function a(S){return p.indexOf(S.toUpperCase())!==-1}Zt=i;const p=Zt.toUpperCase();cn=a("JavaFX"),bn=a("WebKit"),Tn=a("Gecko")&&!bn,gn=a("Android"),i=globalThis.navigator&&globalThis.navigator.maxTouchPoints,Dr=a("iPad")||a("Macintosh")&&0{S.push(this.componentData.get(O))}),S.sort(function(O,j){return O.weight-j.weight}),S.forEach(function(O){p.push(O.component)})}else i.forEach(S=>{p.push(this.componentData.get(S).component)});return p}};gl.Capability=wa;var mf=!1,Zh=` .blocklySvg { background-color: #fff; outline: none; @@ -496,7 +496,7 @@ input[type=number] { z-index: 80; pointer-events: none; } -`,hs={};hs.inject=mt,hs.register=At;var _n=class{constructor(i,a){this.x=i,this.y=a}clone(){return new _n(this.x,this.y)}scale(i){return this.x*=i,this.y*=i,this}translate(i,a){return this.x+=i,this.y+=a,this}static equals(i,a){return i===a?!0:i&&a?i.x===a.x&&i.y===a.y:!1}static distance(i,a){const p=i.x-a.x;return i=i.y-a.y,Math.sqrt(p*p+i*i)}static magnitude(i){return Math.sqrt(i.x*i.x+i.y*i.y)}static difference(i,a){return new _n(i.x-a.x,i.y-a.y)}static sum(i,a){return new _n(i.x+a.x,i.y+a.y)}},g0=new Set,Mg={};Mg.warn=xe;var Jm="http://www.w3.org/2000/svg",xc="http://www.w3.org/1999/xhtml",Zs="http://www.w3.org/1999/xlink",Gf;(function(i){i[i.ELEMENT_NODE=1]="ELEMENT_NODE",i[i.TEXT_NODE=3]="TEXT_NODE",i[i.COMMENT_NODE=8]="COMMENT_NODE"})(Gf||(Gf={}));var Dd=null,Ka=0,Ur=null,Ea={HTML_NS:xc};Ea.NodeType=Gf,Ea.SVG_NS=Jm,Ea.XLINK_NS=Zs,Ea.addClass=$e,Ea.containsNode=Le,Ea.createSvgElement=se,Ea.getFastTextWidth=Xe,Ea.getFastTextWidthWithSizeString=Wt,Ea.getTextWidth=ke,Ea.hasClass=It,Ea.insertAfter=Ke,Ea.measureFontMetrics=Ge,Ea.removeClass=St,Ea.removeClasses=ht,Ea.removeNode=pt,Ea.setCssTransform=Q,Ea.startTextWidthCache=te,Ea.stopTextWidthCache=me;var Ve=class{constructor(i){this.tagName=i}toString(){return this.tagName}};Ve.ANIMATE=new Ve("animate"),Ve.CIRCLE=new Ve("circle"),Ve.CLIPPATH=new Ve("clipPath"),Ve.DEFS=new Ve("defs"),Ve.FECOMPOSITE=new Ve("feComposite"),Ve.FECOMPONENTTRANSFER=new Ve("feComponentTransfer"),Ve.FEFLOOD=new Ve("feFlood"),Ve.FEFUNCA=new Ve("feFuncA"),Ve.FEGAUSSIANBLUR=new Ve("feGaussianBlur"),Ve.FEPOINTLIGHT=new Ve("fePointLight"),Ve.FESPECULARLIGHTING=new Ve("feSpecularLighting"),Ve.FILTER=new Ve("filter"),Ve.FOREIGNOBJECT=new Ve("foreignObject"),Ve.G=new Ve("g"),Ve.IMAGE=new Ve("image"),Ve.LINE=new Ve("line"),Ve.PATH=new Ve("path"),Ve.PATTERN=new Ve("pattern"),Ve.POLYGON=new Ve("polygon"),Ve.RECT=new Ve("rect"),Ve.SVG=new Ve("svg"),Ve.TEXT=new Ve("text"),Ve.TSPAN=new Ve("tspan");var Oi=class{constructor(i,a,p,S){this.top=i,this.bottom=a,this.left=p,this.right=S}getHeight(){return this.bottom-this.top}getWidth(){return this.right-this.left}contains(i,a){return i>=this.left&&i<=this.right&&a>=this.top&&a<=this.bottom}intersects(i){return!(this.left>i.right||this.righti.bottom||this.bottom=i||isNaN(i)?0:Math.min(i,this.scrollbarLength)}setHandleLength(i){this.handleLength=i,this.svgHandle.setAttribute(this.lengthAttribute_,String(this.handleLength))}constrainHandlePosition(i){return i=0>=i||isNaN(i)?0:Math.min(i,this.scrollbarLength-this.handleLength)}setHandlePosition(i){this.handlePosition=i,this.svgHandle.setAttribute(this.positionAttribute_,String(this.handlePosition))}setScrollbarLength(i){this.scrollbarLength=i,this.outerSvg.setAttribute(this.lengthAttribute_,String(this.scrollbarLength)),this.svgBackground.setAttribute(this.lengthAttribute_,String(this.scrollbarLength))}setPosition(i,a){this.position.x=i,this.position.y=a,Q(this.outerSvg,"translate("+(this.position.x+this.origin.x)+"px,"+(this.position.y+this.origin.y)+"px)")}resize(i){!i&&(i=this.workspace.getMetrics(),!i)||this.oldHostMetrics&&xa.metricsAreEquivalent(i,this.oldHostMetrics)||(this.horizontal?this.resizeHorizontal(i):this.resizeVertical(i),this.oldHostMetrics=i,this.updateMetrics())}requiresViewResize(i){return this.oldHostMetrics?this.oldHostMetrics.viewWidth!==i.viewWidth||this.oldHostMetrics.viewHeight!==i.viewHeight||this.oldHostMetrics.absoluteLeft!==i.absoluteLeft||this.oldHostMetrics.absoluteTop!==i.absoluteTop:!0}resizeHorizontal(i){this.requiresViewResize(i)?this.resizeViewHorizontal(i):this.resizeContentHorizontal(i)}resizeViewHorizontal(i){var a=i.viewWidth-2*this.margin;this.pair&&(a-=xa.scrollbarThickness),this.setScrollbarLength(Math.max(0,a)),a=i.absoluteLeft+this.margin,this.pair&&this.workspace.RTL&&(a+=xa.scrollbarThickness),this.setPosition(a,i.absoluteTop+i.viewHeight-xa.scrollbarThickness-this.margin),this.resizeContentHorizontal(i)}resizeContentHorizontal(i){if(i.viewWidth>=i.scrollWidth)this.setHandleLength(this.scrollbarLength),this.setHandlePosition(0),this.pair||this.setVisible(!1);else{this.pair||this.setVisible(!0);var a=this.scrollbarLength*i.viewWidth/i.scrollWidth;a=this.constrainHandleLength(a),this.setHandleLength(a),a=i.scrollWidth-i.viewWidth;var p=this.scrollbarLength-this.handleLength;i=(i.viewLeft-i.scrollLeft)/a*p,i=this.constrainHandlePosition(i),this.setHandlePosition(i),this.ratio=p/a}}resizeVertical(i){this.requiresViewResize(i)?this.resizeViewVertical(i):this.resizeContentVertical(i)}resizeViewVertical(i){let a=i.viewHeight-2*this.margin;this.pair&&(a-=xa.scrollbarThickness),this.setScrollbarLength(Math.max(0,a)),this.setPosition(this.workspace.RTL?i.absoluteLeft+this.margin:i.absoluteLeft+i.viewWidth-xa.scrollbarThickness-this.margin,i.absoluteTop+this.margin),this.resizeContentVertical(i)}resizeContentVertical(i){if(i.viewHeight>=i.scrollHeight)this.setHandleLength(this.scrollbarLength),this.setHandlePosition(0),this.pair||this.setVisible(!1);else{this.pair||this.setVisible(!0);var a=this.scrollbarLength*i.viewHeight/i.scrollHeight;a=this.constrainHandleLength(a),this.setHandleLength(a),a=i.scrollHeight-i.viewHeight;var p=this.scrollbarLength-this.handleLength;i=(i.viewTop-i.scrollTop)/a*p,i=this.constrainHandlePosition(i),this.setHandlePosition(i),this.ratio=p/a}}isVisible(){return this.isHandleVisible}setContainerVisible(i){const a=i!==this.containerVisible;this.containerVisible=i,a&&this.updateDisplay_()}setVisible(i){if(this.pair)throw Error("Unable to toggle visibility of paired scrollbars.");this.setVisibleInternal(i)}setVisibleInternal(i){const a=i!==this.isVisible();this.isHandleVisible=i,a&&this.updateDisplay_()}updateDisplay_(){this.containerVisible&&this.isVisible()?this.outerSvg.setAttribute("display","block"):this.outerSvg.setAttribute("display","none")}onMouseDownBar(i){if(this.workspace.markFocused(),nt(),this.cleanUp(),Nt(i))i.stopPropagation();else{var a=kt(i,this.workspace.getParentSvg(),this.workspace.getInverseScreenCTM());a=this.horizontal?a.x:a.y;var p=ne(this.svgHandle);p=this.horizontal?p.x:p.y;var S=this.handlePosition,O=.95*this.handleLength;a<=p?S-=O:a>=p+this.handleLength&&(S+=O),this.setHandlePosition(this.constrainHandlePosition(S)),this.updateMetrics(),i.stopPropagation(),i.preventDefault()}}onMouseDownHandle(i){this.workspace.markFocused(),this.cleanUp(),Nt(i)?i.stopPropagation():(this.startDragHandle=this.handlePosition,this.startDragMouse=this.horizontal?i.clientX:i.clientY,this.onMouseUpWrapper_=Ce(document,"pointerup",this,this.onMouseUpHandle),this.onMouseMoveWrapper_=Ce(document,"pointermove",this,this.onMouseMoveHandle),i.stopPropagation(),i.preventDefault())}onMouseMoveHandle(i){this.setHandlePosition(this.constrainHandlePosition(this.startDragHandle+((this.horizontal?i.clientX:i.clientY)-this.startDragMouse))),this.updateMetrics()}onMouseUpHandle(){nt(),this.cleanUp()}cleanUp(){this.workspace.hideChaff(!0),this.onMouseUpWrapper_&&(rt(this.onMouseUpWrapper_),this.onMouseUpWrapper_=null),this.onMouseMoveWrapper_&&(rt(this.onMouseMoveWrapper_),this.onMouseMoveWrapper_=null)}getRatio_(){let i=this.handlePosition/(this.scrollbarLength-this.handleLength);return isNaN(i)&&(i=0),i}updateMetrics(){const i=this.getRatio_();this.horizontal?this.workspace.setMetrics({x:i}):this.workspace.setMetrics({y:i})}set(i,a){this.setHandlePosition(this.constrainHandlePosition(i*this.ratio)),(a||a===void 0)&&this.updateMetrics()}setOrigin(i,a){this.origin=new _n(i,a)}static metricsAreEquivalent(i,a){return i.viewWidth===a.viewWidth&&i.viewHeight===a.viewHeight&&i.viewLeft===a.viewLeft&&i.viewTop===a.viewTop&&i.absoluteTop===a.absoluteTop&&i.absoluteLeft===a.absoluteLeft&&i.scrollWidth===a.scrollWidth&&i.scrollHeight===a.scrollHeight&&i.scrollLeft===a.scrollLeft&&i.scrollTop===a.scrollTop}};xa.scrollbarThickness=W?25:15,xa.DEFAULT_SCROLLBAR_MARGIN=.5;var Ag={parseFromString:function(){throw Error("DOMParser was not found in the global scope and was not properly injected using injectDependencies")}},nm={serializeToString:function(){throw Error("XMLSerializer was not foundin the global scope and was not properly injected using injectDependencies")}},{document:$p,DOMParser:_l,XMLSerializer:cu}=globalThis;_l&&(Ag=new _l),cu&&(nm=new cu);var Pd="https://developers.google.com/blockly/xml",gf=/[\x00-\x09\x0B\x0C\x0E-\x1F]/g,Bd={NAME_SPACE:Pd};Bd.createElement=t.createElement$$module$build$src$core$utils$xml,Bd.createTextNode=t.createTextNode$$module$build$src$core$utils$xml,Bd.domToText=Nn,Bd.injectDependencies=sn,Bd.textToDom=t.textToDom$$module$build$src$core$utils$xml;var nh="categoryToolbox",Ig="flyoutToolbox",dr;(function(i){i[i.TOP=0]="TOP",i[i.BOTTOM=1]="BOTTOM",i[i.LEFT=2]="LEFT",i[i.RIGHT=3]="RIGHT"})(dr||(dr={}));var _0={hasCategoriesInternal:Wn},yo={};yo.Position=dr,yo.TEST_ONLY=_0,yo.convertFlyoutDefToJsonArray=bt,yo.convertToolboxDefToJson=gt,yo.hasCategories=Vt,yo.isCategoryCollapsible=rr,yo.parseToolboxTree=Br;var Ja;(function(i){i[i.TOP=0]="TOP",i[i.BOTTOM=1]="BOTTOM"})(Ja||(Ja={}));var rm;(function(i){i[i.LEFT=0]="LEFT",i[i.RIGHT=1]="RIGHT"})(rm||(rm={}));var Fd;(function(i){i[i.UP=0]="UP",i[i.DOWN=1]="DOWN"})(Fd||(Fd={}));var im={};im.bumpDirection=Fd,im.bumpPositionRect=Oa,im.getCornerOppositeToolbox=Ss,im.getStartPositionRect=Yr,im.horizontalPosition=rm,im.verticalPosition=Ja;var Ru={width:96,height:124,url:"sprites.png"},v0=class{constructor(i){this.workspace=i,this.id="zoomControls",this.boundEvents=[],this.zoomResetGroup=this.zoomOutGroup=this.zoomInGroup=null,this.HEIGHT=this.WIDTH=32,this.SMALL_SPACING=2,this.LARGE_SPACING=11,this.MARGIN_HORIZONTAL=this.MARGIN_VERTICAL=20,this.svgGroup=null,this.top=this.left=0,this.initialized=!1}createDom(){this.svgGroup=se(Ve.G,{});const i=String(Math.random()).substring(2);return this.createZoomOutSvg(i),this.createZoomInSvg(i),this.workspace.isMovable()&&this.createZoomResetSvg(i),this.svgGroup}init(){this.workspace.getComponentManager().addComponent({component:this,weight:2,capabilities:[gl.Capability.POSITIONABLE]}),this.initialized=!0}dispose(){this.workspace.getComponentManager().removeComponent("zoomControls"),this.svgGroup&&pt(this.svgGroup);for(const i of this.boundEvents)rt(i);this.boundEvents.length=0}getBoundingRectangle(){let i=this.SMALL_SPACING+2*this.HEIGHT;return this.zoomResetGroup&&(i+=this.LARGE_SPACING+this.HEIGHT),new Oi(this.top,this.top+i,this.left,this.left+this.WIDTH)}position(i,a){if(this.initialized){var p=Ss(this.workspace,i),S=this.SMALL_SPACING+2*this.HEIGHT;if(this.zoomResetGroup&&(S+=this.LARGE_SPACING+this.HEIGHT),i=Yr(p,new eo(this.WIDTH,S),this.MARGIN_HORIZONTAL,this.MARGIN_VERTICAL,i,this.workspace),p=p.vertical,a=Oa(i,this.MARGIN_VERTICAL,p===Ja.TOP?Fd.DOWN:Fd.UP,a),p===Ja.TOP){var O=this.SMALL_SPACING+this.HEIGHT,j;(j=this.zoomInGroup)==null||j.setAttribute("transform","translate(0, "+O+")"),this.zoomResetGroup&&this.zoomResetGroup.setAttribute("transform","translate(0, "+(O+this.LARGE_SPACING+this.HEIGHT)+")")}else{j=this.zoomResetGroup?this.LARGE_SPACING+this.HEIGHT:0;let Ue;(Ue=this.zoomInGroup)==null||Ue.setAttribute("transform","translate(0, "+j+")"),j=j+this.SMALL_SPACING+this.HEIGHT,(O=this.zoomOutGroup)==null||O.setAttribute("transform","translate(0, "+j+")")}this.top=a.top,this.left=a.left;var ve;(ve=this.svgGroup)==null||ve.setAttribute("transform","translate("+this.left+","+this.top+")")}}createZoomOutSvg(i){this.zoomOutGroup=se(Ve.G,{class:"blocklyZoom blocklyZoomOut"},this.svgGroup);const a=se(Ve.CLIPPATH,{id:"blocklyZoomoutClipPath"+i},this.zoomOutGroup);se(Ve.RECT,{width:32,height:32},a),se(Ve.IMAGE,{width:Ru.width,height:Ru.height,x:-64,y:-92,"clip-path":"url(#blocklyZoomoutClipPath"+i+")"},this.zoomOutGroup).setAttributeNS(Zs,"xlink:href",this.workspace.options.pathToMedia+Ru.url),this.boundEvents.push(Ce(this.zoomOutGroup,"pointerdown",null,this.zoom.bind(this,-1)))}createZoomInSvg(i){this.zoomInGroup=se(Ve.G,{class:"blocklyZoom blocklyZoomIn"},this.svgGroup);const a=se(Ve.CLIPPATH,{id:"blocklyZoominClipPath"+i},this.zoomInGroup);se(Ve.RECT,{width:32,height:32},a),se(Ve.IMAGE,{width:Ru.width,height:Ru.height,x:-32,y:-92,"clip-path":"url(#blocklyZoominClipPath"+i+")"},this.zoomInGroup).setAttributeNS(Zs,"xlink:href",this.workspace.options.pathToMedia+Ru.url),this.boundEvents.push(Ce(this.zoomInGroup,"pointerdown",null,this.zoom.bind(this,1)))}zoom(i,a){this.workspace.markFocused(),this.workspace.zoomCenter(i),this.fireZoomEvent(),nt(),a.stopPropagation(),a.preventDefault()}createZoomResetSvg(i){this.zoomResetGroup=se(Ve.G,{class:"blocklyZoom blocklyZoomReset"},this.svgGroup);const a=se(Ve.CLIPPATH,{id:"blocklyZoomresetClipPath"+i},this.zoomResetGroup);se(Ve.RECT,{width:32,height:32},a),se(Ve.IMAGE,{width:Ru.width,height:Ru.height,y:-92,"clip-path":"url(#blocklyZoomresetClipPath"+i+")"},this.zoomResetGroup).setAttributeNS(Zs,"xlink:href",this.workspace.options.pathToMedia+Ru.url),this.boundEvents.push(Ce(this.zoomResetGroup,"pointerdown",null,this.resetZoom.bind(this)))}resetZoom(i){this.workspace.markFocused();const a=Math.log(this.workspace.options.zoomOptions.startScale/this.workspace.scale)/Math.log(this.workspace.options.zoomOptions.scaleSpeed);this.workspace.beginCanvasTransition(),this.workspace.zoomCenter(a),this.workspace.scrollCenter(),setTimeout(this.workspace.endCanvasTransition.bind(this.workspace),500),this.fireZoomEvent(),nt(),i.stopPropagation(),i.preventDefault()}fireZoomEvent(){const i=new(Ie(rc))(null,this.workspace.id,"zoom_controls");ue(i)}};At(` +`,hs={};hs.inject=gt,hs.register=At;var _n=class{constructor(i,a){this.x=i,this.y=a}clone(){return new _n(this.x,this.y)}scale(i){return this.x*=i,this.y*=i,this}translate(i,a){return this.x+=i,this.y+=a,this}static equals(i,a){return i===a?!0:i&&a?i.x===a.x&&i.y===a.y:!1}static distance(i,a){const p=i.x-a.x;return i=i.y-a.y,Math.sqrt(p*p+i*i)}static magnitude(i){return Math.sqrt(i.x*i.x+i.y*i.y)}static difference(i,a){return new _n(i.x-a.x,i.y-a.y)}static sum(i,a){return new _n(i.x+a.x,i.y+a.y)}},g0=new Set,Mg={};Mg.warn=xe;var Jm="http://www.w3.org/2000/svg",xc="http://www.w3.org/1999/xhtml",Zs="http://www.w3.org/1999/xlink",Gf;(function(i){i[i.ELEMENT_NODE=1]="ELEMENT_NODE",i[i.TEXT_NODE=3]="TEXT_NODE",i[i.COMMENT_NODE=8]="COMMENT_NODE"})(Gf||(Gf={}));var Dd=null,Ka=0,Ur=null,Ea={HTML_NS:xc};Ea.NodeType=Gf,Ea.SVG_NS=Jm,Ea.XLINK_NS=Zs,Ea.addClass=Pe,Ea.containsNode=Oe,Ea.createSvgElement=ie,Ea.getFastTextWidth=Je,Ea.getFastTextWidthWithSizeString=jt,Ea.getTextWidth=Ae,Ea.hasClass=It,Ea.insertAfter=Ke,Ea.measureFontMetrics=Ge,Ea.removeClass=St,Ea.removeClasses=Ye,Ea.removeNode=mt,Ea.setCssTransform=Q,Ea.startTextWidthCache=te,Ea.stopTextWidthCache=pe;var Ve=class{constructor(i){this.tagName=i}toString(){return this.tagName}};Ve.ANIMATE=new Ve("animate"),Ve.CIRCLE=new Ve("circle"),Ve.CLIPPATH=new Ve("clipPath"),Ve.DEFS=new Ve("defs"),Ve.FECOMPOSITE=new Ve("feComposite"),Ve.FECOMPONENTTRANSFER=new Ve("feComponentTransfer"),Ve.FEFLOOD=new Ve("feFlood"),Ve.FEFUNCA=new Ve("feFuncA"),Ve.FEGAUSSIANBLUR=new Ve("feGaussianBlur"),Ve.FEPOINTLIGHT=new Ve("fePointLight"),Ve.FESPECULARLIGHTING=new Ve("feSpecularLighting"),Ve.FILTER=new Ve("filter"),Ve.FOREIGNOBJECT=new Ve("foreignObject"),Ve.G=new Ve("g"),Ve.IMAGE=new Ve("image"),Ve.LINE=new Ve("line"),Ve.PATH=new Ve("path"),Ve.PATTERN=new Ve("pattern"),Ve.POLYGON=new Ve("polygon"),Ve.RECT=new Ve("rect"),Ve.SVG=new Ve("svg"),Ve.TEXT=new Ve("text"),Ve.TSPAN=new Ve("tspan");var Oi=class{constructor(i,a,p,S){this.top=i,this.bottom=a,this.left=p,this.right=S}getHeight(){return this.bottom-this.top}getWidth(){return this.right-this.left}contains(i,a){return i>=this.left&&i<=this.right&&a>=this.top&&a<=this.bottom}intersects(i){return!(this.left>i.right||this.righti.bottom||this.bottom=i||isNaN(i)?0:Math.min(i,this.scrollbarLength)}setHandleLength(i){this.handleLength=i,this.svgHandle.setAttribute(this.lengthAttribute_,String(this.handleLength))}constrainHandlePosition(i){return i=0>=i||isNaN(i)?0:Math.min(i,this.scrollbarLength-this.handleLength)}setHandlePosition(i){this.handlePosition=i,this.svgHandle.setAttribute(this.positionAttribute_,String(this.handlePosition))}setScrollbarLength(i){this.scrollbarLength=i,this.outerSvg.setAttribute(this.lengthAttribute_,String(this.scrollbarLength)),this.svgBackground.setAttribute(this.lengthAttribute_,String(this.scrollbarLength))}setPosition(i,a){this.position.x=i,this.position.y=a,Q(this.outerSvg,"translate("+(this.position.x+this.origin.x)+"px,"+(this.position.y+this.origin.y)+"px)")}resize(i){!i&&(i=this.workspace.getMetrics(),!i)||this.oldHostMetrics&&xa.metricsAreEquivalent(i,this.oldHostMetrics)||(this.horizontal?this.resizeHorizontal(i):this.resizeVertical(i),this.oldHostMetrics=i,this.updateMetrics())}requiresViewResize(i){return this.oldHostMetrics?this.oldHostMetrics.viewWidth!==i.viewWidth||this.oldHostMetrics.viewHeight!==i.viewHeight||this.oldHostMetrics.absoluteLeft!==i.absoluteLeft||this.oldHostMetrics.absoluteTop!==i.absoluteTop:!0}resizeHorizontal(i){this.requiresViewResize(i)?this.resizeViewHorizontal(i):this.resizeContentHorizontal(i)}resizeViewHorizontal(i){var a=i.viewWidth-2*this.margin;this.pair&&(a-=xa.scrollbarThickness),this.setScrollbarLength(Math.max(0,a)),a=i.absoluteLeft+this.margin,this.pair&&this.workspace.RTL&&(a+=xa.scrollbarThickness),this.setPosition(a,i.absoluteTop+i.viewHeight-xa.scrollbarThickness-this.margin),this.resizeContentHorizontal(i)}resizeContentHorizontal(i){if(i.viewWidth>=i.scrollWidth)this.setHandleLength(this.scrollbarLength),this.setHandlePosition(0),this.pair||this.setVisible(!1);else{this.pair||this.setVisible(!0);var a=this.scrollbarLength*i.viewWidth/i.scrollWidth;a=this.constrainHandleLength(a),this.setHandleLength(a),a=i.scrollWidth-i.viewWidth;var p=this.scrollbarLength-this.handleLength;i=(i.viewLeft-i.scrollLeft)/a*p,i=this.constrainHandlePosition(i),this.setHandlePosition(i),this.ratio=p/a}}resizeVertical(i){this.requiresViewResize(i)?this.resizeViewVertical(i):this.resizeContentVertical(i)}resizeViewVertical(i){let a=i.viewHeight-2*this.margin;this.pair&&(a-=xa.scrollbarThickness),this.setScrollbarLength(Math.max(0,a)),this.setPosition(this.workspace.RTL?i.absoluteLeft+this.margin:i.absoluteLeft+i.viewWidth-xa.scrollbarThickness-this.margin,i.absoluteTop+this.margin),this.resizeContentVertical(i)}resizeContentVertical(i){if(i.viewHeight>=i.scrollHeight)this.setHandleLength(this.scrollbarLength),this.setHandlePosition(0),this.pair||this.setVisible(!1);else{this.pair||this.setVisible(!0);var a=this.scrollbarLength*i.viewHeight/i.scrollHeight;a=this.constrainHandleLength(a),this.setHandleLength(a),a=i.scrollHeight-i.viewHeight;var p=this.scrollbarLength-this.handleLength;i=(i.viewTop-i.scrollTop)/a*p,i=this.constrainHandlePosition(i),this.setHandlePosition(i),this.ratio=p/a}}isVisible(){return this.isHandleVisible}setContainerVisible(i){const a=i!==this.containerVisible;this.containerVisible=i,a&&this.updateDisplay_()}setVisible(i){if(this.pair)throw Error("Unable to toggle visibility of paired scrollbars.");this.setVisibleInternal(i)}setVisibleInternal(i){const a=i!==this.isVisible();this.isHandleVisible=i,a&&this.updateDisplay_()}updateDisplay_(){this.containerVisible&&this.isVisible()?this.outerSvg.setAttribute("display","block"):this.outerSvg.setAttribute("display","none")}onMouseDownBar(i){if(this.workspace.markFocused(),rt(),this.cleanUp(),Nt(i))i.stopPropagation();else{var a=kt(i,this.workspace.getParentSvg(),this.workspace.getInverseScreenCTM());a=this.horizontal?a.x:a.y;var p=ne(this.svgHandle);p=this.horizontal?p.x:p.y;var S=this.handlePosition,O=.95*this.handleLength;a<=p?S-=O:a>=p+this.handleLength&&(S+=O),this.setHandlePosition(this.constrainHandlePosition(S)),this.updateMetrics(),i.stopPropagation(),i.preventDefault()}}onMouseDownHandle(i){this.workspace.markFocused(),this.cleanUp(),Nt(i)?i.stopPropagation():(this.startDragHandle=this.handlePosition,this.startDragMouse=this.horizontal?i.clientX:i.clientY,this.onMouseUpWrapper_=$e(document,"pointerup",this,this.onMouseUpHandle),this.onMouseMoveWrapper_=$e(document,"pointermove",this,this.onMouseMoveHandle),i.stopPropagation(),i.preventDefault())}onMouseMoveHandle(i){this.setHandlePosition(this.constrainHandlePosition(this.startDragHandle+((this.horizontal?i.clientX:i.clientY)-this.startDragMouse))),this.updateMetrics()}onMouseUpHandle(){rt(),this.cleanUp()}cleanUp(){this.workspace.hideChaff(!0),this.onMouseUpWrapper_&&(it(this.onMouseUpWrapper_),this.onMouseUpWrapper_=null),this.onMouseMoveWrapper_&&(it(this.onMouseMoveWrapper_),this.onMouseMoveWrapper_=null)}getRatio_(){let i=this.handlePosition/(this.scrollbarLength-this.handleLength);return isNaN(i)&&(i=0),i}updateMetrics(){const i=this.getRatio_();this.horizontal?this.workspace.setMetrics({x:i}):this.workspace.setMetrics({y:i})}set(i,a){this.setHandlePosition(this.constrainHandlePosition(i*this.ratio)),(a||a===void 0)&&this.updateMetrics()}setOrigin(i,a){this.origin=new _n(i,a)}static metricsAreEquivalent(i,a){return i.viewWidth===a.viewWidth&&i.viewHeight===a.viewHeight&&i.viewLeft===a.viewLeft&&i.viewTop===a.viewTop&&i.absoluteTop===a.absoluteTop&&i.absoluteLeft===a.absoluteLeft&&i.scrollWidth===a.scrollWidth&&i.scrollHeight===a.scrollHeight&&i.scrollLeft===a.scrollLeft&&i.scrollTop===a.scrollTop}};xa.scrollbarThickness=W?25:15,xa.DEFAULT_SCROLLBAR_MARGIN=.5;var Ag={parseFromString:function(){throw Error("DOMParser was not found in the global scope and was not properly injected using injectDependencies")}},nm={serializeToString:function(){throw Error("XMLSerializer was not foundin the global scope and was not properly injected using injectDependencies")}},{document:$p,DOMParser:_l,XMLSerializer:cu}=globalThis;_l&&(Ag=new _l),cu&&(nm=new cu);var Pd="https://developers.google.com/blockly/xml",gf=/[\x00-\x09\x0B\x0C\x0E-\x1F]/g,Bd={NAME_SPACE:Pd};Bd.createElement=t.createElement$$module$build$src$core$utils$xml,Bd.createTextNode=t.createTextNode$$module$build$src$core$utils$xml,Bd.domToText=Nn,Bd.injectDependencies=sn,Bd.textToDom=t.textToDom$$module$build$src$core$utils$xml;var nh="categoryToolbox",Ig="flyoutToolbox",dr;(function(i){i[i.TOP=0]="TOP",i[i.BOTTOM=1]="BOTTOM",i[i.LEFT=2]="LEFT",i[i.RIGHT=3]="RIGHT"})(dr||(dr={}));var _0={hasCategoriesInternal:Wn},yo={};yo.Position=dr,yo.TEST_ONLY=_0,yo.convertFlyoutDefToJsonArray=bt,yo.convertToolboxDefToJson=_t,yo.hasCategories=Wt,yo.isCategoryCollapsible=rr,yo.parseToolboxTree=Br;var Ja;(function(i){i[i.TOP=0]="TOP",i[i.BOTTOM=1]="BOTTOM"})(Ja||(Ja={}));var rm;(function(i){i[i.LEFT=0]="LEFT",i[i.RIGHT=1]="RIGHT"})(rm||(rm={}));var Fd;(function(i){i[i.UP=0]="UP",i[i.DOWN=1]="DOWN"})(Fd||(Fd={}));var im={};im.bumpDirection=Fd,im.bumpPositionRect=Oa,im.getCornerOppositeToolbox=Ss,im.getStartPositionRect=Yr,im.horizontalPosition=rm,im.verticalPosition=Ja;var Ru={width:96,height:124,url:"sprites.png"},v0=class{constructor(i){this.workspace=i,this.id="zoomControls",this.boundEvents=[],this.zoomResetGroup=this.zoomOutGroup=this.zoomInGroup=null,this.HEIGHT=this.WIDTH=32,this.SMALL_SPACING=2,this.LARGE_SPACING=11,this.MARGIN_HORIZONTAL=this.MARGIN_VERTICAL=20,this.svgGroup=null,this.top=this.left=0,this.initialized=!1}createDom(){this.svgGroup=ie(Ve.G,{});const i=String(Math.random()).substring(2);return this.createZoomOutSvg(i),this.createZoomInSvg(i),this.workspace.isMovable()&&this.createZoomResetSvg(i),this.svgGroup}init(){this.workspace.getComponentManager().addComponent({component:this,weight:2,capabilities:[gl.Capability.POSITIONABLE]}),this.initialized=!0}dispose(){this.workspace.getComponentManager().removeComponent("zoomControls"),this.svgGroup&&mt(this.svgGroup);for(const i of this.boundEvents)it(i);this.boundEvents.length=0}getBoundingRectangle(){let i=this.SMALL_SPACING+2*this.HEIGHT;return this.zoomResetGroup&&(i+=this.LARGE_SPACING+this.HEIGHT),new Oi(this.top,this.top+i,this.left,this.left+this.WIDTH)}position(i,a){if(this.initialized){var p=Ss(this.workspace,i),S=this.SMALL_SPACING+2*this.HEIGHT;if(this.zoomResetGroup&&(S+=this.LARGE_SPACING+this.HEIGHT),i=Yr(p,new eo(this.WIDTH,S),this.MARGIN_HORIZONTAL,this.MARGIN_VERTICAL,i,this.workspace),p=p.vertical,a=Oa(i,this.MARGIN_VERTICAL,p===Ja.TOP?Fd.DOWN:Fd.UP,a),p===Ja.TOP){var O=this.SMALL_SPACING+this.HEIGHT,j;(j=this.zoomInGroup)==null||j.setAttribute("transform","translate(0, "+O+")"),this.zoomResetGroup&&this.zoomResetGroup.setAttribute("transform","translate(0, "+(O+this.LARGE_SPACING+this.HEIGHT)+")")}else{j=this.zoomResetGroup?this.LARGE_SPACING+this.HEIGHT:0;let Ue;(Ue=this.zoomInGroup)==null||Ue.setAttribute("transform","translate(0, "+j+")"),j=j+this.SMALL_SPACING+this.HEIGHT,(O=this.zoomOutGroup)==null||O.setAttribute("transform","translate(0, "+j+")")}this.top=a.top,this.left=a.left;var ve;(ve=this.svgGroup)==null||ve.setAttribute("transform","translate("+this.left+","+this.top+")")}}createZoomOutSvg(i){this.zoomOutGroup=ie(Ve.G,{class:"blocklyZoom blocklyZoomOut"},this.svgGroup);const a=ie(Ve.CLIPPATH,{id:"blocklyZoomoutClipPath"+i},this.zoomOutGroup);ie(Ve.RECT,{width:32,height:32},a),ie(Ve.IMAGE,{width:Ru.width,height:Ru.height,x:-64,y:-92,"clip-path":"url(#blocklyZoomoutClipPath"+i+")"},this.zoomOutGroup).setAttributeNS(Zs,"xlink:href",this.workspace.options.pathToMedia+Ru.url),this.boundEvents.push($e(this.zoomOutGroup,"pointerdown",null,this.zoom.bind(this,-1)))}createZoomInSvg(i){this.zoomInGroup=ie(Ve.G,{class:"blocklyZoom blocklyZoomIn"},this.svgGroup);const a=ie(Ve.CLIPPATH,{id:"blocklyZoominClipPath"+i},this.zoomInGroup);ie(Ve.RECT,{width:32,height:32},a),ie(Ve.IMAGE,{width:Ru.width,height:Ru.height,x:-32,y:-92,"clip-path":"url(#blocklyZoominClipPath"+i+")"},this.zoomInGroup).setAttributeNS(Zs,"xlink:href",this.workspace.options.pathToMedia+Ru.url),this.boundEvents.push($e(this.zoomInGroup,"pointerdown",null,this.zoom.bind(this,1)))}zoom(i,a){this.workspace.markFocused(),this.workspace.zoomCenter(i),this.fireZoomEvent(),rt(),a.stopPropagation(),a.preventDefault()}createZoomResetSvg(i){this.zoomResetGroup=ie(Ve.G,{class:"blocklyZoom blocklyZoomReset"},this.svgGroup);const a=ie(Ve.CLIPPATH,{id:"blocklyZoomresetClipPath"+i},this.zoomResetGroup);ie(Ve.RECT,{width:32,height:32},a),ie(Ve.IMAGE,{width:Ru.width,height:Ru.height,y:-92,"clip-path":"url(#blocklyZoomresetClipPath"+i+")"},this.zoomResetGroup).setAttributeNS(Zs,"xlink:href",this.workspace.options.pathToMedia+Ru.url),this.boundEvents.push($e(this.zoomResetGroup,"pointerdown",null,this.resetZoom.bind(this)))}resetZoom(i){this.workspace.markFocused();const a=Math.log(this.workspace.options.zoomOptions.startScale/this.workspace.scale)/Math.log(this.workspace.options.zoomOptions.scaleSpeed);this.workspace.beginCanvasTransition(),this.workspace.zoomCenter(a),this.workspace.scrollCenter(),setTimeout(this.workspace.endCanvasTransition.bind(this.workspace),500),this.fireZoomEvent(),rt(),i.stopPropagation(),i.preventDefault()}fireZoomEvent(){const i=new(Ie(rc))(null,this.workspace.id,"zoom_controls");ue(i)}};At(` .blocklyZoom>image, .blocklyZoom>svg>image { opacity: .4; } @@ -508,7 +508,7 @@ input[type=number] { .blocklyZoom>image:active, .blocklyZoom>svg>image:active { opacity: .8; } -`);var Wo=class{constructor(i){this.name=i}toString(){return this.name}equals(i){return this.name===i.toString()}};Wo.MUTATOR=new Wo("mutator"),Wo.WARNING=new Wo("warning"),Wo.COMMENT=new Wo("comment"),function(i){i[i.VALUE=1]="VALUE",i[i.STATEMENT=3]="STATEMENT",i[i.DUMMY=5]="DUMMY",i[i.CUSTOM=6]="CUSTOM",i[i.END_ROW=7]="END_ROW"}(t.inputTypes$$module$build$src$core$inputs$input_types||(t.inputTypes$$module$build$src$core$inputs$input_types={})),t.inputTypes$$module$build$src$core$inputs$input_types;var ns=function(i,a){window.alert(i),a&&a()},hu=function(i,a){a(window.confirm(i))},vl=function(i,a,p){p(window.prompt(i,a))},ku={confirmInternal:Rr},du={TEST_ONLY:ku};du.alert=Eo,du.confirm=nn,du.prompt=La,du.setAlert=Yl,du.setConfirm=el,du.setPrompt=Fs;var Cp,Fl;t.Msg$$module$build$src$core$msg=Object.create(null),Cp=function(i){Object.keys(i).forEach(function(a){t.Msg$$module$build$src$core$msg[a]=i[a]})},Fl={Msg:t.Msg$$module$build$src$core$msg,setLocale:Cp};var zd=class extends d{constructor(i){super(),this.isBlank=typeof i>"u",i&&(this.varId=i.getId(),this.workspaceId=i.workspace.id)}toJson(){const i=super.toJson();if(!this.varId)throw Error("The var ID is undefined. Either pass a variable to the constructor, or call fromJson");return i.varId=this.varId,i}static fromJson(i,a,p){return a=super.fromJson(i,a,p??new zd),a.varId=i.varId,a}},Ud=class extends zd{constructor(i){super(i),this.type=go,i&&(this.varType=i.type,this.varName=i.name)}toJson(){const i=super.toJson();if(this.varType===void 0)throw Error("The var type is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.varName)throw Error("The var name is undefined. Either pass a variable to the constructor, or call fromJson");return i.varType=this.varType,i.varName=this.varName,i}static fromJson(i,a,p){return a=super.fromJson(i,a,p??new Ud),a.varType=i.varType,a.varName=i.varName,a}run(i){const a=this.getEventWorkspace_();if(!this.varId)throw Error("The var ID is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.varName)throw Error("The var name is undefined. Either pass a variable to the constructor, or call fromJson");i?a.createVariable(this.varName,this.varType,this.varId):a.deleteVariableById(this.varId)}};r(Ft.EVENT,go,Ud);var _f=class{constructor(i,a,p,S){this.workspace=i,this.name=a,this.type=p||"",this.id_=S||q()}getId(){return this.id_}static compareByName(i,a){return i.name.localeCompare(a.name,void 0,{sensitivity:"base"})}},Rg="VARIABLE",sm="ijkmnopqrstuvwxyzabcdefgh",rh={generateUniqueNameInternal:yr},yl={CATEGORY_NAME:Rg,TEST_ONLY:rh,VAR_LETTER_OPTIONS:sm};yl.allDeveloperVariables=t.allDeveloperVariables$$module$build$src$core$variables,yl.allUsedVarModels=t.allUsedVarModels$$module$build$src$core$variables,yl.createVariableButtonHandler=ws,yl.flyoutCategory=An,yl.flyoutCategoryBlocks=Ir,yl.generateUniqueName=Gr,yl.generateUniqueNameFromOptions=Pi,yl.generateVariableFieldDom=Xs,yl.getAddedVariables=Xl,yl.getOrCreateVariablePackage=t.getOrCreateVariablePackage$$module$build$src$core$variables,yl.getVariable=t.getVariable$$module$build$src$core$variables,yl.nameUsedWithAnyType=tl,yl.nameUsedWithConflictingParam=Na,yl.promptName=fi,yl.renameVariable=t.renameVariable$$module$build$src$core$variables;var ih=class{constructor(i,a,p,S,O){this.workspace=i,this.editable=this.movable=this.deletable=!0,this.disposed_=!1,this.isComment=!0,this.id=O&&!i.getCommentById(O)?O:q(),i.addTopComment(this),this.xy_=new _n(0,0),this.height_=p,this.width_=S,this.RTL=i.RTL,this.content_=a,ih.fireCreateEvent(this)}dispose(){this.disposed_||(ie()&&ue(new(Ie(qh))(this)),this.workspace.removeTopComment(this),this.disposed_=!0)}getHeight(){return this.height_}setHeight(i){this.height_=i}getWidth(){return this.width_}setWidth(i){this.width_=i}getRelativeToSurfaceXY(){return new _n(this.xy_.x,this.xy_.y)}moveBy(i,a){const p=new(Ie(Ta))(this);this.xy_.translate(i,a),p.recordNew(),ue(p)}isDeletable(){return this.deletable&&!(this.workspace&&this.workspace.options.readOnly)}setDeletable(i){this.deletable=i}isMovable(){return this.movable&&!(this.workspace&&this.workspace.options.readOnly)}setMovable(i){this.movable=i}isEditable(){return this.editable&&!(this.workspace&&this.workspace.options.readOnly)}setEditable(i){this.editable=i}getContent(){return this.content_}setContent(i){this.content_!==i&&(ue(new(Ie(yd))(this,this.content_,i)),this.content_=i)}toXmlWithXY(i){return i=this.toXml(i),i.setAttribute("x",String(Math.round(this.xy_.x))),i.setAttribute("y",String(Math.round(this.xy_.y))),i.setAttribute("h",String(this.height_)),i.setAttribute("w",String(this.width_)),i}toXml(i){const a=t.createElement$$module$build$src$core$utils$xml("comment");return i||(a.id=this.id),a.textContent=this.getContent(),a}static fireCreateEvent(i){if(ie()){const a=t.getGroup$$module$build$src$core$events$utils();a||t.setGroup$$module$build$src$core$events$utils(!0);try{ue(new(Ie(cs))(i))}finally{t.setGroup$$module$build$src$core$events$utils(a)}}}static fromXml(i,a){var p=ih.parseAttributes(i);return a=new ih(a,p.content,p.h,p.w,p.id),p=i.getAttribute("x"),i=i.getAttribute("y"),p=p?parseInt(p,10):NaN,i=i?parseInt(i,10):NaN,isNaN(p)||isNaN(i)||a.moveBy(p,i),ih.fireCreateEvent(a),a}static parseAttributes(i){const a=i.getAttribute("h"),p=i.getAttribute("w"),S=i.getAttribute("x"),O=i.getAttribute("y"),j=i.getAttribute("id");if(!j)throw Error("No ID present in XML comment definition.");let ve;return{id:j,h:a?parseInt(a):100,w:p?parseInt(p):100,x:S?parseInt(S):NaN,y:O?parseInt(O):NaN,content:(ve=i.textContent)!=null?ve:""}}},Hd=class extends _{constructor(i,a,p){super(p),this.type=_o,this.oldElementId=i??void 0,this.newElementId=a??void 0}toJson(){const i=super.toJson();return i.oldElementId=this.oldElementId,i.newElementId=this.newElementId,i}static fromJson(i,a,p){return a=super.fromJson(i,a,p??new Hd),a.oldElementId=i.oldElementId,a.newElementId=i.newElementId,a}};r(Ft.EVENT,_o,Hd);var qm={};qm.register=gu,qm.unregister=mh;var Qm=class{paste(i,a,p){const S=i.commentState;if(p)S.setAttribute("x",`${p.x}`),S.setAttribute("y",`${p.y}`);else{var O;p=parseInt((O=S.getAttribute("x"))!=null?O:"0")+50;let j;O=parseInt((j=S.getAttribute("y"))!=null?j:"0")+50,S.setAttribute("x",`${p}`),S.setAttribute("y",`${O}`)}return zl.fromXmlRendered(i.commentState,a)}};Qm.TYPE="workspace-comment",gu(Qm.TYPE,new Qm);var bo=8,om=3,Ls=2,zl=class extends ih{constructor(i,a,p,S,O){super(i,a,p,S,O),this.onMouseMoveWrapper=this.onMouseUpWrapper=null,this.eventsInit=!1,this.deleteIconBorder=this.deleteGroup=this.resizeGroup=this.foreignObject=this.svgHandleTarget=this.svgRectTarget=this.textarea=null,this.rendered=this.autoLayout=this.focused=!1,this.svgGroup=se(Ve.G,{class:"blocklyComment"}),this.workspace=i,this.svgRect_=se(Ve.RECT,{class:"blocklyCommentRect",x:0,y:0,rx:om,ry:om}),this.svgGroup.appendChild(this.svgRect_),this.render()}dispose(){this.disposed_||(L()===this&&(this.unselect(),this.workspace.cancelCurrentGesture()),ie()&&ue(new(Ie(qh))(this)),pt(this.svgGroup),t.disable$$module$build$src$core$events$utils(),super.dispose(),t.enable$$module$build$src$core$events$utils())}initSvg(i){if(!this.workspace.rendered)throw TypeError("Workspace is headless.");this.workspace.options.readOnly||this.eventsInit||(Ce(this.svgRectTarget,"pointerdown",this,this.pathMouseDown),Ce(this.svgHandleTarget,"pointerdown",this,this.pathMouseDown)),this.eventsInit=!0,this.updateMovable(),this.getSvgRoot().parentNode||this.workspace.getBubbleCanvas().appendChild(this.getSvgRoot()),!i&&this.textarea&&this.textarea.select()}pathMouseDown(i){const a=this.workspace.getGesture(i);a&&a.handleBubbleStart(i,this)}showContextMenu(i){throw Error("The implementation of showContextMenu should be monkey-patched in by blockly.ts")}select(){if(L()!==this){var i=null;if(L()){i=L().id,t.disable$$module$build$src$core$events$utils();try{L().unselect()}finally{t.enable$$module$build$src$core$events$utils()}}i=new(Ie(_o))(i,this.id,this.workspace.id),ue(i),P(this),this.addSelect()}}unselect(){if(L()===this){var i=new(Ie(_o))(this.id,null,this.workspace.id);ue(i),P(null),this.removeSelect(),this.blurFocus()}}addSelect(){$e(this.svgGroup,"blocklySelected"),this.setFocus()}removeSelect(){$e(this.svgGroup,"blocklySelected"),this.blurFocus()}addFocus(){$e(this.svgGroup,"blocklyFocused")}removeFocus(){St(this.svgGroup,"blocklyFocused")}getRelativeToSurfaceXY(){const i=this.workspace.getLayerManager();if(!i)throw Error("Cannot calculate position because the workspace has not been appended");let a=0,p=0,S=this.getSvgRoot();if(S)do{const O=mr(S);a+=O.x,p+=O.y,S=S.parentNode}while(S&&!i.hasLayer(S)&&S!==null);return this.xy_=new _n(a,p)}moveBy(i,a){const p=new(Ie(Ta))(this),S=this.getRelativeToSurfaceXY();this.translate(S.x+i,S.y+a),this.xy_=new _n(S.x+i,S.y+a),p.recordNew(),ue(p),this.workspace.resizeContents()}translate(i,a){this.xy_=new _n(i,a),this.getSvgRoot().setAttribute("transform","translate("+i+","+a+")")}moveDuringDrag(i){i=`translate(${i.x}, ${i.y})`,this.getSvgRoot().setAttribute("transform",i)}moveTo(i,a){this.translate(i,a)}clearTransformAttributes(){this.getSvgRoot().removeAttribute("transform")}getBoundingRectangle(){var i=this.getRelativeToSurfaceXY();const a=this.getHeightWidth(),p=i.y,S=i.y+a.height;let O;return this.RTL?(O=i.x-a.width,i=i.x):(O=i.x,i=i.x+a.width),new Oi(p,S,O,i)}updateMovable(){this.isMovable()?$e(this.svgGroup,"blocklyDraggable"):St(this.svgGroup,"blocklyDraggable")}setMovable(i){super.setMovable(i),this.updateMovable()}setEditable(i){super.setEditable(i),this.textarea&&(this.textarea.readOnly=!i)}setDragging(i){i?$e(this.getSvgRoot(),"blocklyDragging"):St(this.getSvgRoot(),"blocklyDragging")}getSvgRoot(){return this.svgGroup}getContent(){return this.textarea?this.textarea.value:this.content_}setContent(i){super.setContent(i),this.textarea&&(this.textarea.value=i)}setDeleteStyle(i){i?$e(this.svgGroup,"blocklyDraggingDelete"):St(this.svgGroup,"blocklyDraggingDelete")}setAutoLayout(i){}toXmlWithXY(i){let a=0;this.workspace.RTL&&(a=this.workspace.getWidth()),i=this.toXml(i);const p=this.getRelativeToSurfaceXY();return i.setAttribute("x",String(Math.round(this.workspace.RTL?a-p.x:p.x))),i.setAttribute("y",String(Math.round(p.y))),i.setAttribute("h",String(this.getHeight())),i.setAttribute("w",String(this.getWidth())),i}toCopyData(){return{paster:Qm.TYPE,commentState:this.toXmlWithXY()}}getHeightWidth(){return{width:this.getWidth(),height:this.getHeight()}}render(){if(!this.rendered){var i=this.getHeightWidth(),a=this.createEditor();this.svgGroup.appendChild(a),this.svgHandleTarget=se(Ve.RECT,{class:"blocklyCommentHandleTarget",x:0,y:0}),this.svgGroup.appendChild(this.svgHandleTarget),this.svgRectTarget=se(Ve.RECT,{class:"blocklyCommentTarget",x:0,y:0,rx:om,ry:om}),this.svgGroup.appendChild(this.svgRectTarget),this.addResizeDom(),this.isDeletable()&&this.addDeleteDom(),this.setSize(i.width,i.height),this.textarea.value=this.content_,this.rendered=!0,this.resizeGroup&&Ce(this.resizeGroup,"pointerdown",this,this.resizeMouseDown),this.isDeletable()&&(Ce(this.deleteGroup,"pointerdown",this,this.deleteMouseDown),Ce(this.deleteGroup,"pointerout",this,this.deleteMouseOut),Ce(this.deleteGroup,"pointerup",this,this.deleteMouseUp))}}createEditor(){this.foreignObject=se(Ve.FOREIGNOBJECT,{x:0,y:zl.TOP_OFFSET,class:"blocklyCommentForeignObject"});const i=document.createElementNS(xc,"body");i.setAttribute("xmlns",xc),i.className="blocklyMinimalBody";const a=document.createElementNS(xc,"textarea");return a.className="blocklyCommentTextarea",a.setAttribute("dir",this.RTL?"RTL":"LTR"),a.readOnly=!this.isEditable(),i.appendChild(a),this.textarea=a,this.foreignObject.appendChild(i),Ce(a,"wheel",this,function(p){p.stopPropagation()}),Ce(a,"change",this,function(p){this.setContent(a.value)}),this.foreignObject}addResizeDom(){this.resizeGroup=se(Ve.G,{class:this.RTL?"blocklyResizeSW":"blocklyResizeSE"},this.svgGroup),se(Ve.POLYGON,{points:`0,${bo} ${bo},${bo} ${bo},0`},this.resizeGroup),se(Ve.LINE,{class:"blocklyResizeLine",x1:bo/3,y1:bo-1,x2:bo-1,y2:bo/3},this.resizeGroup),se(Ve.LINE,{class:"blocklyResizeLine",x1:2*bo/3,y1:bo-1,x2:bo-1,y2:2*bo/3},this.resizeGroup)}addDeleteDom(){this.deleteGroup=se(Ve.G,{class:"blocklyCommentDeleteIcon"},this.svgGroup),this.deleteIconBorder=se(Ve.CIRCLE,{class:"blocklyDeleteIconShape",r:"7",cx:"7.5",cy:"7.5"},this.deleteGroup),se(Ve.LINE,{x1:"5",y1:"10",x2:"10",y2:"5",stroke:"#fff","stroke-width":"2"},this.deleteGroup),se(Ve.LINE,{x1:"5",y1:"5",x2:"10",y2:"10",stroke:"#fff","stroke-width":"2"},this.deleteGroup)}resizeMouseDown(i){this.unbindDragEvents(),Nt(i)||(this.workspace.startDrag(i,new _n(this.workspace.RTL?-this.width_:this.width_,this.height_)),this.onMouseUpWrapper=Ce(document,"pointerup",this,this.resizeMouseUp),this.onMouseMoveWrapper=Ce(document,"pointermove",this,this.resizeMouseMove),this.workspace.hideChaff()),i.stopPropagation()}deleteMouseDown(i){this.deleteIconBorder&&$e(this.deleteIconBorder,"blocklyDeleteIconHighlighted"),i.stopPropagation()}deleteMouseOut(i){this.deleteIconBorder&&St(this.deleteIconBorder,"blocklyDeleteIconHighlighted")}deleteMouseUp(i){this.dispose(),i.stopPropagation()}unbindDragEvents(){this.onMouseUpWrapper&&(rt(this.onMouseUpWrapper),this.onMouseUpWrapper=null),this.onMouseMoveWrapper&&(rt(this.onMouseMoveWrapper),this.onMouseMoveWrapper=null)}resizeMouseUp(i){nt(),this.unbindDragEvents()}resizeMouseMove(i){this.autoLayout=!1,i=this.workspace.moveDrag(i),this.setSize(this.RTL?-i.x:i.x,i.y)}resizeComment(){const i=this.getHeightWidth(),a=zl.TOP_OFFSET,p=2*Ls;let S;(S=this.foreignObject)==null||S.setAttribute("width",String(i.width));let O;if((O=this.foreignObject)==null||O.setAttribute("height",String(i.height-a)),this.RTL){let j;(j=this.foreignObject)==null||j.setAttribute("x",String(-i.width))}this.textarea&&(this.textarea.style.width=i.width-p+"px",this.textarea.style.height=i.height-p-a+"px")}setSize(i,a){i=Math.max(i,45),a=Math.max(a,20+zl.TOP_OFFSET),this.width_=i,this.height_=a,this.svgRect_.setAttribute("width",`${i}`),this.svgRect_.setAttribute("height",`${a}`);let p;(p=this.svgRectTarget)==null||p.setAttribute("width",`${i}`);let S;(S=this.svgRectTarget)==null||S.setAttribute("height",`${a}`);let O;(O=this.svgHandleTarget)==null||O.setAttribute("width",`${i}`);let j;if((j=this.svgHandleTarget)==null||j.setAttribute("height",String(zl.TOP_OFFSET)),this.RTL){this.svgRect_.setAttribute("transform","scale(-1 1)");let ve;(ve=this.svgRectTarget)==null||ve.setAttribute("transform","scale(-1 1)")}if(this.resizeGroup)if(this.RTL){this.resizeGroup.setAttribute("transform","translate("+(-i+bo)+","+(a-bo)+") scale(-1 1)");let ve;(ve=this.deleteGroup)==null||ve.setAttribute("transform","translate("+(-i+bo)+","+-bo+") scale(-1 1)")}else{this.resizeGroup.setAttribute("transform","translate("+(i-bo)+","+(a-bo)+")");let ve;(ve=this.deleteGroup)==null||ve.setAttribute("transform","translate("+(i-bo)+","+-bo+")")}this.resizeComment()}setFocus(){this.focused=!0,setTimeout(()=>{this.disposed_||(this.textarea.focus(),this.addFocus(),this.svgRectTarget&&$e(this.svgRectTarget,"blocklyCommentTargetFocused"),this.svgHandleTarget&&$e(this.svgHandleTarget,"blocklyCommentHandleTargetFocused"))},0)}blurFocus(){this.focused=!1,setTimeout(()=>{this.disposed_||(this.textarea.blur(),this.removeFocus(),this.svgRectTarget&&St(this.svgRectTarget,"blocklyCommentTargetFocused"),this.svgHandleTarget&&St(this.svgHandleTarget,"blocklyCommentHandleTargetFocused"))},0)}static fromXmlRendered(i,a,p){t.disable$$module$build$src$core$events$utils();let S;try{const O=ih.parseAttributes(i);if(S=new zl(a,O.content,O.h,O.w,O.id),a.rendered&&(S.initSvg(!0),S.render()),!isNaN(O.x)&&!isNaN(O.y))if(a.RTL){const j=p||a.getWidth();S.moveBy(j-O.x,O.y)}else S.moveBy(O.x,O.y)}finally{t.enable$$module$build$src$core$events$utils()}return ih.fireCreateEvent(S),S}};zl.DEFAULT_SIZE=100,zl.TOP_OFFSET=10,At(` +`);var Wo=class{constructor(i){this.name=i}toString(){return this.name}equals(i){return this.name===i.toString()}};Wo.MUTATOR=new Wo("mutator"),Wo.WARNING=new Wo("warning"),Wo.COMMENT=new Wo("comment"),function(i){i[i.VALUE=1]="VALUE",i[i.STATEMENT=3]="STATEMENT",i[i.DUMMY=5]="DUMMY",i[i.CUSTOM=6]="CUSTOM",i[i.END_ROW=7]="END_ROW"}(t.inputTypes$$module$build$src$core$inputs$input_types||(t.inputTypes$$module$build$src$core$inputs$input_types={})),t.inputTypes$$module$build$src$core$inputs$input_types;var ns=function(i,a){window.alert(i),a&&a()},hu=function(i,a){a(window.confirm(i))},vl=function(i,a,p){p(window.prompt(i,a))},ku={confirmInternal:Rr},du={TEST_ONLY:ku};du.alert=Eo,du.confirm=nn,du.prompt=La,du.setAlert=Yl,du.setConfirm=el,du.setPrompt=Fs;var Cp,Fl;t.Msg$$module$build$src$core$msg=Object.create(null),Cp=function(i){Object.keys(i).forEach(function(a){t.Msg$$module$build$src$core$msg[a]=i[a]})},Fl={Msg:t.Msg$$module$build$src$core$msg,setLocale:Cp};var zd=class extends d{constructor(i){super(),this.isBlank=typeof i>"u",i&&(this.varId=i.getId(),this.workspaceId=i.workspace.id)}toJson(){const i=super.toJson();if(!this.varId)throw Error("The var ID is undefined. Either pass a variable to the constructor, or call fromJson");return i.varId=this.varId,i}static fromJson(i,a,p){return a=super.fromJson(i,a,p??new zd),a.varId=i.varId,a}},Ud=class extends zd{constructor(i){super(i),this.type=go,i&&(this.varType=i.type,this.varName=i.name)}toJson(){const i=super.toJson();if(this.varType===void 0)throw Error("The var type is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.varName)throw Error("The var name is undefined. Either pass a variable to the constructor, or call fromJson");return i.varType=this.varType,i.varName=this.varName,i}static fromJson(i,a,p){return a=super.fromJson(i,a,p??new Ud),a.varType=i.varType,a.varName=i.varName,a}run(i){const a=this.getEventWorkspace_();if(!this.varId)throw Error("The var ID is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.varName)throw Error("The var name is undefined. Either pass a variable to the constructor, or call fromJson");i?a.createVariable(this.varName,this.varType,this.varId):a.deleteVariableById(this.varId)}};r(Ft.EVENT,go,Ud);var _f=class{constructor(i,a,p,S){this.workspace=i,this.name=a,this.type=p||"",this.id_=S||q()}getId(){return this.id_}static compareByName(i,a){return i.name.localeCompare(a.name,void 0,{sensitivity:"base"})}},Rg="VARIABLE",sm="ijkmnopqrstuvwxyzabcdefgh",rh={generateUniqueNameInternal:yr},yl={CATEGORY_NAME:Rg,TEST_ONLY:rh,VAR_LETTER_OPTIONS:sm};yl.allDeveloperVariables=t.allDeveloperVariables$$module$build$src$core$variables,yl.allUsedVarModels=t.allUsedVarModels$$module$build$src$core$variables,yl.createVariableButtonHandler=ws,yl.flyoutCategory=In,yl.flyoutCategoryBlocks=Ir,yl.generateUniqueName=Gr,yl.generateUniqueNameFromOptions=Pi,yl.generateVariableFieldDom=Xs,yl.getAddedVariables=Xl,yl.getOrCreateVariablePackage=t.getOrCreateVariablePackage$$module$build$src$core$variables,yl.getVariable=t.getVariable$$module$build$src$core$variables,yl.nameUsedWithAnyType=tl,yl.nameUsedWithConflictingParam=Na,yl.promptName=fi,yl.renameVariable=t.renameVariable$$module$build$src$core$variables;var ih=class{constructor(i,a,p,S,O){this.workspace=i,this.editable=this.movable=this.deletable=!0,this.disposed_=!1,this.isComment=!0,this.id=O&&!i.getCommentById(O)?O:q(),i.addTopComment(this),this.xy_=new _n(0,0),this.height_=p,this.width_=S,this.RTL=i.RTL,this.content_=a,ih.fireCreateEvent(this)}dispose(){this.disposed_||(se()&&ue(new(Ie(qh))(this)),this.workspace.removeTopComment(this),this.disposed_=!0)}getHeight(){return this.height_}setHeight(i){this.height_=i}getWidth(){return this.width_}setWidth(i){this.width_=i}getRelativeToSurfaceXY(){return new _n(this.xy_.x,this.xy_.y)}moveBy(i,a){const p=new(Ie(Ta))(this);this.xy_.translate(i,a),p.recordNew(),ue(p)}isDeletable(){return this.deletable&&!(this.workspace&&this.workspace.options.readOnly)}setDeletable(i){this.deletable=i}isMovable(){return this.movable&&!(this.workspace&&this.workspace.options.readOnly)}setMovable(i){this.movable=i}isEditable(){return this.editable&&!(this.workspace&&this.workspace.options.readOnly)}setEditable(i){this.editable=i}getContent(){return this.content_}setContent(i){this.content_!==i&&(ue(new(Ie(yd))(this,this.content_,i)),this.content_=i)}toXmlWithXY(i){return i=this.toXml(i),i.setAttribute("x",String(Math.round(this.xy_.x))),i.setAttribute("y",String(Math.round(this.xy_.y))),i.setAttribute("h",String(this.height_)),i.setAttribute("w",String(this.width_)),i}toXml(i){const a=t.createElement$$module$build$src$core$utils$xml("comment");return i||(a.id=this.id),a.textContent=this.getContent(),a}static fireCreateEvent(i){if(se()){const a=t.getGroup$$module$build$src$core$events$utils();a||t.setGroup$$module$build$src$core$events$utils(!0);try{ue(new(Ie(cs))(i))}finally{t.setGroup$$module$build$src$core$events$utils(a)}}}static fromXml(i,a){var p=ih.parseAttributes(i);return a=new ih(a,p.content,p.h,p.w,p.id),p=i.getAttribute("x"),i=i.getAttribute("y"),p=p?parseInt(p,10):NaN,i=i?parseInt(i,10):NaN,isNaN(p)||isNaN(i)||a.moveBy(p,i),ih.fireCreateEvent(a),a}static parseAttributes(i){const a=i.getAttribute("h"),p=i.getAttribute("w"),S=i.getAttribute("x"),O=i.getAttribute("y"),j=i.getAttribute("id");if(!j)throw Error("No ID present in XML comment definition.");let ve;return{id:j,h:a?parseInt(a):100,w:p?parseInt(p):100,x:S?parseInt(S):NaN,y:O?parseInt(O):NaN,content:(ve=i.textContent)!=null?ve:""}}},Hd=class extends _{constructor(i,a,p){super(p),this.type=_o,this.oldElementId=i??void 0,this.newElementId=a??void 0}toJson(){const i=super.toJson();return i.oldElementId=this.oldElementId,i.newElementId=this.newElementId,i}static fromJson(i,a,p){return a=super.fromJson(i,a,p??new Hd),a.oldElementId=i.oldElementId,a.newElementId=i.newElementId,a}};r(Ft.EVENT,_o,Hd);var qm={};qm.register=gu,qm.unregister=mh;var Qm=class{paste(i,a,p){const S=i.commentState;if(p)S.setAttribute("x",`${p.x}`),S.setAttribute("y",`${p.y}`);else{var O;p=parseInt((O=S.getAttribute("x"))!=null?O:"0")+50;let j;O=parseInt((j=S.getAttribute("y"))!=null?j:"0")+50,S.setAttribute("x",`${p}`),S.setAttribute("y",`${O}`)}return zl.fromXmlRendered(i.commentState,a)}};Qm.TYPE="workspace-comment",gu(Qm.TYPE,new Qm);var bo=8,om=3,Ls=2,zl=class extends ih{constructor(i,a,p,S,O){super(i,a,p,S,O),this.onMouseMoveWrapper=this.onMouseUpWrapper=null,this.eventsInit=!1,this.deleteIconBorder=this.deleteGroup=this.resizeGroup=this.foreignObject=this.svgHandleTarget=this.svgRectTarget=this.textarea=null,this.rendered=this.autoLayout=this.focused=!1,this.svgGroup=ie(Ve.G,{class:"blocklyComment"}),this.workspace=i,this.svgRect_=ie(Ve.RECT,{class:"blocklyCommentRect",x:0,y:0,rx:om,ry:om}),this.svgGroup.appendChild(this.svgRect_),this.render()}dispose(){this.disposed_||(L()===this&&(this.unselect(),this.workspace.cancelCurrentGesture()),se()&&ue(new(Ie(qh))(this)),mt(this.svgGroup),t.disable$$module$build$src$core$events$utils(),super.dispose(),t.enable$$module$build$src$core$events$utils())}initSvg(i){if(!this.workspace.rendered)throw TypeError("Workspace is headless.");this.workspace.options.readOnly||this.eventsInit||($e(this.svgRectTarget,"pointerdown",this,this.pathMouseDown),$e(this.svgHandleTarget,"pointerdown",this,this.pathMouseDown)),this.eventsInit=!0,this.updateMovable(),this.getSvgRoot().parentNode||this.workspace.getBubbleCanvas().appendChild(this.getSvgRoot()),!i&&this.textarea&&this.textarea.select()}pathMouseDown(i){const a=this.workspace.getGesture(i);a&&a.handleBubbleStart(i,this)}showContextMenu(i){throw Error("The implementation of showContextMenu should be monkey-patched in by blockly.ts")}select(){if(L()!==this){var i=null;if(L()){i=L().id,t.disable$$module$build$src$core$events$utils();try{L().unselect()}finally{t.enable$$module$build$src$core$events$utils()}}i=new(Ie(_o))(i,this.id,this.workspace.id),ue(i),P(this),this.addSelect()}}unselect(){if(L()===this){var i=new(Ie(_o))(this.id,null,this.workspace.id);ue(i),P(null),this.removeSelect(),this.blurFocus()}}addSelect(){Pe(this.svgGroup,"blocklySelected"),this.setFocus()}removeSelect(){Pe(this.svgGroup,"blocklySelected"),this.blurFocus()}addFocus(){Pe(this.svgGroup,"blocklyFocused")}removeFocus(){St(this.svgGroup,"blocklyFocused")}getRelativeToSurfaceXY(){const i=this.workspace.getLayerManager();if(!i)throw Error("Cannot calculate position because the workspace has not been appended");let a=0,p=0,S=this.getSvgRoot();if(S)do{const O=mr(S);a+=O.x,p+=O.y,S=S.parentNode}while(S&&!i.hasLayer(S)&&S!==null);return this.xy_=new _n(a,p)}moveBy(i,a){const p=new(Ie(Ta))(this),S=this.getRelativeToSurfaceXY();this.translate(S.x+i,S.y+a),this.xy_=new _n(S.x+i,S.y+a),p.recordNew(),ue(p),this.workspace.resizeContents()}translate(i,a){this.xy_=new _n(i,a),this.getSvgRoot().setAttribute("transform","translate("+i+","+a+")")}moveDuringDrag(i){i=`translate(${i.x}, ${i.y})`,this.getSvgRoot().setAttribute("transform",i)}moveTo(i,a){this.translate(i,a)}clearTransformAttributes(){this.getSvgRoot().removeAttribute("transform")}getBoundingRectangle(){var i=this.getRelativeToSurfaceXY();const a=this.getHeightWidth(),p=i.y,S=i.y+a.height;let O;return this.RTL?(O=i.x-a.width,i=i.x):(O=i.x,i=i.x+a.width),new Oi(p,S,O,i)}updateMovable(){this.isMovable()?Pe(this.svgGroup,"blocklyDraggable"):St(this.svgGroup,"blocklyDraggable")}setMovable(i){super.setMovable(i),this.updateMovable()}setEditable(i){super.setEditable(i),this.textarea&&(this.textarea.readOnly=!i)}setDragging(i){i?Pe(this.getSvgRoot(),"blocklyDragging"):St(this.getSvgRoot(),"blocklyDragging")}getSvgRoot(){return this.svgGroup}getContent(){return this.textarea?this.textarea.value:this.content_}setContent(i){super.setContent(i),this.textarea&&(this.textarea.value=i)}setDeleteStyle(i){i?Pe(this.svgGroup,"blocklyDraggingDelete"):St(this.svgGroup,"blocklyDraggingDelete")}setAutoLayout(i){}toXmlWithXY(i){let a=0;this.workspace.RTL&&(a=this.workspace.getWidth()),i=this.toXml(i);const p=this.getRelativeToSurfaceXY();return i.setAttribute("x",String(Math.round(this.workspace.RTL?a-p.x:p.x))),i.setAttribute("y",String(Math.round(p.y))),i.setAttribute("h",String(this.getHeight())),i.setAttribute("w",String(this.getWidth())),i}toCopyData(){return{paster:Qm.TYPE,commentState:this.toXmlWithXY()}}getHeightWidth(){return{width:this.getWidth(),height:this.getHeight()}}render(){if(!this.rendered){var i=this.getHeightWidth(),a=this.createEditor();this.svgGroup.appendChild(a),this.svgHandleTarget=ie(Ve.RECT,{class:"blocklyCommentHandleTarget",x:0,y:0}),this.svgGroup.appendChild(this.svgHandleTarget),this.svgRectTarget=ie(Ve.RECT,{class:"blocklyCommentTarget",x:0,y:0,rx:om,ry:om}),this.svgGroup.appendChild(this.svgRectTarget),this.addResizeDom(),this.isDeletable()&&this.addDeleteDom(),this.setSize(i.width,i.height),this.textarea.value=this.content_,this.rendered=!0,this.resizeGroup&&$e(this.resizeGroup,"pointerdown",this,this.resizeMouseDown),this.isDeletable()&&($e(this.deleteGroup,"pointerdown",this,this.deleteMouseDown),$e(this.deleteGroup,"pointerout",this,this.deleteMouseOut),$e(this.deleteGroup,"pointerup",this,this.deleteMouseUp))}}createEditor(){this.foreignObject=ie(Ve.FOREIGNOBJECT,{x:0,y:zl.TOP_OFFSET,class:"blocklyCommentForeignObject"});const i=document.createElementNS(xc,"body");i.setAttribute("xmlns",xc),i.className="blocklyMinimalBody";const a=document.createElementNS(xc,"textarea");return a.className="blocklyCommentTextarea",a.setAttribute("dir",this.RTL?"RTL":"LTR"),a.readOnly=!this.isEditable(),i.appendChild(a),this.textarea=a,this.foreignObject.appendChild(i),$e(a,"wheel",this,function(p){p.stopPropagation()}),$e(a,"change",this,function(p){this.setContent(a.value)}),this.foreignObject}addResizeDom(){this.resizeGroup=ie(Ve.G,{class:this.RTL?"blocklyResizeSW":"blocklyResizeSE"},this.svgGroup),ie(Ve.POLYGON,{points:`0,${bo} ${bo},${bo} ${bo},0`},this.resizeGroup),ie(Ve.LINE,{class:"blocklyResizeLine",x1:bo/3,y1:bo-1,x2:bo-1,y2:bo/3},this.resizeGroup),ie(Ve.LINE,{class:"blocklyResizeLine",x1:2*bo/3,y1:bo-1,x2:bo-1,y2:2*bo/3},this.resizeGroup)}addDeleteDom(){this.deleteGroup=ie(Ve.G,{class:"blocklyCommentDeleteIcon"},this.svgGroup),this.deleteIconBorder=ie(Ve.CIRCLE,{class:"blocklyDeleteIconShape",r:"7",cx:"7.5",cy:"7.5"},this.deleteGroup),ie(Ve.LINE,{x1:"5",y1:"10",x2:"10",y2:"5",stroke:"#fff","stroke-width":"2"},this.deleteGroup),ie(Ve.LINE,{x1:"5",y1:"5",x2:"10",y2:"10",stroke:"#fff","stroke-width":"2"},this.deleteGroup)}resizeMouseDown(i){this.unbindDragEvents(),Nt(i)||(this.workspace.startDrag(i,new _n(this.workspace.RTL?-this.width_:this.width_,this.height_)),this.onMouseUpWrapper=$e(document,"pointerup",this,this.resizeMouseUp),this.onMouseMoveWrapper=$e(document,"pointermove",this,this.resizeMouseMove),this.workspace.hideChaff()),i.stopPropagation()}deleteMouseDown(i){this.deleteIconBorder&&Pe(this.deleteIconBorder,"blocklyDeleteIconHighlighted"),i.stopPropagation()}deleteMouseOut(i){this.deleteIconBorder&&St(this.deleteIconBorder,"blocklyDeleteIconHighlighted")}deleteMouseUp(i){this.dispose(),i.stopPropagation()}unbindDragEvents(){this.onMouseUpWrapper&&(it(this.onMouseUpWrapper),this.onMouseUpWrapper=null),this.onMouseMoveWrapper&&(it(this.onMouseMoveWrapper),this.onMouseMoveWrapper=null)}resizeMouseUp(i){rt(),this.unbindDragEvents()}resizeMouseMove(i){this.autoLayout=!1,i=this.workspace.moveDrag(i),this.setSize(this.RTL?-i.x:i.x,i.y)}resizeComment(){const i=this.getHeightWidth(),a=zl.TOP_OFFSET,p=2*Ls;let S;(S=this.foreignObject)==null||S.setAttribute("width",String(i.width));let O;if((O=this.foreignObject)==null||O.setAttribute("height",String(i.height-a)),this.RTL){let j;(j=this.foreignObject)==null||j.setAttribute("x",String(-i.width))}this.textarea&&(this.textarea.style.width=i.width-p+"px",this.textarea.style.height=i.height-p-a+"px")}setSize(i,a){i=Math.max(i,45),a=Math.max(a,20+zl.TOP_OFFSET),this.width_=i,this.height_=a,this.svgRect_.setAttribute("width",`${i}`),this.svgRect_.setAttribute("height",`${a}`);let p;(p=this.svgRectTarget)==null||p.setAttribute("width",`${i}`);let S;(S=this.svgRectTarget)==null||S.setAttribute("height",`${a}`);let O;(O=this.svgHandleTarget)==null||O.setAttribute("width",`${i}`);let j;if((j=this.svgHandleTarget)==null||j.setAttribute("height",String(zl.TOP_OFFSET)),this.RTL){this.svgRect_.setAttribute("transform","scale(-1 1)");let ve;(ve=this.svgRectTarget)==null||ve.setAttribute("transform","scale(-1 1)")}if(this.resizeGroup)if(this.RTL){this.resizeGroup.setAttribute("transform","translate("+(-i+bo)+","+(a-bo)+") scale(-1 1)");let ve;(ve=this.deleteGroup)==null||ve.setAttribute("transform","translate("+(-i+bo)+","+-bo+") scale(-1 1)")}else{this.resizeGroup.setAttribute("transform","translate("+(i-bo)+","+(a-bo)+")");let ve;(ve=this.deleteGroup)==null||ve.setAttribute("transform","translate("+(i-bo)+","+-bo+")")}this.resizeComment()}setFocus(){this.focused=!0,setTimeout(()=>{this.disposed_||(this.textarea.focus(),this.addFocus(),this.svgRectTarget&&Pe(this.svgRectTarget,"blocklyCommentTargetFocused"),this.svgHandleTarget&&Pe(this.svgHandleTarget,"blocklyCommentHandleTargetFocused"))},0)}blurFocus(){this.focused=!1,setTimeout(()=>{this.disposed_||(this.textarea.blur(),this.removeFocus(),this.svgRectTarget&&St(this.svgRectTarget,"blocklyCommentTargetFocused"),this.svgHandleTarget&&St(this.svgHandleTarget,"blocklyCommentHandleTargetFocused"))},0)}static fromXmlRendered(i,a,p){t.disable$$module$build$src$core$events$utils();let S;try{const O=ih.parseAttributes(i);if(S=new zl(a,O.content,O.h,O.w,O.id),a.rendered&&(S.initSvg(!0),S.render()),!isNaN(O.x)&&!isNaN(O.y))if(a.RTL){const j=p||a.getWidth();S.moveBy(j-O.x,O.y)}else S.moveBy(O.x,O.y)}finally{t.enable$$module$build$src$core$events$utils()}return ih.fireCreateEvent(S),S}};zl.DEFAULT_SIZE=100,zl.TOP_OFFSET=10,At(` .blocklyCommentForeignObject { position: relative; z-index: 0; @@ -570,10 +570,10 @@ input[type=number] { connection`),this.block=a,this.state=p}},y0=class extends $a{constructor(i,a,p,S){super(`The block ${p.toDevString()} could not connect its ${a} to its parent, because: ${i}`),this.childBlock=p,this.childState=S}},Iv=class extends $a{constructor(i){super(`Encountered a real block which is defined as a child of a shadow block. It is an invariant of Blockly that shadow blocks only have shadow -children`),this.state=i}},Wf=class extends $a{constructor(i,a,p){super(`Cannot add an icon of type '${i}' to the block ${a.toDevString()}, because there is no icon registered with type '${i}'. Make sure that all of your icons have been registered.`),this.block=a,this.state=p}},Ap={};Ap.BadConnectionCheck=y0,Ap.DeserializationError=$a,Ap.MissingBlockType=E_,Ap.MissingConnection=am,Ap.RealChildOfShadow=Iv,Ap.UnregisteredIcon=Wf;var b0=100,Ip=75,T0=50,lm={BLOCKS:T0,PROCEDURES:Ip,VARIABLES:b0},S0={};S0.register=Rs,S0.unregister=bi;var x_=class{constructor(){this.priority=T0}save(i){const a=[];for(const p of i.getTopBlocks(!1))(i=$i(p,{addCoordinates:!0,doFullSerialization:!1}))&&a.push(i);return a.length?{languageVersion:0,blocks:a}:null}load(i,a){i=i.blocks;for(const p of i)Vn(p,a,{recordUndo:ae()})}clear(i){for(const a of i.getTopBlocks(!1))a.dispose(!1)}};Rs("blocks",new x_);var um={};um.BlockSerializer=x_,um.append=Vn,um.appendInternal=Mi,um.save=$i;var vf=class extends d{constructor(i){super(),this.isBlank=!i,i&&(this.blockId=i.id,this.workspaceId=i.workspace.id)}toJson(){const i=super.toJson();if(!this.blockId)throw Error("The block ID is undefined. Either pass a block to the constructor, or call fromJson");return i.blockId=this.blockId,i}static fromJson(i,a,p){return a=super.fromJson(i,a,p??new vf),a.blockId=i.blockId,a}},$_=class extends vf{constructor(i){super(i),this.type=t.CREATE$$module$build$src$core$events$utils,i&&(i.isShadow()&&(this.recordUndo=!1),this.xml=Tr(i),this.ids=Te(i),this.json=$i(i,{addCoordinates:!0}))}toJson(){const i=super.toJson();if(!this.xml)throw Error("The block XML is undefined. Either pass a block to the constructor, or call fromJson");if(!this.ids)throw Error("The block IDs are undefined. Either pass a block to the constructor, or call fromJson");if(!this.json)throw Error("The block JSON is undefined. Either pass a block to the constructor, or call fromJson");return i.xml=Qi(this.xml),i.ids=this.ids,i.json=this.json,this.recordUndo||(i.recordUndo=this.recordUndo),i}static fromJson(i,a,p){return a=super.fromJson(i,a,p??new $_),a.xml=t.textToDom$$module$build$src$core$utils$xml(i.xml),a.ids=i.ids,a.json=i.json,i.recordUndo!==void 0&&(a.recordUndo=i.recordUndo),a}run(i){const a=this.getEventWorkspace_();if(!this.json)throw Error("The block JSON is undefined. Either pass a block to the constructor, or call fromJson");if(!this.ids)throw Error("The block IDs are undefined. Either pass a block to the constructor, or call fromJson");if(!ib(a,this.ids))if(i)Vn(this.json,a);else for(i=0;ii.getBlockById(p)).filter(p=>p&&p.isShadow()).length===a.length};r(Ft.EVENT,t.CREATE$$module$build$src$core$events$utils,$_);var w0=class extends _{constructor(i,a){super(a),this.type=uu,this.themeName=i}toJson(){const i=super.toJson();if(!this.themeName)throw Error("The theme name is undefined. Either pass a theme name to the constructor, or call fromJson");return i.themeName=this.themeName,i}static fromJson(i,a,p){return a=super.fromJson(i,a,p??new w0),a.themeName=i.themeName,a}};r(Ft.EVENT,uu,w0);var E0=class extends _{constructor(i,a,p,S,O){super(S),this.type=ni,this.viewTop=i,this.viewLeft=a,this.scale=p,this.oldScale=O}toJson(){const i=super.toJson();if(this.viewTop===void 0)throw Error("The view top is undefined. Either pass a value to the constructor, or call fromJson");if(this.viewLeft===void 0)throw Error("The view left is undefined. Either pass a value to the constructor, or call fromJson");if(this.scale===void 0)throw Error("The scale is undefined. Either pass a value to the constructor, or call fromJson");if(this.oldScale===void 0)throw Error("The old scale is undefined. Either pass a value to the constructor, or call fromJson");return i.viewTop=this.viewTop,i.viewLeft=this.viewLeft,i.scale=this.scale,i.oldScale=this.oldScale,i}static fromJson(i,a,p){return a=super.fromJson(i,a,p??new E0),a.viewTop=i.viewTop,a.viewLeft=i.viewLeft,a.scale=i.scale,a.oldScale=i.oldScale,a}};r(Ft.EVENT,ni,E0);var Vf;Vf=28,t.config$$module$build$src$core$config={dragRadius:5,flyoutDragRadius:10,snapRadius:Vf,connectingSnapRadius:Vf,currentConnectionPreference:8,bumpDelay:250},t.config$$module$build$src$core$config;var Un;(function(i){i[i.INPUT_VALUE=1]="INPUT_VALUE",i[i.OUTPUT_VALUE=2]="OUTPUT_VALUE",i[i.NEXT_STATEMENT=3]="NEXT_STATEMENT",i[i.PREVIOUS_STATEMENT=4]="PREVIOUS_STATEMENT"})(Un||(Un={}));var sh=class{constructor(i){this.connectionChecker=i,this.connections=[]}addConnection(i,a){a=this.calculateIndexForYPos(a),this.connections.splice(a,0,i)}findIndexOfConnection(i,a){if(!this.connections.length)return-1;const p=this.calculateIndexForYPos(a);if(p>=this.connections.length)return-1;a=i.y;let S=p;for(;0<=S&&this.connections[S].y===a;){if(this.connections[S]===i)return S;S--}for(S=p;Si)p=S;else{a=S;break}}return a}removeConnection(i,a){if(i=this.findIndexOfConnection(i,a),i===-1)throw Error("Unable to find connection in connectionDB.");this.connections.splice(i,1)}getNeighbours(i,a){function p(jn){const bl=O-S[jn].x,Qa=j-S[jn].y;return Math.sqrt(bl*bl+Qa*Qa)<=a&&Yt.push(S[jn]),Qai?this.menuItems.length:i,-1)}highlightFirst(){this.highlightHelper(-1,1)}highlightLast(){this.highlightHelper(this.menuItems.length,-1)}highlightHelper(i,a){i+=a;let p;for(;p=this.menuItems[i];){if(p.isEnabled()){this.setHighlighted(p);break}i+=a}}handleMouseOver(i){(i=this.getMenuItem(i.target))&&(i.isEnabled()?this.highlightedItem!==i&&this.setHighlighted(i):this.setHighlighted(null))}handleClick(i){const a=this.openingCoords;if(this.openingCoords=null,a&&typeof i.clientX=="number"){const p=new _n(i.clientX,i.clientY);if(1>_n.distance(a,p))return}(i=this.getMenuItem(i.target))&&i.performAction()}handleMouseEnter(i){this.focus()}handleMouseLeave(i){this.getElement()&&(this.blur(),this.setHighlighted(null))}handleKeyEvent(i){if(this.menuItems.length&&!(i.shiftKey||i.ctrlKey||i.metaKey||i.altKey)){var a=this.highlightedItem;switch(i.key){case"Enter":case" ":a&&a.performAction();break;case"ArrowUp":this.highlightPrevious();break;case"ArrowDown":this.highlightNext();break;case"PageUp":case"Home":this.highlightFirst();break;case"PageDown":case"End":this.highlightLast();break;default:return}i.preventDefault(),i.stopPropagation()}}getSize(){const i=this.getElement(),a=tn(i);return a.height=i.scrollHeight,a}},jf=class{constructor(i,a){this.content=i,this.opt_value=a,this.enabled=!0,this.element=null,this.rightToLeft=!1,this.roleName=null,this.highlight=this.checked=this.checkable=!1,this.actionHandler=null}createDom(){const i=document.createElement("div");i.id=Z(),this.element=i,i.className="blocklyMenuItem goog-menuitem "+(this.enabled?"":"blocklyMenuItemDisabled goog-menuitem-disabled ")+(this.checked?"blocklyMenuItemSelected goog-option-selected ":"")+(this.highlight?"blocklyMenuItemHighlight goog-menuitem-highlight ":"")+(this.rightToLeft?"blocklyMenuItemRtl goog-menuitem-rtl ":"");const a=document.createElement("div");if(a.className="blocklyMenuItemContent goog-menuitem-content",this.checkable){var p=document.createElement("div");p.className="blocklyMenuItemCheckbox goog-menuitem-checkbox",a.appendChild(p)}return p=this.content,typeof this.content=="string"&&(p=document.createTextNode(this.content)),a.appendChild(p),i.appendChild(a),this.roleName&&ci(i,this.roleName),Er(i,To.SELECTED,this.checkable&&this.checked||!1),Er(i,To.DISABLED,!this.enabled),i}dispose(){this.element=null}getElement(){return this.element}getId(){return this.element.id}getValue(){let i;return(i=this.opt_value)!=null?i:null}setRightToLeft(i){this.rightToLeft=i}setRole(i){this.roleName=i}setCheckable(i){this.checkable=i}setChecked(i){this.checked=i}setHighlighted(i){this.highlight=i;const a=this.getElement();a&&this.isEnabled()&&(i?($e(a,"blocklyMenuItemHighlight"),$e(a,"goog-menuitem-highlight")):(St(a,"blocklyMenuItemHighlight"),St(a,"goog-menuitem-highlight")))}isEnabled(){return this.enabled}setEnabled(i){this.enabled=i}performAction(){this.isEnabled()&&this.actionHandler&&this.actionHandler(this)}onAction(i,a){this.actionHandler=i.bind(a)}},ed=null,hm=null,Yf="blocklyWidgetDiv",Xf="",kp="",bd,yf={};yf.createDom=Bo,yf.getDiv=oo,yf.hide=Ql,yf.hideIfOwner=Wr,yf.isVisible=Fh,yf.positionWithAnchor=Sr,yf.repositionForWindowResize=cf,yf.show=ql,yf.testOnly_setDiv=Fa;var eg=null,kv={},Lg=null,Vd={};Vd.callbackFactory=t.callbackFactory$$module$build$src$core$contextmenu,Vd.commentDeleteOption=eu,Vd.commentDuplicateOption=Uh,Vd.dispose=Us,Vd.getCurrentBlock=hf,Vd.hide=Zl,Vd.setCurrentBlock=pd,Vd.show=Wu,Vd.workspaceCommentOption=zc;var Li=class{constructor(){this.registry_=new Map,this.reset()}reset(){this.registry_.clear()}register(i){if(this.registry_.has(i.id))throw Error('Menu item with ID "'+i.id+'" is already registered.');this.registry_.set(i.id,i)}unregister(i){if(!this.registry_.has(i))throw Error('Menu item with ID "'+i+'" not found.');this.registry_.delete(i)}getItem(i){let a;return(a=this.registry_.get(i))!=null?a:null}getContextMenuOptions(i,a){const p=[];for(const O of this.registry_.values())if(i===O.scopeType){var S=O.preconditionFn(a);S!=="hidden"&&(S={text:typeof O.displayText=="function"?O.displayText(a):O.displayText,enabled:S==="enabled",callback:O.callback,scope:a,weight:O.weight},p.push(S))}return p.sort(function(O,j){return O.weight-j.weight}),p}};(function(i){var a=i.ScopeType||(i.ScopeType={});a.BLOCK="block",a.WORKSPACE="workspace",i.registry=new i})(Li||(Li={})),Li.ScopeType;var dm={};dm.clamp=Fr,dm.toDegrees=is,dm.toRadians=Uc;var tg=16,Ng=1,Ov=12,ng=16,Op=.25,rg=null,Kf=null,Jf="",fm="",Si,qf,pm,mm=null,Lp=null,Dg=null,v={getBoundsInfo:function(){const i=On(mm),a=tn(mm);return{left:i.x,right:i.x+a.width,top:i.y,bottom:i.y+a.height,width:a.width,height:a.height}},getPositionMetrics:function(i,a,p,S){const O=v.getBoundsInfo(),j=tn(Si);return a+j.heightO.top?Jn(p,S,O,j):a+j.heightdocument.documentElement.clientTop?Jn(p,S,O,j):vn(i,O,j)}},T={ANIMATION_TIME:Op,ARROW_HORIZONTAL_PADDING:Ov,ARROW_SIZE:tg,BORDER_SIZE:Ng,PADDING_Y:ng,TEST_ONLY:v};T.clearContent=bh,T.createDom=Cl,T.getContentDiv=xu,T.getOwner=tu,T.getPositionX=zr,T.hide=lo,T.hideIfOwner=Ti,T.hideWithoutAnimation=al,T.isVisible=ao,T.repositionForWindowResize=vs,T.setBoundsElement=za,T.setColour=Ad,T.show=rn,T.showPositionedByBlock=pi,T.showPositionedByField=ye;var R=null,F=null,Y={};Y.connectionUiEffect=pa,Y.disconnectUiEffect=Ks,Y.disconnectUiStop=Ua,Y.disposeUiEffect=$u;var ee=50,be=100,Ye=class{constructor(i,a){this.bubble=i,this.workspace=a,this.dragTarget_=null,this.wouldDeleteBubble_=!1,this.startXY_=this.bubble.getRelativeToSurfaceXY()}startBubbleDrag(){t.getGroup$$module$build$src$core$events$utils()||t.setGroup$$module$build$src$core$events$utils(!0),this.workspace.setResizesEnabled(!1),this.bubble.setAutoLayout&&this.bubble.setAutoLayout(!1);let i;(i=this.workspace.getLayerManager())==null||i.moveToDragLayer(this.bubble),this.bubble.setDragging&&this.bubble.setDragging(!0)}dragBubble(i,a){a=this.pixelsToWorkspaceUnits_(a),a=_n.sum(this.startXY_,a),this.bubble.moveDuringDrag(a),a=this.dragTarget_,this.dragTarget_=this.workspace.getDragTarget(i),i=this.wouldDeleteBubble_,this.wouldDeleteBubble_=this.shouldDelete_(this.dragTarget_),i!==this.wouldDeleteBubble_&&this.updateCursorDuringBubbleDrag_(),this.dragTarget_!==a&&(a&&a.onDragExit(this.bubble),this.dragTarget_&&this.dragTarget_.onDragEnter(this.bubble)),this.dragTarget_&&this.dragTarget_.onDragOver(this.bubble)}shouldDelete_(i){return i&&this.workspace.getComponentManager().hasCapability(i.id,gl.Capability.DELETE_AREA)?i.wouldDelete(this.bubble,!1):!1}updateCursorDuringBubbleDrag_(){this.bubble.setDeleteStyle(this.wouldDeleteBubble_)}endBubbleDrag(i,a){if(this.dragBubble(i,a),this.dragTarget_&&this.dragTarget_.shouldPreventMove(this.bubble)?i=this.startXY_:(i=this.pixelsToWorkspaceUnits_(a),i=_n.sum(this.startXY_,i)),this.bubble.moveTo(i.x,i.y),this.dragTarget_&&this.dragTarget_.onDrop(this.bubble),this.wouldDeleteBubble_)this.fireMoveEvent_(),this.bubble.dispose();else{if(this.bubble.setDragging){this.bubble.setDragging(!1);let p;(p=this.workspace.getLayerManager())==null||p.moveOffDragLayer(this.bubble,be)}this.fireMoveEvent_()}this.workspace.setResizesEnabled(!0),t.setGroup$$module$build$src$core$events$utils(!1)}fireMoveEvent_(){if(this.bubble instanceof zl){const i=new(Ie(Ta))(this.bubble);i.setOldCoordinate(this.startXY_),i.recordNew(),ue(i)}}pixelsToWorkspaceUnits_(i){return i=new _n(i.x/this.workspace.scale,i.y/this.workspace.scale),this.workspace.isMutator&&i.scale(1/this.workspace.options.parentWorkspace.scale),i}},at=30,Lt=!0,Zt=[];Zt[Un.INPUT_VALUE]=Un.OUTPUT_VALUE,Zt[Un.OUTPUT_VALUE]=Un.INPUT_VALUE,Zt[Un.NEXT_STATEMENT]=Un.PREVIOUS_STATEMENT,Zt[Un.PREVIOUS_STATEMENT]=Un.NEXT_STATEMENT;var hn="RENAME_VARIABLE_ID",an="DELETE_VARIABLE_ID",Dn={};Dn.commonWordPrefix=mc,Dn.commonWordSuffix=Zo,Dn.isNumber=t.isNumber$$module$build$src$core$utils$string,Dn.shortestStringLength=Th,Dn.startsWith=Hh,Dn.wrap=t.wrap$$module$build$src$core$utils$string;var Zn=void 0,ir=!1,Io=!1,xt=50,dt=0,Et=0,Sn=0,lr=0,nr=null,fr=null,Lr=0,Ul=10,ds=10,Qf=750,$0=5,Lu=null,jd={HOVER_MS:Qf,LIMIT:xt,MARGINS:$0,OFFSET_X:Lr,OFFSET_Y:Ul,RADIUS_OK:ds};jd.bindMouseEvents=zi,jd.block=Rd,jd.createDom=Vh,jd.dispose=Id,jd.getCustomTooltip=ju,jd.getDiv=ea,jd.getTooltipOfObject=uo,jd.hide=Al,jd.isVisible=md,jd.setCustomTooltip=gc,jd.unbindMouseEvents=gd,jd.unblock=jh;var pT=class{constructor(i){this.workspace=i,this.horizontalScrollEnabled_=this.workspace.isMovableHorizontally(),this.verticalScrollEnabled_=this.workspace.isMovableVertically(),this.startScrollXY_=new _n(i.scrollX,i.scrollY)}dispose(){this.workspace=null}startDrag(){L()&&L().unselect()}endDrag(i){this.drag(i)}drag(i){if(i=_n.sum(this.startScrollXY_,i),this.horizontalScrollEnabled_&&this.verticalScrollEnabled_)this.workspace.scroll(i.x,i.y);else if(this.horizontalScrollEnabled_)this.workspace.scroll(i.x,this.workspace.scrollY);else if(this.verticalScrollEnabled_)this.workspace.scroll(this.workspace.scrollX,i.y);else throw new TypeError("Invalid state.")}},bE=5,TE=6,gm=class{constructor(i,a){this.creatorWorkspace=a,this.mouseDownXY=new _n(0,0),this.startWorkspace_=this.targetBlock=this.startBlock=this.startIcon=this.startField=this.startBubble=null,this.hasExceededDragRadius=!1,this.boundEvents=[],this.flyout=this.workspaceDragger=this.blockDragger=this.bubbleDragger=null,this.isMultiTouch_=this.isEnding_=this.gestureHasStarted=this.calledUpdateIsDragging=!1,this.cachedPoints=new Map,this.startDistance=this.previousScale=0,this.currentDropdownOwner=this.isPinchZoomEnabled=null,this.mostRecentEvent=i,this.currentDragDeltaXY=new _n(0,0),this.healStack=!Lt}dispose(){nt(),jh(),this.creatorWorkspace.clearGesture();for(const i of this.boundEvents)rt(i);this.boundEvents.length=0,this.blockDragger&&this.blockDragger.dispose(),this.workspaceDragger&&this.workspaceDragger.dispose()}updateFromEvent(i){const a=new _n(i.clientX,i.clientY);this.updateDragDelta(a)&&(this.updateIsDragging(),Qe()),this.mostRecentEvent=i}updateDragDelta(i){return this.currentDragDeltaXY=_n.difference(i,this.mouseDownXY),this.hasExceededDragRadius?!1:this.hasExceededDragRadius=_n.magnitude(this.currentDragDeltaXY)>(this.flyout?t.config$$module$build$src$core$config.flyoutDragRadius:t.config$$module$build$src$core$config.dragRadius)}updateIsDraggingFromFlyout(){let i;if(!this.targetBlock||(i=this.flyout)==null||!i.isBlockCreatable(this.targetBlock))return!1;if(!this.flyout.targetWorkspace)throw Error(`Cannot update dragging from the flyout because the ' + - 'flyout's target workspace is undefined`);return!this.flyout.isScrollable()||this.flyout.isDragTowardWorkspace(this.currentDragDeltaXY)?(this.startWorkspace_=this.flyout.targetWorkspace,this.startWorkspace_.updateScreenCalculationsIfScrolled(),t.getGroup$$module$build$src$core$events$utils()||t.setGroup$$module$build$src$core$events$utils(!0),this.startBlock=null,this.targetBlock=this.flyout.createBlock(this.targetBlock),this.targetBlock.select(),!0):!1}updateIsDraggingBubble(){return this.startBubble?(this.startDraggingBubble(),!0):!1}updateIsDraggingBlock(){if(!this.targetBlock)return!1;if(this.flyout){if(this.updateIsDraggingFromFlyout())return this.startDraggingBlock(),!0}else if(this.targetBlock.isMovable())return this.startDraggingBlock(),!0;return!1}updateIsDraggingWorkspace(){if(!this.startWorkspace_)throw Error("Cannot update dragging the workspace because the start workspace is undefined");(this.flyout?this.flyout.isScrollable():this.startWorkspace_&&this.startWorkspace_.isDraggable())&&(this.workspaceDragger=new pT(this.startWorkspace_),this.workspaceDragger.startDrag())}updateIsDragging(){if(this.calledUpdateIsDragging)throw Error("updateIsDragging_ should only be called once per gesture.");this.calledUpdateIsDragging=!0,this.updateIsDraggingBubble()||this.updateIsDraggingBlock()||this.updateIsDraggingWorkspace()}startDraggingBlock(){this.blockDragger=new(y(Ft.BLOCK_DRAGGER,this.creatorWorkspace.options,!0))(this.targetBlock,this.startWorkspace_),this.blockDragger.startDrag(this.currentDragDeltaXY,this.healStack),this.blockDragger.drag(this.mostRecentEvent,this.currentDragDeltaXY)}startDraggingBubble(){if(!this.startBubble)throw Error("Cannot update dragging the bubble because the start bubble is undefined");if(!this.startWorkspace_)throw Error("Cannot update dragging the bubble because the start workspace is undefined");this.bubbleDragger=new Ye(this.startBubble,this.startWorkspace_),this.bubbleDragger.startBubbleDrag(),this.bubbleDragger.dragBubble(this.mostRecentEvent,this.currentDragDeltaXY)}doStart(i){if(!this.startWorkspace_)throw Error("Cannot start the touch gesture becauase the start workspace is undefined");this.isPinchZoomEnabled=this.startWorkspace_.options.zoomOptions&&this.startWorkspace_.options.zoomOptions.pinch,it(i)?this.cancel():(this.gestureHasStarted=!0,Ua(),this.startWorkspace_.updateScreenCalculationsIfScrolled(),this.startWorkspace_.isMutator&&this.startWorkspace_.resize(),this.currentDropdownOwner=tu(),this.startWorkspace_.hideChaff(!!this.flyout),this.startWorkspace_.markFocused(),this.mostRecentEvent=i,Rd(),this.targetBlock&&this.targetBlock.select(),Nt(i)?this.handleRightClick(i):(i.type.toLowerCase()==="pointerdown"&&i.pointerType!=="mouse"&&Re(i,this),this.mouseDownXY=new _n(i.clientX,i.clientY),this.healStack=i.altKey||i.ctrlKey||i.metaKey,this.bindMouseEvents(i),this.isEnding_||this.handleTouchStart(i)))}bindMouseEvents(i){this.boundEvents.push(Ce(document,"pointerdown",null,this.handleStart.bind(this),!0)),this.boundEvents.push(Ce(document,"pointermove",null,this.handleMove.bind(this),!0)),this.boundEvents.push(Ce(document,"pointerup",null,this.handleUp.bind(this),!0)),i.preventDefault(),i.stopPropagation()}handleStart(i){this.isDragging()||(this.handleTouchStart(i),this.isMultiTouch()&&Qe())}handleMove(i){this.isDragging()&&ft(i)||!this.isMultiTouch()?(this.updateFromEvent(i),this.workspaceDragger?this.workspaceDragger.drag(this.currentDragDeltaXY):this.blockDragger?this.blockDragger.drag(this.mostRecentEvent,this.currentDragDeltaXY):this.bubbleDragger&&this.bubbleDragger.dragBubble(this.mostRecentEvent,this.currentDragDeltaXY),i.preventDefault(),i.stopPropagation()):this.isMultiTouch()&&(this.handleTouchMove(i),Qe())}handleUp(i){if(this.isDragging()||this.handleTouchEnd(i),!this.isMultiTouch()||this.isDragging()){if(!ft(i))return;if(this.updateFromEvent(i),Qe(),this.isEnding_){console.log("Trying to end a gesture recursively.");return}this.isEnding_=!0,this.bubbleDragger?this.bubbleDragger.endBubbleDrag(i,this.currentDragDeltaXY):this.blockDragger?this.blockDragger.endDrag(i,this.currentDragDeltaXY):this.workspaceDragger?this.workspaceDragger.endDrag(this.currentDragDeltaXY):this.isBubbleClick()?this.doBubbleClick():this.isFieldClick()?this.doFieldClick():this.isIconClick()?this.doIconClick():this.isBlockClick()?this.doBlockClick():this.isWorkspaceClick()&&this.doWorkspaceClick(i)}i.preventDefault(),i.stopPropagation(),this.dispose()}handleTouchStart(i){var a=lt(i);this.cachedPoints.set(a,this.getTouchPoint(i));var p=Array.from(this.cachedPoints.keys());p.length===2&&(a=this.cachedPoints.get(p[0]),p=this.cachedPoints.get(p[1]),this.startDistance=_n.distance(a,p),this.isMultiTouch_=!0,i.preventDefault())}handleTouchMove(i){const a=lt(i);this.cachedPoints.set(a,this.getTouchPoint(i)),this.isPinchZoomEnabled&&this.cachedPoints.size===2?this.handlePinch(i):this.handleMove(i)}handlePinch(i){var a=Array.from(this.cachedPoints.keys()),p=this.cachedPoints.get(a[0]);if(a=this.cachedPoints.get(a[1]),p=_n.distance(p,a)/this.startDistance,0this.previousScale){if(a=p-this.previousScale,a=0this.cachedPoints.size&&(this.cachedPoints.clear(),this.previousScale=0)}getTouchPoint(i){return this.startWorkspace_?new _n(i.pageX,i.pageY):null}isMultiTouch(){return this.isMultiTouch_}cancel(){this.isEnding_||(Qe(),this.bubbleDragger?this.bubbleDragger.endBubbleDrag(this.mostRecentEvent,this.currentDragDeltaXY):this.blockDragger?this.blockDragger.endDrag(this.mostRecentEvent,this.currentDragDeltaXY):this.workspaceDragger&&this.workspaceDragger.endDrag(this.currentDragDeltaXY),this.dispose())}handleRightClick(i){this.targetBlock?(this.bringBlockToFront(),this.targetBlock.workspace.hideChaff(!!this.flyout),this.targetBlock.showContextMenu(i)):this.startBubble?this.startBubble.showContextMenu(i):this.startWorkspace_&&!this.flyout&&(this.startWorkspace_.hideChaff(),this.startWorkspace_.showContextMenu(i)),i.preventDefault(),i.stopPropagation(),this.dispose()}handleWsStart(i,a){if(this.gestureHasStarted)throw Error("Tried to call gesture.handleWsStart, but the gesture had already been started.");this.setStartWorkspace(a),this.mostRecentEvent=i,this.doStart(i)}fireWorkspaceClick(i){ue(new(Ie(rc))(null,i.id,"workspace"))}handleFlyoutStart(i,a){if(this.gestureHasStarted)throw Error("Tried to call gesture.handleFlyoutStart, but the gesture had already been started.");this.setStartFlyout(a),this.handleWsStart(i,a.getWorkspace())}handleBlockStart(i,a){if(this.gestureHasStarted)throw Error("Tried to call gesture.handleBlockStart, but the gesture had already been started.");this.setStartBlock(a),this.mostRecentEvent=i}handleBubbleStart(i,a){if(this.gestureHasStarted)throw Error("Tried to call gesture.handleBubbleStart, but the gesture had already been started.");this.setStartBubble(a),this.mostRecentEvent=i}doBubbleClick(){this.startBubble instanceof zl&&(this.startBubble.setFocus(),this.startBubble.select())}doFieldClick(){if(!this.startField)throw Error("Cannot do a field click because the start field is undefined");this.currentDropdownOwner!==this.startField&&this.startField.showEditor(this.mostRecentEvent),this.bringBlockToFront()}doIconClick(){if(!this.startIcon)throw Error("Cannot do an icon click because the start icon is undefined");this.bringBlockToFront(),this.startIcon.onClick()}doBlockClick(){if(this.flyout&&this.flyout.autoClose){if(!this.targetBlock)throw Error("Cannot do a block click because the target block is undefined");this.targetBlock.isEnabled()&&(t.getGroup$$module$build$src$core$events$utils()||t.setGroup$$module$build$src$core$events$utils(!0),this.flyout.createBlock(this.targetBlock).scheduleSnapAndBump())}else{if(!this.startWorkspace_)throw Error("Cannot do a block click because the start workspace is undefined");const i=new(Ie(rc))(this.startBlock,this.startWorkspace_.id,"block");ue(i)}this.bringBlockToFront(),t.setGroup$$module$build$src$core$events$utils(!1)}doWorkspaceClick(i){i=this.creatorWorkspace,L()&&L().unselect(),this.fireWorkspaceClick(this.startWorkspace_||i)}bringBlockToFront(){this.targetBlock&&!this.flyout&&this.targetBlock.bringToFront()}setStartField(i){if(this.gestureHasStarted)throw Error("Tried to call gesture.setStartField, but the gesture had already been started.");this.startField||(this.startField=i)}setStartIcon(i){if(this.gestureHasStarted)throw Error("Tried to call gesture.setStartIcon, but the gesture had already been started.");this.startIcon||(this.startIcon=i)}setStartBubble(i){this.startBubble||(this.startBubble=i)}setStartBlock(i){this.startBlock||this.startBubble||(this.startBlock=i,i.isInFlyout&&i!==i.getRootBlock()?this.setTargetBlock(i.getRootBlock()):this.setTargetBlock(i))}setTargetBlock(i){i.isShadow()?this.setTargetBlock(i.getParent()):this.targetBlock=i}setStartWorkspace(i){this.startWorkspace_||(this.startWorkspace_=i)}setStartFlyout(i){this.flyout||(this.flyout=i)}isBubbleClick(){return!!this.startBubble&&!this.hasExceededDragRadius}isBlockClick(){return!!this.startBlock&&!this.hasExceededDragRadius&&!this.isFieldClick()&&!this.isIconClick()}isFieldClick(){return this.startField?this.startField.isClickable()&&!this.hasExceededDragRadius&&(!this.flyout||this.startField.isClickableInFlyout(this.flyout.autoClose)):!1}isIconClick(){if(!this.startIcon)return!1;const i=!this.flyout||!this.startIcon.isClickableInFlyout||this.startIcon.isClickableInFlyout(this.flyout.autoClose);return!this.hasExceededDragRadius&&i}isWorkspaceClick(){return!this.startBlock&&!this.startBubble&&!this.startField&&!this.hasExceededDragRadius}isDragging(){return!!this.workspaceDragger||!!this.blockDragger||!!this.bubbleDragger}hasStarted(){return this.gestureHasStarted}getInsertionMarkers(){return this.blockDragger?this.blockDragger.getInsertionMarkers():[]}getCurrentDragger(){let i,a;return(a=(i=this.blockDragger)!=null?i:this.workspaceDragger)!=null?a:this.bubbleDragger}static inProgress(){const i=w();for(let a=0,p;p=i[a];a++)if(p.currentGesture_)return!0;return!1}},ob=class{constructor(i,a){this.pattern=i,this.scale=1;let p;this.spacing=(p=a.spacing)!=null?p:0;let S;this.length=(S=a.length)!=null?S:1,this.line2=(this.line1=i.firstChild)&&this.line1.nextSibling;let O;this.snapToGrid=(O=a.snap)!=null?O:!1}setSpacing(i){this.spacing=i,this.update(this.scale)}setLength(i){this.length=i,this.update(this.scale)}setSnapToGrid(i){this.snapToGrid=i}shouldSnap(){return this.snapToGrid}getSpacing(){return this.spacing}getPatternId(){return this.pattern.id}update(i){this.scale=i;var a=this.spacing*i;this.pattern.setAttribute("width",`${a}`),this.pattern.setAttribute("height",`${a}`),a=Math.floor(this.spacing/2)+.5;let p=a-this.length/2,S=a+this.length/2;a*=i,p*=i,S*=i,this.setLineAttributes(this.line1,i,p,S,a,a),this.setLineAttributes(this.line2,i,a,a,p,S)}setLineAttributes(i,a,p,S,O,j){i&&(i.setAttribute("stroke-width",`${a}`),i.setAttribute("x1",`${p}`),i.setAttribute("y1",`${O}`),i.setAttribute("x2",`${S}`),i.setAttribute("y2",`${j}`))}moveTo(i,a){this.pattern.setAttribute("x",`${i}`),this.pattern.setAttribute("y",`${a}`)}static createDom(i,a,p){i=se(Ve.PATTERN,{id:"blocklyGridPattern"+i,patternUnits:"userSpaceOnUse"},p);let S,O;if(0<((S=a.length)!=null?S:1)&&0<((O=a.spacing)!=null?O:0)){se(Ve.LINE,{stroke:a.colour},i);let j;(j=a.length)!=null&&j&&se(Ve.LINE,{stroke:a.colour},i)}else se(Ve.LINE,{},i);return i}},Ca=class{constructor(i){this.workspace=i,this.cursorSvg_=this.cursor_=null,this.markers=new Map,this.markerSvg_=null}registerMarker(i,a){this.markers.has(i)&&this.unregisterMarker(i),a.setDrawer(this.workspace.getRenderer().makeMarkerDrawer(this.workspace,a)),this.setMarkerSvg(a.getDrawer().createDom()),this.markers.set(i,a)}unregisterMarker(i){const a=this.markers.get(i);if(a)a.dispose(),this.markers.delete(i);else throw Error("Marker with ID "+i+" does not exist. Can only unregister markers that exist.")}getCursor(){return this.cursor_}getMarker(i){return this.markers.get(i)||null}setCursor(i){this.cursor_&&this.cursor_.getDrawer()&&this.cursor_.getDrawer().dispose(),(this.cursor_=i)&&(i=this.workspace.getRenderer().makeMarkerDrawer(this.workspace,this.cursor_),this.cursor_.setDrawer(i),this.setCursorSvg(this.cursor_.getDrawer().createDom()))}setCursorSvg(i){i?(this.workspace.getBlockCanvas().appendChild(i),this.cursorSvg_=i):this.cursorSvg_=null}setMarkerSvg(i){i?this.workspace.getBlockCanvas()&&(this.cursorSvg_?this.workspace.getBlockCanvas().insertBefore(i,this.cursorSvg_):this.workspace.getBlockCanvas().appendChild(i)):this.markerSvg_=null}updateMarkers(){this.workspace.keyboardAccessibilityMode&&this.cursorSvg_&&this.workspace.getCursor().draw()}dispose(){const i=Object.keys(this.markers);for(let a=0,p;p=i[a];a++)this.unregisterMarker(p);this.markers.clear(),this.cursor_&&(this.cursor_.dispose(),this.cursor_=null)}};Ca.LOCAL_MARKER="local_marker_1";var mT={};mT.deepMerge=Il;var Pg=class{constructor(i,a,p,S){this.name=i,this.startHats=!1,this.blockStyles=a||Object.create(null),this.categoryStyles=p||Object.create(null),this.componentStyles=S||Object.create(null),this.fontStyle=Object.create(null),r(Ft.THEME,i,this,!0)}getClassName(){return this.name+"-theme"}setBlockStyle(i,a){this.blockStyles[i]=a}setCategoryStyle(i,a){this.categoryStyles[i]=a}getComponentStyle(i){if(i=this.componentStyles[i],!i)return null;if(typeof i=="string"){const a=this.getComponentStyle(i);if(a)return a}return`${i}`}setComponentStyle(i,a){this.componentStyles[i]=a}setFontStyle(i){this.fontStyle=i}setStartHats(i){this.startHats=i}static defineTheme(i,a){i=i.toLowerCase();const p=new Pg(i);let S=a.base;if(S){if(typeof S=="string"){let O;S=(O=f(Ft.THEME,S))!=null?O:void 0}S instanceof Pg&&(Il(p,S),p.name=i)}return Il(p.blockStyles,a.blockStyles),Il(p.categoryStyles,a.categoryStyles),Il(p.componentStyles,a.componentStyles),Il(p.fontStyle,a.fontStyle),a.startHats!==null&&(p.startHats=a.startHats),p}},Yd={colour_blocks:{colourPrimary:"20"},list_blocks:{colourPrimary:"260"},logic_blocks:{colourPrimary:"210"},loop_blocks:{colourPrimary:"120"},math_blocks:{colourPrimary:"230"},procedure_blocks:{colourPrimary:"290"},text_blocks:{colourPrimary:"160"},variable_blocks:{colourPrimary:"330"},variable_dynamic_blocks:{colourPrimary:"310"},hat_blocks:{colourPrimary:"330",hat:"cap"}},kn={colour_category:{colour:"20"},list_category:{colour:"260"},logic_category:{colour:"210"},loop_category:{colour:"120"},math_category:{colour:"230"},procedure_category:{colour:"290"},text_category:{colour:"160"},variable_category:{colour:"330"},variable_dynamic_category:{colour:"310"}},Lv=new Pg("classic",Yd,kn),Hi=class{constructor(i){this.gridPattern=null,this.getMetrics=this.setMetrics=void 0;let a=null,p=!1;var S=!1,O=!1,j=!1,ve=!1,Ue=!1;const Yt=!!i.readOnly;if(!Yt){var jn;a=gt((jn=i.toolbox)!=null?jn:null),p=Vt(a),S=i.trashcan,S=S===void 0?p:S,O=i.collapse,O=O===void 0?p:O,j=i.comments,j=j===void 0?p:j,ve=i.disable,ve=ve===void 0?p:ve,Ue=i.sounds,Ue=Ue===void 0?!0:Ue}jn=i.maxTrashcanContents,S?jn===void 0&&(jn=32):jn=0;const bl=!!i.rtl;let Qa=i.horizontalLayout;Qa===void 0&&(Qa=!1);var Fp=i.toolboxPosition!=="end";Fp=Qa?Fp?dr.TOP:dr.BOTTOM:Fp===bl?dr.RIGHT:dr.LEFT;let HT=i.css;HT===void 0&&(HT=!0);let GT="https://blockly-demo.appspot.com/static/media/";i.media?GT=i.media.endsWith("/")?i.media:i.media+"/":"path"in i&&(xe("path","Nov 2014","Jul 2023","media"),GT=i.path+"media/");const Ez=i.oneBasedIndex,Gte=i.renderer||"geras",Wte=i.plugins||{};let R2=i.modalInputs;R2===void 0&&(R2=!0),this.RTL=bl,this.oneBasedIndex=Ez===void 0?!0:Ez,this.collapse=O,this.comments=j,this.disable=ve,this.readOnly=Yt,this.maxBlocks=i.maxBlocks||1/0;let xz;this.maxInstances=(xz=i.maxInstances)!=null?xz:null,this.modalInputs=R2,this.pathToMedia=GT,this.hasCategories=p,this.moveOptions=Hi.parseMoveOptions_(i,p),this.hasScrollbars=!!this.moveOptions.scrollbars,this.hasTrashcan=S,this.maxTrashcanContents=jn,this.hasSounds=Ue,this.hasCss=HT,this.horizontalLayout=Qa,this.languageTree=a,this.gridOptions=Hi.parseGridOptions_(i),this.zoomOptions=Hi.parseZoomOptions_(i),this.toolboxPosition=Fp,this.theme=Hi.parseThemeOptions_(i),this.renderer=Gte;let $z;this.rendererOverrides=($z=i.rendererOverrides)!=null?$z:null;let Cz;this.parentWorkspace=(Cz=i.parentWorkspace)!=null?Cz:null,this.plugins=Wte}static parseMoveOptions_(i,a){const p=i.move||{},S={};return p.scrollbars===void 0&&i.scrollbars===void 0?S.scrollbars=a:typeof p.scrollbars=="object"?(S.scrollbars={horizontal:!!p.scrollbars.horizontal,vertical:!!p.scrollbars.vertical},S.scrollbars.horizontal&&S.scrollbars.vertical?S.scrollbars=!0:S.scrollbars.horizontal||S.scrollbars.vertical||(S.scrollbars=!1)):S.scrollbars=!!p.scrollbars||!!i.scrollbars,S.wheel=S.scrollbars&&p.wheel!==void 0?!!p.wheel:typeof S.scrollbars=="object",S.drag=S.scrollbars?p.drag===void 0?!0:!!p.drag:!1,S}static parseZoomOptions_(i){i=i.zoom||{};const a={};return a.controls=i.controls===void 0?!1:!!i.controls,a.wheel=i.wheel===void 0?!1:!!i.wheel,a.startScale=i.startScale===void 0?1:Number(i.startScale),a.maxScale=i.maxScale===void 0?3:Number(i.maxScale),a.minScale=i.minScale===void 0?.3:Number(i.minScale),a.scaleSpeed=i.scaleSpeed===void 0?1.2:Number(i.scaleSpeed),a.pinch=i.pinch===void 0?a.wheel||a.controls:!!i.pinch,a}static parseGridOptions_(i){i=i.grid||{};const a={};return a.spacing=Number(i.spacing)||0,a.colour=i.colour||"#888",a.length=i.length===void 0?1:Number(i.length),a.snap=0")),ue(new Jr(a,"mutation",null,p,i));break;default:console.warn("Unknown change type: "+this.element)}}static getExtraBlockState_(i){return i.saveExtraState?(i=i.saveExtraState(!0))?JSON.stringify(i):"":i.mutationToDom&&(i=i.mutationToDom())?Qi(i):""}};r(Ft.EVENT,t.CHANGE$$module$build$src$core$events$utils,Jr);var ab=.45,ah=.65,gT={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00"},bf={};bf.blend=Vc,bf.getHsvSaturation=Xu,bf.getHsvValue=Sh,bf.hexToRgb=Wc,bf.hsvToHex=kl,bf.hueToHex=_c,bf.names=gT,bf.parse=ta,bf.rgbToHex=Rl,bf.setHsvSaturation=Ku,bf.setHsvValue=ll;var M_={};M_.checkMessageReferences=ul,M_.parseBlockColour=Zi,M_.replaceMessageReferences=Vr,M_.tokenizeInterpolation=Ga;var Gi=class{constructor(i,a,p){this.DEFAULT_VALUE=null,this.name=void 0,this.constants_=this.mouseDownWrapper_=this.textContent_=this.textElement_=this.borderRect_=this.fieldGroup_=this.markerSvg_=this.cursorSvg_=this.tooltip_=this.validator_=null,this.disposed=!1,this.maxDisplayLength=50,this.sourceBlock_=null,this.enabled_=this.visible_=this.isDirty_=!0,this.suffixField=this.prefixField=this.clickTarget_=null,this.EDITABLE=!0,this.SERIALIZABLE=!1,this.CURSOR="",this.value_="DEFAULT_VALUE"in new.target.prototype?new.target.prototype.DEFAULT_VALUE:this.DEFAULT_VALUE,this.size_=new eo(0,0),i!==Gi.SKIP_SETUP&&(p&&this.configure_(p),this.setValue(i),a&&this.setValidator(a))}configure_(i){i.tooltip&&this.setTooltip(Vr(i.tooltip))}setSourceBlock(i){if(this.sourceBlock_)throw Error("Field already bound to a block");this.sourceBlock_=i}getConstants(){return!this.constants_&&this.sourceBlock_&&!this.sourceBlock_.isDeadOrDying()&&this.sourceBlock_.workspace.rendered&&(this.constants_=this.sourceBlock_.workspace.getRenderer().getConstants()),this.constants_}getSourceBlock(){return this.sourceBlock_}init(){this.fieldGroup_||(this.fieldGroup_=se(Ve.G,{}),this.isVisible()||(this.fieldGroup_.style.display="none"),this.sourceBlock_.getSvgRoot().appendChild(this.fieldGroup_),this.initView(),this.updateEditable(),this.setTooltip(this.tooltip_),this.bindEvents_(),this.initModel())}initView(){this.createBorderRect_(),this.createTextElement_()}initModel(){}isFullBlockField(){return!this.borderRect_}createBorderRect_(){this.borderRect_=se(Ve.RECT,{rx:this.getConstants().FIELD_BORDER_RECT_RADIUS,ry:this.getConstants().FIELD_BORDER_RECT_RADIUS,x:0,y:0,height:this.size_.height,width:this.size_.width,class:"blocklyFieldRect"},this.fieldGroup_)}createTextElement_(){this.textElement_=se(Ve.TEXT,{class:"blocklyText"},this.fieldGroup_),this.getConstants().FIELD_TEXT_BASELINE_CENTER&&this.textElement_.setAttribute("dominant-baseline","central"),this.textContent_=document.createTextNode(""),this.textElement_.appendChild(this.textContent_)}bindEvents_(){const i=this.getClickTarget_();if(!i)throw Error("A click target has not been set.");zi(i),this.mouseDownWrapper_=Ce(i,"pointerdown",this,this.onMouseDown_)}fromXml(i){this.setValue(i.textContent)}toXml(i){return i.textContent=this.getValue(),i}saveState(i){return i=this.saveLegacyState(Gi),i!==null?i:this.getValue()}loadState(i){this.loadLegacyState(Gi,i)||this.setValue(i)}saveLegacyState(i){return i.prototype.saveState===this.saveState&&i.prototype.toXml!==this.toXml?(i=t.createElement$$module$build$src$core$utils$xml("field"),i.setAttribute("name",this.name||""),Nn(this.toXml(i)).replace(' xmlns="https://developers.google.com/blockly/xml"',"")):null}loadLegacyState(i,a){return i.prototype.loadState===this.loadState&&i.prototype.fromXml!==this.fromXml?(this.fromXml(t.textToDom$$module$build$src$core$utils$xml(a)),!0):!1}dispose(){Ti(this),Wr(this);let i;(i=this.getSourceBlock())!=null&&i.isDeadOrDying()||pt(this.fieldGroup_),this.disposed=!0}updateEditable(){const i=this.fieldGroup_,a=this.getSourceBlock();this.EDITABLE&&i&&a&&(this.enabled_&&a.isEditable()?($e(i,"blocklyEditableText"),St(i,"blocklyNonEditableText"),i.style.cursor=this.CURSOR):($e(i,"blocklyNonEditableText"),St(i,"blocklyEditableText"),i.style.cursor=""))}setEnabled(i){this.enabled_=i,this.updateEditable()}isEnabled(){return this.enabled_}isClickable(){return this.enabled_&&!!this.sourceBlock_&&this.sourceBlock_.isEditable()&&this.showEditor_!==Gi.prototype.showEditor_}isClickableInFlyout(i){return!i}isCurrentlyEditable(){return this.enabled_&&this.EDITABLE&&!!this.sourceBlock_&&this.sourceBlock_.isEditable()}isSerializable(){let i=!1;return this.name&&(this.SERIALIZABLE?i=!0:this.EDITABLE&&(console.warn("Detected an editable field that was not serializable. Please define SERIALIZABLE property as true on all editable custom fields. Proceeding with serialization."),i=!0)),i}isVisible(){return this.visible_}setVisible(i){if(this.visible_!==i){this.visible_=i;var a=this.fieldGroup_;a&&(a.style.display=i?"block":"none")}}setValidator(i){this.validator_=i}getValidator(){return this.validator_}getSvgRoot(){return this.fieldGroup_}getBorderRect(){if(!this.borderRect_)throw Error(`The border rectangle is ${this.borderRect_}.`);return this.borderRect_}getTextElement(){if(!this.textElement_)throw Error(`The text element is ${this.textElement_}.`);return this.textElement_}getTextContent(){if(!this.textContent_)throw Error(`The text content is ${this.textContent_}.`);return this.textContent_}applyColour(){}render_(){this.textContent_&&(this.textContent_.nodeValue=this.getDisplayText_()),this.updateSize_()}showEditor(i){this.isClickable()&&this.showEditor_(i)}showEditor_(i){}repositionForWindowResize(){return!1}updateSize_(i){const a=this.getConstants();i=i!==void 0?i:this.isFullBlockField()?0:this.getConstants().FIELD_BORDER_RECT_X_PADDING;let p=2*i,S=a.FIELD_TEXT_HEIGHT,O=0;this.textElement_&&(O=Xe(this.textElement_,a.FIELD_TEXT_FONTSIZE,a.FIELD_TEXT_FONTWEIGHT,a.FIELD_TEXT_FONTFAMILY),p+=O),this.isFullBlockField()||(S=Math.max(S,a.FIELD_BORDER_RECT_HEIGHT)),this.size_.height=S,this.size_.width=p,this.positionTextElement_(i,O),this.positionBorderRect_()}positionTextElement_(i,a){if(this.textElement_){var p=this.getConstants(),S=this.size_.height/2,O;this.textElement_.setAttribute("x",String((O=this.getSourceBlock())!=null&&O.RTL?this.size_.width-a-i:i)),this.textElement_.setAttribute("y",String(p.FIELD_TEXT_BASELINE_CENTER?S:S-p.FIELD_TEXT_HEIGHT/2+p.FIELD_TEXT_BASELINE))}}positionBorderRect_(){this.borderRect_&&(this.borderRect_.setAttribute("width",String(this.size_.width)),this.borderRect_.setAttribute("height",String(this.size_.height)),this.borderRect_.setAttribute("rx",String(this.getConstants().FIELD_BORDER_RECT_RADIUS)),this.borderRect_.setAttribute("ry",String(this.getConstants().FIELD_BORDER_RECT_RADIUS)))}getSize(){return this.isVisible()?(this.isDirty_?(this.render_(),this.isDirty_=!1):this.visible_&&this.size_.width===0&&(this.render_(),this.size_.width!==0&&console.warn("Deprecated use of setting size_.width to 0 to rerender a field. Set field.isDirty_ to true instead.")),this.size_):new eo(0,0)}getScaledBBox(){let i;var a=this.getSourceBlock();if(!a)throw new Ro;if(this.isFullBlockField()){var p=this.sourceBlock_.getHeightWidth();const S=a.workspace.scale;i=this.getAbsoluteXY_(),a=(p.width+1)*S,p=(p.height+1)*S,En?(i.x+=1.5*S,i.y+=1.5*S):(i.x-=.5*S,i.y-=.5*S)}else p=this.borderRect_.getBoundingClientRect(),i=On(this.borderRect_),a=p.width,p=p.height;return new Oi(i.y,i.y+p,i.x,i.x+a)}onLocationChange(i){}getDisplayText_(){let i=this.getText();return i?(i.length>this.maxDisplayLength&&(i=i.substring(0,this.maxDisplayLength-2)+"…"),i=i.replace(/\s/g,Gi.NBSP),this.sourceBlock_&&this.sourceBlock_.RTL&&(i+="‏"),i):Gi.NBSP}getText(){const i=this.getText_();return String(i!==null?i:this.getValue())}getText_(){return null}markDirty(){this.isDirty_=!0,this.constants_=null}forceRerender(){this.isDirty_=!0,this.sourceBlock_&&this.sourceBlock_.rendered&&(this.sourceBlock_.queueRender(),this.sourceBlock_.bumpNeighbours())}setValue(i,a=!0){if(i!==null){var p=this.doClassValidation_(i);if(i=this.processValidation_(i,p),!(i instanceof Error)){var S;p=(S=this.getValidator())==null?void 0:S.call(this,i),S=this.processValidation_(i,p),S instanceof Error||(i=this.sourceBlock_,i&&i.disposed||(p=this.getValue(),p===S?this.doValueUpdate_(S):(this.doValueUpdate_(S),a&&i&&ie()&&ue(new(Ie(t.CHANGE$$module$build$src$core$events$utils))(i,"field",this.name||null,p,S)),this.isDirty_&&this.forceRerender())))}}}processValidation_(i,a){return a===null?(this.doValueInvalid_(i),this.isDirty_&&this.forceRerender(),Error()):a===void 0?i:a}getValue(){return this.value_}doClassValidation_(i){return i??null}doValueUpdate_(i){this.value_=i,this.isDirty_=!0}doValueInvalid_(i){}onMouseDown_(i){this.sourceBlock_&&!this.sourceBlock_.isDeadOrDying()&&(i=this.sourceBlock_.workspace.getGesture(i))&&i.setStartField(this)}setTooltip(i){i||i===""||(i=this.sourceBlock_);const a=this.getClickTarget_();a?a.tooltip=i:this.tooltip_=i}getTooltip(){const i=this.getClickTarget_();return uo(i||{tooltip:this.tooltip_})}getClickTarget_(){return this.clickTarget_||this.getSvgRoot()}getAbsoluteXY_(){return On(this.getClickTarget_())}referencesVariables(){return!1}refreshVariableName(){}getParentInput(){let i=null;const a=this.getSourceBlock();if(!a)throw new Ro;const p=a.inputList;for(let S=0;Sa[1]===i)?i:(this.sourceBlock_&&console.warn("Cannot set the dropdown's value to an unavailable option. Block type: "+this.sourceBlock_.type+", Field name: "+this.name+", Value: "+i),null)}doValueUpdate_(i){super.doValueUpdate_(i),i=this.getOptions(!0);for(let a=0,p;p=i[a];a++)p[1]===this.value_&&(this.selectedOption=p)}applyColour(){const i=this.sourceBlock_.style;this.borderRect_&&(this.borderRect_.setAttribute("stroke",i.colourTertiary),this.menu_?this.borderRect_.setAttribute("fill",i.colourTertiary):this.borderRect_.setAttribute("fill","transparent")),this.sourceBlock_&&this.arrow&&(this.sourceBlock_.isShadow()?this.arrow.style.fill=i.colourSecondary:this.arrow.style.fill=i.colourPrimary)}render_(){this.getTextContent().nodeValue="",this.imageElement.style.display="none";const i=this.selectedOption&&this.selectedOption[0];i&&typeof i=="object"?this.renderSelectedImage(i):this.renderSelectedText(),this.positionBorderRect_()}renderSelectedImage(i){const a=this.getSourceBlock();if(!a)throw new Ro;this.imageElement.style.display="",this.imageElement.setAttributeNS(Zs,"xlink:href",i.src),this.imageElement.setAttribute("height",String(i.height)),this.imageElement.setAttribute("width",String(i.width));const p=Number(i.height);i=Number(i.width);var S=!!this.borderRect_;const O=Math.max(S?this.getConstants().FIELD_DROPDOWN_BORDER_RECT_HEIGHT:0,p+di);S=S?this.getConstants().FIELD_BORDER_RECT_X_PADDING:0;let j;j=this.svgArrow?this.positionSVGArrow(i+S,O/2-this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE/2):Xe(this.arrow,this.getConstants().FIELD_TEXT_FONTSIZE,this.getConstants().FIELD_TEXT_FONTWEIGHT,this.getConstants().FIELD_TEXT_FONTFAMILY),this.size_.width=i+j+2*S,this.size_.height=O;let ve=0;a.RTL?this.imageElement.setAttribute("x",`${S+j}`):(ve=i+j,this.getTextElement().setAttribute("text-anchor","end"),this.imageElement.setAttribute("x",`${S}`)),this.imageElement.setAttribute("y",String(O/2-p/2)),this.positionTextElement_(ve+S,i+j)}renderSelectedText(){this.getTextContent().nodeValue=this.getDisplayText_();var i=this.getTextElement();$e(i,"blocklyDropdownText"),i.setAttribute("text-anchor","start");var a=!!this.borderRect_;i=Math.max(a?this.getConstants().FIELD_DROPDOWN_BORDER_RECT_HEIGHT:0,this.getConstants().FIELD_TEXT_HEIGHT);const p=Xe(this.getTextElement(),this.getConstants().FIELD_TEXT_FONTSIZE,this.getConstants().FIELD_TEXT_FONTWEIGHT,this.getConstants().FIELD_TEXT_FONTFAMILY);a=a?this.getConstants().FIELD_BORDER_RECT_X_PADDING:0;let S=0;this.svgArrow&&(S=this.positionSVGArrow(p+a,i/2-this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE/2)),this.size_.width=p+S+2*a,this.size_.height=i,this.positionTextElement_(a,p)}positionSVGArrow(i,a){if(!this.svgArrow)return 0;const p=this.getSourceBlock();if(!p)throw new Ro;const S=this.borderRect_?this.getConstants().FIELD_BORDER_RECT_X_PADDING:0,O=this.getConstants().FIELD_DROPDOWN_SVG_ARROW_PADDING,j=this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE;return this.svgArrow.setAttribute("transform","translate("+(p.RTL?S:i+O)+","+a+")"),j+O}getText_(){if(!this.selectedOption)return null;const i=this.selectedOption[0];return typeof i=="object"?i.alt:i}static fromJson(i){if(!i.options)throw Error("options are required for the dropdown field. The options property must be assigned an array of [humanReadableValue, languageNeutralValue] tuples.");return new this(i.options,void 0,i)}};Ah.CHECKMARK_OVERHANG=25,Ah.MAX_MENU_HEIGHT_VH=.45,Ah.ARROW_CHAR="▾";var ri=5,di=2*ri;xs("field_dropdown",Ah);var td,As=class{constructor(i,a,p){this.workspace=i,this.anchor=a,this.ownerRect=p,this.size=new eo(0,0),this.colour="#ffffff",this.disposed=!1,this.relativeLeft=this.relativeTop=0,this.svgRoot=se(Ve.G,{},i.getBubbleCanvas()),i=se(Ve.G,{filter:`url(#${this.workspace.getRenderer().getConstants().embossFilterId})`},this.svgRoot),this.tail=se(Ve.PATH,{},i),this.background=se(Ve.RECT,{class:"blocklyDraggable",x:0,y:0,rx:td.BORDER_WIDTH,ry:td.BORDER_WIDTH},i),this.contentContainer=se(Ve.G,{},this.svgRoot),Ce(this.background,"pointerdown",this,this.onMouseDown)}dispose(){pt(this.svgRoot),this.disposed=!0}setAnchorLocation(i,a=!1){this.anchor=i,a?this.positionByRect(this.ownerRect):this.positionRelativeToAnchor(),this.renderTail()}setPositionRelativeToAnchor(i,a){this.relativeLeft=i,this.relativeTop=a,this.positionRelativeToAnchor(),this.renderTail()}getSize(){return this.size}setSize(i,a=!1){i.width=Math.max(i.width,td.MIN_SIZE),i.height=Math.max(i.height,td.MIN_SIZE),this.size=i,this.background.setAttribute("width",`${i.width}`),this.background.setAttribute("height",`${i.height}`),a?this.positionByRect(this.ownerRect):this.positionRelativeToAnchor(),this.renderTail()}getColour(){return this.colour}setColour(i){this.colour=i,this.tail.setAttribute("fill",i),this.background.setAttribute("fill",i)}onMouseDown(i){let a;(a=this.workspace.getGesture(i))==null||a.handleBubbleStart(i,this)}positionRelativeToAnchor(){let i=this.anchor.x;i=this.workspace.RTL?i-(this.relativeLeft+this.size.width):i+this.relativeLeft,this.moveTo(i,this.relativeTop+this.anchor.y)}moveTo(i,a){this.svgRoot.setAttribute("transform",`translate(${i}, ${a})`)}positionByRect(i=new Oi(0,0,0,0)){var a=this.workspace.getMetricsManager().getViewMetrics(!0),p=this.getOptimalRelativeLeft(a),S=this.getOptimalRelativeTop(a);const O={x:p,y:-this.size.height-this.workspace.getRenderer().getConstants().MIN_BLOCK_HEIGHT},j={x:-this.size.width-30,y:S};S={x:i.getWidth(),y:S};var ve={x:p,y:i.getHeight()};p=i.getWidth()i.width)return a;if(i=this.getWorkspaceViewRect(i),this.workspace.RTL){var p=this.anchor.x-a;p-this.size.widthi.right&&(a=-(i.right-this.anchor.x))}else{p=a+this.anchor.x;const S=p+this.size.width;pi.right&&(a=i.right-this.anchor.x-this.size.width)}return a}getOptimalRelativeTop(i){let a=-this.size.height/4;if(this.size.height>i.height)return a;const p=this.anchor.y+a,S=p+this.size.height;return i=this.getWorkspaceViewRect(i),pi.bottom&&(a=i.bottom-this.anchor.y-this.size.height),a}getWorkspaceViewRect(i){const a=i.top;let p=i.top+i.height,S=i.left;return i=i.left+i.width,p-=this.getScrollbarThickness(),this.workspace.RTL?S-=this.getScrollbarThickness():i-=this.getScrollbarThickness(),new Oi(a,p,S,i)}getScrollbarThickness(){return xa.scrollbarThickness/this.workspace.scale}renderTail(){const i=[];var a=this.size.width/2,p=this.size.height/2,S=-this.relativeLeft,O=-this.relativeTop;if(a===S&&p===O)i.push("M "+a+","+p);else{O-=p,S-=a,this.workspace.RTL&&(S*=-1);var j=Math.sqrt(O*O+S*S),ve=Math.acos(S/j);0>O&&(ve=2*Math.PI-ve);var Ue=ve+Math.PI/2;Ue>2*Math.PI&&(Ue-=2*Math.PI);var Yt=Math.sin(Ue);const bl=Math.cos(Ue);let Qa=(this.size.width+this.size.height)/td.TAIL_THICKNESS;Qa=Math.min(Qa,this.size.width,this.size.height)/4,Ue=1-td.ANCHOR_RADIUS/j,S=a+Ue*S,O=p+Ue*O,Ue=a+Qa*bl;const Fp=p+Qa*Yt;a-=Qa*bl,p-=Qa*Yt,Yt=Uc(this.workspace.RTL?-td.TAIL_ANGLE:td.TAIL_ANGLE),Yt=ve+Yt,Yt>2*Math.PI&&(Yt-=2*Math.PI),ve=Math.sin(Yt)*j/td.TAIL_BEND,j=Math.cos(Yt)*j/td.TAIL_BEND,i.push("M"+Ue+","+Fp),i.push("C"+(Ue+j)+","+(Fp+ve)+" "+S+","+O+" "+S+","+O),i.push("C"+S+","+O+" "+(a+j)+","+(p+ve)+" "+a+","+p)}i.push("z");let jn;(jn=this.tail)==null||jn.setAttribute("d",i.join(" "))}bringToFront(){let i;const a=(i=this.svgRoot)==null?void 0:i.parentNode;return this.svgRoot&&(a==null?void 0:a.lastChild)!==this.svgRoot?(a==null||a.appendChild(this.svgRoot),!0):!1}getRelativeToSurfaceXY(){return new _n(this.workspace.RTL?-this.relativeLeft+this.anchor.x-this.size.width:this.anchor.x+this.relativeLeft,this.anchor.y+this.relativeTop)}getSvgRoot(){return this.svgRoot}moveDuringDrag(i){this.moveTo(i.x,i.y),this.relativeLeft=this.workspace.RTL?this.anchor.x-i.x-this.size.width:i.x-this.anchor.x,this.relativeTop=i.y-this.anchor.y,this.renderTail()}setDragging(i){}setDeleteStyle(i){}isDeletable(){return!1}showContextMenu(i){}};td=As,As.BORDER_WIDTH=6,As.DOUBLE_BORDER=2*td.BORDER_WIDTH,As.MIN_SIZE=td.DOUBLE_BORDER,As.TAIL_THICKNESS=1,As.TAIL_ANGLE=20,As.TAIL_BEND=4,As.ANCHOR_RADIUS=8;var _m=class extends As{constructor(i,a,p,S){super(a,p,S),this.workspace=a,this.anchor=p,this.ownerRect=S,this.autoLayout=!0,a=new Hi(i),this.validateWorkspaceOptions(a),this.svgDialog=se(Ve.SVG,{x:As.BORDER_WIDTH,y:As.BORDER_WIDTH},this.contentContainer),i.parentWorkspace=this.workspace,this.miniWorkspace=this.newWorkspaceSvg(new Hi(i)),this.miniWorkspace.internalIsMutator=!0,i=this.miniWorkspace.createDom("blocklyMutatorBackground"),this.svgDialog.appendChild(i),a.languageTree&&(i.insertBefore(this.miniWorkspace.addFlyout(Ve.G),this.miniWorkspace.getCanvas()),i=this.miniWorkspace.getFlyout(),i==null||i.init(this.miniWorkspace),i==null||i.show(a.languageTree)),this.miniWorkspace.addChangeListener(this.onWorkspaceChange.bind(this));let O,j;(O=this.miniWorkspace.getFlyout())==null||(j=O.getWorkspace())==null||j.addChangeListener(this.onWorkspaceChange.bind(this)),this.updateBubbleSize()}dispose(){this.miniWorkspace.dispose(),super.dispose()}getWorkspace(){return this.miniWorkspace}addWorkspaceChangeListener(i){this.miniWorkspace.addChangeListener(i)}validateWorkspaceOptions(i){if(i.hasCategories)throw Error("The miniworkspace bubble does not support toolboxes with categories");if(i.hasTrashcan)throw Error("The miniworkspace bubble does not support trashcans");if(i.zoomOptions.controls||i.zoomOptions.wheel||i.zoomOptions.pinch)throw Error("The miniworkspace bubble does not support zooming");if(i.moveOptions.scrollbars||i.moveOptions.wheel||i.moveOptions.drag)throw Error("The miniworkspace bubble does not scrolling/moving the workspace");if(i.horizontalLayout)throw Error("The miniworkspace bubble does not support horizontal layouts")}onWorkspaceChange(){this.bumpBlocksIntoBounds(),this.updateBubbleSize()}bumpBlocksIntoBounds(){if(!this.miniWorkspace.isDragging())for(const i of this.miniWorkspace.getTopBlocks(!1)){const a=i.getRelativeToSurfaceXY();if(20>a.y&&i.moveBy(0,20-a.y),i.RTL){let p=-20;const S=this.miniWorkspace.getFlyout();S&&(p-=S.getWidth()),a.x>p&&i.moveBy(p-a.x,0)}else 20>a.x&&i.moveBy(20-a.x,0)}}updateBubbleSize(){if(!this.miniWorkspace.isDragging()){var i=this.getSize(),a=this.calculateWorkspaceSize();Math.abs(i.width-a.width)<_m.MINIMUM_VIEW_CHANGE&&Math.abs(i.height-a.height)<_m.MINIMUM_VIEW_CHANGE||(this.svgDialog.setAttribute("width",`${a.width}px`),this.svgDialog.setAttribute("height",`${a.height}px`),this.miniWorkspace.setCachedParentSvgSize(a.width,a.height),this.miniWorkspace.RTL&&this.miniWorkspace.getCanvas().setAttribute("transform",`translate(${a.width}, 0)`),this.setSize(new eo(a.width+As.DOUBLE_BORDER,a.height+As.DOUBLE_BORDER),this.autoLayout),this.miniWorkspace.resize(),this.miniWorkspace.recordDragTargets())}}calculateWorkspaceSize(){var i=this.miniWorkspace.getCanvas().getBBox();let a=i.width+_m.MARGIN;i=i.height+_m.MARGIN;const p=this.miniWorkspace.getFlyout();if(p){const S=p.getWorkspace().getMetricsManager().getScrollMetrics();i=Math.max(i,S.height+20),a+=p.getWidth()}return new eo(a,i)}updateBlockStyles(){for(var i of this.miniWorkspace.getAllBlocks(!1))i.setStyle(i.getStyleName());let a;if(i=(a=this.miniWorkspace.getFlyout())==null?void 0:a.getWorkspace())for(const p of i.getAllBlocks(!1))p.setStyle(p.getStyleName())}moveDuringDrag(i){super.moveDuringDrag(i),this.autoLayout=!1}moveTo(i,a){super.moveTo(i,a),this.miniWorkspace.recordDragTargets()}newWorkspaceSvg(i){throw Error("The implementation of newWorkspaceSvg should be monkey-patched in by blockly.ts")}};_m.MINIMUM_VIEW_CHANGE=10,_m.MARGIN=3*As.DOUBLE_BORDER;var Dv,Pv;Dv=17,Pv=16,t.MutatorIcon$$module$build$src$core$icons$mutator_icon=class extends Nv{constructor(i,a){super(a),this.flyoutBlockTypes=i,this.sourceBlock=a,this.saveConnectionsListener=this.updateWorkspacePid=this.rootBlock=this.miniWorkspaceBubble=null}getType(){return t.MutatorIcon$$module$build$src$core$icons$mutator_icon.TYPE}initView(i){this.svgRoot||(super.initView(i),se(Ve.RECT,{class:"blocklyIconShape",rx:"4",ry:"4",height:"16",width:"16"},this.svgRoot),se(Ve.PATH,{class:"blocklyIconSymbol",d:"m4.203,7.296 0,1.368 -0.92,0.677 -0.11,0.41 0.9,1.559 0.41,0.11 1.043,-0.457 1.187,0.683 0.127,1.134 0.3,0.3 1.8,0 0.3,-0.299 0.127,-1.138 1.185,-0.682 1.046,0.458 0.409,-0.11 0.9,-1.559 -0.11,-0.41 -0.92,-0.677 0,-1.366 0.92,-0.677 0.11,-0.41 -0.9,-1.559 -0.409,-0.109 -1.046,0.458 -1.185,-0.682 -0.127,-1.138 -0.3,-0.299 -1.8,0 -0.3,0.3 -0.126,1.135 -1.187,0.682 -1.043,-0.457 -0.41,0.11 -0.899,1.559 0.108,0.409z"},this.svgRoot),se(Ve.CIRCLE,{class:"blocklyIconShape",r:"2.7",cx:"8",cy:"8"},this.svgRoot),$e(this.svgRoot,"blockly-icon-mutator"))}dispose(){super.dispose();let i;(i=this.miniWorkspaceBubble)==null||i.dispose()}getWeight(){return t.MutatorIcon$$module$build$src$core$icons$mutator_icon.WEIGHT}getSize(){return new eo(Dv,Dv)}applyColour(){super.applyColour();let i;(i=this.miniWorkspaceBubble)==null||i.setColour(this.sourceBlock.style.colourPrimary);let a;(a=this.miniWorkspaceBubble)==null||a.updateBlockStyles()}updateCollapsed(){super.updateCollapsed(),this.sourceBlock.isCollapsed()&&this.setBubbleVisible(!1)}onLocationChange(i){super.onLocationChange(i);let a;(a=this.miniWorkspaceBubble)==null||a.setAnchorLocation(this.getAnchorLocation())}onClick(){super.onClick(),this.sourceBlock.isEditable()&&this.setBubbleVisible(!this.bubbleIsVisible())}isClickableInFlyout(){return!1}bubbleIsVisible(){return!!this.miniWorkspaceBubble}setBubbleVisible(i){if(this.bubbleIsVisible()!==i){if(i){this.miniWorkspaceBubble=new _m(this.getMiniWorkspaceConfig(),this.sourceBlock.workspace,this.getAnchorLocation(),this.getBubbleOwnerRect()),this.applyColour(),this.createRootBlock(),this.addSaveConnectionsListener();let a;(a=this.miniWorkspaceBubble)==null||a.addWorkspaceChangeListener(this.createMiniWorkspaceChangeListener())}else{let a;(a=this.miniWorkspaceBubble)==null||a.dispose(),this.miniWorkspaceBubble=null,this.saveConnectionsListener&&this.sourceBlock.workspace.removeChangeListener(this.saveConnectionsListener),this.saveConnectionsListener=null}ue(new(Ie(vo))(this.sourceBlock,i,"mutator"))}}getMiniWorkspaceConfig(){let i;const a={disable:!1,media:this.sourceBlock.workspace.options.pathToMedia,rtl:this.sourceBlock.RTL,renderer:this.sourceBlock.workspace.options.renderer,rendererOverrides:(i=this.sourceBlock.workspace.options.rendererOverrides)!=null?i:void 0};return this.flyoutBlockTypes.length&&(a.toolbox={kind:"flyoutToolbox",contents:this.flyoutBlockTypes.map(p=>({kind:"block",type:p}))}),a}getAnchorLocation(){const i=Dv/2;return _n.sum(this.workspaceLocation,new _n(i,i))}getBubbleOwnerRect(){const i=this.sourceBlock.getSvgRoot().getBBox();return new Oi(i.y,i.y+i.height,i.x,i.x+i.width)}createRootBlock(){if(!this.sourceBlock.decompose)throw Error("Blocks with mutator icons must include a decompose method");this.rootBlock=this.sourceBlock.decompose(this.miniWorkspaceBubble.getWorkspace());for(var i of this.rootBlock.getDescendants(!1))i.queueRender();this.rootBlock.setMovable(!1),this.rootBlock.setDeletable(!1);let a,p,S,O;i=(O=(a=this.miniWorkspaceBubble)==null||(p=a.getWorkspace())==null||(S=p.getFlyout())==null?void 0:S.getWidth())!=null?O:0,this.rootBlock.moveBy(this.rootBlock.RTL?-(i+Pv):Pv,Pv)}addSaveConnectionsListener(){this.sourceBlock.saveConnections&&this.rootBlock&&(this.saveConnectionsListener=()=>{this.sourceBlock.saveConnections&&this.rootBlock&&this.sourceBlock.saveConnections(this.rootBlock)},this.saveConnectionsListener(),this.sourceBlock.workspace.addChangeListener(this.saveConnectionsListener))}createMiniWorkspaceChangeListener(){return i=>{t.MutatorIcon$$module$build$src$core$icons$mutator_icon.isIgnorableMutatorEvent(i)||this.updateWorkspacePid||(this.updateWorkspacePid=setTimeout(()=>{this.updateWorkspacePid=null,this.recomposeSourceBlock()},0))}}static isIgnorableMutatorEvent(i){return i.isUiEvent||i.type===t.CREATE$$module$build$src$core$events$utils||i.type===t.CHANGE$$module$build$src$core$events$utils&&i.element==="disabled"}recomposeSourceBlock(){if(this.rootBlock){if(!this.sourceBlock.compose)throw Error("Blocks with mutator icons must include a compose method");var i=t.getGroup$$module$build$src$core$events$utils();i||t.setGroup$$module$build$src$core$events$utils(!0);var a=Jr.getExtraBlockState_(this.sourceBlock);this.sourceBlock.compose(this.rootBlock);var p=Jr.getExtraBlockState_(this.sourceBlock);a!==p&&ue(new(Ie(t.CHANGE$$module$build$src$core$events$utils))(this.sourceBlock,"mutation",null,a,p)),t.setGroup$$module$build$src$core$events$utils(i)}}getWorkspace(){let i;return(i=this.miniWorkspaceBubble)==null?void 0:i.getWorkspace()}static reconnect(i,a,p){return xe("MutatorIcon.reconnect","v10","v11","connection.reconnect"),i?i.reconnect(a,p):!1}static findParentWs(i){return xe("MutatorIcon.findParentWs","v10","v11","workspace.getRootWorkspace"),i.getRootWorkspace()}},t.MutatorIcon$$module$build$src$core$icons$mutator_icon.TYPE=Wo.MUTATOR,t.MutatorIcon$$module$build$src$core$icons$mutator_icon.WEIGHT=1,t.MutatorIcon$$module$build$src$core$icons$mutator_icon;var A0=Object.create(null),SE={allExtensions:A0};t.register$$module$build$src$core$extensions("parent_tooltip_when_inline",Gs);var Xd={TEST_ONLY:SE};Xd.apply=es,Xd.buildTooltipForDropdown=t.buildTooltipForDropdown$$module$build$src$core$extensions,Xd.buildTooltipWithFieldText=t.buildTooltipWithFieldText$$module$build$src$core$extensions,Xd.isRegistered=hi,Xd.register=t.register$$module$build$src$core$extensions,Xd.registerMixin=t.registerMixin$$module$build$src$core$extensions,Xd.registerMutator=t.registerMutator$$module$build$src$core$extensions,Xd.runAfterPageLoad=Ld,Xd.unregister=Ri;var Hr;(function(i){i[i.WIN_KEY_FF_LINUX=0]="WIN_KEY_FF_LINUX",i[i.MAC_ENTER=3]="MAC_ENTER",i[i.BACKSPACE=8]="BACKSPACE",i[i.TAB=9]="TAB",i[i.NUM_CENTER=12]="NUM_CENTER",i[i.ENTER=13]="ENTER",i[i.SHIFT=16]="SHIFT",i[i.CTRL=17]="CTRL",i[i.ALT=18]="ALT",i[i.PAUSE=19]="PAUSE",i[i.CAPS_LOCK=20]="CAPS_LOCK",i[i.ESC=27]="ESC",i[i.SPACE=32]="SPACE",i[i.PAGE_UP=33]="PAGE_UP",i[i.PAGE_DOWN=34]="PAGE_DOWN",i[i.END=35]="END",i[i.HOME=36]="HOME",i[i.LEFT=37]="LEFT",i[i.UP=38]="UP",i[i.RIGHT=39]="RIGHT",i[i.DOWN=40]="DOWN",i[i.PLUS_SIGN=43]="PLUS_SIGN",i[i.PRINT_SCREEN=44]="PRINT_SCREEN",i[i.INSERT=45]="INSERT",i[i.DELETE=46]="DELETE",i[i.ZERO=48]="ZERO",i[i.ONE=49]="ONE",i[i.TWO=50]="TWO",i[i.THREE=51]="THREE",i[i.FOUR=52]="FOUR",i[i.FIVE=53]="FIVE",i[i.SIX=54]="SIX",i[i.SEVEN=55]="SEVEN",i[i.EIGHT=56]="EIGHT",i[i.NINE=57]="NINE",i[i.FF_SEMICOLON=59]="FF_SEMICOLON",i[i.FF_EQUALS=61]="FF_EQUALS",i[i.FF_DASH=173]="FF_DASH",i[i.FF_HASH=163]="FF_HASH",i[i.QUESTION_MARK=63]="QUESTION_MARK",i[i.AT_SIGN=64]="AT_SIGN",i[i.A=65]="A",i[i.B=66]="B",i[i.C=67]="C",i[i.D=68]="D",i[i.E=69]="E",i[i.F=70]="F",i[i.G=71]="G",i[i.H=72]="H",i[i.I=73]="I",i[i.J=74]="J",i[i.K=75]="K",i[i.L=76]="L",i[i.M=77]="M",i[i.N=78]="N",i[i.O=79]="O",i[i.P=80]="P",i[i.Q=81]="Q",i[i.R=82]="R",i[i.S=83]="S",i[i.T=84]="T",i[i.U=85]="U",i[i.V=86]="V",i[i.W=87]="W",i[i.X=88]="X",i[i.Y=89]="Y",i[i.Z=90]="Z",i[i.META=91]="META",i[i.WIN_KEY_RIGHT=92]="WIN_KEY_RIGHT",i[i.CONTEXT_MENU=93]="CONTEXT_MENU",i[i.NUM_ZERO=96]="NUM_ZERO",i[i.NUM_ONE=97]="NUM_ONE",i[i.NUM_TWO=98]="NUM_TWO",i[i.NUM_THREE=99]="NUM_THREE",i[i.NUM_FOUR=100]="NUM_FOUR",i[i.NUM_FIVE=101]="NUM_FIVE",i[i.NUM_SIX=102]="NUM_SIX",i[i.NUM_SEVEN=103]="NUM_SEVEN",i[i.NUM_EIGHT=104]="NUM_EIGHT",i[i.NUM_NINE=105]="NUM_NINE",i[i.NUM_MULTIPLY=106]="NUM_MULTIPLY",i[i.NUM_PLUS=107]="NUM_PLUS",i[i.NUM_MINUS=109]="NUM_MINUS",i[i.NUM_PERIOD=110]="NUM_PERIOD",i[i.NUM_DIVISION=111]="NUM_DIVISION",i[i.F1=112]="F1",i[i.F2=113]="F2",i[i.F3=114]="F3",i[i.F4=115]="F4",i[i.F5=116]="F5",i[i.F6=117]="F6",i[i.F7=118]="F7",i[i.F8=119]="F8",i[i.F9=120]="F9",i[i.F10=121]="F10",i[i.F11=122]="F11",i[i.F12=123]="F12",i[i.NUMLOCK=144]="NUMLOCK",i[i.SCROLL_LOCK=145]="SCROLL_LOCK",i[i.FIRST_MEDIA_KEY=166]="FIRST_MEDIA_KEY",i[i.LAST_MEDIA_KEY=183]="LAST_MEDIA_KEY",i[i.SEMICOLON=186]="SEMICOLON",i[i.DASH=189]="DASH",i[i.EQUALS=187]="EQUALS",i[i.COMMA=188]="COMMA",i[i.PERIOD=190]="PERIOD",i[i.SLASH=191]="SLASH",i[i.APOSTROPHE=192]="APOSTROPHE",i[i.TILDE=192]="TILDE",i[i.SINGLE_QUOTE=222]="SINGLE_QUOTE",i[i.OPEN_SQUARE_BRACKET=219]="OPEN_SQUARE_BRACKET",i[i.BACKSLASH=220]="BACKSLASH",i[i.CLOSE_SQUARE_BRACKET=221]="CLOSE_SQUARE_BRACKET",i[i.WIN_KEY=224]="WIN_KEY",i[i.MAC_FF_META=224]="MAC_FF_META",i[i.MAC_WK_CMD_LEFT=91]="MAC_WK_CMD_LEFT",i[i.MAC_WK_CMD_RIGHT=93]="MAC_WK_CMD_RIGHT",i[i.WIN_IME=229]="WIN_IME",i[i.VK_NONAME=252]="VK_NONAME",i[i.PHANTOM=255]="PHANTOM"})(Hr||(Hr={}));var Kd={};Kd.arc=mi,Kd.curve=Ws,Kd.line=Fo,Kd.lineOnAxis=xn,Kd.lineTo=iu,Kd.moveBy=Ui,Kd.moveTo=Js,Kd.point=Kn;var qa={};qa.Coordinate=_n,qa.KeyCodes=Hr,qa.Rect=Oi,qa.Size=eo,qa.Svg=Ve,qa.aria=Ou,qa.array=em,qa.browserEvents=th,qa.colour=bf,qa.deprecation=Mg,qa.dom=Ea,qa.extensions=Xd,qa.idGenerator=nc,qa.math=dm,qa.object=mT,qa.parsing=M_,qa.string=Dn,qa.style=$c,qa.svgMath=xp,qa.svgPaths=Kd,qa.toolbox=yo,qa.userAgent=pf,qa.xml=Bd;var A_={};A_.register=gi,A_.unregister=Uf;var vm=class extends As{constructor(i,a,p,S){super(a,p,S),this.text=i,this.workspace=a,this.anchor=p,this.ownerRect=S,this.paragraph=this.stringToSvg(i,this.contentContainer),this.updateBubbleSize()}getText(){return this.text}setText(i){this.text=i,pt(this.paragraph),this.paragraph=this.stringToSvg(i,this.contentContainer),this.updateBubbleSize()}stringToSvg(i,a){return a=this.createParagraph(a),i=this.createSpans(a,i),this.workspace.RTL&&this.rightAlignSpans(a.getBBox().width,i),a}createParagraph(i){return se(Ve.TEXT,{class:"blocklyText blocklyBubbleText blocklyNoPointerEvents",y:As.BORDER_WIDTH},i)}createSpans(i,a){return a.split(` -`).map(p=>{const S=se(Ve.TSPAN,{dy:"1em",x:As.BORDER_WIDTH},i);return p=document.createTextNode(p),S.appendChild(p),S})}rightAlignSpans(i,a){for(const p of a)p.setAttribute("text-anchor","end"),p.setAttribute("x",`${i+As.BORDER_WIDTH}`)}updateBubbleSize(){const i=this.paragraph.getBBox();this.setSize(new eo(i.width+2*As.BORDER_WIDTH,i.height+2*As.BORDER_WIDTH),!0)}},aa=class extends As{constructor(i,a,p){super(i,a,p),this.workspace=i,this.anchor=a,this.ownerRect=p,this.resizePointerMoveListener=this.resizePointerUpListener=null,this.textChangeListeners=[],this.sizeChangeListeners=[],this.text="",this.DEFAULT_SIZE=new eo(160+As.DOUBLE_BORDER,80+As.DOUBLE_BORDER),this.MIN_SIZE=new eo(45+As.DOUBLE_BORDER,20+As.DOUBLE_BORDER),{inputRoot:this.inputRoot,textArea:this.textArea}=this.createEditor(this.contentContainer),this.resizeGroup=this.createResizeHandle(this.svgRoot),this.setSize(this.DEFAULT_SIZE,!0)}getText(){return this.text}setText(i){this.text=i,this.textArea.value=i,this.onTextChange()}addTextChangeListener(i){this.textChangeListeners.push(i)}addSizeChangeListener(i){this.sizeChangeListeners.push(i)}createEditor(i){i=se(Ve.FOREIGNOBJECT,{x:As.BORDER_WIDTH,y:As.BORDER_WIDTH},i);const a=document.createElementNS(xc,"body");a.setAttribute("xmlns",xc),a.className="blocklyMinimalBody";const p=document.createElementNS(xc,"textarea");return p.className="blocklyCommentTextarea",p.setAttribute("dir",this.workspace.RTL?"RTL":"LTR"),a.appendChild(p),i.appendChild(a),this.bindTextAreaEvents(p),setTimeout(()=>{p.focus()},0),{inputRoot:i,textArea:p}}bindTextAreaEvents(i){Ce(i,"wheel",this,a=>{a.stopPropagation()}),Ce(i,"focus",this,this.onStartEdit,!0),Ce(i,"change",this,this.onTextChange)}createResizeHandle(i){i=se(Ve.G,{class:this.workspace.RTL?"blocklyResizeSW":"blocklyResizeSE"},i);const a=2*As.BORDER_WIDTH;return se(Ve.POLYGON,{points:`0,${a} ${a},${a} ${a},0`},i),se(Ve.LINE,{class:"blocklyResizeLine",x1:a/3,y1:a-1,x2:a-1,y2:a/3},i),se(Ve.LINE,{class:"blocklyResizeLine",x1:2*a/3,y1:a-1,x2:a-1,y2:2*a/3},i),Ce(i,"pointerdown",this,this.onResizePointerDown),i}setSize(i,a=!1){i.width=Math.max(i.width,this.MIN_SIZE.width),i.height=Math.max(i.height,this.MIN_SIZE.height);const p=i.width-As.DOUBLE_BORDER,S=i.height-As.DOUBLE_BORDER;this.inputRoot.setAttribute("width",`${p}`),this.inputRoot.setAttribute("height",`${S}`),this.textArea.style.width=`${p-4}px`,this.textArea.style.height=`${S-4}px`,this.workspace.RTL?this.resizeGroup.setAttribute("transform",`translate(${As.DOUBLE_BORDER}, ${S}) scale(-1 1)`):this.resizeGroup.setAttribute("transform",`translate(${p}, ${S})`),super.setSize(i,a),this.onSizeChange()}getSize(){return super.getSize()}onResizePointerDown(i){this.bringToFront(),Nt(i)||(this.workspace.startDrag(i,new _n(this.workspace.RTL?-this.getSize().width:this.getSize().width,this.getSize().height)),this.resizePointerUpListener=Ce(document,"pointerup",this,this.onResizePointerUp),this.resizePointerMoveListener=Ce(document,"pointermove",this,this.onResizePointerMove),this.workspace.hideChaff()),i.stopPropagation()}onResizePointerUp(i){nt(),this.resizePointerUpListener&&(rt(this.resizePointerUpListener),this.resizePointerUpListener=null),this.resizePointerMoveListener&&(rt(this.resizePointerMoveListener),this.resizePointerMoveListener=null)}onResizePointerMove(i){i=this.workspace.moveDrag(i),this.setSize(new eo(this.workspace.RTL?-i.x:i.x,i.y),!1),this.onSizeChange()}onStartEdit(){this.bringToFront()&&this.textArea.focus()}onTextChange(){this.text=this.textArea.value;for(const i of this.textChangeListeners)i()}onSizeChange(){for(const i of this.sizeChangeListeners)i()}};At(` +children`),this.state=i}},Wf=class extends $a{constructor(i,a,p){super(`Cannot add an icon of type '${i}' to the block ${a.toDevString()}, because there is no icon registered with type '${i}'. Make sure that all of your icons have been registered.`),this.block=a,this.state=p}},Ap={};Ap.BadConnectionCheck=y0,Ap.DeserializationError=$a,Ap.MissingBlockType=E_,Ap.MissingConnection=am,Ap.RealChildOfShadow=Iv,Ap.UnregisteredIcon=Wf;var b0=100,Ip=75,T0=50,lm={BLOCKS:T0,PROCEDURES:Ip,VARIABLES:b0},S0={};S0.register=Rs,S0.unregister=bi;var x_=class{constructor(){this.priority=T0}save(i){const a=[];for(const p of i.getTopBlocks(!1))(i=$i(p,{addCoordinates:!0,doFullSerialization:!1}))&&a.push(i);return a.length?{languageVersion:0,blocks:a}:null}load(i,a){i=i.blocks;for(const p of i)Vn(p,a,{recordUndo:ae()})}clear(i){for(const a of i.getTopBlocks(!1))a.dispose(!1)}};Rs("blocks",new x_);var um={};um.BlockSerializer=x_,um.append=Vn,um.appendInternal=Mi,um.save=$i;var vf=class extends d{constructor(i){super(),this.isBlank=!i,i&&(this.blockId=i.id,this.workspaceId=i.workspace.id)}toJson(){const i=super.toJson();if(!this.blockId)throw Error("The block ID is undefined. Either pass a block to the constructor, or call fromJson");return i.blockId=this.blockId,i}static fromJson(i,a,p){return a=super.fromJson(i,a,p??new vf),a.blockId=i.blockId,a}},$_=class extends vf{constructor(i){super(i),this.type=t.CREATE$$module$build$src$core$events$utils,i&&(i.isShadow()&&(this.recordUndo=!1),this.xml=Tr(i),this.ids=Te(i),this.json=$i(i,{addCoordinates:!0}))}toJson(){const i=super.toJson();if(!this.xml)throw Error("The block XML is undefined. Either pass a block to the constructor, or call fromJson");if(!this.ids)throw Error("The block IDs are undefined. Either pass a block to the constructor, or call fromJson");if(!this.json)throw Error("The block JSON is undefined. Either pass a block to the constructor, or call fromJson");return i.xml=Qi(this.xml),i.ids=this.ids,i.json=this.json,this.recordUndo||(i.recordUndo=this.recordUndo),i}static fromJson(i,a,p){return a=super.fromJson(i,a,p??new $_),a.xml=t.textToDom$$module$build$src$core$utils$xml(i.xml),a.ids=i.ids,a.json=i.json,i.recordUndo!==void 0&&(a.recordUndo=i.recordUndo),a}run(i){const a=this.getEventWorkspace_();if(!this.json)throw Error("The block JSON is undefined. Either pass a block to the constructor, or call fromJson");if(!this.ids)throw Error("The block IDs are undefined. Either pass a block to the constructor, or call fromJson");if(!ib(a,this.ids))if(i)Vn(this.json,a);else for(i=0;ii.getBlockById(p)).filter(p=>p&&p.isShadow()).length===a.length};r(Ft.EVENT,t.CREATE$$module$build$src$core$events$utils,$_);var w0=class extends _{constructor(i,a){super(a),this.type=uu,this.themeName=i}toJson(){const i=super.toJson();if(!this.themeName)throw Error("The theme name is undefined. Either pass a theme name to the constructor, or call fromJson");return i.themeName=this.themeName,i}static fromJson(i,a,p){return a=super.fromJson(i,a,p??new w0),a.themeName=i.themeName,a}};r(Ft.EVENT,uu,w0);var E0=class extends _{constructor(i,a,p,S,O){super(S),this.type=ni,this.viewTop=i,this.viewLeft=a,this.scale=p,this.oldScale=O}toJson(){const i=super.toJson();if(this.viewTop===void 0)throw Error("The view top is undefined. Either pass a value to the constructor, or call fromJson");if(this.viewLeft===void 0)throw Error("The view left is undefined. Either pass a value to the constructor, or call fromJson");if(this.scale===void 0)throw Error("The scale is undefined. Either pass a value to the constructor, or call fromJson");if(this.oldScale===void 0)throw Error("The old scale is undefined. Either pass a value to the constructor, or call fromJson");return i.viewTop=this.viewTop,i.viewLeft=this.viewLeft,i.scale=this.scale,i.oldScale=this.oldScale,i}static fromJson(i,a,p){return a=super.fromJson(i,a,p??new E0),a.viewTop=i.viewTop,a.viewLeft=i.viewLeft,a.scale=i.scale,a.oldScale=i.oldScale,a}};r(Ft.EVENT,ni,E0);var Vf;Vf=28,t.config$$module$build$src$core$config={dragRadius:5,flyoutDragRadius:10,snapRadius:Vf,connectingSnapRadius:Vf,currentConnectionPreference:8,bumpDelay:250},t.config$$module$build$src$core$config;var Un;(function(i){i[i.INPUT_VALUE=1]="INPUT_VALUE",i[i.OUTPUT_VALUE=2]="OUTPUT_VALUE",i[i.NEXT_STATEMENT=3]="NEXT_STATEMENT",i[i.PREVIOUS_STATEMENT=4]="PREVIOUS_STATEMENT"})(Un||(Un={}));var sh=class{constructor(i){this.connectionChecker=i,this.connections=[]}addConnection(i,a){a=this.calculateIndexForYPos(a),this.connections.splice(a,0,i)}findIndexOfConnection(i,a){if(!this.connections.length)return-1;const p=this.calculateIndexForYPos(a);if(p>=this.connections.length)return-1;a=i.y;let S=p;for(;0<=S&&this.connections[S].y===a;){if(this.connections[S]===i)return S;S--}for(S=p;Si)p=S;else{a=S;break}}return a}removeConnection(i,a){if(i=this.findIndexOfConnection(i,a),i===-1)throw Error("Unable to find connection in connectionDB.");this.connections.splice(i,1)}getNeighbours(i,a){function p(jn){const bl=O-S[jn].x,Qa=j-S[jn].y;return Math.sqrt(bl*bl+Qa*Qa)<=a&&Yt.push(S[jn]),Qai?this.menuItems.length:i,-1)}highlightFirst(){this.highlightHelper(-1,1)}highlightLast(){this.highlightHelper(this.menuItems.length,-1)}highlightHelper(i,a){i+=a;let p;for(;p=this.menuItems[i];){if(p.isEnabled()){this.setHighlighted(p);break}i+=a}}handleMouseOver(i){(i=this.getMenuItem(i.target))&&(i.isEnabled()?this.highlightedItem!==i&&this.setHighlighted(i):this.setHighlighted(null))}handleClick(i){const a=this.openingCoords;if(this.openingCoords=null,a&&typeof i.clientX=="number"){const p=new _n(i.clientX,i.clientY);if(1>_n.distance(a,p))return}(i=this.getMenuItem(i.target))&&i.performAction()}handleMouseEnter(i){this.focus()}handleMouseLeave(i){this.getElement()&&(this.blur(),this.setHighlighted(null))}handleKeyEvent(i){if(this.menuItems.length&&!(i.shiftKey||i.ctrlKey||i.metaKey||i.altKey)){var a=this.highlightedItem;switch(i.key){case"Enter":case" ":a&&a.performAction();break;case"ArrowUp":this.highlightPrevious();break;case"ArrowDown":this.highlightNext();break;case"PageUp":case"Home":this.highlightFirst();break;case"PageDown":case"End":this.highlightLast();break;default:return}i.preventDefault(),i.stopPropagation()}}getSize(){const i=this.getElement(),a=qt(i);return a.height=i.scrollHeight,a}},jf=class{constructor(i,a){this.content=i,this.opt_value=a,this.enabled=!0,this.element=null,this.rightToLeft=!1,this.roleName=null,this.highlight=this.checked=this.checkable=!1,this.actionHandler=null}createDom(){const i=document.createElement("div");i.id=Z(),this.element=i,i.className="blocklyMenuItem goog-menuitem "+(this.enabled?"":"blocklyMenuItemDisabled goog-menuitem-disabled ")+(this.checked?"blocklyMenuItemSelected goog-option-selected ":"")+(this.highlight?"blocklyMenuItemHighlight goog-menuitem-highlight ":"")+(this.rightToLeft?"blocklyMenuItemRtl goog-menuitem-rtl ":"");const a=document.createElement("div");if(a.className="blocklyMenuItemContent goog-menuitem-content",this.checkable){var p=document.createElement("div");p.className="blocklyMenuItemCheckbox goog-menuitem-checkbox",a.appendChild(p)}return p=this.content,typeof this.content=="string"&&(p=document.createTextNode(this.content)),a.appendChild(p),i.appendChild(a),this.roleName&&ci(i,this.roleName),Er(i,To.SELECTED,this.checkable&&this.checked||!1),Er(i,To.DISABLED,!this.enabled),i}dispose(){this.element=null}getElement(){return this.element}getId(){return this.element.id}getValue(){let i;return(i=this.opt_value)!=null?i:null}setRightToLeft(i){this.rightToLeft=i}setRole(i){this.roleName=i}setCheckable(i){this.checkable=i}setChecked(i){this.checked=i}setHighlighted(i){this.highlight=i;const a=this.getElement();a&&this.isEnabled()&&(i?(Pe(a,"blocklyMenuItemHighlight"),Pe(a,"goog-menuitem-highlight")):(St(a,"blocklyMenuItemHighlight"),St(a,"goog-menuitem-highlight")))}isEnabled(){return this.enabled}setEnabled(i){this.enabled=i}performAction(){this.isEnabled()&&this.actionHandler&&this.actionHandler(this)}onAction(i,a){this.actionHandler=i.bind(a)}},ed=null,hm=null,Yf="blocklyWidgetDiv",Xf="",kp="",bd,yf={};yf.createDom=Bo,yf.getDiv=oo,yf.hide=Ql,yf.hideIfOwner=Wr,yf.isVisible=Fh,yf.positionWithAnchor=Sr,yf.repositionForWindowResize=cf,yf.show=ql,yf.testOnly_setDiv=Fa;var eg=null,kv={},Lg=null,Vd={};Vd.callbackFactory=t.callbackFactory$$module$build$src$core$contextmenu,Vd.commentDeleteOption=eu,Vd.commentDuplicateOption=Uh,Vd.dispose=Us,Vd.getCurrentBlock=hf,Vd.hide=Zl,Vd.setCurrentBlock=pd,Vd.show=Wu,Vd.workspaceCommentOption=zc;var Li=class{constructor(){this.registry_=new Map,this.reset()}reset(){this.registry_.clear()}register(i){if(this.registry_.has(i.id))throw Error('Menu item with ID "'+i.id+'" is already registered.');this.registry_.set(i.id,i)}unregister(i){if(!this.registry_.has(i))throw Error('Menu item with ID "'+i+'" not found.');this.registry_.delete(i)}getItem(i){let a;return(a=this.registry_.get(i))!=null?a:null}getContextMenuOptions(i,a){const p=[];for(const O of this.registry_.values())if(i===O.scopeType){var S=O.preconditionFn(a);S!=="hidden"&&(S={text:typeof O.displayText=="function"?O.displayText(a):O.displayText,enabled:S==="enabled",callback:O.callback,scope:a,weight:O.weight},p.push(S))}return p.sort(function(O,j){return O.weight-j.weight}),p}};(function(i){var a=i.ScopeType||(i.ScopeType={});a.BLOCK="block",a.WORKSPACE="workspace",i.registry=new i})(Li||(Li={})),Li.ScopeType;var dm={};dm.clamp=Fr,dm.toDegrees=is,dm.toRadians=Uc;var tg=16,Ng=1,Ov=12,ng=16,Op=.25,rg=null,Kf=null,Jf="",fm="",Si,qf,pm,mm=null,Lp=null,Dg=null,v={getBoundsInfo:function(){const i=xn(mm),a=qt(mm);return{left:i.x,right:i.x+a.width,top:i.y,bottom:i.y+a.height,width:a.width,height:a.height}},getPositionMetrics:function(i,a,p,S){const O=v.getBoundsInfo(),j=qt(Si);return a+j.heightO.top?Jn(p,S,O,j):a+j.heightdocument.documentElement.clientTop?Jn(p,S,O,j):vn(i,O,j)}},T={ANIMATION_TIME:Op,ARROW_HORIZONTAL_PADDING:Ov,ARROW_SIZE:tg,BORDER_SIZE:Ng,PADDING_Y:ng,TEST_ONLY:v};T.clearContent=bh,T.createDom=Cl,T.getContentDiv=xu,T.getOwner=tu,T.getPositionX=zr,T.hide=lo,T.hideIfOwner=Ti,T.hideWithoutAnimation=al,T.isVisible=ao,T.repositionForWindowResize=vs,T.setBoundsElement=za,T.setColour=Ad,T.show=rn,T.showPositionedByBlock=pi,T.showPositionedByField=ye;var R=null,F=null,Y={};Y.connectionUiEffect=pa,Y.disconnectUiEffect=Ks,Y.disconnectUiStop=Ua,Y.disposeUiEffect=$u;var ee=50,be=100,Xe=class{constructor(i,a){this.bubble=i,this.workspace=a,this.dragTarget_=null,this.wouldDeleteBubble_=!1,this.startXY_=this.bubble.getRelativeToSurfaceXY()}startBubbleDrag(){t.getGroup$$module$build$src$core$events$utils()||t.setGroup$$module$build$src$core$events$utils(!0),this.workspace.setResizesEnabled(!1),this.bubble.setAutoLayout&&this.bubble.setAutoLayout(!1);let i;(i=this.workspace.getLayerManager())==null||i.moveToDragLayer(this.bubble),this.bubble.setDragging&&this.bubble.setDragging(!0)}dragBubble(i,a){a=this.pixelsToWorkspaceUnits_(a),a=_n.sum(this.startXY_,a),this.bubble.moveDuringDrag(a),a=this.dragTarget_,this.dragTarget_=this.workspace.getDragTarget(i),i=this.wouldDeleteBubble_,this.wouldDeleteBubble_=this.shouldDelete_(this.dragTarget_),i!==this.wouldDeleteBubble_&&this.updateCursorDuringBubbleDrag_(),this.dragTarget_!==a&&(a&&a.onDragExit(this.bubble),this.dragTarget_&&this.dragTarget_.onDragEnter(this.bubble)),this.dragTarget_&&this.dragTarget_.onDragOver(this.bubble)}shouldDelete_(i){return i&&this.workspace.getComponentManager().hasCapability(i.id,gl.Capability.DELETE_AREA)?i.wouldDelete(this.bubble,!1):!1}updateCursorDuringBubbleDrag_(){this.bubble.setDeleteStyle(this.wouldDeleteBubble_)}endBubbleDrag(i,a){if(this.dragBubble(i,a),this.dragTarget_&&this.dragTarget_.shouldPreventMove(this.bubble)?i=this.startXY_:(i=this.pixelsToWorkspaceUnits_(a),i=_n.sum(this.startXY_,i)),this.bubble.moveTo(i.x,i.y),this.dragTarget_&&this.dragTarget_.onDrop(this.bubble),this.wouldDeleteBubble_)this.fireMoveEvent_(),this.bubble.dispose();else{if(this.bubble.setDragging){this.bubble.setDragging(!1);let p;(p=this.workspace.getLayerManager())==null||p.moveOffDragLayer(this.bubble,be)}this.fireMoveEvent_()}this.workspace.setResizesEnabled(!0),t.setGroup$$module$build$src$core$events$utils(!1)}fireMoveEvent_(){if(this.bubble instanceof zl){const i=new(Ie(Ta))(this.bubble);i.setOldCoordinate(this.startXY_),i.recordNew(),ue(i)}}pixelsToWorkspaceUnits_(i){return i=new _n(i.x/this.workspace.scale,i.y/this.workspace.scale),this.workspace.isMutator&&i.scale(1/this.workspace.options.parentWorkspace.scale),i}},lt=30,Lt=!0,en=[];en[Un.INPUT_VALUE]=Un.OUTPUT_VALUE,en[Un.OUTPUT_VALUE]=Un.INPUT_VALUE,en[Un.NEXT_STATEMENT]=Un.PREVIOUS_STATEMENT,en[Un.PREVIOUS_STATEMENT]=Un.NEXT_STATEMENT;var hn="RENAME_VARIABLE_ID",an="DELETE_VARIABLE_ID",Dn={};Dn.commonWordPrefix=mc,Dn.commonWordSuffix=Zo,Dn.isNumber=t.isNumber$$module$build$src$core$utils$string,Dn.shortestStringLength=Th,Dn.startsWith=Hh,Dn.wrap=t.wrap$$module$build$src$core$utils$string;var Zn=void 0,ir=!1,Io=!1,xt=50,dt=0,Et=0,Sn=0,lr=0,nr=null,fr=null,Lr=0,Ul=10,ds=10,Qf=750,$0=5,Lu=null,jd={HOVER_MS:Qf,LIMIT:xt,MARGINS:$0,OFFSET_X:Lr,OFFSET_Y:Ul,RADIUS_OK:ds};jd.bindMouseEvents=zi,jd.block=Rd,jd.createDom=Vh,jd.dispose=Id,jd.getCustomTooltip=ju,jd.getDiv=ea,jd.getTooltipOfObject=uo,jd.hide=Al,jd.isVisible=md,jd.setCustomTooltip=gc,jd.unbindMouseEvents=gd,jd.unblock=jh;var mT=class{constructor(i){this.workspace=i,this.horizontalScrollEnabled_=this.workspace.isMovableHorizontally(),this.verticalScrollEnabled_=this.workspace.isMovableVertically(),this.startScrollXY_=new _n(i.scrollX,i.scrollY)}dispose(){this.workspace=null}startDrag(){L()&&L().unselect()}endDrag(i){this.drag(i)}drag(i){if(i=_n.sum(this.startScrollXY_,i),this.horizontalScrollEnabled_&&this.verticalScrollEnabled_)this.workspace.scroll(i.x,i.y);else if(this.horizontalScrollEnabled_)this.workspace.scroll(i.x,this.workspace.scrollY);else if(this.verticalScrollEnabled_)this.workspace.scroll(this.workspace.scrollX,i.y);else throw new TypeError("Invalid state.")}},bE=5,TE=6,gm=class{constructor(i,a){this.creatorWorkspace=a,this.mouseDownXY=new _n(0,0),this.startWorkspace_=this.targetBlock=this.startBlock=this.startIcon=this.startField=this.startBubble=null,this.hasExceededDragRadius=!1,this.boundEvents=[],this.flyout=this.workspaceDragger=this.blockDragger=this.bubbleDragger=null,this.isMultiTouch_=this.isEnding_=this.gestureHasStarted=this.calledUpdateIsDragging=!1,this.cachedPoints=new Map,this.startDistance=this.previousScale=0,this.currentDropdownOwner=this.isPinchZoomEnabled=null,this.mostRecentEvent=i,this.currentDragDeltaXY=new _n(0,0),this.healStack=!Lt}dispose(){rt(),jh(),this.creatorWorkspace.clearGesture();for(const i of this.boundEvents)it(i);this.boundEvents.length=0,this.blockDragger&&this.blockDragger.dispose(),this.workspaceDragger&&this.workspaceDragger.dispose()}updateFromEvent(i){const a=new _n(i.clientX,i.clientY);this.updateDragDelta(a)&&(this.updateIsDragging(),Ze()),this.mostRecentEvent=i}updateDragDelta(i){return this.currentDragDeltaXY=_n.difference(i,this.mouseDownXY),this.hasExceededDragRadius?!1:this.hasExceededDragRadius=_n.magnitude(this.currentDragDeltaXY)>(this.flyout?t.config$$module$build$src$core$config.flyoutDragRadius:t.config$$module$build$src$core$config.dragRadius)}updateIsDraggingFromFlyout(){let i;if(!this.targetBlock||(i=this.flyout)==null||!i.isBlockCreatable(this.targetBlock))return!1;if(!this.flyout.targetWorkspace)throw Error(`Cannot update dragging from the flyout because the ' + + 'flyout's target workspace is undefined`);return!this.flyout.isScrollable()||this.flyout.isDragTowardWorkspace(this.currentDragDeltaXY)?(this.startWorkspace_=this.flyout.targetWorkspace,this.startWorkspace_.updateScreenCalculationsIfScrolled(),t.getGroup$$module$build$src$core$events$utils()||t.setGroup$$module$build$src$core$events$utils(!0),this.startBlock=null,this.targetBlock=this.flyout.createBlock(this.targetBlock),this.targetBlock.select(),!0):!1}updateIsDraggingBubble(){return this.startBubble?(this.startDraggingBubble(),!0):!1}updateIsDraggingBlock(){if(!this.targetBlock)return!1;if(this.flyout){if(this.updateIsDraggingFromFlyout())return this.startDraggingBlock(),!0}else if(this.targetBlock.isMovable())return this.startDraggingBlock(),!0;return!1}updateIsDraggingWorkspace(){if(!this.startWorkspace_)throw Error("Cannot update dragging the workspace because the start workspace is undefined");(this.flyout?this.flyout.isScrollable():this.startWorkspace_&&this.startWorkspace_.isDraggable())&&(this.workspaceDragger=new mT(this.startWorkspace_),this.workspaceDragger.startDrag())}updateIsDragging(){if(this.calledUpdateIsDragging)throw Error("updateIsDragging_ should only be called once per gesture.");this.calledUpdateIsDragging=!0,this.updateIsDraggingBubble()||this.updateIsDraggingBlock()||this.updateIsDraggingWorkspace()}startDraggingBlock(){this.blockDragger=new(y(Ft.BLOCK_DRAGGER,this.creatorWorkspace.options,!0))(this.targetBlock,this.startWorkspace_),this.blockDragger.startDrag(this.currentDragDeltaXY,this.healStack),this.blockDragger.drag(this.mostRecentEvent,this.currentDragDeltaXY)}startDraggingBubble(){if(!this.startBubble)throw Error("Cannot update dragging the bubble because the start bubble is undefined");if(!this.startWorkspace_)throw Error("Cannot update dragging the bubble because the start workspace is undefined");this.bubbleDragger=new Xe(this.startBubble,this.startWorkspace_),this.bubbleDragger.startBubbleDrag(),this.bubbleDragger.dragBubble(this.mostRecentEvent,this.currentDragDeltaXY)}doStart(i){if(!this.startWorkspace_)throw Error("Cannot start the touch gesture becauase the start workspace is undefined");this.isPinchZoomEnabled=this.startWorkspace_.options.zoomOptions&&this.startWorkspace_.options.zoomOptions.pinch,st(i)?this.cancel():(this.gestureHasStarted=!0,Ua(),this.startWorkspace_.updateScreenCalculationsIfScrolled(),this.startWorkspace_.isMutator&&this.startWorkspace_.resize(),this.currentDropdownOwner=tu(),this.startWorkspace_.hideChaff(!!this.flyout),this.startWorkspace_.markFocused(),this.mostRecentEvent=i,Rd(),this.targetBlock&&this.targetBlock.select(),Nt(i)?this.handleRightClick(i):(i.type.toLowerCase()==="pointerdown"&&i.pointerType!=="mouse"&&Re(i,this),this.mouseDownXY=new _n(i.clientX,i.clientY),this.healStack=i.altKey||i.ctrlKey||i.metaKey,this.bindMouseEvents(i),this.isEnding_||this.handleTouchStart(i)))}bindMouseEvents(i){this.boundEvents.push($e(document,"pointerdown",null,this.handleStart.bind(this),!0)),this.boundEvents.push($e(document,"pointermove",null,this.handleMove.bind(this),!0)),this.boundEvents.push($e(document,"pointerup",null,this.handleUp.bind(this),!0)),i.preventDefault(),i.stopPropagation()}handleStart(i){this.isDragging()||(this.handleTouchStart(i),this.isMultiTouch()&&Ze())}handleMove(i){this.isDragging()&&ft(i)||!this.isMultiTouch()?(this.updateFromEvent(i),this.workspaceDragger?this.workspaceDragger.drag(this.currentDragDeltaXY):this.blockDragger?this.blockDragger.drag(this.mostRecentEvent,this.currentDragDeltaXY):this.bubbleDragger&&this.bubbleDragger.dragBubble(this.mostRecentEvent,this.currentDragDeltaXY),i.preventDefault(),i.stopPropagation()):this.isMultiTouch()&&(this.handleTouchMove(i),Ze())}handleUp(i){if(this.isDragging()||this.handleTouchEnd(i),!this.isMultiTouch()||this.isDragging()){if(!ft(i))return;if(this.updateFromEvent(i),Ze(),this.isEnding_){console.log("Trying to end a gesture recursively.");return}this.isEnding_=!0,this.bubbleDragger?this.bubbleDragger.endBubbleDrag(i,this.currentDragDeltaXY):this.blockDragger?this.blockDragger.endDrag(i,this.currentDragDeltaXY):this.workspaceDragger?this.workspaceDragger.endDrag(this.currentDragDeltaXY):this.isBubbleClick()?this.doBubbleClick():this.isFieldClick()?this.doFieldClick():this.isIconClick()?this.doIconClick():this.isBlockClick()?this.doBlockClick():this.isWorkspaceClick()&&this.doWorkspaceClick(i)}i.preventDefault(),i.stopPropagation(),this.dispose()}handleTouchStart(i){var a=ut(i);this.cachedPoints.set(a,this.getTouchPoint(i));var p=Array.from(this.cachedPoints.keys());p.length===2&&(a=this.cachedPoints.get(p[0]),p=this.cachedPoints.get(p[1]),this.startDistance=_n.distance(a,p),this.isMultiTouch_=!0,i.preventDefault())}handleTouchMove(i){const a=ut(i);this.cachedPoints.set(a,this.getTouchPoint(i)),this.isPinchZoomEnabled&&this.cachedPoints.size===2?this.handlePinch(i):this.handleMove(i)}handlePinch(i){var a=Array.from(this.cachedPoints.keys()),p=this.cachedPoints.get(a[0]);if(a=this.cachedPoints.get(a[1]),p=_n.distance(p,a)/this.startDistance,0this.previousScale){if(a=p-this.previousScale,a=0this.cachedPoints.size&&(this.cachedPoints.clear(),this.previousScale=0)}getTouchPoint(i){return this.startWorkspace_?new _n(i.pageX,i.pageY):null}isMultiTouch(){return this.isMultiTouch_}cancel(){this.isEnding_||(Ze(),this.bubbleDragger?this.bubbleDragger.endBubbleDrag(this.mostRecentEvent,this.currentDragDeltaXY):this.blockDragger?this.blockDragger.endDrag(this.mostRecentEvent,this.currentDragDeltaXY):this.workspaceDragger&&this.workspaceDragger.endDrag(this.currentDragDeltaXY),this.dispose())}handleRightClick(i){this.targetBlock?(this.bringBlockToFront(),this.targetBlock.workspace.hideChaff(!!this.flyout),this.targetBlock.showContextMenu(i)):this.startBubble?this.startBubble.showContextMenu(i):this.startWorkspace_&&!this.flyout&&(this.startWorkspace_.hideChaff(),this.startWorkspace_.showContextMenu(i)),i.preventDefault(),i.stopPropagation(),this.dispose()}handleWsStart(i,a){if(this.gestureHasStarted)throw Error("Tried to call gesture.handleWsStart, but the gesture had already been started.");this.setStartWorkspace(a),this.mostRecentEvent=i,this.doStart(i)}fireWorkspaceClick(i){ue(new(Ie(rc))(null,i.id,"workspace"))}handleFlyoutStart(i,a){if(this.gestureHasStarted)throw Error("Tried to call gesture.handleFlyoutStart, but the gesture had already been started.");this.setStartFlyout(a),this.handleWsStart(i,a.getWorkspace())}handleBlockStart(i,a){if(this.gestureHasStarted)throw Error("Tried to call gesture.handleBlockStart, but the gesture had already been started.");this.setStartBlock(a),this.mostRecentEvent=i}handleBubbleStart(i,a){if(this.gestureHasStarted)throw Error("Tried to call gesture.handleBubbleStart, but the gesture had already been started.");this.setStartBubble(a),this.mostRecentEvent=i}doBubbleClick(){this.startBubble instanceof zl&&(this.startBubble.setFocus(),this.startBubble.select())}doFieldClick(){if(!this.startField)throw Error("Cannot do a field click because the start field is undefined");this.currentDropdownOwner!==this.startField&&this.startField.showEditor(this.mostRecentEvent),this.bringBlockToFront()}doIconClick(){if(!this.startIcon)throw Error("Cannot do an icon click because the start icon is undefined");this.bringBlockToFront(),this.startIcon.onClick()}doBlockClick(){if(this.flyout&&this.flyout.autoClose){if(!this.targetBlock)throw Error("Cannot do a block click because the target block is undefined");this.targetBlock.isEnabled()&&(t.getGroup$$module$build$src$core$events$utils()||t.setGroup$$module$build$src$core$events$utils(!0),this.flyout.createBlock(this.targetBlock).scheduleSnapAndBump())}else{if(!this.startWorkspace_)throw Error("Cannot do a block click because the start workspace is undefined");const i=new(Ie(rc))(this.startBlock,this.startWorkspace_.id,"block");ue(i)}this.bringBlockToFront(),t.setGroup$$module$build$src$core$events$utils(!1)}doWorkspaceClick(i){i=this.creatorWorkspace,L()&&L().unselect(),this.fireWorkspaceClick(this.startWorkspace_||i)}bringBlockToFront(){this.targetBlock&&!this.flyout&&this.targetBlock.bringToFront()}setStartField(i){if(this.gestureHasStarted)throw Error("Tried to call gesture.setStartField, but the gesture had already been started.");this.startField||(this.startField=i)}setStartIcon(i){if(this.gestureHasStarted)throw Error("Tried to call gesture.setStartIcon, but the gesture had already been started.");this.startIcon||(this.startIcon=i)}setStartBubble(i){this.startBubble||(this.startBubble=i)}setStartBlock(i){this.startBlock||this.startBubble||(this.startBlock=i,i.isInFlyout&&i!==i.getRootBlock()?this.setTargetBlock(i.getRootBlock()):this.setTargetBlock(i))}setTargetBlock(i){i.isShadow()?this.setTargetBlock(i.getParent()):this.targetBlock=i}setStartWorkspace(i){this.startWorkspace_||(this.startWorkspace_=i)}setStartFlyout(i){this.flyout||(this.flyout=i)}isBubbleClick(){return!!this.startBubble&&!this.hasExceededDragRadius}isBlockClick(){return!!this.startBlock&&!this.hasExceededDragRadius&&!this.isFieldClick()&&!this.isIconClick()}isFieldClick(){return this.startField?this.startField.isClickable()&&!this.hasExceededDragRadius&&(!this.flyout||this.startField.isClickableInFlyout(this.flyout.autoClose)):!1}isIconClick(){if(!this.startIcon)return!1;const i=!this.flyout||!this.startIcon.isClickableInFlyout||this.startIcon.isClickableInFlyout(this.flyout.autoClose);return!this.hasExceededDragRadius&&i}isWorkspaceClick(){return!this.startBlock&&!this.startBubble&&!this.startField&&!this.hasExceededDragRadius}isDragging(){return!!this.workspaceDragger||!!this.blockDragger||!!this.bubbleDragger}hasStarted(){return this.gestureHasStarted}getInsertionMarkers(){return this.blockDragger?this.blockDragger.getInsertionMarkers():[]}getCurrentDragger(){let i,a;return(a=(i=this.blockDragger)!=null?i:this.workspaceDragger)!=null?a:this.bubbleDragger}static inProgress(){const i=w();for(let a=0,p;p=i[a];a++)if(p.currentGesture_)return!0;return!1}},ob=class{constructor(i,a){this.pattern=i,this.scale=1;let p;this.spacing=(p=a.spacing)!=null?p:0;let S;this.length=(S=a.length)!=null?S:1,this.line2=(this.line1=i.firstChild)&&this.line1.nextSibling;let O;this.snapToGrid=(O=a.snap)!=null?O:!1}setSpacing(i){this.spacing=i,this.update(this.scale)}setLength(i){this.length=i,this.update(this.scale)}setSnapToGrid(i){this.snapToGrid=i}shouldSnap(){return this.snapToGrid}getSpacing(){return this.spacing}getPatternId(){return this.pattern.id}update(i){this.scale=i;var a=this.spacing*i;this.pattern.setAttribute("width",`${a}`),this.pattern.setAttribute("height",`${a}`),a=Math.floor(this.spacing/2)+.5;let p=a-this.length/2,S=a+this.length/2;a*=i,p*=i,S*=i,this.setLineAttributes(this.line1,i,p,S,a,a),this.setLineAttributes(this.line2,i,a,a,p,S)}setLineAttributes(i,a,p,S,O,j){i&&(i.setAttribute("stroke-width",`${a}`),i.setAttribute("x1",`${p}`),i.setAttribute("y1",`${O}`),i.setAttribute("x2",`${S}`),i.setAttribute("y2",`${j}`))}moveTo(i,a){this.pattern.setAttribute("x",`${i}`),this.pattern.setAttribute("y",`${a}`)}static createDom(i,a,p){i=ie(Ve.PATTERN,{id:"blocklyGridPattern"+i,patternUnits:"userSpaceOnUse"},p);let S,O;if(0<((S=a.length)!=null?S:1)&&0<((O=a.spacing)!=null?O:0)){ie(Ve.LINE,{stroke:a.colour},i);let j;(j=a.length)!=null&&j&&ie(Ve.LINE,{stroke:a.colour},i)}else ie(Ve.LINE,{},i);return i}},Ca=class{constructor(i){this.workspace=i,this.cursorSvg_=this.cursor_=null,this.markers=new Map,this.markerSvg_=null}registerMarker(i,a){this.markers.has(i)&&this.unregisterMarker(i),a.setDrawer(this.workspace.getRenderer().makeMarkerDrawer(this.workspace,a)),this.setMarkerSvg(a.getDrawer().createDom()),this.markers.set(i,a)}unregisterMarker(i){const a=this.markers.get(i);if(a)a.dispose(),this.markers.delete(i);else throw Error("Marker with ID "+i+" does not exist. Can only unregister markers that exist.")}getCursor(){return this.cursor_}getMarker(i){return this.markers.get(i)||null}setCursor(i){this.cursor_&&this.cursor_.getDrawer()&&this.cursor_.getDrawer().dispose(),(this.cursor_=i)&&(i=this.workspace.getRenderer().makeMarkerDrawer(this.workspace,this.cursor_),this.cursor_.setDrawer(i),this.setCursorSvg(this.cursor_.getDrawer().createDom()))}setCursorSvg(i){i?(this.workspace.getBlockCanvas().appendChild(i),this.cursorSvg_=i):this.cursorSvg_=null}setMarkerSvg(i){i?this.workspace.getBlockCanvas()&&(this.cursorSvg_?this.workspace.getBlockCanvas().insertBefore(i,this.cursorSvg_):this.workspace.getBlockCanvas().appendChild(i)):this.markerSvg_=null}updateMarkers(){this.workspace.keyboardAccessibilityMode&&this.cursorSvg_&&this.workspace.getCursor().draw()}dispose(){const i=Object.keys(this.markers);for(let a=0,p;p=i[a];a++)this.unregisterMarker(p);this.markers.clear(),this.cursor_&&(this.cursor_.dispose(),this.cursor_=null)}};Ca.LOCAL_MARKER="local_marker_1";var gT={};gT.deepMerge=Il;var Pg=class{constructor(i,a,p,S){this.name=i,this.startHats=!1,this.blockStyles=a||Object.create(null),this.categoryStyles=p||Object.create(null),this.componentStyles=S||Object.create(null),this.fontStyle=Object.create(null),r(Ft.THEME,i,this,!0)}getClassName(){return this.name+"-theme"}setBlockStyle(i,a){this.blockStyles[i]=a}setCategoryStyle(i,a){this.categoryStyles[i]=a}getComponentStyle(i){if(i=this.componentStyles[i],!i)return null;if(typeof i=="string"){const a=this.getComponentStyle(i);if(a)return a}return`${i}`}setComponentStyle(i,a){this.componentStyles[i]=a}setFontStyle(i){this.fontStyle=i}setStartHats(i){this.startHats=i}static defineTheme(i,a){i=i.toLowerCase();const p=new Pg(i);let S=a.base;if(S){if(typeof S=="string"){let O;S=(O=f(Ft.THEME,S))!=null?O:void 0}S instanceof Pg&&(Il(p,S),p.name=i)}return Il(p.blockStyles,a.blockStyles),Il(p.categoryStyles,a.categoryStyles),Il(p.componentStyles,a.componentStyles),Il(p.fontStyle,a.fontStyle),a.startHats!==null&&(p.startHats=a.startHats),p}},Yd={colour_blocks:{colourPrimary:"20"},list_blocks:{colourPrimary:"260"},logic_blocks:{colourPrimary:"210"},loop_blocks:{colourPrimary:"120"},math_blocks:{colourPrimary:"230"},procedure_blocks:{colourPrimary:"290"},text_blocks:{colourPrimary:"160"},variable_blocks:{colourPrimary:"330"},variable_dynamic_blocks:{colourPrimary:"310"},hat_blocks:{colourPrimary:"330",hat:"cap"}},On={colour_category:{colour:"20"},list_category:{colour:"260"},logic_category:{colour:"210"},loop_category:{colour:"120"},math_category:{colour:"230"},procedure_category:{colour:"290"},text_category:{colour:"160"},variable_category:{colour:"330"},variable_dynamic_category:{colour:"310"}},Lv=new Pg("classic",Yd,On),Hi=class{constructor(i){this.gridPattern=null,this.getMetrics=this.setMetrics=void 0;let a=null,p=!1;var S=!1,O=!1,j=!1,ve=!1,Ue=!1;const Yt=!!i.readOnly;if(!Yt){var jn;a=_t((jn=i.toolbox)!=null?jn:null),p=Wt(a),S=i.trashcan,S=S===void 0?p:S,O=i.collapse,O=O===void 0?p:O,j=i.comments,j=j===void 0?p:j,ve=i.disable,ve=ve===void 0?p:ve,Ue=i.sounds,Ue=Ue===void 0?!0:Ue}jn=i.maxTrashcanContents,S?jn===void 0&&(jn=32):jn=0;const bl=!!i.rtl;let Qa=i.horizontalLayout;Qa===void 0&&(Qa=!1);var Fp=i.toolboxPosition!=="end";Fp=Qa?Fp?dr.TOP:dr.BOTTOM:Fp===bl?dr.RIGHT:dr.LEFT;let GT=i.css;GT===void 0&&(GT=!0);let WT="https://blockly-demo.appspot.com/static/media/";i.media?WT=i.media.endsWith("/")?i.media:i.media+"/":"path"in i&&(xe("path","Nov 2014","Jul 2023","media"),WT=i.path+"media/");const Ez=i.oneBasedIndex,Wte=i.renderer||"geras",Vte=i.plugins||{};let R2=i.modalInputs;R2===void 0&&(R2=!0),this.RTL=bl,this.oneBasedIndex=Ez===void 0?!0:Ez,this.collapse=O,this.comments=j,this.disable=ve,this.readOnly=Yt,this.maxBlocks=i.maxBlocks||1/0;let xz;this.maxInstances=(xz=i.maxInstances)!=null?xz:null,this.modalInputs=R2,this.pathToMedia=WT,this.hasCategories=p,this.moveOptions=Hi.parseMoveOptions_(i,p),this.hasScrollbars=!!this.moveOptions.scrollbars,this.hasTrashcan=S,this.maxTrashcanContents=jn,this.hasSounds=Ue,this.hasCss=GT,this.horizontalLayout=Qa,this.languageTree=a,this.gridOptions=Hi.parseGridOptions_(i),this.zoomOptions=Hi.parseZoomOptions_(i),this.toolboxPosition=Fp,this.theme=Hi.parseThemeOptions_(i),this.renderer=Wte;let $z;this.rendererOverrides=($z=i.rendererOverrides)!=null?$z:null;let Cz;this.parentWorkspace=(Cz=i.parentWorkspace)!=null?Cz:null,this.plugins=Vte}static parseMoveOptions_(i,a){const p=i.move||{},S={};return p.scrollbars===void 0&&i.scrollbars===void 0?S.scrollbars=a:typeof p.scrollbars=="object"?(S.scrollbars={horizontal:!!p.scrollbars.horizontal,vertical:!!p.scrollbars.vertical},S.scrollbars.horizontal&&S.scrollbars.vertical?S.scrollbars=!0:S.scrollbars.horizontal||S.scrollbars.vertical||(S.scrollbars=!1)):S.scrollbars=!!p.scrollbars||!!i.scrollbars,S.wheel=S.scrollbars&&p.wheel!==void 0?!!p.wheel:typeof S.scrollbars=="object",S.drag=S.scrollbars?p.drag===void 0?!0:!!p.drag:!1,S}static parseZoomOptions_(i){i=i.zoom||{};const a={};return a.controls=i.controls===void 0?!1:!!i.controls,a.wheel=i.wheel===void 0?!1:!!i.wheel,a.startScale=i.startScale===void 0?1:Number(i.startScale),a.maxScale=i.maxScale===void 0?3:Number(i.maxScale),a.minScale=i.minScale===void 0?.3:Number(i.minScale),a.scaleSpeed=i.scaleSpeed===void 0?1.2:Number(i.scaleSpeed),a.pinch=i.pinch===void 0?a.wheel||a.controls:!!i.pinch,a}static parseGridOptions_(i){i=i.grid||{};const a={};return a.spacing=Number(i.spacing)||0,a.colour=i.colour||"#888",a.length=i.length===void 0?1:Number(i.length),a.snap=0")),ue(new Jr(a,"mutation",null,p,i));break;default:console.warn("Unknown change type: "+this.element)}}static getExtraBlockState_(i){return i.saveExtraState?(i=i.saveExtraState(!0))?JSON.stringify(i):"":i.mutationToDom&&(i=i.mutationToDom())?Qi(i):""}};r(Ft.EVENT,t.CHANGE$$module$build$src$core$events$utils,Jr);var ab=.45,ah=.65,_T={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00"},bf={};bf.blend=Vc,bf.getHsvSaturation=Xu,bf.getHsvValue=Sh,bf.hexToRgb=Wc,bf.hsvToHex=kl,bf.hueToHex=_c,bf.names=_T,bf.parse=ta,bf.rgbToHex=Rl,bf.setHsvSaturation=Ku,bf.setHsvValue=ll;var M_={};M_.checkMessageReferences=ul,M_.parseBlockColour=Zi,M_.replaceMessageReferences=Vr,M_.tokenizeInterpolation=Ga;var Gi=class{constructor(i,a,p){this.DEFAULT_VALUE=null,this.name=void 0,this.constants_=this.mouseDownWrapper_=this.textContent_=this.textElement_=this.borderRect_=this.fieldGroup_=this.markerSvg_=this.cursorSvg_=this.tooltip_=this.validator_=null,this.disposed=!1,this.maxDisplayLength=50,this.sourceBlock_=null,this.enabled_=this.visible_=this.isDirty_=!0,this.suffixField=this.prefixField=this.clickTarget_=null,this.EDITABLE=!0,this.SERIALIZABLE=!1,this.CURSOR="",this.value_="DEFAULT_VALUE"in new.target.prototype?new.target.prototype.DEFAULT_VALUE:this.DEFAULT_VALUE,this.size_=new eo(0,0),i!==Gi.SKIP_SETUP&&(p&&this.configure_(p),this.setValue(i),a&&this.setValidator(a))}configure_(i){i.tooltip&&this.setTooltip(Vr(i.tooltip))}setSourceBlock(i){if(this.sourceBlock_)throw Error("Field already bound to a block");this.sourceBlock_=i}getConstants(){return!this.constants_&&this.sourceBlock_&&!this.sourceBlock_.isDeadOrDying()&&this.sourceBlock_.workspace.rendered&&(this.constants_=this.sourceBlock_.workspace.getRenderer().getConstants()),this.constants_}getSourceBlock(){return this.sourceBlock_}init(){this.fieldGroup_||(this.fieldGroup_=ie(Ve.G,{}),this.isVisible()||(this.fieldGroup_.style.display="none"),this.sourceBlock_.getSvgRoot().appendChild(this.fieldGroup_),this.initView(),this.updateEditable(),this.setTooltip(this.tooltip_),this.bindEvents_(),this.initModel())}initView(){this.createBorderRect_(),this.createTextElement_()}initModel(){}isFullBlockField(){return!this.borderRect_}createBorderRect_(){this.borderRect_=ie(Ve.RECT,{rx:this.getConstants().FIELD_BORDER_RECT_RADIUS,ry:this.getConstants().FIELD_BORDER_RECT_RADIUS,x:0,y:0,height:this.size_.height,width:this.size_.width,class:"blocklyFieldRect"},this.fieldGroup_)}createTextElement_(){this.textElement_=ie(Ve.TEXT,{class:"blocklyText"},this.fieldGroup_),this.getConstants().FIELD_TEXT_BASELINE_CENTER&&this.textElement_.setAttribute("dominant-baseline","central"),this.textContent_=document.createTextNode(""),this.textElement_.appendChild(this.textContent_)}bindEvents_(){const i=this.getClickTarget_();if(!i)throw Error("A click target has not been set.");zi(i),this.mouseDownWrapper_=$e(i,"pointerdown",this,this.onMouseDown_)}fromXml(i){this.setValue(i.textContent)}toXml(i){return i.textContent=this.getValue(),i}saveState(i){return i=this.saveLegacyState(Gi),i!==null?i:this.getValue()}loadState(i){this.loadLegacyState(Gi,i)||this.setValue(i)}saveLegacyState(i){return i.prototype.saveState===this.saveState&&i.prototype.toXml!==this.toXml?(i=t.createElement$$module$build$src$core$utils$xml("field"),i.setAttribute("name",this.name||""),Nn(this.toXml(i)).replace(' xmlns="https://developers.google.com/blockly/xml"',"")):null}loadLegacyState(i,a){return i.prototype.loadState===this.loadState&&i.prototype.fromXml!==this.fromXml?(this.fromXml(t.textToDom$$module$build$src$core$utils$xml(a)),!0):!1}dispose(){Ti(this),Wr(this);let i;(i=this.getSourceBlock())!=null&&i.isDeadOrDying()||mt(this.fieldGroup_),this.disposed=!0}updateEditable(){const i=this.fieldGroup_,a=this.getSourceBlock();this.EDITABLE&&i&&a&&(this.enabled_&&a.isEditable()?(Pe(i,"blocklyEditableText"),St(i,"blocklyNonEditableText"),i.style.cursor=this.CURSOR):(Pe(i,"blocklyNonEditableText"),St(i,"blocklyEditableText"),i.style.cursor=""))}setEnabled(i){this.enabled_=i,this.updateEditable()}isEnabled(){return this.enabled_}isClickable(){return this.enabled_&&!!this.sourceBlock_&&this.sourceBlock_.isEditable()&&this.showEditor_!==Gi.prototype.showEditor_}isClickableInFlyout(i){return!i}isCurrentlyEditable(){return this.enabled_&&this.EDITABLE&&!!this.sourceBlock_&&this.sourceBlock_.isEditable()}isSerializable(){let i=!1;return this.name&&(this.SERIALIZABLE?i=!0:this.EDITABLE&&(console.warn("Detected an editable field that was not serializable. Please define SERIALIZABLE property as true on all editable custom fields. Proceeding with serialization."),i=!0)),i}isVisible(){return this.visible_}setVisible(i){if(this.visible_!==i){this.visible_=i;var a=this.fieldGroup_;a&&(a.style.display=i?"block":"none")}}setValidator(i){this.validator_=i}getValidator(){return this.validator_}getSvgRoot(){return this.fieldGroup_}getBorderRect(){if(!this.borderRect_)throw Error(`The border rectangle is ${this.borderRect_}.`);return this.borderRect_}getTextElement(){if(!this.textElement_)throw Error(`The text element is ${this.textElement_}.`);return this.textElement_}getTextContent(){if(!this.textContent_)throw Error(`The text content is ${this.textContent_}.`);return this.textContent_}applyColour(){}render_(){this.textContent_&&(this.textContent_.nodeValue=this.getDisplayText_()),this.updateSize_()}showEditor(i){this.isClickable()&&this.showEditor_(i)}showEditor_(i){}repositionForWindowResize(){return!1}updateSize_(i){const a=this.getConstants();i=i!==void 0?i:this.isFullBlockField()?0:this.getConstants().FIELD_BORDER_RECT_X_PADDING;let p=2*i,S=a.FIELD_TEXT_HEIGHT,O=0;this.textElement_&&(O=Je(this.textElement_,a.FIELD_TEXT_FONTSIZE,a.FIELD_TEXT_FONTWEIGHT,a.FIELD_TEXT_FONTFAMILY),p+=O),this.isFullBlockField()||(S=Math.max(S,a.FIELD_BORDER_RECT_HEIGHT)),this.size_.height=S,this.size_.width=p,this.positionTextElement_(i,O),this.positionBorderRect_()}positionTextElement_(i,a){if(this.textElement_){var p=this.getConstants(),S=this.size_.height/2,O;this.textElement_.setAttribute("x",String((O=this.getSourceBlock())!=null&&O.RTL?this.size_.width-a-i:i)),this.textElement_.setAttribute("y",String(p.FIELD_TEXT_BASELINE_CENTER?S:S-p.FIELD_TEXT_HEIGHT/2+p.FIELD_TEXT_BASELINE))}}positionBorderRect_(){this.borderRect_&&(this.borderRect_.setAttribute("width",String(this.size_.width)),this.borderRect_.setAttribute("height",String(this.size_.height)),this.borderRect_.setAttribute("rx",String(this.getConstants().FIELD_BORDER_RECT_RADIUS)),this.borderRect_.setAttribute("ry",String(this.getConstants().FIELD_BORDER_RECT_RADIUS)))}getSize(){return this.isVisible()?(this.isDirty_?(this.render_(),this.isDirty_=!1):this.visible_&&this.size_.width===0&&(this.render_(),this.size_.width!==0&&console.warn("Deprecated use of setting size_.width to 0 to rerender a field. Set field.isDirty_ to true instead.")),this.size_):new eo(0,0)}getScaledBBox(){let i;var a=this.getSourceBlock();if(!a)throw new Ro;if(this.isFullBlockField()){var p=this.sourceBlock_.getHeightWidth();const S=a.workspace.scale;i=this.getAbsoluteXY_(),a=(p.width+1)*S,p=(p.height+1)*S,En?(i.x+=1.5*S,i.y+=1.5*S):(i.x-=.5*S,i.y-=.5*S)}else p=this.borderRect_.getBoundingClientRect(),i=xn(this.borderRect_),a=p.width,p=p.height;return new Oi(i.y,i.y+p,i.x,i.x+a)}onLocationChange(i){}getDisplayText_(){let i=this.getText();return i?(i.length>this.maxDisplayLength&&(i=i.substring(0,this.maxDisplayLength-2)+"…"),i=i.replace(/\s/g,Gi.NBSP),this.sourceBlock_&&this.sourceBlock_.RTL&&(i+="‏"),i):Gi.NBSP}getText(){const i=this.getText_();return String(i!==null?i:this.getValue())}getText_(){return null}markDirty(){this.isDirty_=!0,this.constants_=null}forceRerender(){this.isDirty_=!0,this.sourceBlock_&&this.sourceBlock_.rendered&&(this.sourceBlock_.queueRender(),this.sourceBlock_.bumpNeighbours())}setValue(i,a=!0){if(i!==null){var p=this.doClassValidation_(i);if(i=this.processValidation_(i,p),!(i instanceof Error)){var S;p=(S=this.getValidator())==null?void 0:S.call(this,i),S=this.processValidation_(i,p),S instanceof Error||(i=this.sourceBlock_,i&&i.disposed||(p=this.getValue(),p===S?this.doValueUpdate_(S):(this.doValueUpdate_(S),a&&i&&se()&&ue(new(Ie(t.CHANGE$$module$build$src$core$events$utils))(i,"field",this.name||null,p,S)),this.isDirty_&&this.forceRerender())))}}}processValidation_(i,a){return a===null?(this.doValueInvalid_(i),this.isDirty_&&this.forceRerender(),Error()):a===void 0?i:a}getValue(){return this.value_}doClassValidation_(i){return i??null}doValueUpdate_(i){this.value_=i,this.isDirty_=!0}doValueInvalid_(i){}onMouseDown_(i){this.sourceBlock_&&!this.sourceBlock_.isDeadOrDying()&&(i=this.sourceBlock_.workspace.getGesture(i))&&i.setStartField(this)}setTooltip(i){i||i===""||(i=this.sourceBlock_);const a=this.getClickTarget_();a?a.tooltip=i:this.tooltip_=i}getTooltip(){const i=this.getClickTarget_();return uo(i||{tooltip:this.tooltip_})}getClickTarget_(){return this.clickTarget_||this.getSvgRoot()}getAbsoluteXY_(){return xn(this.getClickTarget_())}referencesVariables(){return!1}refreshVariableName(){}getParentInput(){let i=null;const a=this.getSourceBlock();if(!a)throw new Ro;const p=a.inputList;for(let S=0;Sa[1]===i)?i:(this.sourceBlock_&&console.warn("Cannot set the dropdown's value to an unavailable option. Block type: "+this.sourceBlock_.type+", Field name: "+this.name+", Value: "+i),null)}doValueUpdate_(i){super.doValueUpdate_(i),i=this.getOptions(!0);for(let a=0,p;p=i[a];a++)p[1]===this.value_&&(this.selectedOption=p)}applyColour(){const i=this.sourceBlock_.style;this.borderRect_&&(this.borderRect_.setAttribute("stroke",i.colourTertiary),this.menu_?this.borderRect_.setAttribute("fill",i.colourTertiary):this.borderRect_.setAttribute("fill","transparent")),this.sourceBlock_&&this.arrow&&(this.sourceBlock_.isShadow()?this.arrow.style.fill=i.colourSecondary:this.arrow.style.fill=i.colourPrimary)}render_(){this.getTextContent().nodeValue="",this.imageElement.style.display="none";const i=this.selectedOption&&this.selectedOption[0];i&&typeof i=="object"?this.renderSelectedImage(i):this.renderSelectedText(),this.positionBorderRect_()}renderSelectedImage(i){const a=this.getSourceBlock();if(!a)throw new Ro;this.imageElement.style.display="",this.imageElement.setAttributeNS(Zs,"xlink:href",i.src),this.imageElement.setAttribute("height",String(i.height)),this.imageElement.setAttribute("width",String(i.width));const p=Number(i.height);i=Number(i.width);var S=!!this.borderRect_;const O=Math.max(S?this.getConstants().FIELD_DROPDOWN_BORDER_RECT_HEIGHT:0,p+di);S=S?this.getConstants().FIELD_BORDER_RECT_X_PADDING:0;let j;j=this.svgArrow?this.positionSVGArrow(i+S,O/2-this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE/2):Je(this.arrow,this.getConstants().FIELD_TEXT_FONTSIZE,this.getConstants().FIELD_TEXT_FONTWEIGHT,this.getConstants().FIELD_TEXT_FONTFAMILY),this.size_.width=i+j+2*S,this.size_.height=O;let ve=0;a.RTL?this.imageElement.setAttribute("x",`${S+j}`):(ve=i+j,this.getTextElement().setAttribute("text-anchor","end"),this.imageElement.setAttribute("x",`${S}`)),this.imageElement.setAttribute("y",String(O/2-p/2)),this.positionTextElement_(ve+S,i+j)}renderSelectedText(){this.getTextContent().nodeValue=this.getDisplayText_();var i=this.getTextElement();Pe(i,"blocklyDropdownText"),i.setAttribute("text-anchor","start");var a=!!this.borderRect_;i=Math.max(a?this.getConstants().FIELD_DROPDOWN_BORDER_RECT_HEIGHT:0,this.getConstants().FIELD_TEXT_HEIGHT);const p=Je(this.getTextElement(),this.getConstants().FIELD_TEXT_FONTSIZE,this.getConstants().FIELD_TEXT_FONTWEIGHT,this.getConstants().FIELD_TEXT_FONTFAMILY);a=a?this.getConstants().FIELD_BORDER_RECT_X_PADDING:0;let S=0;this.svgArrow&&(S=this.positionSVGArrow(p+a,i/2-this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE/2)),this.size_.width=p+S+2*a,this.size_.height=i,this.positionTextElement_(a,p)}positionSVGArrow(i,a){if(!this.svgArrow)return 0;const p=this.getSourceBlock();if(!p)throw new Ro;const S=this.borderRect_?this.getConstants().FIELD_BORDER_RECT_X_PADDING:0,O=this.getConstants().FIELD_DROPDOWN_SVG_ARROW_PADDING,j=this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE;return this.svgArrow.setAttribute("transform","translate("+(p.RTL?S:i+O)+","+a+")"),j+O}getText_(){if(!this.selectedOption)return null;const i=this.selectedOption[0];return typeof i=="object"?i.alt:i}static fromJson(i){if(!i.options)throw Error("options are required for the dropdown field. The options property must be assigned an array of [humanReadableValue, languageNeutralValue] tuples.");return new this(i.options,void 0,i)}};Ah.CHECKMARK_OVERHANG=25,Ah.MAX_MENU_HEIGHT_VH=.45,Ah.ARROW_CHAR="▾";var ri=5,di=2*ri;xs("field_dropdown",Ah);var td,As=class{constructor(i,a,p){this.workspace=i,this.anchor=a,this.ownerRect=p,this.size=new eo(0,0),this.colour="#ffffff",this.disposed=!1,this.relativeLeft=this.relativeTop=0,this.svgRoot=ie(Ve.G,{},i.getBubbleCanvas()),i=ie(Ve.G,{filter:`url(#${this.workspace.getRenderer().getConstants().embossFilterId})`},this.svgRoot),this.tail=ie(Ve.PATH,{},i),this.background=ie(Ve.RECT,{class:"blocklyDraggable",x:0,y:0,rx:td.BORDER_WIDTH,ry:td.BORDER_WIDTH},i),this.contentContainer=ie(Ve.G,{},this.svgRoot),$e(this.background,"pointerdown",this,this.onMouseDown)}dispose(){mt(this.svgRoot),this.disposed=!0}setAnchorLocation(i,a=!1){this.anchor=i,a?this.positionByRect(this.ownerRect):this.positionRelativeToAnchor(),this.renderTail()}setPositionRelativeToAnchor(i,a){this.relativeLeft=i,this.relativeTop=a,this.positionRelativeToAnchor(),this.renderTail()}getSize(){return this.size}setSize(i,a=!1){i.width=Math.max(i.width,td.MIN_SIZE),i.height=Math.max(i.height,td.MIN_SIZE),this.size=i,this.background.setAttribute("width",`${i.width}`),this.background.setAttribute("height",`${i.height}`),a?this.positionByRect(this.ownerRect):this.positionRelativeToAnchor(),this.renderTail()}getColour(){return this.colour}setColour(i){this.colour=i,this.tail.setAttribute("fill",i),this.background.setAttribute("fill",i)}onMouseDown(i){let a;(a=this.workspace.getGesture(i))==null||a.handleBubbleStart(i,this)}positionRelativeToAnchor(){let i=this.anchor.x;i=this.workspace.RTL?i-(this.relativeLeft+this.size.width):i+this.relativeLeft,this.moveTo(i,this.relativeTop+this.anchor.y)}moveTo(i,a){this.svgRoot.setAttribute("transform",`translate(${i}, ${a})`)}positionByRect(i=new Oi(0,0,0,0)){var a=this.workspace.getMetricsManager().getViewMetrics(!0),p=this.getOptimalRelativeLeft(a),S=this.getOptimalRelativeTop(a);const O={x:p,y:-this.size.height-this.workspace.getRenderer().getConstants().MIN_BLOCK_HEIGHT},j={x:-this.size.width-30,y:S};S={x:i.getWidth(),y:S};var ve={x:p,y:i.getHeight()};p=i.getWidth()i.width)return a;if(i=this.getWorkspaceViewRect(i),this.workspace.RTL){var p=this.anchor.x-a;p-this.size.widthi.right&&(a=-(i.right-this.anchor.x))}else{p=a+this.anchor.x;const S=p+this.size.width;pi.right&&(a=i.right-this.anchor.x-this.size.width)}return a}getOptimalRelativeTop(i){let a=-this.size.height/4;if(this.size.height>i.height)return a;const p=this.anchor.y+a,S=p+this.size.height;return i=this.getWorkspaceViewRect(i),pi.bottom&&(a=i.bottom-this.anchor.y-this.size.height),a}getWorkspaceViewRect(i){const a=i.top;let p=i.top+i.height,S=i.left;return i=i.left+i.width,p-=this.getScrollbarThickness(),this.workspace.RTL?S-=this.getScrollbarThickness():i-=this.getScrollbarThickness(),new Oi(a,p,S,i)}getScrollbarThickness(){return xa.scrollbarThickness/this.workspace.scale}renderTail(){const i=[];var a=this.size.width/2,p=this.size.height/2,S=-this.relativeLeft,O=-this.relativeTop;if(a===S&&p===O)i.push("M "+a+","+p);else{O-=p,S-=a,this.workspace.RTL&&(S*=-1);var j=Math.sqrt(O*O+S*S),ve=Math.acos(S/j);0>O&&(ve=2*Math.PI-ve);var Ue=ve+Math.PI/2;Ue>2*Math.PI&&(Ue-=2*Math.PI);var Yt=Math.sin(Ue);const bl=Math.cos(Ue);let Qa=(this.size.width+this.size.height)/td.TAIL_THICKNESS;Qa=Math.min(Qa,this.size.width,this.size.height)/4,Ue=1-td.ANCHOR_RADIUS/j,S=a+Ue*S,O=p+Ue*O,Ue=a+Qa*bl;const Fp=p+Qa*Yt;a-=Qa*bl,p-=Qa*Yt,Yt=Uc(this.workspace.RTL?-td.TAIL_ANGLE:td.TAIL_ANGLE),Yt=ve+Yt,Yt>2*Math.PI&&(Yt-=2*Math.PI),ve=Math.sin(Yt)*j/td.TAIL_BEND,j=Math.cos(Yt)*j/td.TAIL_BEND,i.push("M"+Ue+","+Fp),i.push("C"+(Ue+j)+","+(Fp+ve)+" "+S+","+O+" "+S+","+O),i.push("C"+S+","+O+" "+(a+j)+","+(p+ve)+" "+a+","+p)}i.push("z");let jn;(jn=this.tail)==null||jn.setAttribute("d",i.join(" "))}bringToFront(){let i;const a=(i=this.svgRoot)==null?void 0:i.parentNode;return this.svgRoot&&(a==null?void 0:a.lastChild)!==this.svgRoot?(a==null||a.appendChild(this.svgRoot),!0):!1}getRelativeToSurfaceXY(){return new _n(this.workspace.RTL?-this.relativeLeft+this.anchor.x-this.size.width:this.anchor.x+this.relativeLeft,this.anchor.y+this.relativeTop)}getSvgRoot(){return this.svgRoot}moveDuringDrag(i){this.moveTo(i.x,i.y),this.relativeLeft=this.workspace.RTL?this.anchor.x-i.x-this.size.width:i.x-this.anchor.x,this.relativeTop=i.y-this.anchor.y,this.renderTail()}setDragging(i){}setDeleteStyle(i){}isDeletable(){return!1}showContextMenu(i){}};td=As,As.BORDER_WIDTH=6,As.DOUBLE_BORDER=2*td.BORDER_WIDTH,As.MIN_SIZE=td.DOUBLE_BORDER,As.TAIL_THICKNESS=1,As.TAIL_ANGLE=20,As.TAIL_BEND=4,As.ANCHOR_RADIUS=8;var _m=class extends As{constructor(i,a,p,S){super(a,p,S),this.workspace=a,this.anchor=p,this.ownerRect=S,this.autoLayout=!0,a=new Hi(i),this.validateWorkspaceOptions(a),this.svgDialog=ie(Ve.SVG,{x:As.BORDER_WIDTH,y:As.BORDER_WIDTH},this.contentContainer),i.parentWorkspace=this.workspace,this.miniWorkspace=this.newWorkspaceSvg(new Hi(i)),this.miniWorkspace.internalIsMutator=!0,i=this.miniWorkspace.createDom("blocklyMutatorBackground"),this.svgDialog.appendChild(i),a.languageTree&&(i.insertBefore(this.miniWorkspace.addFlyout(Ve.G),this.miniWorkspace.getCanvas()),i=this.miniWorkspace.getFlyout(),i==null||i.init(this.miniWorkspace),i==null||i.show(a.languageTree)),this.miniWorkspace.addChangeListener(this.onWorkspaceChange.bind(this));let O,j;(O=this.miniWorkspace.getFlyout())==null||(j=O.getWorkspace())==null||j.addChangeListener(this.onWorkspaceChange.bind(this)),this.updateBubbleSize()}dispose(){this.miniWorkspace.dispose(),super.dispose()}getWorkspace(){return this.miniWorkspace}addWorkspaceChangeListener(i){this.miniWorkspace.addChangeListener(i)}validateWorkspaceOptions(i){if(i.hasCategories)throw Error("The miniworkspace bubble does not support toolboxes with categories");if(i.hasTrashcan)throw Error("The miniworkspace bubble does not support trashcans");if(i.zoomOptions.controls||i.zoomOptions.wheel||i.zoomOptions.pinch)throw Error("The miniworkspace bubble does not support zooming");if(i.moveOptions.scrollbars||i.moveOptions.wheel||i.moveOptions.drag)throw Error("The miniworkspace bubble does not scrolling/moving the workspace");if(i.horizontalLayout)throw Error("The miniworkspace bubble does not support horizontal layouts")}onWorkspaceChange(){this.bumpBlocksIntoBounds(),this.updateBubbleSize()}bumpBlocksIntoBounds(){if(!this.miniWorkspace.isDragging())for(const i of this.miniWorkspace.getTopBlocks(!1)){const a=i.getRelativeToSurfaceXY();if(20>a.y&&i.moveBy(0,20-a.y),i.RTL){let p=-20;const S=this.miniWorkspace.getFlyout();S&&(p-=S.getWidth()),a.x>p&&i.moveBy(p-a.x,0)}else 20>a.x&&i.moveBy(20-a.x,0)}}updateBubbleSize(){if(!this.miniWorkspace.isDragging()){var i=this.getSize(),a=this.calculateWorkspaceSize();Math.abs(i.width-a.width)<_m.MINIMUM_VIEW_CHANGE&&Math.abs(i.height-a.height)<_m.MINIMUM_VIEW_CHANGE||(this.svgDialog.setAttribute("width",`${a.width}px`),this.svgDialog.setAttribute("height",`${a.height}px`),this.miniWorkspace.setCachedParentSvgSize(a.width,a.height),this.miniWorkspace.RTL&&this.miniWorkspace.getCanvas().setAttribute("transform",`translate(${a.width}, 0)`),this.setSize(new eo(a.width+As.DOUBLE_BORDER,a.height+As.DOUBLE_BORDER),this.autoLayout),this.miniWorkspace.resize(),this.miniWorkspace.recordDragTargets())}}calculateWorkspaceSize(){var i=this.miniWorkspace.getCanvas().getBBox();let a=i.width+_m.MARGIN;i=i.height+_m.MARGIN;const p=this.miniWorkspace.getFlyout();if(p){const S=p.getWorkspace().getMetricsManager().getScrollMetrics();i=Math.max(i,S.height+20),a+=p.getWidth()}return new eo(a,i)}updateBlockStyles(){for(var i of this.miniWorkspace.getAllBlocks(!1))i.setStyle(i.getStyleName());let a;if(i=(a=this.miniWorkspace.getFlyout())==null?void 0:a.getWorkspace())for(const p of i.getAllBlocks(!1))p.setStyle(p.getStyleName())}moveDuringDrag(i){super.moveDuringDrag(i),this.autoLayout=!1}moveTo(i,a){super.moveTo(i,a),this.miniWorkspace.recordDragTargets()}newWorkspaceSvg(i){throw Error("The implementation of newWorkspaceSvg should be monkey-patched in by blockly.ts")}};_m.MINIMUM_VIEW_CHANGE=10,_m.MARGIN=3*As.DOUBLE_BORDER;var Dv,Pv;Dv=17,Pv=16,t.MutatorIcon$$module$build$src$core$icons$mutator_icon=class extends Nv{constructor(i,a){super(a),this.flyoutBlockTypes=i,this.sourceBlock=a,this.saveConnectionsListener=this.updateWorkspacePid=this.rootBlock=this.miniWorkspaceBubble=null}getType(){return t.MutatorIcon$$module$build$src$core$icons$mutator_icon.TYPE}initView(i){this.svgRoot||(super.initView(i),ie(Ve.RECT,{class:"blocklyIconShape",rx:"4",ry:"4",height:"16",width:"16"},this.svgRoot),ie(Ve.PATH,{class:"blocklyIconSymbol",d:"m4.203,7.296 0,1.368 -0.92,0.677 -0.11,0.41 0.9,1.559 0.41,0.11 1.043,-0.457 1.187,0.683 0.127,1.134 0.3,0.3 1.8,0 0.3,-0.299 0.127,-1.138 1.185,-0.682 1.046,0.458 0.409,-0.11 0.9,-1.559 -0.11,-0.41 -0.92,-0.677 0,-1.366 0.92,-0.677 0.11,-0.41 -0.9,-1.559 -0.409,-0.109 -1.046,0.458 -1.185,-0.682 -0.127,-1.138 -0.3,-0.299 -1.8,0 -0.3,0.3 -0.126,1.135 -1.187,0.682 -1.043,-0.457 -0.41,0.11 -0.899,1.559 0.108,0.409z"},this.svgRoot),ie(Ve.CIRCLE,{class:"blocklyIconShape",r:"2.7",cx:"8",cy:"8"},this.svgRoot),Pe(this.svgRoot,"blockly-icon-mutator"))}dispose(){super.dispose();let i;(i=this.miniWorkspaceBubble)==null||i.dispose()}getWeight(){return t.MutatorIcon$$module$build$src$core$icons$mutator_icon.WEIGHT}getSize(){return new eo(Dv,Dv)}applyColour(){super.applyColour();let i;(i=this.miniWorkspaceBubble)==null||i.setColour(this.sourceBlock.style.colourPrimary);let a;(a=this.miniWorkspaceBubble)==null||a.updateBlockStyles()}updateCollapsed(){super.updateCollapsed(),this.sourceBlock.isCollapsed()&&this.setBubbleVisible(!1)}onLocationChange(i){super.onLocationChange(i);let a;(a=this.miniWorkspaceBubble)==null||a.setAnchorLocation(this.getAnchorLocation())}onClick(){super.onClick(),this.sourceBlock.isEditable()&&this.setBubbleVisible(!this.bubbleIsVisible())}isClickableInFlyout(){return!1}bubbleIsVisible(){return!!this.miniWorkspaceBubble}setBubbleVisible(i){if(this.bubbleIsVisible()!==i){if(i){this.miniWorkspaceBubble=new _m(this.getMiniWorkspaceConfig(),this.sourceBlock.workspace,this.getAnchorLocation(),this.getBubbleOwnerRect()),this.applyColour(),this.createRootBlock(),this.addSaveConnectionsListener();let a;(a=this.miniWorkspaceBubble)==null||a.addWorkspaceChangeListener(this.createMiniWorkspaceChangeListener())}else{let a;(a=this.miniWorkspaceBubble)==null||a.dispose(),this.miniWorkspaceBubble=null,this.saveConnectionsListener&&this.sourceBlock.workspace.removeChangeListener(this.saveConnectionsListener),this.saveConnectionsListener=null}ue(new(Ie(vo))(this.sourceBlock,i,"mutator"))}}getMiniWorkspaceConfig(){let i;const a={disable:!1,media:this.sourceBlock.workspace.options.pathToMedia,rtl:this.sourceBlock.RTL,renderer:this.sourceBlock.workspace.options.renderer,rendererOverrides:(i=this.sourceBlock.workspace.options.rendererOverrides)!=null?i:void 0};return this.flyoutBlockTypes.length&&(a.toolbox={kind:"flyoutToolbox",contents:this.flyoutBlockTypes.map(p=>({kind:"block",type:p}))}),a}getAnchorLocation(){const i=Dv/2;return _n.sum(this.workspaceLocation,new _n(i,i))}getBubbleOwnerRect(){const i=this.sourceBlock.getSvgRoot().getBBox();return new Oi(i.y,i.y+i.height,i.x,i.x+i.width)}createRootBlock(){if(!this.sourceBlock.decompose)throw Error("Blocks with mutator icons must include a decompose method");this.rootBlock=this.sourceBlock.decompose(this.miniWorkspaceBubble.getWorkspace());for(var i of this.rootBlock.getDescendants(!1))i.queueRender();this.rootBlock.setMovable(!1),this.rootBlock.setDeletable(!1);let a,p,S,O;i=(O=(a=this.miniWorkspaceBubble)==null||(p=a.getWorkspace())==null||(S=p.getFlyout())==null?void 0:S.getWidth())!=null?O:0,this.rootBlock.moveBy(this.rootBlock.RTL?-(i+Pv):Pv,Pv)}addSaveConnectionsListener(){this.sourceBlock.saveConnections&&this.rootBlock&&(this.saveConnectionsListener=()=>{this.sourceBlock.saveConnections&&this.rootBlock&&this.sourceBlock.saveConnections(this.rootBlock)},this.saveConnectionsListener(),this.sourceBlock.workspace.addChangeListener(this.saveConnectionsListener))}createMiniWorkspaceChangeListener(){return i=>{t.MutatorIcon$$module$build$src$core$icons$mutator_icon.isIgnorableMutatorEvent(i)||this.updateWorkspacePid||(this.updateWorkspacePid=setTimeout(()=>{this.updateWorkspacePid=null,this.recomposeSourceBlock()},0))}}static isIgnorableMutatorEvent(i){return i.isUiEvent||i.type===t.CREATE$$module$build$src$core$events$utils||i.type===t.CHANGE$$module$build$src$core$events$utils&&i.element==="disabled"}recomposeSourceBlock(){if(this.rootBlock){if(!this.sourceBlock.compose)throw Error("Blocks with mutator icons must include a compose method");var i=t.getGroup$$module$build$src$core$events$utils();i||t.setGroup$$module$build$src$core$events$utils(!0);var a=Jr.getExtraBlockState_(this.sourceBlock);this.sourceBlock.compose(this.rootBlock);var p=Jr.getExtraBlockState_(this.sourceBlock);a!==p&&ue(new(Ie(t.CHANGE$$module$build$src$core$events$utils))(this.sourceBlock,"mutation",null,a,p)),t.setGroup$$module$build$src$core$events$utils(i)}}getWorkspace(){let i;return(i=this.miniWorkspaceBubble)==null?void 0:i.getWorkspace()}static reconnect(i,a,p){return xe("MutatorIcon.reconnect","v10","v11","connection.reconnect"),i?i.reconnect(a,p):!1}static findParentWs(i){return xe("MutatorIcon.findParentWs","v10","v11","workspace.getRootWorkspace"),i.getRootWorkspace()}},t.MutatorIcon$$module$build$src$core$icons$mutator_icon.TYPE=Wo.MUTATOR,t.MutatorIcon$$module$build$src$core$icons$mutator_icon.WEIGHT=1,t.MutatorIcon$$module$build$src$core$icons$mutator_icon;var A0=Object.create(null),SE={allExtensions:A0};t.register$$module$build$src$core$extensions("parent_tooltip_when_inline",Gs);var Xd={TEST_ONLY:SE};Xd.apply=es,Xd.buildTooltipForDropdown=t.buildTooltipForDropdown$$module$build$src$core$extensions,Xd.buildTooltipWithFieldText=t.buildTooltipWithFieldText$$module$build$src$core$extensions,Xd.isRegistered=hi,Xd.register=t.register$$module$build$src$core$extensions,Xd.registerMixin=t.registerMixin$$module$build$src$core$extensions,Xd.registerMutator=t.registerMutator$$module$build$src$core$extensions,Xd.runAfterPageLoad=Ld,Xd.unregister=Ri;var Hr;(function(i){i[i.WIN_KEY_FF_LINUX=0]="WIN_KEY_FF_LINUX",i[i.MAC_ENTER=3]="MAC_ENTER",i[i.BACKSPACE=8]="BACKSPACE",i[i.TAB=9]="TAB",i[i.NUM_CENTER=12]="NUM_CENTER",i[i.ENTER=13]="ENTER",i[i.SHIFT=16]="SHIFT",i[i.CTRL=17]="CTRL",i[i.ALT=18]="ALT",i[i.PAUSE=19]="PAUSE",i[i.CAPS_LOCK=20]="CAPS_LOCK",i[i.ESC=27]="ESC",i[i.SPACE=32]="SPACE",i[i.PAGE_UP=33]="PAGE_UP",i[i.PAGE_DOWN=34]="PAGE_DOWN",i[i.END=35]="END",i[i.HOME=36]="HOME",i[i.LEFT=37]="LEFT",i[i.UP=38]="UP",i[i.RIGHT=39]="RIGHT",i[i.DOWN=40]="DOWN",i[i.PLUS_SIGN=43]="PLUS_SIGN",i[i.PRINT_SCREEN=44]="PRINT_SCREEN",i[i.INSERT=45]="INSERT",i[i.DELETE=46]="DELETE",i[i.ZERO=48]="ZERO",i[i.ONE=49]="ONE",i[i.TWO=50]="TWO",i[i.THREE=51]="THREE",i[i.FOUR=52]="FOUR",i[i.FIVE=53]="FIVE",i[i.SIX=54]="SIX",i[i.SEVEN=55]="SEVEN",i[i.EIGHT=56]="EIGHT",i[i.NINE=57]="NINE",i[i.FF_SEMICOLON=59]="FF_SEMICOLON",i[i.FF_EQUALS=61]="FF_EQUALS",i[i.FF_DASH=173]="FF_DASH",i[i.FF_HASH=163]="FF_HASH",i[i.QUESTION_MARK=63]="QUESTION_MARK",i[i.AT_SIGN=64]="AT_SIGN",i[i.A=65]="A",i[i.B=66]="B",i[i.C=67]="C",i[i.D=68]="D",i[i.E=69]="E",i[i.F=70]="F",i[i.G=71]="G",i[i.H=72]="H",i[i.I=73]="I",i[i.J=74]="J",i[i.K=75]="K",i[i.L=76]="L",i[i.M=77]="M",i[i.N=78]="N",i[i.O=79]="O",i[i.P=80]="P",i[i.Q=81]="Q",i[i.R=82]="R",i[i.S=83]="S",i[i.T=84]="T",i[i.U=85]="U",i[i.V=86]="V",i[i.W=87]="W",i[i.X=88]="X",i[i.Y=89]="Y",i[i.Z=90]="Z",i[i.META=91]="META",i[i.WIN_KEY_RIGHT=92]="WIN_KEY_RIGHT",i[i.CONTEXT_MENU=93]="CONTEXT_MENU",i[i.NUM_ZERO=96]="NUM_ZERO",i[i.NUM_ONE=97]="NUM_ONE",i[i.NUM_TWO=98]="NUM_TWO",i[i.NUM_THREE=99]="NUM_THREE",i[i.NUM_FOUR=100]="NUM_FOUR",i[i.NUM_FIVE=101]="NUM_FIVE",i[i.NUM_SIX=102]="NUM_SIX",i[i.NUM_SEVEN=103]="NUM_SEVEN",i[i.NUM_EIGHT=104]="NUM_EIGHT",i[i.NUM_NINE=105]="NUM_NINE",i[i.NUM_MULTIPLY=106]="NUM_MULTIPLY",i[i.NUM_PLUS=107]="NUM_PLUS",i[i.NUM_MINUS=109]="NUM_MINUS",i[i.NUM_PERIOD=110]="NUM_PERIOD",i[i.NUM_DIVISION=111]="NUM_DIVISION",i[i.F1=112]="F1",i[i.F2=113]="F2",i[i.F3=114]="F3",i[i.F4=115]="F4",i[i.F5=116]="F5",i[i.F6=117]="F6",i[i.F7=118]="F7",i[i.F8=119]="F8",i[i.F9=120]="F9",i[i.F10=121]="F10",i[i.F11=122]="F11",i[i.F12=123]="F12",i[i.NUMLOCK=144]="NUMLOCK",i[i.SCROLL_LOCK=145]="SCROLL_LOCK",i[i.FIRST_MEDIA_KEY=166]="FIRST_MEDIA_KEY",i[i.LAST_MEDIA_KEY=183]="LAST_MEDIA_KEY",i[i.SEMICOLON=186]="SEMICOLON",i[i.DASH=189]="DASH",i[i.EQUALS=187]="EQUALS",i[i.COMMA=188]="COMMA",i[i.PERIOD=190]="PERIOD",i[i.SLASH=191]="SLASH",i[i.APOSTROPHE=192]="APOSTROPHE",i[i.TILDE=192]="TILDE",i[i.SINGLE_QUOTE=222]="SINGLE_QUOTE",i[i.OPEN_SQUARE_BRACKET=219]="OPEN_SQUARE_BRACKET",i[i.BACKSLASH=220]="BACKSLASH",i[i.CLOSE_SQUARE_BRACKET=221]="CLOSE_SQUARE_BRACKET",i[i.WIN_KEY=224]="WIN_KEY",i[i.MAC_FF_META=224]="MAC_FF_META",i[i.MAC_WK_CMD_LEFT=91]="MAC_WK_CMD_LEFT",i[i.MAC_WK_CMD_RIGHT=93]="MAC_WK_CMD_RIGHT",i[i.WIN_IME=229]="WIN_IME",i[i.VK_NONAME=252]="VK_NONAME",i[i.PHANTOM=255]="PHANTOM"})(Hr||(Hr={}));var Kd={};Kd.arc=mi,Kd.curve=Ws,Kd.line=Fo,Kd.lineOnAxis=$n,Kd.lineTo=iu,Kd.moveBy=Ui,Kd.moveTo=Js,Kd.point=Kn;var qa={};qa.Coordinate=_n,qa.KeyCodes=Hr,qa.Rect=Oi,qa.Size=eo,qa.Svg=Ve,qa.aria=Ou,qa.array=em,qa.browserEvents=th,qa.colour=bf,qa.deprecation=Mg,qa.dom=Ea,qa.extensions=Xd,qa.idGenerator=nc,qa.math=dm,qa.object=gT,qa.parsing=M_,qa.string=Dn,qa.style=$c,qa.svgMath=xp,qa.svgPaths=Kd,qa.toolbox=yo,qa.userAgent=pf,qa.xml=Bd;var A_={};A_.register=gi,A_.unregister=Uf;var vm=class extends As{constructor(i,a,p,S){super(a,p,S),this.text=i,this.workspace=a,this.anchor=p,this.ownerRect=S,this.paragraph=this.stringToSvg(i,this.contentContainer),this.updateBubbleSize()}getText(){return this.text}setText(i){this.text=i,mt(this.paragraph),this.paragraph=this.stringToSvg(i,this.contentContainer),this.updateBubbleSize()}stringToSvg(i,a){return a=this.createParagraph(a),i=this.createSpans(a,i),this.workspace.RTL&&this.rightAlignSpans(a.getBBox().width,i),a}createParagraph(i){return ie(Ve.TEXT,{class:"blocklyText blocklyBubbleText blocklyNoPointerEvents",y:As.BORDER_WIDTH},i)}createSpans(i,a){return a.split(` +`).map(p=>{const S=ie(Ve.TSPAN,{dy:"1em",x:As.BORDER_WIDTH},i);return p=document.createTextNode(p),S.appendChild(p),S})}rightAlignSpans(i,a){for(const p of a)p.setAttribute("text-anchor","end"),p.setAttribute("x",`${i+As.BORDER_WIDTH}`)}updateBubbleSize(){const i=this.paragraph.getBBox();this.setSize(new eo(i.width+2*As.BORDER_WIDTH,i.height+2*As.BORDER_WIDTH),!0)}},aa=class extends As{constructor(i,a,p){super(i,a,p),this.workspace=i,this.anchor=a,this.ownerRect=p,this.resizePointerMoveListener=this.resizePointerUpListener=null,this.textChangeListeners=[],this.sizeChangeListeners=[],this.text="",this.DEFAULT_SIZE=new eo(160+As.DOUBLE_BORDER,80+As.DOUBLE_BORDER),this.MIN_SIZE=new eo(45+As.DOUBLE_BORDER,20+As.DOUBLE_BORDER),{inputRoot:this.inputRoot,textArea:this.textArea}=this.createEditor(this.contentContainer),this.resizeGroup=this.createResizeHandle(this.svgRoot),this.setSize(this.DEFAULT_SIZE,!0)}getText(){return this.text}setText(i){this.text=i,this.textArea.value=i,this.onTextChange()}addTextChangeListener(i){this.textChangeListeners.push(i)}addSizeChangeListener(i){this.sizeChangeListeners.push(i)}createEditor(i){i=ie(Ve.FOREIGNOBJECT,{x:As.BORDER_WIDTH,y:As.BORDER_WIDTH},i);const a=document.createElementNS(xc,"body");a.setAttribute("xmlns",xc),a.className="blocklyMinimalBody";const p=document.createElementNS(xc,"textarea");return p.className="blocklyCommentTextarea",p.setAttribute("dir",this.workspace.RTL?"RTL":"LTR"),a.appendChild(p),i.appendChild(a),this.bindTextAreaEvents(p),setTimeout(()=>{p.focus()},0),{inputRoot:i,textArea:p}}bindTextAreaEvents(i){$e(i,"wheel",this,a=>{a.stopPropagation()}),$e(i,"focus",this,this.onStartEdit,!0),$e(i,"change",this,this.onTextChange)}createResizeHandle(i){i=ie(Ve.G,{class:this.workspace.RTL?"blocklyResizeSW":"blocklyResizeSE"},i);const a=2*As.BORDER_WIDTH;return ie(Ve.POLYGON,{points:`0,${a} ${a},${a} ${a},0`},i),ie(Ve.LINE,{class:"blocklyResizeLine",x1:a/3,y1:a-1,x2:a-1,y2:a/3},i),ie(Ve.LINE,{class:"blocklyResizeLine",x1:2*a/3,y1:a-1,x2:a-1,y2:2*a/3},i),$e(i,"pointerdown",this,this.onResizePointerDown),i}setSize(i,a=!1){i.width=Math.max(i.width,this.MIN_SIZE.width),i.height=Math.max(i.height,this.MIN_SIZE.height);const p=i.width-As.DOUBLE_BORDER,S=i.height-As.DOUBLE_BORDER;this.inputRoot.setAttribute("width",`${p}`),this.inputRoot.setAttribute("height",`${S}`),this.textArea.style.width=`${p-4}px`,this.textArea.style.height=`${S-4}px`,this.workspace.RTL?this.resizeGroup.setAttribute("transform",`translate(${As.DOUBLE_BORDER}, ${S}) scale(-1 1)`):this.resizeGroup.setAttribute("transform",`translate(${p}, ${S})`),super.setSize(i,a),this.onSizeChange()}getSize(){return super.getSize()}onResizePointerDown(i){this.bringToFront(),Nt(i)||(this.workspace.startDrag(i,new _n(this.workspace.RTL?-this.getSize().width:this.getSize().width,this.getSize().height)),this.resizePointerUpListener=$e(document,"pointerup",this,this.onResizePointerUp),this.resizePointerMoveListener=$e(document,"pointermove",this,this.onResizePointerMove),this.workspace.hideChaff()),i.stopPropagation()}onResizePointerUp(i){rt(),this.resizePointerUpListener&&(it(this.resizePointerUpListener),this.resizePointerUpListener=null),this.resizePointerMoveListener&&(it(this.resizePointerMoveListener),this.resizePointerMoveListener=null)}onResizePointerMove(i){i=this.workspace.moveDrag(i),this.setSize(new eo(this.workspace.RTL?-i.x:i.x,i.y),!1),this.onSizeChange()}onStartEdit(){this.bringToFront()&&this.textArea.focus()}onTextChange(){this.text=this.textArea.value;for(const i of this.textChangeListeners)i()}onSizeChange(){for(const i of this.sizeChangeListeners)i()}};At(` .blocklyCommentTextarea { background-color: #fef49c; border: 0; @@ -584,12 +584,12 @@ Blockly.YourGeneratorName.nameDB_.setVariableMap(workspace.getVariableMap());`), resize: none; text-overflow: hidden; } -`);var Jd=17,_T=160,vT=80,nd=class extends Nv{constructor(i){super(i),this.sourceBlock=i,this.textBubble=this.textInputBubble=null,this.text="",this.bubbleSize=new eo(_T,vT),this.bubbleVisiblity=!1}getType(){return nd.TYPE}initView(i){this.svgRoot||(super.initView(i),se(Ve.CIRCLE,{class:"blocklyIconShape",r:"8",cx:"8",cy:"8"},this.svgRoot),se(Ve.PATH,{class:"blocklyIconSymbol",d:"m6.8,10h2c0.003,-0.617 0.271,-0.962 0.633,-1.266 2.875,-2.4050.607,-5.534 -3.765,-3.874v1.7c3.12,-1.657 3.698,0.118 2.336,1.25-1.201,0.998 -1.201,1.528 -1.204,2.19z"},this.svgRoot),se(Ve.RECT,{class:"blocklyIconSymbol",x:"6.8",y:"10.78",height:"2",width:"2"},this.svgRoot),$e(this.svgRoot,"blockly-icon-comment"))}dispose(){super.dispose();let i;(i=this.textInputBubble)==null||i.dispose();let a;(a=this.textBubble)==null||a.dispose()}getWeight(){return nd.WEIGHT}getSize(){return new eo(Jd,Jd)}applyColour(){super.applyColour();const i=this.sourceBlock.style.colourPrimary;let a;(a=this.textInputBubble)==null||a.setColour(i);let p;(p=this.textBubble)==null||p.setColour(i)}updateEditable(){super.updateEditable(),this.bubbleIsVisible()&&(this.setBubbleVisible(!1),this.setBubbleVisible(!0))}onLocationChange(i){super.onLocationChange(i),i=this.getAnchorLocation();let a;(a=this.textInputBubble)==null||a.setAnchorLocation(i);let p;(p=this.textBubble)==null||p.setAnchorLocation(i)}setText(i){const a=this.text;ue(new(Ie(t.CHANGE$$module$build$src$core$events$utils))(this.sourceBlock,"comment",null,a,i)),this.text=i;let p;(p=this.textInputBubble)==null||p.setText(this.text);let S;(S=this.textBubble)==null||S.setText(this.text)}getText(){return this.text}setBubbleSize(i){this.bubbleSize=i;let a;(a=this.textInputBubble)==null||a.setSize(this.bubbleSize,!0)}getBubbleSize(){return this.bubbleSize}saveState(){return this.text?{text:this.text,pinned:this.bubbleIsVisible(),height:this.bubbleSize.height,width:this.bubbleSize.width}:null}loadState(i){let a;this.text=(a=i.text)!=null?a:"";let p,S;this.bubbleSize=new eo((p=i.width)!=null?p:_T,(S=i.height)!=null?S:vT);let O;this.bubbleVisiblity=(O=i.pinned)!=null?O:!1,setTimeout(()=>this.setBubbleVisible(this.bubbleVisiblity),1)}onClick(){super.onClick(),this.setBubbleVisible(!this.bubbleIsVisible())}isClickableInFlyout(){return!1}onTextChange(){if(this.textInputBubble){var i=this.textInputBubble.getText();this.text!==i&&(ue(new(Ie(t.CHANGE$$module$build$src$core$events$utils))(this.sourceBlock,"comment",null,this.text,i)),this.text=i)}}onSizeChange(){this.textInputBubble&&(this.bubbleSize=this.textInputBubble.getSize())}bubbleIsVisible(){return this.bubbleVisiblity}setBubbleVisible(i){(!i||!this.textBubble&&!this.textInputBubble)&&(i||this.textBubble||this.textInputBubble)&&(this.bubbleVisiblity=i,this.sourceBlock.rendered&&!this.sourceBlock.isInFlyout&&(i?(this.sourceBlock.isEditable()?this.showEditableBubble():this.showNonEditableBubble(),this.applyColour()):this.hideBubble(),ue(new(Ie(vo))(this.sourceBlock,i,"comment"))))}showEditableBubble(){this.textInputBubble=new aa(this.sourceBlock.workspace,this.getAnchorLocation(),this.getBubbleOwnerRect()),this.textInputBubble.setText(this.getText()),this.textInputBubble.setSize(this.bubbleSize,!0),this.textInputBubble.addTextChangeListener(()=>this.onTextChange()),this.textInputBubble.addSizeChangeListener(()=>this.onSizeChange())}showNonEditableBubble(){this.textBubble=new vm(this.getText(),this.sourceBlock.workspace,this.getAnchorLocation(),this.getBubbleOwnerRect())}hideBubble(){let i;(i=this.textInputBubble)==null||i.dispose(),this.textInputBubble=null;let a;(a=this.textBubble)==null||a.dispose(),this.textBubble=null}getAnchorLocation(){const i=Jd/2;return _n.sum(this.workspaceLocation,new _n(i,i))}getBubbleOwnerRect(){const i=this.sourceBlock.getSvgRoot().getBBox();return new Oi(i.y,i.y+i.height,i.x,i.x+i.width)}};nd.TYPE=Wo.COMMENT,nd.WEIGHT=3,gi(nd.TYPE,nd);var lb=17,Zf=class extends Nv{constructor(i){super(i),this.sourceBlock=i,this.textMap=new Map,this.textBubble=null}getType(){return Zf.TYPE}initView(i){this.svgRoot||(super.initView(i),se(Ve.PATH,{class:"blocklyIconShape",d:"M2,15Q-1,15 0.5,12L6.5,1.7Q8,-1 9.5,1.7L15.5,12Q17,15 14,15z"},this.svgRoot),se(Ve.PATH,{class:"blocklyIconSymbol",d:"m7,4.8v3.16l0.27,2.27h1.46l0.27,-2.27v-3.16z"},this.svgRoot),se(Ve.RECT,{class:"blocklyIconSymbol",x:"7",y:"11",height:"2",width:"2"},this.svgRoot),$e(this.svgRoot,"blockly-icon-warning"))}dispose(){super.dispose();let i;(i=this.textBubble)==null||i.dispose()}getWeight(){return Zf.WEIGHT}getSize(){return new eo(lb,lb)}applyColour(){super.applyColour();let i;(i=this.textBubble)==null||i.setColour(this.sourceBlock.style.colourPrimary)}updateCollapsed(){}isShownWhenCollapsed(){return!0}onLocationChange(i){super.onLocationChange(i);let a;(a=this.textBubble)==null||a.setAnchorLocation(this.getAnchorLocation())}addMessage(i,a){if(this.textMap.get(a)===i)return this;i?this.textMap.set(a,i):this.textMap.delete(a);let p;return(p=this.textBubble)==null||p.setText(this.getText()),this}getText(){return[...this.textMap.values()].join(` -`)}onClick(){super.onClick(),this.setBubbleVisible(!this.bubbleIsVisible())}isClickableInFlyout(){return!1}bubbleIsVisible(){return!!this.textBubble}setBubbleVisible(i){if(this.bubbleIsVisible()!==i){if(i)this.textBubble=new vm(this.getText(),this.sourceBlock.workspace,this.getAnchorLocation(),this.getBubbleOwnerRect()),this.applyColour();else{let a;(a=this.textBubble)==null||a.dispose(),this.textBubble=null}ue(new(Ie(vo))(this.sourceBlock,i,"warning"))}}getAnchorLocation(){const i=lb/2;return _n.sum(this.workspaceLocation,new _n(i,i))}getBubbleOwnerRect(){const i=this.sourceBlock.getSvgRoot().getBBox();return new Oi(i.y,i.y+i.height,i.x,i.x+i.width)}};Zf.TYPE=Wo.WARNING,Zf.WEIGHT=2;var Bv=class extends Error{constructor(i){super(`Tried to append an icon of type ${i.getType()} when an icon of that type already exists on the block. Use getIcon to access the existing icon.`),this.icon=i}},Ac={};Ac.DuplicateIconType=Bv;var Mn={};Mn.CommentIcon=nd,Mn.Icon=Nv,Mn.IconType=Wo,Mn.MutatorIcon=t.MutatorIcon$$module$build$src$core$icons$mutator_icon,Mn.WarningIcon=Zf,Mn.exceptions=Ac,Mn.registry=A_;var I0,Ki;I0="PROCEDURE",t.DEFAULT_ARG$$module$build$src$core$procedures="x",Ki={CATEGORY_NAME:I0,DEFAULT_ARG:t.DEFAULT_ARG$$module$build$src$core$procedures},Ki.ObservableProcedureMap=C0,Ki.allProcedures=wh,Ki.findLegalName=t.findLegalName$$module$build$src$core$procedures,Ki.flyoutCategory=yn,Ki.getCallers=su,Ki.getDefinition=t.getDefinition$$module$build$src$core$procedures,Ki.isNameUsed=Cn,Ki.isProcedureBlock=ma,Ki.mutateCallers=t.mutateCallers$$module$build$src$core$procedures,Ki.mutatorOpenListener=vc,Ki.rename=t.rename$$module$build$src$core$procedures;var ub=class{constructor(){this.NONE=0,this.FIELD=1,this.HAT=2,this.ICON=4,this.SPACER=8,this.BETWEEN_ROW_SPACER=16,this.IN_ROW_SPACER=32,this.EXTERNAL_VALUE_INPUT=64,this.INPUT=128,this.INLINE_INPUT=256,this.STATEMENT_INPUT=512,this.CONNECTION=1024,this.PREVIOUS_CONNECTION=2048,this.NEXT_CONNECTION=4096,this.OUTPUT_CONNECTION=8192,this.CORNER=16384,this.LEFT_SQUARE_CORNER=32768,this.LEFT_ROUND_CORNER=65536,this.RIGHT_SQUARE_CORNER=131072,this.RIGHT_ROUND_CORNER=262144,this.JAGGED_EDGE=524288,this.ROW=1048576,this.TOP_ROW=2097152,this.BOTTOM_ROW=4194304,this.INPUT_ROW=8388608,this.LEFT_CORNER=this.LEFT_SQUARE_CORNER|this.LEFT_ROUND_CORNER,this.RIGHT_CORNER=this.RIGHT_SQUARE_CORNER|this.RIGHT_ROUND_CORNER,this.nextTypeValue_=16777216}getType(i){return Object.prototype.hasOwnProperty.call(this,i)||(this[i]=this.nextTypeValue_,this.nextTypeValue_<<=1),this[i]}isField(i){return i.type&this.FIELD}isHat(i){return i.type&this.HAT}isIcon(i){return i.type&this.ICON}isSpacer(i){return i.type&this.SPACER}isInRowSpacer(i){return i.type&this.IN_ROW_SPACER}isInput(i){return i.type&this.INPUT}isExternalInput(i){return i.type&this.EXTERNAL_VALUE_INPUT}isInlineInput(i){return i.type&this.INLINE_INPUT}isStatementInput(i){return i.type&this.STATEMENT_INPUT}isPreviousConnection(i){return i.type&this.PREVIOUS_CONNECTION}isNextConnection(i){return i.type&this.NEXT_CONNECTION}isPreviousOrNextConnection(i){return i.type&(this.PREVIOUS_CONNECTION|this.NEXT_CONNECTION)}isLeftRoundedCorner(i){return i.type&this.LEFT_ROUND_CORNER}isRightRoundedCorner(i){return i.type&this.RIGHT_ROUND_CORNER}isLeftSquareCorner(i){return i.type&this.LEFT_SQUARE_CORNER}isRightSquareCorner(i){return i.type&this.RIGHT_SQUARE_CORNER}isCorner(i){return i.type&this.CORNER}isJaggedEdge(i){return i.type&this.JAGGED_EDGE}isRow(i){return i.type&this.ROW}isBetweenRowSpacer(i){return i.type&this.BETWEEN_ROW_SPACER}isTopRow(i){return i.type&this.TOP_ROW}isBottomRow(i){return i.type&this.BOTTOM_ROW}isTopOrBottomRow(i){return i.type&(this.TOP_ROW|this.BOTTOM_ROW)}isInputRow(i){return i.type&this.INPUT_ROW}},ut=new ub,sr=class{constructor(i){this.centerline=this.xPos=this.height=this.width=0,this.constants_=i,this.type=ut.NONE,this.notchOffset=this.constants_.NOTCH_OFFSET_LEFT}},I_=class{constructor(i){this.elements=[],this.xPos=this.yPos=this.widthWithConnectedBlocks=this.minWidth=this.minHeight=this.width=this.height=0,this.hasStatement=this.hasExternalInput=!1,this.statementEdge=0,this.hasJaggedEdge=this.hasDummyInput=this.hasInlineInput=!1,this.align=null,this.constants_=i,this.type=ut.ROW,this.notchOffset=this.constants_.NOTCH_OFFSET_LEFT}getLastInput(){for(let i=this.elements.length-1;0<=i;i--){const a=this.elements[i];if(ut.isInput(a))return a}return null}measure(){throw Error("Unexpected attempt to measure a base Row.")}startsWithElemSpacer(){return!0}endsWithElemSpacer(){return!0}getFirstSpacer(){for(let i=0;ithis.setBubbleVisible(this.bubbleVisiblity),1)}onClick(){super.onClick(),this.setBubbleVisible(!this.bubbleIsVisible())}isClickableInFlyout(){return!1}onTextChange(){if(this.textInputBubble){var i=this.textInputBubble.getText();this.text!==i&&(ue(new(Ie(t.CHANGE$$module$build$src$core$events$utils))(this.sourceBlock,"comment",null,this.text,i)),this.text=i)}}onSizeChange(){this.textInputBubble&&(this.bubbleSize=this.textInputBubble.getSize())}bubbleIsVisible(){return this.bubbleVisiblity}setBubbleVisible(i){(!i||!this.textBubble&&!this.textInputBubble)&&(i||this.textBubble||this.textInputBubble)&&(this.bubbleVisiblity=i,this.sourceBlock.rendered&&!this.sourceBlock.isInFlyout&&(i?(this.sourceBlock.isEditable()?this.showEditableBubble():this.showNonEditableBubble(),this.applyColour()):this.hideBubble(),ue(new(Ie(vo))(this.sourceBlock,i,"comment"))))}showEditableBubble(){this.textInputBubble=new aa(this.sourceBlock.workspace,this.getAnchorLocation(),this.getBubbleOwnerRect()),this.textInputBubble.setText(this.getText()),this.textInputBubble.setSize(this.bubbleSize,!0),this.textInputBubble.addTextChangeListener(()=>this.onTextChange()),this.textInputBubble.addSizeChangeListener(()=>this.onSizeChange())}showNonEditableBubble(){this.textBubble=new vm(this.getText(),this.sourceBlock.workspace,this.getAnchorLocation(),this.getBubbleOwnerRect())}hideBubble(){let i;(i=this.textInputBubble)==null||i.dispose(),this.textInputBubble=null;let a;(a=this.textBubble)==null||a.dispose(),this.textBubble=null}getAnchorLocation(){const i=Jd/2;return _n.sum(this.workspaceLocation,new _n(i,i))}getBubbleOwnerRect(){const i=this.sourceBlock.getSvgRoot().getBBox();return new Oi(i.y,i.y+i.height,i.x,i.x+i.width)}};nd.TYPE=Wo.COMMENT,nd.WEIGHT=3,gi(nd.TYPE,nd);var lb=17,Zf=class extends Nv{constructor(i){super(i),this.sourceBlock=i,this.textMap=new Map,this.textBubble=null}getType(){return Zf.TYPE}initView(i){this.svgRoot||(super.initView(i),ie(Ve.PATH,{class:"blocklyIconShape",d:"M2,15Q-1,15 0.5,12L6.5,1.7Q8,-1 9.5,1.7L15.5,12Q17,15 14,15z"},this.svgRoot),ie(Ve.PATH,{class:"blocklyIconSymbol",d:"m7,4.8v3.16l0.27,2.27h1.46l0.27,-2.27v-3.16z"},this.svgRoot),ie(Ve.RECT,{class:"blocklyIconSymbol",x:"7",y:"11",height:"2",width:"2"},this.svgRoot),Pe(this.svgRoot,"blockly-icon-warning"))}dispose(){super.dispose();let i;(i=this.textBubble)==null||i.dispose()}getWeight(){return Zf.WEIGHT}getSize(){return new eo(lb,lb)}applyColour(){super.applyColour();let i;(i=this.textBubble)==null||i.setColour(this.sourceBlock.style.colourPrimary)}updateCollapsed(){}isShownWhenCollapsed(){return!0}onLocationChange(i){super.onLocationChange(i);let a;(a=this.textBubble)==null||a.setAnchorLocation(this.getAnchorLocation())}addMessage(i,a){if(this.textMap.get(a)===i)return this;i?this.textMap.set(a,i):this.textMap.delete(a);let p;return(p=this.textBubble)==null||p.setText(this.getText()),this}getText(){return[...this.textMap.values()].join(` +`)}onClick(){super.onClick(),this.setBubbleVisible(!this.bubbleIsVisible())}isClickableInFlyout(){return!1}bubbleIsVisible(){return!!this.textBubble}setBubbleVisible(i){if(this.bubbleIsVisible()!==i){if(i)this.textBubble=new vm(this.getText(),this.sourceBlock.workspace,this.getAnchorLocation(),this.getBubbleOwnerRect()),this.applyColour();else{let a;(a=this.textBubble)==null||a.dispose(),this.textBubble=null}ue(new(Ie(vo))(this.sourceBlock,i,"warning"))}}getAnchorLocation(){const i=lb/2;return _n.sum(this.workspaceLocation,new _n(i,i))}getBubbleOwnerRect(){const i=this.sourceBlock.getSvgRoot().getBBox();return new Oi(i.y,i.y+i.height,i.x,i.x+i.width)}};Zf.TYPE=Wo.WARNING,Zf.WEIGHT=2;var Bv=class extends Error{constructor(i){super(`Tried to append an icon of type ${i.getType()} when an icon of that type already exists on the block. Use getIcon to access the existing icon.`),this.icon=i}},Ac={};Ac.DuplicateIconType=Bv;var An={};An.CommentIcon=nd,An.Icon=Nv,An.IconType=Wo,An.MutatorIcon=t.MutatorIcon$$module$build$src$core$icons$mutator_icon,An.WarningIcon=Zf,An.exceptions=Ac,An.registry=A_;var I0,Ki;I0="PROCEDURE",t.DEFAULT_ARG$$module$build$src$core$procedures="x",Ki={CATEGORY_NAME:I0,DEFAULT_ARG:t.DEFAULT_ARG$$module$build$src$core$procedures},Ki.ObservableProcedureMap=C0,Ki.allProcedures=wh,Ki.findLegalName=t.findLegalName$$module$build$src$core$procedures,Ki.flyoutCategory=yn,Ki.getCallers=su,Ki.getDefinition=t.getDefinition$$module$build$src$core$procedures,Ki.isNameUsed=Mn,Ki.isProcedureBlock=ma,Ki.mutateCallers=t.mutateCallers$$module$build$src$core$procedures,Ki.mutatorOpenListener=vc,Ki.rename=t.rename$$module$build$src$core$procedures;var ub=class{constructor(){this.NONE=0,this.FIELD=1,this.HAT=2,this.ICON=4,this.SPACER=8,this.BETWEEN_ROW_SPACER=16,this.IN_ROW_SPACER=32,this.EXTERNAL_VALUE_INPUT=64,this.INPUT=128,this.INLINE_INPUT=256,this.STATEMENT_INPUT=512,this.CONNECTION=1024,this.PREVIOUS_CONNECTION=2048,this.NEXT_CONNECTION=4096,this.OUTPUT_CONNECTION=8192,this.CORNER=16384,this.LEFT_SQUARE_CORNER=32768,this.LEFT_ROUND_CORNER=65536,this.RIGHT_SQUARE_CORNER=131072,this.RIGHT_ROUND_CORNER=262144,this.JAGGED_EDGE=524288,this.ROW=1048576,this.TOP_ROW=2097152,this.BOTTOM_ROW=4194304,this.INPUT_ROW=8388608,this.LEFT_CORNER=this.LEFT_SQUARE_CORNER|this.LEFT_ROUND_CORNER,this.RIGHT_CORNER=this.RIGHT_SQUARE_CORNER|this.RIGHT_ROUND_CORNER,this.nextTypeValue_=16777216}getType(i){return Object.prototype.hasOwnProperty.call(this,i)||(this[i]=this.nextTypeValue_,this.nextTypeValue_<<=1),this[i]}isField(i){return i.type&this.FIELD}isHat(i){return i.type&this.HAT}isIcon(i){return i.type&this.ICON}isSpacer(i){return i.type&this.SPACER}isInRowSpacer(i){return i.type&this.IN_ROW_SPACER}isInput(i){return i.type&this.INPUT}isExternalInput(i){return i.type&this.EXTERNAL_VALUE_INPUT}isInlineInput(i){return i.type&this.INLINE_INPUT}isStatementInput(i){return i.type&this.STATEMENT_INPUT}isPreviousConnection(i){return i.type&this.PREVIOUS_CONNECTION}isNextConnection(i){return i.type&this.NEXT_CONNECTION}isPreviousOrNextConnection(i){return i.type&(this.PREVIOUS_CONNECTION|this.NEXT_CONNECTION)}isLeftRoundedCorner(i){return i.type&this.LEFT_ROUND_CORNER}isRightRoundedCorner(i){return i.type&this.RIGHT_ROUND_CORNER}isLeftSquareCorner(i){return i.type&this.LEFT_SQUARE_CORNER}isRightSquareCorner(i){return i.type&this.RIGHT_SQUARE_CORNER}isCorner(i){return i.type&this.CORNER}isJaggedEdge(i){return i.type&this.JAGGED_EDGE}isRow(i){return i.type&this.ROW}isBetweenRowSpacer(i){return i.type&this.BETWEEN_ROW_SPACER}isTopRow(i){return i.type&this.TOP_ROW}isBottomRow(i){return i.type&this.BOTTOM_ROW}isTopOrBottomRow(i){return i.type&(this.TOP_ROW|this.BOTTOM_ROW)}isInputRow(i){return i.type&this.INPUT_ROW}},ct=new ub,sr=class{constructor(i){this.centerline=this.xPos=this.height=this.width=0,this.constants_=i,this.type=ct.NONE,this.notchOffset=this.constants_.NOTCH_OFFSET_LEFT}},I_=class{constructor(i){this.elements=[],this.xPos=this.yPos=this.widthWithConnectedBlocks=this.minWidth=this.minHeight=this.width=this.height=0,this.hasStatement=this.hasExternalInput=!1,this.statementEdge=0,this.hasJaggedEdge=this.hasDummyInput=this.hasInlineInput=!1,this.align=null,this.constants_=i,this.type=ct.ROW,this.notchOffset=this.constants_.NOTCH_OFFSET_LEFT}getLastInput(){for(let i=this.elements.length-1;0<=i;i--){const a=this.elements[i];if(ct.isInput(a))return a}return null}measure(){throw Error("Unexpected attempt to measure a base Row.")}startsWithElemSpacer(){return!0}endsWithElemSpacer(){return!0}getFirstSpacer(){for(let i=0;irect,`,`${i} .blocklyEditableText>rect {`,`fill: ${this.FIELD_BORDER_RECT_COLOUR};`,"fill-opacity: .6;","stroke: none;","}",`${i} .blocklyNonEditableText>text,`,`${i} .blocklyEditableText>text {`,"fill: #000;","}",`${i} .blocklyFlyoutLabelText {`,"fill: #000;","}",`${i} .blocklyText.blocklyBubbleText {`,"fill: #000;","}",`${i} .blocklyEditableText:not(.editing):hover>rect {`,"stroke: #fff;","stroke-width: 2;","}",`${i} .blocklyHtmlInput {`,`font-family: ${this.FIELD_TEXT_FONTFAMILY};`,`font-weight: ${this.FIELD_TEXT_FONTWEIGHT};`,"}",`${i} .blocklySelected>.blocklyPath {`,"stroke: #fc3;","stroke-width: 3px;","}",`${i} .blocklyHighlightedConnectionPath {`,"stroke: #fc3;","}",`${i} .blocklyReplaceable .blocklyPath {`,"fill-opacity: .5;","}",`${i} .blocklyReplaceable .blocklyPathLight,`,`${i} .blocklyReplaceable .blocklyPathDark {`,"display: none;","}",`${i} .blocklyInsertionMarker>.blocklyPath {`,`fill-opacity: ${this.INSERTION_MARKER_OPACITY};`,"stroke: none;","}"]}},L_=class{constructor(i,a){this.inlinePath_=this.outlinePath_="",this.block_=i,this.info_=a,this.topLeft_=i.getRelativeToSurfaceXY(),this.constants_=a.getRenderer().getConstants()}draw(){this.drawOutline_(),this.drawInternals_(),this.updateConnectionHighlights(),this.block_.pathObject.setPath(this.outlinePath_+` -`+this.inlinePath_),this.info_.RTL&&this.block_.pathObject.flipRTL(),this.recordSizeOnBlock_()}hideHiddenIcons_(){xe("hideHiddenIcons_","v10","v11")}recordSizeOnBlock_(){this.block_.height=this.info_.height,this.block_.width=this.info_.widthWithChildren}drawOutline_(){this.drawTop_();for(let i=1;ii||i>this.fieldRow.length)throw Error("index "+i+" out of bounds.");return(a||a===""&&p)&&(typeof a=="string"&&(a=t.fromJson$$module$build$src$core$field_registry({type:"field_label",text:a})),a.setSourceBlock(this.sourceBlock),this.sourceBlock.rendered&&(a.init(),a.applyColour()),a.name=p,a.setVisible(this.isVisible()),a.prefixField&&(i=this.insertFieldAt(i,a.prefixField)),this.fieldRow.splice(i,0,a),i++,a.suffixField&&(i=this.insertFieldAt(i,a.suffixField)),this.sourceBlock.rendered&&(this.sourceBlock.queueRender(),this.sourceBlock.bumpNeighbours())),i}removeField(i,a){for(let p=0,S;S=this.fieldRow[p];p++)if(S.name===i)return S.dispose(),this.fieldRow.splice(p,1),this.sourceBlock.rendered&&(this.sourceBlock.queueRender(),this.sourceBlock.bumpNeighbours()),!0;if(a)return!1;throw Error('Field "'+i+'" not found.')}isVisible(){return this.visible}setVisible(i){let a=[];if(this.visible===i)return a;this.visible=i;for(let S=0,O;O=this.fieldRow[S];S++)O.setVisible(i);if(this.connection){var p=this.connection;i?a=p.startTrackingAll():p.stopTrackingAll(),(p=p.targetBlock())&&(p.getSvgRoot().style.display=i?"block":"none")}return a}markDirty(){for(let i=0,a;a=this.fieldRow[i];i++)a.markDirty()}setCheck(i){if(!this.connection)throw Error("This input does not have a connection.");return this.connection.setCheck(i),this}setAlign(i){return this.align=i,this.sourceBlock.rendered&&this.sourceBlock.queueRender(),this}setShadowDom(i){if(!this.connection)throw Error("This input does not have a connection.");return this.connection.setShadowDom(i),this}getShadowDom(){if(!this.connection)throw Error("This input does not have a connection.");return this.connection.getShadowDom()}init(){if(this.sourceBlock.workspace.rendered)for(let i=0;i{pa(p.getSourceBlock()),setTimeout(()=>{S.bringToFront()},0)})}}}update(i,a){const p=this.getCandidate(i);((this.wouldDeleteBlock=this.shouldDelete(!!p,a))||this.shouldUpdatePreviews(p,i))&&(t.disable$$module$build$src$core$events$utils(),this.maybeHidePreview(p),this.maybeShowPreview(p),t.enable$$module$build$src$core$events$utils())}createMarkerBlock(i){var a=i.type;t.disable$$module$build$src$core$events$utils();let p;try{if(p=this.workspace.newBlock(a),p.setInsertionMarker(!0),i.saveExtraState){var S=i.saveExtraState(!0);S&&p.loadExtraState&&p.loadExtraState(S)}else if(i.mutationToDom){const O=i.mutationToDom();O&&p.domToMutation&&p.domToMutation(O)}for(a=0;a{let Yt;(Yt=S)==null||Yt.positionNearConnection(Ue,j,ve);let jn;(jn=S)==null||jn.getSvgRoot().setAttribute("visibility","visible")}),this.markerConnection=O}hideInsertionMarker(){if(this.markerConnection){var i=this.markerConnection,a=i.getSourceBlock(),p=a.outputConnection,S;if((S=a.previousConnection)!=null&&S.targetConnection||p!=null&&p.targetConnection)a.unplug(!0);else{let O;(O=i.targetBlock())==null||O.unplug(!1)}if(i.targetConnection)throw Error("markerConnection still connected at the end of disconnectInsertionMarker");this.markerConnection=null,(i=a.getSvgRoot())&&i.setAttribute("visibility","hidden")}}showInsertionInputOutline(i){i=i.closest,this.highlightedBlock=i.getSourceBlock(),this.highlightedBlock.highlightShapeForInput(i,!0)}hideInsertionInputOutline(){if(this.highlightedBlock){if(!this.activeCandidate)throw Error("Cannot hide the insertion marker outline because there is no active candidate");this.highlightedBlock.highlightShapeForInput(this.activeCandidate.closest,!1),this.highlightedBlock=null}}showReplacementFade(i){if(this.fadedBlock=i.closest.targetBlock(),!this.fadedBlock)throw Error("Cannot show the replacement fade because the closest connection does not have a target block");this.fadedBlock.fadeForReplacement(!0)}hideReplacementFade(){this.fadedBlock&&(this.fadedBlock.fadeForReplacement(!1),this.fadedBlock=null)}getInsertionMarkers(){const i=[];return this.firstMarker&&i.push(this.firstMarker),this.lastMarker&&i.push(this.lastMarker),i}disposeInsertionMarker(i){if(i){t.disable$$module$build$src$core$events$utils();try{i.dispose()}finally{t.enable$$module$build$src$core$events$utils()}}}};(function(i){i=i.PREVIEW_TYPE||(i.PREVIEW_TYPE={}),i[i.INSERTION_MARKER=0]="INSERTION_MARKER",i[i.INPUT_OUTLINE=1]="INPUT_OUTLINE",i[i.REPLACEMENT_FADE=2]="REPLACEMENT_FADE"})(Sf||(Sf={})),Sf.PREVIEW_TYPE;var P_=class{constructor(i){this.overrides=null,this.name=i}getClassName(){return this.name+"-renderer"}init(i,a){this.constants_=this.makeConstants_(),a&&(this.overrides=a,Object.assign(this.constants_,a)),this.constants_.setTheme(i),this.constants_.init()}createDom(i,a){this.constants_.createDom(i,this.name+"-"+a.name,"."+this.getClassName()+"."+a.getClassName())}refreshDom(i,a){const p=this.getConstants();p.dispose(),this.constants_=this.makeConstants_(),this.overrides&&Object.assign(this.constants_,this.overrides),this.constants_.randomIdentifier=p.randomIdentifier,this.constants_.setTheme(a),this.constants_.init(),this.createDom(i,a)}dispose(){this.constants_&&this.constants_.dispose()}makeConstants_(){return new O_}makeRenderInfo_(i){return new k0(this,i)}makeDrawer_(i,a){return new L_(i,a)}makeMarkerDrawer(i,a){return new D_(i,this.getConstants(),a)}makePathObject(i,a){return new O0(i,a,this.constants_)}getConstants(){return this.constants_}shouldHighlightConnection(i){return!0}orphanCanConnectAtEnd(i,a,p){return!!fs.getConnectionForOrphanedConnection(i,p===Un.OUTPUT_VALUE?a.outputConnection:a.previousConnection)}getConnectionPreviewMethod(i,a,p){return xe("getConnectionPreviewMethod","v10","v12","an IConnectionPreviewer, if it fulfills your use case."),a.type===Un.OUTPUT_VALUE||a.type===Un.PREVIOUS_STATEMENT?!i.isConnected()||this.orphanCanConnectAtEnd(p,i.targetBlock(),a.type)?Sf.PREVIEW_TYPE.INSERTION_MARKER:Sf.PREVIEW_TYPE.REPLACEMENT_FADE:Sf.PREVIEW_TYPE.INSERTION_MARKER}render(i){const a=this.makeRenderInfo_(i);a.measure(),this.makeDrawer_(i,a).draw()}},Ns={};Ns.BottomRow=R_,Ns.Connection=rd,Ns.ConstantProvider=O_,Ns.Drawer=L_,Ns.ExternalValueInput=Fv,Ns.Field=R0,Ns.Hat=cb,Ns.Icon=yT,Ns.InRowSpacer=qd,Ns.InlineInput=hb,Ns.InputConnection=ig,Ns.InputRow=db,Ns.JaggedEdge=bT,Ns.MarkerSvg=D_,Ns.Measurable=sr,Ns.NextConnection=TT,Ns.OutputConnection=ST,Ns.PathObject=O0,Ns.PreviousConnection=wT,Ns.RenderInfo=k0,Ns.Renderer=P_,Ns.RoundCorner=ym,Ns.Row=I_,Ns.SpacerRow=fb,Ns.SquareCorner=bm,Ns.StatementInput=k_,Ns.TopRow=pb,Ns.Types=ut,Ns.init=Xc,Ns.register=ki,Ns.unregister=Nd;var $T=class{constructor(i,a){this.workspace=i,this.theme=a,this.subscribedWorkspaces_=[],this.componentDB=new Map}getTheme(){return this.theme}setTheme(i){var a=this.theme;this.theme=i,(i=this.workspace.getInjectionDiv())&&(a&&(a=a.getClassName())&&St(i,a),(a=this.theme.getClassName())&&$e(i,a));for(let p=0,S;S=this.subscribedWorkspaces_[p];p++)S.refreshTheme();for(const[p,S]of this.componentDB)for(const O of S){i=O.element,a=O.propertyName;const j=this.theme&&this.theme.getComponentStyle(p);i.style.setProperty(a,j||"")}for(const p of this.subscribedWorkspaces_)p.hideChaff()}subscribeWorkspace(i){this.subscribedWorkspaces_.push(i)}unsubscribeWorkspace(i){if(!Mt(this.subscribedWorkspaces_,i))throw Error("Cannot unsubscribe a workspace that hasn't been subscribed.")}subscribe(i,a,p){this.componentDB.has(a)||this.componentDB.set(a,[]),this.componentDB.get(a).push({element:i,propertyName:p}),a=this.theme&&this.theme.getComponentStyle(a),i.style.setProperty(p,a||"")}unsubscribe(i){if(i)for(const[a,p]of this.componentDB){for(let S=p.length-1;0<=S;S--)p[S].element===i&&p.splice(S,1);p.length||this.componentDB.delete(a)}}dispose(){this.subscribedWorkspaces_.length=0,this.componentDB.clear()}},mb="VARIABLE_DYNAMIC",Sm={CATEGORY_NAME:mb};Sm.flyoutCategory=df,Sm.flyoutCategoryBlocks=Cu,Sm.onCreateVariableButtonClick_Colour=Co,Sm.onCreateVariableButtonClick_Number=Uo,Sm.onCreateVariableButtonClick_String=Kh;var Uv=class{canConnect(i,a,p,S){return this.canConnectWithReason(i,a,p,S)===fs.CAN_CONNECT}canConnectWithReason(i,a,p,S){const O=this.doSafetyChecks(i,a);return O!==fs.CAN_CONNECT?O:this.doTypeChecks(i,a)?p&&!this.doDragChecks(i,a,S||0)?fs.REASON_DRAG_CHECKS_FAILED:fs.CAN_CONNECT:fs.REASON_CHECKS_FAILED}getErrorMessage(i,a,p){switch(i){case fs.REASON_SELF_CONNECTION:return"Attempted to connect a block to itself.";case fs.REASON_DIFFERENT_WORKSPACES:return"Blocks not on same workspace.";case fs.REASON_WRONG_TYPE:return"Attempt to connect incompatible types.";case fs.REASON_TARGET_NULL:return"Target connection is null.";case fs.REASON_CHECKS_FAILED:return"Connection checks failed. "+(a+" expected "+a.getCheck()+", found "+p.getCheck());case fs.REASON_SHADOW_PARENT:return"Connecting non-shadow to shadow block.";case fs.REASON_DRAG_CHECKS_FAILED:return"Drag checks failed.";case fs.REASON_PREVIOUS_AND_OUTPUT:return"Block would have an output and a previous connection.";default:return"Unknown connection failure: this should never happen!"}}doSafetyChecks(i,a){if(!i||!a)return fs.REASON_TARGET_NULL;let p,S,O;return i.isSuperior()?(p=i.getSourceBlock(),S=a.getSourceBlock(),O=a):(S=i.getSourceBlock(),p=a.getSourceBlock(),O=i,i=a),p===S?fs.REASON_SELF_CONNECTION:O.type!==Zt[i.type]?fs.REASON_WRONG_TYPE:p.workspace!==S.workspace?fs.REASON_DIFFERENT_WORKSPACES:p.isShadow()&&!S.isShadow()?fs.REASON_SHADOW_PARENT:O.type===Un.OUTPUT_VALUE&&S.previousConnection&&S.previousConnection.isConnected()||O.type===Un.PREVIOUS_STATEMENT&&S.outputConnection&&S.outputConnection.isConnected()?fs.REASON_PREVIOUS_AND_OUTPUT:fs.CAN_CONNECT}doTypeChecks(i,a){if(i=i.getCheck(),a=a.getCheck(),!i||!a)return!0;for(let p=0;pp||a.getSourceBlock().isInsertionMarker())return!1;switch(a.type){case Un.PREVIOUS_STATEMENT:return this.canConnectToPrevious_(i,a);case Un.OUTPUT_VALUE:if(a.isConnected()&&!a.targetBlock().isInsertionMarker()||i.isConnected())return!1;break;case Un.INPUT_VALUE:if(a.isConnected()&&!a.targetBlock().isMovable()&&!a.targetBlock().isShadow())return!1;break;case Un.NEXT_STATEMENT:if(a.isConnected()&&!i.getSourceBlock().nextConnection&&!a.targetBlock().isShadow()&&a.targetBlock().nextConnection||a.targetBlock()&&!a.targetBlock().isMovable()&&!a.targetBlock().isShadow())return!1;break;default:return!1}return Xi.indexOf(a)===-1}canConnectToPrevious_(i,a){return i.targetConnection||Xi.indexOf(a)!==-1?!1:a.targetConnection?(i=a.targetBlock(),i.isInsertionMarker()?!i.getPreviousBlock():!1):!0}};r(Ft.CONNECTION_CHECKER,Nl,Uv);var gb=class extends zd{constructor(i){super(i),this.type=Iu,i&&(this.varType=i.type,this.varName=i.name)}toJson(){const i=super.toJson();if(this.varType===void 0)throw Error("The var type is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.varName)throw Error("The var name is undefined. Either pass a variable to the constructor, or call fromJson");return i.varType=this.varType,i.varName=this.varName,i}static fromJson(i,a,p){return a=super.fromJson(i,a,p??new gb),a.varType=i.varType,a.varName=i.varName,a}run(i){const a=this.getEventWorkspace_();if(!this.varId)throw Error("The var ID is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.varName)throw Error("The var name is undefined. Either pass a variable to the constructor, or call fromJson");i?a.deleteVariableById(this.varId):a.createVariable(this.varName,this.varType,this.varId)}};r(Ft.EVENT,Iu,gb);var _b=class extends zd{constructor(i,a){super(i),this.type=eh,i&&(this.oldName=i.name,this.newName=typeof a>"u"?"":a)}toJson(){const i=super.toJson();if(!this.oldName)throw Error("The old var name is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.newName)throw Error("The new var name is undefined. Either pass a value to the constructor, or call fromJson");return i.oldName=this.oldName,i.newName=this.newName,i}static fromJson(i,a,p){return a=super.fromJson(i,a,p??new _b),a.oldName=i.oldName,a.newName=i.newName,a}run(i){const a=this.getEventWorkspace_();if(!this.varId)throw Error("The var ID is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.oldName)throw Error("The old var name is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.newName)throw Error("The new var name is undefined. Either pass a value to the constructor, or call fromJson");i?a.renameVariableById(this.varId,this.newName):a.renameVariableById(this.varId,this.oldName)}};r(Ft.EVENT,eh,_b);var vb=class{constructor(i){this.workspace=i,this.variableMap=new Map}clear(){for(const i of this.variableMap.values())for(;0{O&&a&&this.deleteVariableInternal(a,S)})):this.deleteVariableInternal(a,S)}else console.warn("Can't delete non-existent variable: "+i)}deleteVariableInternal(i,a){const p=t.getGroup$$module$build$src$core$events$utils();p||t.setGroup$$module$build$src$core$events$utils(!0);try{for(let S=0;Si.name)}getVariableUsesById(i){const a=[],p=this.workspace.getAllBlocks(!1);for(let S=0;Sthis.remainingCapacityOfType(p))return!1;a+=i[p]}return!(a>this.remainingCapacity())}hasBlockLimits(){return this.options.maxBlocks!==1/0||!!this.options.maxInstances}getUndoStack(){return this.undoStack_}getRedoStack(){return this.redoStack_}undo(i){var a=i?this.redoStack_:this.undoStack_,p=i?this.undoStack_:this.redoStack_;const S=a.pop();if(S){for(var O=[S];a.length&&S.group&&S.group===a[a.length-1].group;){const j=a.pop();j&&O.push(j)}for(a=0;athis.MAX_UNDO&&0<=this.MAX_UNDO;)this.undoStack_.shift();for(let a=0;aj[0]-ve[0]);for(const[j,ve]of O)if(i{},document.body.addEventListener("wheel",this.dummyWheelListener),Ce(this.svgGroup_,"wheel",this,this.onMouseWheel_)),this.options.hasCategories&&(this.toolbox_=new(y(Ft.TOOLBOX,this.options,!0))(this)),this.grid&&this.grid.update(this.scale),this.recordDragTargets(),(i=y(Ft.CURSOR,this.options))&&this.markerManager.setCursor(new i),this.renderer.createDom(this.svgGroup_,this.getTheme()),this.svgGroup_}dispose(){if(this.rendered=!1,this.currentGesture_&&this.currentGesture_.cancel(),this.svgGroup_&&pt(this.svgGroup_),this.toolbox_&&(this.toolbox_.dispose(),this.toolbox_=null),this.flyout&&(this.flyout.dispose(),this.flyout=null),this.trashcan&&(this.trashcan.dispose(),this.trashcan=null),this.scrollbar&&(this.scrollbar.dispose(),this.scrollbar=null),this.zoomControls_&&this.zoomControls_.dispose(),this.audioManager&&this.audioManager.dispose(),this.grid&&(this.grid=null),this.renderer.dispose(),this.markerManager&&this.markerManager.dispose(),super.dispose(),this.themeManager_&&(this.themeManager_.unsubscribeWorkspace(this),this.themeManager_.unsubscribe(this.svgBackground_),this.options.parentWorkspace||this.themeManager_.dispose()),this.connectionDBList.length=0,this.toolboxCategoryCallbacks.clear(),this.flyoutButtonCallbacks.clear(),!this.options.parentWorkspace){const i=this.getParentSvg();i&&i.parentNode&&pt(i.parentNode)}this.resizeHandlerWrapper&&(rt(this.resizeHandlerWrapper),this.resizeHandlerWrapper=null),this.dummyWheelListener&&(document.body.removeEventListener("wheel",this.dummyWheelListener),this.dummyWheelListener=null)}addTrashcan(){this.trashcan=ep.newTrashcan(this);const i=this.trashcan.createDom();this.svgGroup_.insertBefore(i,this.getCanvas())}static newTrashcan(i){throw Error("The implementation of newTrashcan should be monkey-patched in by blockly.ts")}addZoomControls(){this.zoomControls_=new v0(this);const i=this.zoomControls_.createDom();this.svgGroup_.appendChild(i)}addFlyout(i){const a=new Hi({parentWorkspace:this,rtl:this.RTL,oneBasedIndex:this.options.oneBasedIndex,horizontalLayout:this.horizontalLayout,renderer:this.options.renderer,rendererOverrides:this.options.rendererOverrides,move:{scrollbars:!0}});return a.toolboxPosition=this.options.toolboxPosition,this.flyout=this.horizontalLayout?new(y(Ft.FLYOUTS_HORIZONTAL_TOOLBOX,this.options,!0))(a):new(y(Ft.FLYOUTS_VERTICAL_TOOLBOX,this.options,!0))(a),this.flyout.autoClose=!1,this.flyout.getWorkspace().setVisible(!0),this.flyout.createDom(i)}getFlyout(i){return this.flyout||i?this.flyout:this.toolbox_?this.toolbox_.getFlyout():null}getToolbox(){return this.toolbox_}updateScreenCalculations_(){this.updateInverseScreenCTM(),this.recordDragTargets()}resizeContents(){this.resizesEnabled&&this.rendered&&(this.scrollbar&&this.scrollbar.resize(),this.updateInverseScreenCTM())}resize(){this.toolbox_&&this.toolbox_.position(),this.flyout&&this.flyout.position();const i=this.componentManager.getComponents(gl.Capability.POSITIONABLE,!0),a=this.getMetricsManager().getUiMetrics(),p=[];for(let S=0,O;O=i[S];S++){O.position(a,p);const j=O.getBoundingRectangle();j&&p.push(j)}this.scrollbar&&this.scrollbar.resize(),this.updateScreenCalculations_()}updateScreenCalculationsIfScrolled(){const i=We();_n.equals(this.lastRecordedPageScroll,i)||(this.lastRecordedPageScroll=i,this.updateScreenCalculations_())}getLayerManager(){return this.layerManager}getCanvas(){return this.layerManager.getBlockLayer()}setCachedParentSvgSize(i,a){const p=this.getParentSvg();i!=null&&(this.cachedParentSvgSize.width=i,p.setAttribute("data-cached-width",`${i}`)),a!=null&&(this.cachedParentSvgSize.height=a,p.setAttribute("data-cached-height",`${a}`))}getBubbleCanvas(){return this.layerManager.getBubbleLayer()}getParentSvg(){if(!this.cachedParentSvg){let i=this.svgGroup_;for(;i;){if(i.tagName==="svg"){this.cachedParentSvg=i;break}i=i.parentNode}}return this.cachedParentSvg}maybeFireViewportChangeEvent(){if(ie()){var i=this.scale,a=-this.scrollY,p=-this.scrollX;if(!(i===this.oldScale&&1>Math.abs(a-this.oldTop)&&1>Math.abs(p-this.oldLeft))){var S=new(Ie(ni))(a,p,i,this.id,this.oldScale);this.oldScale=i,this.oldTop=a,this.oldLeft=p,ue(S)}}}translate(i,a){let p;(p=this.layerManager)==null||p.translateLayers(new _n(i,a),this.scale);let S;(S=this.grid)==null||S.moveTo(i,a),this.maybeFireViewportChangeEvent()}getWidth(){const i=this.getMetrics();return i?i.viewWidth/this.scale:0}setVisible(i){this.isVisible_=i,this.svgGroup_&&(this.scrollbar&&this.scrollbar.setContainerVisible(i),this.getFlyout()&&this.getFlyout().setContainerVisible(i),this.getParentSvg().style.display=i?"block":"none",this.toolbox_&&this.toolbox_.setVisible(i),i||this.hideChaff(!0))}render(){for(var i=this.getAllBlocks(!1),a=i.length-1;0<=a;a--)i[a].queueRender();if(this.currentGesture_)for(i=this.currentGesture_.getInsertionMarkers(),a=0;avoid this.markerManager.updateMarkers())}highlightBlock(i,a){if(a===void 0){for(let p=0,S;S=this.highlightedBlocks[p];p++)S.setHighlighted(!1);this.highlightedBlocks.length=0}(i=i?this.getBlockById(i):null)&&((a=a===void 0||a)?this.highlightedBlocks.indexOf(i)===-1&&this.highlightedBlocks.push(i):Mt(this.highlightedBlocks,i),i.setHighlighted(a))}paste(i){if(xe("Blockly.WorkspaceSvg.prototype.paste","v10","v11","Blockly.clipboard.paste"),!this.rendered||!i.type&&!i.tagName)return null;this.currentGesture_&&this.currentGesture_.cancel();const a=t.getGroup$$module$build$src$core$events$utils();a||t.setGroup$$module$build$src$core$events$utils(!0);let p;try{p=i.type?this.pasteBlock_(null,i):i.tagName.toLowerCase()==="comment"?this.pasteWorkspaceComment_(i):this.pasteBlock_(i,null)}finally{t.setGroup$$module$build$src$core$events$utils(a)}return p}pasteBlock_(i,a){t.disable$$module$build$src$core$events$utils();let p;try{let S=0,O=0;if(i){p=io(i,this);let j;S=parseInt((j=i.getAttribute("x"))!=null?j:"0"),this.RTL&&(S=-S);let ve;O=parseInt((ve=i.getAttribute("y"))!=null?ve:"0")}else a&&(p=Vn(a,this),S=a.x||10,this.RTL&&(S=this.getWidth()-S),O=a.y||10);if(!isNaN(S)&&!isNaN(O)){let j;do{j=!1;const ve=this.getAllBlocks(!1);for(let Ue=0,Yt;Yt=ve[Ue];Ue++){const jn=Yt.getRelativeToSurfaceXY();if(1>=Math.abs(S-jn.x)&&1>=Math.abs(O-jn.y)){j=!0;break}}if(!j){const Ue=p.getConnections_(!1);for(let Yt=0,jn;jn=Ue[Yt];Yt++)if(jn.closest(t.config$$module$build$src$core$config.snapRadius,new _n(S,O)).connection){j=!0;break}}j&&(S=this.RTL?S-t.config$$module$build$src$core$config.snapRadius:S+t.config$$module$build$src$core$config.snapRadius,O+=2*t.config$$module$build$src$core$config.snapRadius)}while(j);p.moveTo(new _n(S,O))}}finally{t.enable$$module$build$src$core$events$utils()}return ie()&&!p.isShadow()&&ue(new(Ie(t.CREATE$$module$build$src$core$events$utils))(p)),p.select(),p}pasteWorkspaceComment_(i){t.disable$$module$build$src$core$events$utils();let a;try{a=zl.fromXmlRendered(i,this);let p,S=parseInt((p=i.getAttribute("x"))!=null?p:"0"),O,j=parseInt((O=i.getAttribute("y"))!=null?O:"0");isNaN(S)||isNaN(j)||(this.RTL&&(S=-S),a.moveBy(S+50,j+50))}finally{t.enable$$module$build$src$core$events$utils()}return ie()&&ih.fireCreateEvent(a),a.select(),a}refreshToolboxSelection(){const i=this.isFlyout?this.targetWorkspace:this;i&&!i.currentGesture_&&i.toolbox_&&i.toolbox_.getFlyout()&&i.toolbox_.refreshSelection()}renameVariableById(i,a){super.renameVariableById(i,a),this.refreshToolboxSelection()}deleteVariableById(i){super.deleteVariableById(i),this.refreshToolboxSelection()}createVariable(i,a,p){return i=super.createVariable(i,a,p),this.refreshToolboxSelection(),i}recordDragTargets(){const i=this.componentManager.getComponents(gl.Capability.DRAG_TARGET,!0);this.dragTargetAreas=[];for(let a=0,p;p=i[a];a++){const S=p.getClientRect();S&&this.dragTargetAreas.push({component:p,clientRect:S})}}newBlock(i,a){throw Error("The implementation of newBlock should be monkey-patched in by blockly.ts")}getDragTarget(i){for(let a=0,p;p=this.dragTargetAreas[a];a++)if(p.clientRect.contains(i.clientX,i.clientY))return p.component;return null}onMouseDown_(i){const a=this.getGesture(i);a&&a.handleWsStart(i,this)}startDrag(i,a){i=kt(i,this.getParentSvg(),this.getInverseScreenCTM()),i.x/=this.scale,i.y/=this.scale,this.dragDeltaXY=_n.difference(a,i)}moveDrag(i){return i=kt(i,this.getParentSvg(),this.getInverseScreenCTM()),i.x/=this.scale,i.y/=this.scale,_n.sum(this.dragDeltaXY,i)}isDragging(){return this.currentGesture_!==null&&this.currentGesture_.isDragging()}isDraggable(){return this.options.moveOptions&&this.options.moveOptions.drag}isMovable(){return this.options.moveOptions&&!!this.options.moveOptions.scrollbars||this.options.moveOptions&&this.options.moveOptions.wheel||this.options.moveOptions&&this.options.moveOptions.drag||this.options.zoomOptions&&this.options.zoomOptions.wheel||this.options.zoomOptions&&this.options.zoomOptions.pinch}isMovableHorizontally(){const i=!!this.scrollbar;return this.isMovable()&&(!i||i&&this.scrollbar.canScrollHorizontally())}isMovableVertically(){const i=!!this.scrollbar;return this.isMovable()&&(!i||i&&this.scrollbar.canScrollVertically())}onMouseWheel_(i){if(gm.inProgress())i.preventDefault(),i.stopPropagation();else{var a=this.options.zoomOptions&&this.options.zoomOptions.wheel,p=this.options.moveOptions&&this.options.moveOptions.wheel;if(a||p){var S=vt(i);if(Mr)var O=i.metaKey;a&&(i.ctrlKey||O||!p)?(S=-S.y/50,a=kt(i,this.getParentSvg(),this.getInverseScreenCTM()),this.zoom(a.x,a.y,S)):(a=this.scrollX-S.x,p=this.scrollY-S.y,i.shiftKey&&!S.x&&(a=this.scrollX-S.y,p=this.scrollY),this.scroll(a,p)),i.preventDefault()}}}getBlocksBoundingBox(){const i=this.getTopBoundedElements();if(!i.length)return new Oi(0,0,0,0);const a=i[0].getBoundingRectangle();for(let S=1;Sa.bottom&&(a.bottom=p.bottom),p.lefta.right&&(a.right=p.right))}return a}cleanUp(){this.setResizesEnabled(!1),t.setGroup$$module$build$src$core$events$utils(!0);const i=this.getTopBlocks(!0);let a=0;for(let p=0,S;S=i[p];p++){if(!S.isMovable())continue;const O=S.getRelativeToSurfaceXY();S.moveBy(-O.x,a-O.y,["cleanup"]),S.snapToGrid(),a=S.getRelativeToSurfaceXY().y+S.getHeightWidth().height+this.renderer.getConstants().MIN_BLOCK_HEIGHT}t.setGroup$$module$build$src$core$events$utils(!1),this.setResizesEnabled(!0)}showContextMenu(i){if(!this.options.readOnly&&!this.isFlyout){var a=Li.registry.getContextMenuOptions(Li.ScopeType.WORKSPACE,{workspace:this});this.configureContextMenu&&this.configureContextMenu(a,i),Wu(i,a,this.RTL)}}updateToolbox(i){if(i=gt(i)){if(!this.options.languageTree)throw Error("Existing toolbox is null. Can't create new toolbox.");if(Vt(i)){if(!this.toolbox_)throw Error("Existing toolbox has no categories. Can't change mode.");this.options.languageTree=i,this.toolbox_.render(i)}else{if(!this.flyout)throw Error("Existing toolbox has categories. Can't change mode.");this.options.languageTree=i,this.flyout.show(i)}}else if(this.options.languageTree)throw Error("Can't nullify an existing toolbox.")}markFocused(){this.options.parentWorkspace?this.options.parentWorkspace.markFocused():(k(this),this.getParentSvg().focus({preventScroll:!0}))}zoom(i,a,p){p=Math.pow(this.options.zoomOptions.scaleSpeed,p);const S=this.scale*p;if(this.scale!==S){S>this.options.zoomOptions.maxScale?p=this.options.zoomOptions.maxScale/this.scale:Sthis.options.zoomOptions.maxScale?i=this.options.zoomOptions.maxScale:this.options.zoomOptions.minScale&&ia.autoHide(i))}static setTopLevelWorkspaceMetrics_(i){const a=this.getMetrics();typeof i.x=="number"&&(this.scrollX=-(a.scrollLeft+(a.scrollWidth-a.viewWidth)*i.x)),typeof i.y=="number"&&(this.scrollY=-(a.scrollTop+(a.scrollHeight-a.viewHeight)*i.y)),this.translate(this.scrollX+a.absoluteLeft,this.scrollY+a.absoluteTop)}},yb=class extends _{constructor(i,a){super(a),this.type=Pl,this.isOpen=i}toJson(){const i=super.toJson();if(this.isOpen===void 0)throw Error("Whether this is already open or not is undefined. Either pass a value to the constructor, or call fromJson");return i.isOpen=this.isOpen,i}static fromJson(i,a,p){return a=super.fromJson(i,a,p??new yb),a.isOpen=i.isOpen,a}};r(Ft.EVENT,Pl,yb);var bb=class extends vf{constructor(i){if(super(i),this.type=t.DELETE$$module$build$src$core$events$utils,i){if(i.getParent())throw Error("Connected blocks cannot be deleted.");i.isShadow()&&(this.recordUndo=!1),this.oldXml=Tr(i),this.ids=Te(i),this.wasShadow=i.isShadow(),this.oldJson=$i(i,{addCoordinates:!0})}}toJson(){const i=super.toJson();if(!this.oldXml)throw Error("The old block XML is undefined. Either pass a block to the constructor, or call fromJson");if(!this.ids)throw Error("The block IDs are undefined. Either pass a block to the constructor, or call fromJson");if(this.wasShadow===void 0)throw Error("Whether the block was a shadow is undefined. Either pass a block to the constructor, or call fromJson");if(!this.oldJson)throw Error("The old block JSON is undefined. Either pass a block to the constructor, or call fromJson");return i.oldXml=Qi(this.oldXml),i.ids=this.ids,i.wasShadow=this.wasShadow,i.oldJson=this.oldJson,this.recordUndo||(i.recordUndo=this.recordUndo),i}static fromJson(i,a,p){return a=super.fromJson(i,a,p??new bb),a.oldXml=t.textToDom$$module$build$src$core$utils$xml(i.oldXml),a.ids=i.ids,a.wasShadow=i.wasShadow||a.oldXml.tagName.toLowerCase()==="shadow",a.oldJson=i.oldJson,i.recordUndo!==void 0&&(a.recordUndo=i.recordUndo),a}run(i){const a=this.getEventWorkspace_();if(!this.ids)throw Error("The block IDs are undefined. Either pass a block to the constructor, or call fromJson");if(!this.oldJson)throw Error("The old block JSON is undefined. Either pass a block to the constructor, or call fromJson");if(i)for(i=0;ii.disposeInternal()),this.inputList.forEach(i=>i.dispose()),this.inputList.length=0,this.getConnections_(!0).forEach(i=>i.dispose()),this.disposed=!0)}isDeadOrDying(){return this.disposing||this.disposed}initModel(){for(const i of this.inputList)for(const a of i.fieldRow)a.initModel&&a.initModel()}unplug(i){this.outputConnection&&this.unplugFromRow_(i),this.previousConnection&&this.unplugFromStack_(i)}unplugFromRow_(i){let a=null,p;(p=this.outputConnection)!=null&&p.isConnected()&&(a=this.outputConnection.targetConnection,this.outputConnection.disconnect()),a&&i&&(i=this.getOnlyValueConnection_())&&i.isConnected()&&!i.targetBlock().isShadow()&&(i=i.targetConnection,i==null||i.disconnect(),this.workspace.connectionChecker.canConnect(i,a,!1)?a.connect(i):i==null||i.onFailedConnect(a))}getOnlyValueConnection_(){let i=null;for(let a=0;a(S=S+(p==="("||O===")"?"":" ")+O,p=O[O.length-1],S),""),a=a.trim()||"???",i&&a.length>i&&(a=a.substring(0,i-3)+"..."),a}toTokens(i="?"){const a=[];for(const S of this.inputList)if(S.name!=Bg){for(const O of S.fieldRow)a.push(O.getText());if(S.connection){const O=S.connection.targetBlock();if(O){var p=S.connection;let j=p.getCheck();!j&&p.targetConnection&&(j=p.targetConnection.getCheck()),(p=!!j&&(j.indexOf("Boolean")!==-1||j.indexOf("Number")!==-1))&&a.push("("),a.push(...O.toTokens(i)),p&&a.push(")")}else a.push(i)}}return a}appendValueInput(i){return this.appendInput(new t.ValueInput$$module$build$src$core$inputs$value_input(i,this))}appendStatementInput(i){return this.statementInputCount++,this.appendInput(new id(i,this))}appendDummyInput(i=""){return this.appendInput(new Np(i,this))}appendEndRowInput(i=""){return this.appendInput(new Tm(i,this))}appendInput(i){return this.inputList.push(i),i}appendInputFromRegistry(i,a){return(i=h(Ft.INPUT,i,!1))?this.appendInput(new i(a,this)):null}jsonInit(i){var a=i.type?'Block "'+i.type+'": ':"";if(i.output&&i.previousStatement)throw Error(a+"Must not have both an output and a previousStatement.");for(var p=0;i["args"+p];){if(i["message"+p]===void 0)throw Error(a+`args${p} must have a corresponding message (message${p}).`);p++}if(i.style&&i.style.hat&&(this.hat=i.style.hat,i.style=null),i.style&&i.colour)throw Error(a+"Must not have both a colour and a style.");for(i.style?this.jsonInitStyle_(i,a):this.jsonInitColour_(i,a),p=0;i["message"+p]!==void 0;)this.interpolate_(i["message"+p],i["args"+p]||[],i["implicitAlign"+p]||i["lastDummyAlign"+p],a),p++;if(i.inputsInline!==void 0&&(t.disable$$module$build$src$core$events$utils(),this.setInputsInline(i.inputsInline),t.enable$$module$build$src$core$events$utils()),i.output!==void 0&&this.setOutput(!0,i.output),i.outputShape!==void 0&&this.setOutputShape(i.outputShape),i.previousStatement!==void 0&&this.setPreviousStatement(!0,i.previousStatement),i.nextStatement!==void 0&&this.setNextStatement(!0,i.nextStatement),i.tooltip!==void 0&&(p=Vr(i.tooltip),this.setTooltip(p)),i.enableContextMenu!==void 0&&(this.contextMenu=!!i.enableContextMenu),i.suppressPrefixSuffix!==void 0&&(this.suppressPrefixSuffix=!!i.suppressPrefixSuffix),i.helpUrl!==void 0&&(p=Vr(i.helpUrl),this.setHelpUrl(p)),typeof i.extensions=="string"&&(console.warn(a+"JSON attribute 'extensions' should be an array of strings. Found raw string in JSON for '"+i.type+"' block."),i.extensions=[i.extensions]),i.mutator!==void 0&&es(i.mutator,this,!0),i=i.extensions,Array.isArray(i))for(a=0;aj||j>a)throw Error('Block "'+this.type+'": Message index %'+j+" out of range.");if(p[j])throw Error('Block "'+this.type+'": Message index %'+j+" duplicated.");p[j]=!0,S++}}if(S!==a)throw Error('Block "'+this.type+'": Message does not reference all '+a+" arg(s).")}interpolateArguments_(i,a,p){const S=[];for(let j=0;j=this.inputList.length)throw RangeError("Input index "+i+" out of bounds.");if(a>this.inputList.length)throw RangeError("Reference input "+a+" out of bounds.");const p=this.inputList[i];this.inputList.splice(i,1),ia.getWeight()-p.getWeight()),i}removeIcon(i){if(!this.hasIcon(i))return!1;let a;return(a=this.getIcon(i))==null||a.dispose(),this.icons=this.icons.filter(p=>!p.getType().equals(i)),!0}hasIcon(i){return this.icons.some(a=>a.getType().equals(i))}getIcon(i){return i instanceof Wo?this.icons.find(a=>a.getType().equals(i)):this.icons.find(a=>a.getType().toString()===i)}getIcons(){return[...this.icons]}getRelativeToSurfaceXY(){return this.xy_}moveBy(i,a,p){if(this.parentBlock_)throw Error("Block has parent");const S=new(Ie(t.MOVE$$module$build$src$core$events$utils))(this);p&&S.setReason(p),this.xy_.translate(i,a),S.recordNew(),ue(S)}makeConnection_(i){return new fs(this,i)}allInputsFilled(i){if(i===void 0&&(i=!0),!i&&this.isShadow())return!1;for(let p=0,S;S=this.inputList[p];p++)if(S.connection){var a=S.connection.targetBlock();if(!a||!a.allInputsFilled(i))return!1}return(a=this.getNextBlock())?a.allInputsFilled(i):!0}toDevString(){let i=this.type?'"'+this.type+'" block':"Block";return this.id&&(i+=' (id="'+this.id+'")'),i}};L0.COLLAPSED_INPUT_NAME=Bg,L0.COLLAPSED_FIELD_NAME=zv;var MT=class{constructor(){this.drawer=this.curNode=this.colour=null,this.type="marker"}setDrawer(i){this.drawer=i}getDrawer(){return this.drawer}getCurNode(){return this.curNode}setCurNode(i){const a=this.curNode;this.curNode=i,this.drawer&&this.drawer.draw(a,this.curNode)}draw(){this.drawer&&this.drawer.draw(this.curNode,this.curNode)}hide(){this.drawer&&this.drawer.hide()}dispose(){this.getDrawer()&&this.getDrawer().dispose()}},Tb=class extends MT{constructor(){super(),this.type="cursor"}next(){var i=this.getCurNode();if(!i)return null;for(i=i.next();i&&i.next()&&(i.getType()===en.types.NEXT||i.getType()===en.types.BLOCK);)i=i.next();return i&&this.setCurNode(i),i}in(){var i=this.getCurNode();if(!i)return null;(i.getType()===en.types.PREVIOUS||i.getType()===en.types.OUTPUT)&&(i=i.next());let a,p;return(i=(p=(a=i)==null?void 0:a.in())!=null?p:null)&&this.setCurNode(i),i}prev(){var i=this.getCurNode();if(!i)return null;for(i=i.prev();i&&i.prev()&&(i.getType()===en.types.NEXT||i.getType()===en.types.BLOCK);)i=i.prev();return i&&this.setCurNode(i),i}out(){var i=this.getCurNode();return i?((i=i.out())&&i.getType()===en.types.BLOCK&&(i=i.prev()||i),i&&this.setCurNode(i),i):null}};r(Ft.CURSOR,Nl,Tb);var F_=class extends Tb{constructor(){super()}next(){var i=this.getCurNode();return i?((i=this.getNextNode_(i,this.validNode_))&&this.setCurNode(i),i):null}in(){return this.next()}prev(){var i=this.getCurNode();return i?((i=this.getPreviousNode_(i,this.validNode_))&&this.setCurNode(i),i):null}out(){return this.prev()}getNextNode_(i,a){if(!i)return null;const p=i.in()||i.next();return a(p)?p:p?this.getNextNode_(p,a):(i=this.findSiblingOrParent(i.out()),a(i)?i:i?this.getNextNode_(i,a):null)}getPreviousNode_(i,a){if(!i)return null;let p=i.prev();return p=p?this.getRightMostChild(p):i.out(),a(p)?p:p?this.getPreviousNode_(p,a):null}validNode_(i){let a=!1;return i=i&&i.getType(),(i===en.types.OUTPUT||i===en.types.INPUT||i===en.types.FIELD||i===en.types.NEXT||i===en.types.PREVIOUS||i===en.types.WORKSPACE)&&(a=!0),a}findSiblingOrParent(i){if(!i)return null;const a=i.next();return a||this.findSiblingOrParent(i.out())}getRightMostChild(i){if(!i.in())return i;for(i=i.in();i&&i.next();)i=i.next();return this.getRightMostChild(i)}};F_.registrationName="basicCursor",r(Ft.CURSOR,F_.registrationName,F_);var AT=class extends F_{validNode_(i){let a=!1;const p=i&&i.getType();return i&&(i=i.getLocation(),p===en.types.FIELD&&i&&i.isTabNavigable()&&i.isClickable()&&(a=!0)),a}},Sb=10,sd=class extends fs{constructor(i,a){super(i,a),this.highlighted=!1,this.targetConnection=null,this.db=i.workspace.connectionDBList[a],this.dbOpposite=i.workspace.connectionDBList[Zt[a]],this.offsetInBlock=new _n(0,0),this.trackedState=sd.TrackedState.WILL_TRACK}dispose(){super.dispose(),this.trackedState===sd.TrackedState.TRACKED&&this.db.removeConnection(this,this.y);let i,a;(a=(i=this.sourceBlock_.pathObject).removeConnectionHighlight)==null||a.call(i,this)}getSourceBlock(){return super.getSourceBlock()}targetBlock(){return super.targetBlock()}distanceFrom(i){const a=this.x-i.x;return i=this.y-i.y,Math.sqrt(a*a+i*i)}bumpAwayFrom(i){if(!this.sourceBlock_.workspace.isDragging()){var a=this.sourceBlock_.getRootBlock();if(!a.isInFlyout){var p=!1;if(!a.isMovable()){if(a=i.getSourceBlock().getRootBlock(),!a.isMovable())return;i=this,p=!0}var S=L()==a;S||a.addSelect();var O=i.x+t.config$$module$build$src$core$config.snapRadius+Math.floor(Math.random()*Sb)-this.x,j=i.y+t.config$$module$build$src$core$config.snapRadius+Math.floor(Math.random()*Sb)-this.y;p&&(j=-j),a.RTL&&(O=i.x-t.config$$module$build$src$core$config.snapRadius-Math.floor(Math.random()*Sb)-this.x),a.moveBy(O,j,["bump"]),S||a.removeSelect()}}}moveTo(i,a){let p=!1;return this.trackedState===sd.TrackedState.WILL_TRACK?(this.db.addConnection(this,a),this.trackedState=sd.TrackedState.TRACKED,p=!0):this.trackedState===sd.TrackedState.TRACKED&&(this.db.removeConnection(this,this.y),this.db.addConnection(this,a),p=!0),this.x=i,this.y=a,p}moveBy(i,a){return this.moveTo(this.x+i,this.y+a)}moveToOffset(i){return this.moveTo(i.x+this.offsetInBlock.x,i.y+this.offsetInBlock.y)}setOffsetInBlock(i,a){this.offsetInBlock.x=i,this.offsetInBlock.y=a}getOffsetInBlock(){return this.offsetInBlock}tightenEfficiently(){var i=this.targetConnection;const a=this.targetBlock();i&&a&&(i=_n.difference(this.offsetInBlock,i.offsetInBlock),a.translate(i.x,i.y))}closest(i,a){return this.dbOpposite.searchForClosest(this,i,a)}highlight(){this.highlighted=!0,this.getSourceBlock().queueRender()}unhighlight(){this.highlighted=!1,this.getSourceBlock().queueRender()}isHighlighted(){return this.highlighted}setTracking(i){i&&this.trackedState===sd.TrackedState.TRACKED||!i&&this.trackedState===sd.TrackedState.UNTRACKED||this.sourceBlock_.isInFlyout||(i?(this.db.addConnection(this,this.y),this.trackedState=sd.TrackedState.TRACKED):(this.trackedState===sd.TrackedState.TRACKED&&this.db.removeConnection(this,this.y),this.trackedState=sd.TrackedState.UNTRACKED))}stopTrackingAll(){if(this.setTracking(!1),this.targetConnection){const i=this.targetBlock().getDescendants(!1);for(let a=0;aclearTimeout(i)),this.warningTextDb.clear(),this.getIcons().forEach(i=>i.dispose()))}checkAndDelete(){this.workspace.isFlyout||(t.setGroup$$module$build$src$core$events$utils(!0),this.workspace.hideChaff(),this.outputConnection?this.dispose(!1,!0):this.dispose(!0,!0),t.setGroup$$module$build$src$core$events$utils(!1))}toCopyData(){return this.isInsertionMarker_?null:{paster:Rp.TYPE,blockState:$i(this,{addCoordinates:!0,addNextBlocks:!1}),typeCounts:V(this,!0)}}applyColour(){this.pathObject.applyColour(this);const i=this.getIcons();for(let a=0;a{this.isDeadOrDying()||(this.warningTextDb.delete(a),this.setWarningText(i,a))},100));else if(this.isInFlyout&&(i=null),p=this.getIcon(Zf.TYPE),i){let S=this.getSurroundParent(),O=null;for(;S;)S.isCollapsed()&&(O=S),S=S.getSurroundParent();O&&O.setWarningText(t.Msg$$module$build$src$core$msg.COLLAPSED_WARNINGS_WARNING,Dp.COLLAPSED_WARNING_ID),p?p.addMessage(i,a):this.addIcon(new Zf(this).addMessage(i,a))}else p&&(a?(p.addMessage("",a),p.getText()||this.removeIcon(Zf.TYPE)):this.removeIcon(Zf.TYPE))}setMutator(i){this.removeIcon(t.MutatorIcon$$module$build$src$core$icons$mutator_icon.TYPE),i&&this.addIcon(i)}addIcon(i){return super.addIcon(i),i instanceof Zf&&(this.warning=i),i instanceof t.MutatorIcon$$module$build$src$core$icons$mutator_icon&&(this.mutator=i),this.rendered&&(i.initView(this.createIconPointerDownListener(i)),i.applyColour(),i.updateEditable(),this.queueRender(),xi(),this.bumpNeighbours()),i}createIconPointerDownListener(i){return a=>{this.isDeadOrDying()||(a=this.workspace.getGesture(a))&&a.setStartIcon(i)}}removeIcon(i){const a=super.removeIcon(i);return i.equals(Zf.TYPE)&&(this.warning=null),i.equals(t.MutatorIcon$$module$build$src$core$icons$mutator_icon.TYPE)&&(this.mutator=null),this.rendered&&(this.queueRender(),xi(),this.bumpNeighbours()),a}setEnabled(i){this.isEnabled()!==i&&(super.setEnabled(i),this.rendered&&!this.getInheritedDisabled()&&this.updateDisabled())}setHighlighted(i){this.rendered&&this.pathObject.updateHighlighted(i)}addSelect(){this.pathObject.updateSelected(!0)}removeSelect(){this.pathObject.updateSelected(!1)}setDeleteStyle(i){this.pathObject.updateDraggingDelete(i)}getColour(){return this.style.colourPrimary}setColour(i){super.setColour(i),i=this.workspace.getRenderer().getConstants().getBlockStyleForColour(this.colour_),this.pathObject.setStyle(i.style),this.style=i.style,this.styleName_=i.name,this.applyColour()}setStyle(i){const a=this.workspace.getRenderer().getConstants().getBlockStyle(i);if(this.styleName_=i,a)this.hat=a.hat,this.pathObject.setStyle(a),this.colour_=a.colourPrimary,this.style=a,this.applyColour();else throw Error("Invalid style name: "+i)}bringToFront(i=!1){let a=this;if(!a.isDeadOrDying())do{const p=a.getSvgRoot(),S=p.parentNode,O=S.childNodes;if(O[O.length-1]!==p&&S.appendChild(p),i)break;a=a.getParent()}while(a)}setPreviousStatement(i,a){super.setPreviousStatement(i,a),this.rendered&&(this.queueRender(),this.bumpNeighbours())}setNextStatement(i,a){super.setNextStatement(i,a),this.rendered&&(this.queueRender(),this.bumpNeighbours())}setOutput(i,a){super.setOutput(i,a),this.rendered&&(this.queueRender(),this.bumpNeighbours())}setInputsInline(i){super.setInputsInline(i),this.rendered&&(this.queueRender(),this.bumpNeighbours())}removeInput(i,a){return i=super.removeInput(i,a),this.rendered&&(this.queueRender(),this.bumpNeighbours()),i}moveNumberedInputBefore(i,a){super.moveNumberedInputBefore(i,a),this.rendered&&(this.queueRender(),this.bumpNeighbours())}appendInput(i){return super.appendInput(i),this.rendered&&(this.queueRender(),this.bumpNeighbours()),i}setConnectionTracking(i){if(this.previousConnection&&this.previousConnection.setTracking(i),this.outputConnection&&this.outputConnection.setTracking(i),this.nextConnection){this.nextConnection.setTracking(i);var a=this.nextConnection.targetBlock();a&&a.setConnectionTracking(i)}if(!this.collapsed_)for(a=0;a{const a=t.getGroup$$module$build$src$core$events$utils();t.setGroup$$module$build$src$core$events$utils(i),this.getRootBlock().bumpNeighboursInternal(),t.setGroup$$module$build$src$core$events$utils(a),this.bumpNeighboursPid=0},t.config$$module$build$src$core$config.bumpDelay)}}bumpNeighboursInternal(){const i=this.getRootBlock();if(!(this.isDeadOrDying()||this.workspace.isDragging()||i.isInFlyout))for(const a of this.getConnections_(!1)){if(a.isSuperior()){let p;(p=a.targetBlock())==null||p.bumpNeighboursInternal()}for(const p of a.neighbours(t.config$$module$build$src$core$config.snapRadius))p.getSourceBlock().getRootBlock()!==i&&(a.isConnected()&&p.isConnected()||(a.isSuperior()?p.bumpAwayFrom(a):a.bumpAwayFrom(p)))}}scheduleSnapAndBump(){const i=t.getGroup$$module$build$src$core$events$utils();setTimeout(()=>{t.setGroup$$module$build$src$core$events$utils(i),this.snapToGrid(),t.setGroup$$module$build$src$core$events$utils(!1)},t.config$$module$build$src$core$config.bumpDelay/2),this.bumpNeighbours()}positionNearConnection(i,a,p){if(i.type===Un.NEXT_STATEMENT||i.type===Un.INPUT_VALUE){let S=a.x;a=a.y,S+=p.x-i.getOffsetInBlock().x,a+=p.y-i.getOffsetInBlock().y,this.moveBy(S,a)}}getChildren(i){return super.getChildren(i)}queueRender(){return qo(this)}render(){this.queueRender(),xi()}renderEfficiently(){this.rendered=!0,te(),this.isCollapsed()&&this.updateCollapsed_(),this.isEnabled()||this.updateDisabled(),this.workspace.getRenderer().render(this),this.tightenChildrenEfficiently(),me(),this.updateMarkers_()}tightenChildrenEfficiently(){for(const i of this.inputList){const a=i.connection;a&&a.tightenEfficiently()}this.nextConnection&&this.nextConnection.tightenEfficiently()}updateMarkers_(){this.workspace.keyboardAccessibilityMode&&this.pathObject.cursorSvg&&this.workspace.getCursor().draw(),this.workspace.keyboardAccessibilityMode&&this.pathObject.markerSvg&&this.workspace.getMarker(Ca.LOCAL_MARKER).draw();for(const i of this.inputList)for(const a of i.fieldRow)a.updateMarkers_()}setCursorSvg(i){this.pathObject.setCursorSvg(i)}setMarkerSvg(i){this.pathObject.setMarkerSvg(i)}getHeightWidth(){let i=this.height,a=this.width;var p=this.getNextBlock();if(p){p=p.getHeightWidth();const S=this.workspace.getRenderer().getConstants().NOTCH_HEIGHT;i+=p.height-S,a=Math.max(a,p.width)}return{height:i,width:a}}fadeForReplacement(i){this.pathObject.updateReplacementFade(i)}highlightShapeForInput(i,a){this.pathObject.updateShapeForInputHighlight(i,a)}};Dp.INLINE=-1,Dp.COLLAPSED_WARNING_ID="TEMP_COLLAPSED_WARNING_";var IT=class{constructor(){}onDragEnter(i){}onDragOver(i){}onDragExit(i){}onDrop(i){}getClientRect(){return null}shouldPreventMove(i){return!1}},Hv=class extends IT{constructor(){super(),this.wouldDelete_=!1}wouldDelete(i,a){return i instanceof Dp?(i=!i.getParent()&&i.isDeletable(),this.updateWouldDelete_(i&&!a)):this.updateWouldDelete_(i.isDeletable()),this.wouldDelete_}updateWouldDelete_(i){this.wouldDelete_=i}},RT=class extends Hv{constructor(i){super(),this.workspace=i,this.id="trashcan",this.contents=[],this.flyout=null,this.isLidOpen=!1,this.minOpenness=0,this.lidTask=this.svgLid=this.svgGroup=null,this.top=this.left=this.lidOpen=0,this.initialized=!1,0>=this.workspace.options.maxTrashcanContents||(i=new Hi({scrollbars:!0,parentWorkspace:this.workspace,rtl:this.workspace.RTL,oneBasedIndex:this.workspace.options.oneBasedIndex,renderer:this.workspace.options.renderer,rendererOverrides:this.workspace.options.rendererOverrides,move:{scrollbars:!0}}),this.workspace.horizontalLayout?(i.toolboxPosition=this.workspace.toolboxPosition===dr.TOP?dr.BOTTOM:dr.TOP,this.flyout=new(y(Ft.FLYOUTS_HORIZONTAL_TOOLBOX,this.workspace.options,!0))(i)):(i.toolboxPosition=this.workspace.toolboxPosition===dr.RIGHT?dr.LEFT:dr.RIGHT,this.flyout=new(y(Ft.FLYOUTS_VERTICAL_TOOLBOX,this.workspace.options,!0))(i)),this.workspace.addChangeListener(this.onDelete.bind(this)))}createDom(){this.svgGroup=se(Ve.G,{class:"blocklyTrash"});let i;const a=String(Math.random()).substring(2);i=se(Ve.CLIPPATH,{id:"blocklyTrashBodyClipPath"+a},this.svgGroup),se(Ve.RECT,{width:N0,height:Gv,y:D0},i);const p=se(Ve.IMAGE,{width:Ru.width,x:-Eb,height:Ru.height,y:-xb,"clip-path":"url(#blocklyTrashBodyClipPath"+a+")"},this.svgGroup);return p.setAttributeNS(Zs,"xlink:href",this.workspace.options.pathToMedia+Ru.url),i=se(Ve.CLIPPATH,{id:"blocklyTrashLidClipPath"+a},this.svgGroup),se(Ve.RECT,{width:N0,height:D0},i),this.svgLid=se(Ve.IMAGE,{width:Ru.width,x:-Eb,height:Ru.height,y:-xb,"clip-path":"url(#blocklyTrashLidClipPath"+a+")"},this.svgGroup),this.svgLid.setAttributeNS(Zs,"xlink:href",this.workspace.options.pathToMedia+Ru.url),He(this.svgGroup,"pointerdown",this,this.blockMouseDownWhenOpenable),He(this.svgGroup,"pointerup",this,this.click),He(p,"pointerover",this,this.mouseOver),He(p,"pointerout",this,this.mouseOut),this.animateLid(),this.svgGroup}init(){0{let p;(p=this.flyout)==null||p.show(i),a.cursor="";let S;(S=this.workspace.scrollbar)==null||S.setVisible(!1)},10),this.fireUiEvent(!0)}}closeFlyout(){if(this.contentsIsOpen()){var i;(i=this.flyout)==null||i.hide();var a;(a=this.workspace.scrollbar)==null||a.setVisible(!0),this.fireUiEvent(!1),this.workspace.recordDragTargets()}}autoHide(i){!i&&this.flyout&&this.closeFlyout()}emptyContents(){this.hasContents()&&(this.contents.length=0,this.setMinOpenness(0),this.closeFlyout())}position(i,a){if(this.initialized){var p=Ss(this.workspace,i);i=Yr(p,new eo(N0,Gv+D0),wb,P0,i,this.workspace),a=Oa(i,P0,p.vertical===Ja.TOP?Fd.DOWN:Fd.UP,a),this.top=a.top,this.left=a.left;var S;(S=this.svgGroup)==null||S.setAttribute("transform","translate("+this.left+","+this.top+")")}}getBoundingRectangle(){return new Oi(this.top,this.top+Gv+D0,this.left,this.left+N0)}getClientRect(){if(!this.svgGroup)return null;var i=this.svgGroup.getBoundingClientRect();const a=i.top+xb-B0;return i=i.left+Eb-B0,new Oi(a,a+D0+Gv+2*B0,i,i+N0+2*B0)}onDragOver(i){this.setLidOpen(this.wouldDelete_)}onDragExit(i){this.setLidOpen(!1)}onDrop(i){setTimeout(this.setLidOpen.bind(this,!1),100)}setLidOpen(i){this.isLidOpen!==i&&(this.lidTask&&clearTimeout(this.lidTask),this.isLidOpen=i,this.animateLid())}animateLid(){const i=RE;var a=1/(i+1);this.lidOpen+=this.isLidOpen?a:-a,this.lidOpen=Math.min(Math.max(this.lidOpen,this.minOpenness),1),this.setLidAngle(this.lidOpen*ko),a=kT+this.lidOpen*(kE-kT),this.svgGroup&&(this.svgGroup.style.opacity=`${a}`),this.lidOpen>this.minOpenness&&1>this.lidOpen&&(this.lidTask=setTimeout(this.animateLid.bind(this),z_/i))}setLidAngle(i){const a=this.workspace.toolboxPosition===dr.RIGHT||this.workspace.horizontalLayout&&this.workspace.RTL;let p;(p=this.svgLid)==null||p.setAttribute("transform","rotate("+(a?-i:i)+","+(a?4:N0-4)+","+(D0-2)+")")}setMinOpenness(i){this.minOpenness=i,this.isLidOpen||this.setLidAngle(i*ko)}closeLid(){this.setLidOpen(!1)}click(){this.hasContents()&&!this.workspace.isDragging()&&this.openFlyout()}fireUiEvent(i){i=new(Ie(Pl))(i,this.workspace.id),ue(i)}blockMouseDownWhenOpenable(i){!this.contentsIsOpen()&&this.hasContents()&&i.stopPropagation()}mouseOver(){this.hasContents()&&this.setLidOpen(!0)}mouseOut(){this.setLidOpen(!1)}onDelete(i){if(!(0>=this.workspace.options.maxTrashcanContents||i.type!==t.DELETE$$module$build$src$core$events$utils||i.type!==t.DELETE$$module$build$src$core$events$utils||i.wasShadow)){if(!i.oldJson)throw Error("Encountered a delete event without proper oldJson");if(i=JSON.stringify(this.cleanBlockJson(i.oldJson)),this.contents.indexOf(i)===-1){for(this.contents.unshift(i);this.contents.length>this.workspace.options.maxTrashcanContents;)this.contents.pop();this.setMinOpenness(IE)}}}cleanBlockJson(i){function a(p){if(p){if(delete p.id,delete p.x,delete p.y,delete p.enabled,p.icons&&p.icons.comment){var S=p.icons.comment;delete S.height,delete S.width,delete S.pinned}S=p.inputs;for(var O in S){var j=S[O];const ve=j.block;j=j.shadow,ve&&a(ve),j&&a(j)}p.next&&(O=p.next,p=O.block,O=O.shadow,p&&a(p),O&&a(O))}}return i=JSON.parse(JSON.stringify(i)),a(i),Object.assign({},{kind:"BLOCK"},i)}},N0=47,Gv=44,D0=16,P0=20,wb=20,B0=10,Eb=0,xb=32,IE=.1,z_=80,RE=4,kT=.4,kE=.8,ko=45,Ji=class{constructor(){this.shortcuts=new Map,this.keyMap=new Map,this.reset()}reset(){this.shortcuts.clear(),this.keyMap.clear()}register(i,a){if(this.shortcuts.get(i.name)&&!a)throw Error(`Shortcut named "${i.name}" already exists.`);if(this.shortcuts.set(i.name,i),(a=i.keyCodes)&&0Cs(a)),i.length?i:null}load(i,a){const p=a.getProcedureMap();for(const S of i)p.add(_i(this.procedureModelClass,this.parameterModelClass,S,a))}clear(i){i.getProcedureMap().clear()}},F0={};F0.ProcedureSerializer=H_,F0.loadParameter=ja,F0.loadProcedure=_i,F0.saveParameter=Kc,F0.saveProcedure=Cs;var z0=class{constructor(){this.priority=b0}save(i){const a=[];for(const p of i.getAllVariables())i={name:p.name,id:p.getId()},p.type&&(i.type=p.type),a.push(i);return a.length?a:null}load(i,a){for(const p of i)a.createVariable(p.name,p.type,p.id)}clear(i){i.getVariableMap().clear()}};Rs("variables",new z0);var OT={};OT.VariableSerializer=z0;var $b={};$b.load=ff,$b.save=bc;var OE={blocks:um,exceptions:Ap,priorities:lm,procedures:F0,registry:S0,variables:OT,workspaces:$b},Cb=class{constructor(i,a,p,S,O){this.workspace=i,this.oldHostMetrics_=this.corner_=this.vScroll=this.hScroll=null,a=a===void 0?!0:a,p=p===void 0?!0:p;const j=a&&p;a&&(this.hScroll=new xa(i,!0,j,S,O)),p&&(this.vScroll=new xa(i,!1,j,S,O)),j&&(this.corner_=se(Ve.RECT,{height:xa.scrollbarThickness,width:xa.scrollbarThickness,class:"blocklyScrollbarBackground"}),Ke(this.corner_,i.getBubbleCanvas()))}dispose(){pt(this.corner_),this.oldHostMetrics_=this.corner_=null,this.hScroll&&(this.hScroll.dispose(),this.hScroll=null),this.vScroll&&(this.vScroll.dispose(),this.vScroll=null)}resize(){const i=this.workspace.getMetrics();if(i){var a=!1,p=!1;if(this.oldHostMetrics_&&this.oldHostMetrics_.viewWidth===i.viewWidth&&this.oldHostMetrics_.viewHeight===i.viewHeight&&this.oldHostMetrics_.absoluteTop===i.absoluteTop&&this.oldHostMetrics_.absoluteLeft===i.absoluteLeft?(this.oldHostMetrics_&&this.oldHostMetrics_.scrollWidth===i.scrollWidth&&this.oldHostMetrics_.viewLeft===i.viewLeft&&this.oldHostMetrics_.scrollLeft===i.scrollLeft||(a=!0),this.oldHostMetrics_&&this.oldHostMetrics_.scrollHeight===i.scrollHeight&&this.oldHostMetrics_.viewTop===i.viewTop&&this.oldHostMetrics_.scrollTop===i.scrollTop||(p=!0)):p=a=!0,a||p){try{t.disable$$module$build$src$core$events$utils(),this.hScroll&&a&&this.hScroll.resize(i),this.vScroll&&p&&this.vScroll.resize(i)}finally{t.enable$$module$build$src$core$events$utils()}this.workspace.maybeFireViewportChangeEvent()}if(this.hScroll&&this.vScroll){if(!this.oldHostMetrics_||this.oldHostMetrics_.viewWidth!==i.viewWidth||this.oldHostMetrics_.absoluteLeft!==i.absoluteLeft){let S;(S=this.corner_)==null||S.setAttribute("x",String(this.vScroll.position.x))}if(!this.oldHostMetrics_||this.oldHostMetrics_.viewHeight!==i.viewHeight||this.oldHostMetrics_.absoluteTop!==i.absoluteTop){let S;(S=this.corner_)==null||S.setAttribute("y",String(this.hScroll.position.y))}}this.oldHostMetrics_=i}}canScrollHorizontally(){return!!this.hScroll}canScrollVertically(){return!!this.vScroll}setOrigin(i,a){this.hScroll&&this.hScroll.setOrigin(i,a),this.vScroll&&this.vScroll.setOrigin(i,a)}set(i,a,p){this.hScroll&&this.hScroll.set(i,!1),this.vScroll&&this.vScroll.set(a,!1),(p||p===void 0)&&(i={},this.hScroll&&(i.x=this.hScroll.getRatio_()),this.vScroll&&(i.y=this.vScroll.getRatio_()),this.workspace.setMetrics(i))}setX(i){this.hScroll&&this.hScroll.set(i,!0)}setY(i){this.vScroll&&this.vScroll.set(i,!0)}setContainerVisible(i){this.hScroll&&this.hScroll.setContainerVisible(i),this.vScroll&&this.vScroll.setContainerVisible(i)}isVisible(){let i=!1;return this.hScroll&&(i=this.hScroll.isVisible()),this.vScroll&&(i=i||this.vScroll.isVisible()),i}setVisible(i){this.hScroll&&this.hScroll.setVisibleInternal(i),this.vScroll&&this.vScroll.setVisibleInternal(i)}resizeContent(i){this.hScroll&&this.hScroll.resizeContentHorizontal(i),this.vScroll&&this.vScroll.resizeContentVertical(i)}resizeView(i){this.hScroll&&this.hScroll.resizeViewHorizontal(i),this.vScroll&&this.vScroll.resizeViewVertical(i)}},G_=class{constructor(i){this.workspace_=i}getDimensionsPx_(i){let a=0,p=0;return i&&(a=i.getWidth(),p=i.getHeight()),new eo(a,p)}getFlyoutMetrics(i){return i=this.getDimensionsPx_(this.workspace_.getFlyout(i)),{width:i.width,height:i.height,position:this.workspace_.toolboxPosition}}getToolboxMetrics(){const i=this.getDimensionsPx_(this.workspace_.getToolbox());return{width:i.width,height:i.height,position:this.workspace_.toolboxPosition}}getSvgMetrics(){return this.workspace_.getCachedParentSvgSize()}getAbsoluteMetrics(){let i=0,a=0;const p=this.getToolboxMetrics(),S=this.getFlyoutMetrics(),O=!!this.workspace_.getToolbox();var j;const ve=!((j=this.workspace_.getFlyout())!=null&&j.autoClose);j=O?p.position:S.position;const Ue=j===dr.TOP;return j===dr.LEFT&&(O&&(i+=p.width),ve&&(i+=S.width)),Ue&&(O&&(a+=p.height),ve&&(a+=S.height)),{top:a,left:i}}getViewMetrics(i){i=i?this.workspace_.scale:1;const a=this.getSvgMetrics(),p=this.getToolboxMetrics(),S=this.getFlyoutMetrics(),O=!!this.workspace_.getToolbox();var j;const ve=!((j=this.workspace_.getFlyout())!=null&&j.autoClose);j=O?p.position:S.position;const Ue=j===dr.LEFT||j===dr.RIGHT;return(j===dr.TOP||j===dr.BOTTOM)&&(O&&(a.height-=p.height),ve&&(a.height-=S.height)),Ue&&(O&&(a.width-=p.width),ve&&(a.width-=S.width)),{height:a.height/i,width:a.width/i,top:-this.workspace_.scrollY/i,left:-this.workspace_.scrollX/i}}getContentMetrics(i){i=i?1:this.workspace_.scale;const a=this.workspace_.getBlocksBoundingBox();return{height:(a.bottom-a.top)*i,width:(a.right-a.left)*i,top:a.top*i,left:a.left*i}}hasFixedEdges(){return!this.workspace_.isMovableHorizontally()||!this.workspace_.isMovableVertically()}getComputedFixedEdges_(i){if(!this.hasFixedEdges())return{};const a=this.workspace_.isMovableHorizontally(),p=this.workspace_.isMovableVertically();i=i||this.getViewMetrics(!1);const S={};return p||(S.top=i.top,S.bottom=i.top+i.height),a||(S.left=i.left,S.right=i.left+i.width),S}getPaddedContent_(i,a){const p=a.top+a.height,S=a.left+a.width,O=i.width;i=i.height;const j=O/2,ve=i/2;return{top:Math.min(a.top-ve,p-i),bottom:Math.max(p+ve,a.top+i),left:Math.min(a.left-j,S-O),right:Math.max(S+j,a.left+O)}}getScrollMetrics(i,a,p){i=i?this.workspace_.scale:1,a=a||this.getViewMetrics(!1);var S=p||this.getContentMetrics();p=this.getComputedFixedEdges_(a),a=this.getPaddedContent_(a,S),S=p.top!==void 0?p.top:a.top;const O=p.left!==void 0?p.left:a.left;return{top:S/i,left:O/i,width:((p.right!==void 0?p.right:a.right)-O)/i,height:((p.bottom!==void 0?p.bottom:a.bottom)-S)/i}}getUiMetrics(){return{viewMetrics:this.getViewMetrics(),absoluteMetrics:this.getAbsoluteMetrics(),toolboxMetrics:this.getToolboxMetrics()}}getMetrics(){const i=this.getToolboxMetrics(),a=this.getFlyoutMetrics(!0),p=this.getSvgMetrics(),S=this.getAbsoluteMetrics(),O=this.getViewMetrics(),j=this.getContentMetrics(),ve=this.getScrollMetrics(!1,O,j);return{contentHeight:j.height,contentWidth:j.width,contentTop:j.top,contentLeft:j.left,scrollHeight:ve.height,scrollWidth:ve.width,scrollTop:ve.top,scrollLeft:ve.left,viewHeight:O.height,viewWidth:O.width,viewTop:O.top,viewLeft:O.left,absoluteTop:S.top,absoluteLeft:S.left,svgHeight:p.height,svgWidth:p.width,toolboxWidth:i.width,toolboxHeight:i.height,toolboxPosition:i.position,flyoutWidth:a.width,flyoutHeight:a.height}}};r(Ft.METRICS_MANAGER,Nl,G_);var LT=class extends d{constructor(i){super(),this.isBlank=!0,this.recordUndo=!1,this.type=Sa,this.isBlank=!!i,i&&(this.workspaceId=i.id)}};r(Ft.EVENT,Sa,LT);var Mb=class extends _{constructor(i,a,p){super(i?i.workspace.id:void 0),this.type=Go,i&&(this.blockId=i.id,this.isStart=a,this.blocks=p)}toJson(){const i=super.toJson();if(this.isStart===void 0)throw Error("Whether this event is the start of a drag is undefined. Either pass the value to the constructor, or call fromJson");if(this.blockId===void 0)throw Error("The block ID is undefined. Either pass a block to the constructor, or call fromJson");return i.isStart=this.isStart,i.blockId=this.blockId,i.blocks=this.blocks,i}static fromJson(i,a,p){return a=super.fromJson(i,a,p??new Mb),a.isStart=i.isStart,a.blockId=i.blockId,a.blocks=i.blocks,a}};r(Ft.EVENT,Go,Mb);var Vv={};Vv.bumpIntoBounds=Eh,Vv.bumpIntoBoundsHandler=ra,Vv.bumpTopObjectsIntoBounds=Pn;var U0=class{constructor(i,a){this.connectionCandidate=this.dragTarget_=null,this.wouldDeleteBlock_=!1,this.dragIconData_=[],this.draggingBlock_=i,this.workspace_=a,this.connectionPreviewer=new(y(Ft.CONNECTION_PREVIEWER,this.workspace_.options))(i),this.startXY_=this.draggingBlock_.getRelativeToSurfaceXY(),this.dragIconData_=tr(i,this.startXY_)}dispose(){this.dragIconData_.length=0,this.connectionPreviewer.dispose()}startDrag(i,a){t.getGroup$$module$build$src$core$events$utils()||t.setGroup$$module$build$src$core$events$utils(!0),this.fireDragStartEvent_(),this.draggingBlock_.bringToFront(!0),te(),this.workspace_.setResizesEnabled(!1),Ua(),this.shouldDisconnect_(a)&&this.disconnectBlock_(a,i),this.draggingBlock_.setDragging(!0);let p;(p=this.workspace_.getLayerManager())==null||p.moveToDragLayer(this.draggingBlock_)}shouldDisconnect_(i){return!!(this.draggingBlock_.getParent()||i&&this.draggingBlock_.nextConnection&&this.draggingBlock_.nextConnection.targetBlock())}disconnectBlock_(i,a){this.draggingBlock_.unplug(i),i=this.pixelsToWorkspaceUnits_(a),i=_n.sum(this.startXY_,i),this.draggingBlock_.translate(i.x,i.y),Ks(this.draggingBlock_)}fireDragStartEvent_(){const i=new(Ie(Go))(this.draggingBlock_,!0,this.draggingBlock_.getDescendants(!1));ue(i)}drag(i,a){const p=this.draggingBlock_;this.moveBlock(p,a),this.updateDragTargets(i,p),this.wouldDeleteBlock_=this.wouldDeleteBlock(i,p,a),this.updateCursorDuringBlockDrag_(),this.updateConnectionPreview(p,a)}moveBlock(i,a){a=this.pixelsToWorkspaceUnits_(a),a=_n.sum(this.startXY_,a),i.moveDuringDrag(a)}updateDragTargets(i,a){if(i=this.workspace_.getDragTarget(i),this.dragTarget_!==i){let p;(p=this.dragTarget_)==null||p.onDragExit(a),i==null||i.onDragEnter(a)}i==null||i.onDragOver(a),this.dragTarget_=i}wouldDeleteBlock(i,a,p){return(i=this.workspace_.getDragTarget(i))&&this.workspace_.getComponentManager().hasCapability(i.id,gl.Capability.DELETE_AREA)?i.wouldDelete(a,!!this.getConnectionCandidate(a,p)):!1}updateConnectionPreview(i,a){a=this.pixelsToWorkspaceUnits_(a);const p=this.connectionCandidate,S=this.getConnectionCandidate(i,a);if(S){this.connectionCandidate=a=p&&this.currCandidateIsBetter(p,a,S)?p:S;var{local:O,neighbour:j}=a;O.type!==Un.OUTPUT_VALUE&&O.type!==Un.PREVIOUS_STATEMENT||!j.isConnected()||j.targetBlock().isInsertionMarker()||this.orphanCanConnectAtEnd(i,j.targetBlock(),O.type)?this.connectionPreviewer.previewConnection(O,j):this.connectionPreviewer.previewReplacement(O,j,j.targetBlock())}else this.connectionPreviewer.hidePreview(),this.connectionCandidate=null}orphanCanConnectAtEnd(i,a,p){return!!fs.getConnectionForOrphanedConnection(i,p===Un.OUTPUT_VALUE?a.outputConnection:a.previousConnection)}currCandidateIsBetter(i,a,p){const{local:S,neighbour:O}=i;i=new _n(S.x,S.y);const j=new _n(O.x,O.y);return a=_n.distance(_n.sum(i,a),j),p.distance>a-t.config$$module$build$src$core$config.currentConnectionPreference}getConnectionCandidate(i,a){i=this.getLocalConnections(i);let p=this.connectionCandidate?t.config$$module$build$src$core$config.connectingSnapRadius:t.config$$module$build$src$core$config.snapRadius,S=null;for(const O of i){const{connection:j,radius:ve}=O.closest(p,a);j&&(S={local:O,neighbour:j,distance:ve},p=ve)}return S}getLocalConnections(i){const a=i.getConnections_(!1),p=i.lastConnectionInStack(!0);return p&&p!==i.nextConnection&&a.push(p),a}endDrag(i,a){if(this.drag(i,a),this.fireDragEndEvent_(),me(),Ua(),this.connectionPreviewer.hidePreview(),i=null,this.dragTarget_&&this.dragTarget_.shouldPreventMove(this.draggingBlock_)||(i=this.getNewLocationAfterDrag_(a).delta),this.dragTarget_&&this.dragTarget_.onDrop(this.draggingBlock_),!this.maybeDeleteBlock_()){let p;(p=this.workspace_.getLayerManager())==null||p.moveOffDragLayer(this.draggingBlock_,ee),this.draggingBlock_.setDragging(!1),i?this.updateBlockAfterMove_():Eh(this.draggingBlock_.workspace,this.workspace_.getMetricsManager().getScrollMetrics(!0),this.draggingBlock_)}this.connectionPreviewer.dispose(),this.workspace_.setResizesEnabled(!0),t.setGroup$$module$build$src$core$events$utils(!1)}getNewLocationAfterDrag_(i){i=this.pixelsToWorkspaceUnits_(i);const a=_n.sum(this.startXY_,i);return{delta:i,newLocation:a}}maybeDeleteBlock_(){return this.wouldDeleteBlock_?(this.fireMoveEvent_(),this.draggingBlock_.dispose(!1,!0),Xi.length=0,!0):!1}updateBlockAfterMove_(){this.fireMoveEvent_(),this.connectionCandidate?this.applyConnections(this.connectionCandidate):this.draggingBlock_.queueRender(),this.draggingBlock_.scheduleSnapAndBump()}applyConnections(i){const{local:a,neighbour:p}=i;if(a.connect(p),this.draggingBlock_.rendered){const S=a.isSuperior()?p:a,O=this.draggingBlock_.getRootBlock();vr().then(()=>{pa(S.getSourceBlock()),setTimeout(()=>{O.bringToFront()},0)})}}fireDragEndEvent_(){const i=new(Ie(Go))(this.draggingBlock_,!1,this.draggingBlock_.getDescendants(!1));ue(i)}updateToolboxStyle_(i){const a=this.workspace_.getToolbox();if(a){const p=this.draggingBlock_.isDeletable()?"blocklyToolboxDelete":"blocklyToolboxGrab";i&&typeof a.removeStyle=="function"?a.removeStyle(p):i||typeof a.addStyle!="function"||a.addStyle(p)}}fireMoveEvent_(){if(!this.draggingBlock_.isDeadOrDying()){var i=new(Ie(t.MOVE$$module$build$src$core$events$utils))(this.draggingBlock_);i.setReason(["drag"]),i.oldCoordinate=this.startXY_,i.recordNew(),ue(i)}}updateCursorDuringBlockDrag_(){this.draggingBlock_.setDeleteStyle(this.wouldDeleteBlock_)}pixelsToWorkspaceUnits_(i){return i=new _n(i.x/this.workspace_.scale,i.y/this.workspace_.scale),this.workspace_.isMutator&&i.scale(1/this.workspace_.options.parentWorkspace.scale),i}dragIcons_(){xe("Blockly.BlockDragger.prototype.dragIcons_","v10","v11")}getInsertionMarkers(){return this.workspace_.getAllBlocks().filter(i=>i.isInsertionMarker())}};r(Ft.BLOCK_DRAGGER,Nl,U0);var wm={};wm.Bubble=As,wm.MiniWorkspaceBubble=_m,wm.TextBubble=vm,wm.TextInputBubble=aa;var Ab=class extends vf{constructor(i,a,p,S){super(i),this.type=Ch,this.recordUndo=!1,i&&(this.name=a,this.oldValue=p,this.newValue=S)}toJson(){const i=super.toJson();if(!this.name)throw Error("The changed field name is undefined. Either pass a name to the constructor, or call fromJson.");return i.name=this.name,i.oldValue=this.oldValue,i.newValue=this.newValue,i}static fromJson(i,a,p){return a=super.fromJson(i,a,p??new Ab),a.name=i.name,a.oldValue=i.oldValue,a.newValue=i.newValue,a}isNull(){return this.oldValue===this.newValue}run(i){var a=this.getEventWorkspace_();if(!this.blockId)throw Error("The block ID is undefined. Either pass a block to the constructor, or call fromJson");if(a=a.getBlockById(this.blockId),!a)throw Error("The associated block is undefined. Either pass a block to the constructor, or call fromJson");i=i?this.newValue:this.oldValue,(a=a.getField(this.name))?a.setValue(i):console.warn("Can't set non-existent field: "+this.name)}};r(Ft.EVENT,Ch,Ab);var Ib=class extends vf{constructor(i){super(i),this.type=t.MOVE$$module$build$src$core$events$utils,i&&(i.isShadow()&&(this.recordUndo=!1),i=this.currentLocation_(),this.oldParentId=i.parentId,this.oldInputName=i.inputName,this.oldCoordinate=i.coordinate)}toJson(){const i=super.toJson();return i.oldParentId=this.oldParentId,i.oldInputName=this.oldInputName,this.oldCoordinate&&(i.oldCoordinate=`${Math.round(this.oldCoordinate.x)}, ${Math.round(this.oldCoordinate.y)}`),i.newParentId=this.newParentId,i.newInputName=this.newInputName,this.newCoordinate&&(i.newCoordinate=`${Math.round(this.newCoordinate.x)}, ${Math.round(this.newCoordinate.y)}`),this.reason&&(i.reason=this.reason),this.recordUndo||(i.recordUndo=this.recordUndo),i}static fromJson(i,a,p){return a=super.fromJson(i,a,p??new Ib),a.oldParentId=i.oldParentId,a.oldInputName=i.oldInputName,i.oldCoordinate&&(p=i.oldCoordinate.split(","),a.oldCoordinate=new _n(Number(p[0]),Number(p[1]))),a.newParentId=i.newParentId,a.newInputName=i.newInputName,i.newCoordinate&&(p=i.newCoordinate.split(","),a.newCoordinate=new _n(Number(p[0]),Number(p[1]))),i.reason!==void 0&&(a.reason=i.reason),i.recordUndo!==void 0&&(a.recordUndo=i.recordUndo),a}recordNew(){const i=this.currentLocation_();this.newParentId=i.parentId,this.newInputName=i.inputName,this.newCoordinate=i.coordinate}setReason(i){this.reason=i}currentLocation_(){var i=this.getEventWorkspace_();if(!this.blockId)throw Error("The block ID is undefined. Either pass a block to the constructor, or call fromJson");var a=i.getBlockById(this.blockId);if(!a)throw Error("The block associated with the block move event could not be found");i={};const p=a.getParent();return p?(i.parentId=p.id,(a=p.getInputWithBlock(a))&&(i.inputName=a.name)):i.coordinate=a.getRelativeToSurfaceXY(),i}isNull(){return this.oldParentId===this.newParentId&&this.oldInputName===this.newInputName&&_n.equals(this.oldCoordinate,this.newCoordinate)}run(i){var a=this.getEventWorkspace_();if(!this.blockId)throw Error("The block ID is undefined. Either pass a block to the constructor, or call fromJson");var p=a.getBlockById(this.blockId);if(p){var S=i?this.newParentId:this.oldParentId,O=i?this.newInputName:this.oldInputName;if(i=i?this.newCoordinate:this.oldCoordinate,S){var j=a.getBlockById(S);if(!j){console.warn("Can't connect to non-existent block: "+S);return}}if(p.getParent()&&p.unplug(),i)O=p.getRelativeToSurfaceXY(),p.moveBy(i.x-O.x,i.y-O.y,this.reason);else{a=p.outputConnection,(!a||p.previousConnection&&p.previousConnection.isConnected())&&(a=p.previousConnection);let ve,Ue;p=(Ue=a)==null?void 0:Ue.type,O?(p=j.getInput(O))&&(ve=p.connection):p===Un.PREVIOUS_STATEMENT&&(ve=j.nextConnection),ve&&a?a.connect(ve):console.warn("Can't connect to non-existent input: "+O)}}else console.warn("Can't move non-existent block: "+this.blockId)}};r(Ft.EVENT,t.MOVE$$module$build$src$core$events$utils,Ib);var Rb=class extends _{constructor(i,a,p){super(i?i.workspace.id:void 0),this.type=vo,i&&(this.blockId=i.id,this.isOpen=a,this.bubbleType=p)}toJson(){const i=super.toJson();if(this.isOpen===void 0)throw Error("Whether this event is for opening the bubble is undefined. Either pass the value to the constructor, or call fromJson");if(!this.bubbleType)throw Error("The type of bubble is undefined. Either pass the value to the constructor, or call fromJson");return i.isOpen=this.isOpen,i.bubbleType=this.bubbleType,i.blockId=this.blockId||"",i}static fromJson(i,a,p){return a=super.fromJson(i,a,p??new Rb),a.isOpen=i.isOpen,a.bubbleType=i.bubbleType,a.blockId=i.blockId,a}},kb;(function(i){i.MUTATOR="mutator",i.COMMENT="comment",i.WARNING="warning"})(kb||(kb={})),r(Ft.EVENT,vo,Rb);var sg=class extends d{constructor(i){super(),this.isBlank=!i,i&&(this.commentId=i.id,this.workspaceId=i.workspace.id,this.group=t.getGroup$$module$build$src$core$events$utils(),this.recordUndo=ae())}toJson(){const i=super.toJson();if(!this.commentId)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");return i.commentId=this.commentId,i}static fromJson(i,a,p){return a=super.fromJson(i,a,p??new sg),a.commentId=i.commentId,a}static CommentCreateDeleteHelper(i,a){var p=i.getEventWorkspace_();if(a){if(a=t.createElement$$module$build$src$core$utils$xml("xml"),!i.xml)throw Error("Ecountered a comment event without proper xml");a.appendChild(i.xml),t.domToWorkspace$$module$build$src$core$xml(a,p)}else{if(!i.commentId)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");(p=p.getCommentById(i.commentId))?p.dispose():console.warn("Can't uncreate non-existent comment: "+i.commentId)}}},Ob=class extends sg{constructor(i,a,p){super(i),this.type=yd,i&&(this.oldContents_=typeof a>"u"?"":a,this.newContents_=typeof p>"u"?"":p)}toJson(){const i=super.toJson();if(!this.oldContents_)throw Error("The old contents is undefined. Either pass a value to the constructor, or call fromJson");if(!this.newContents_)throw Error("The new contents is undefined. Either pass a value to the constructor, or call fromJson");return i.oldContents=this.oldContents_,i.newContents=this.newContents_,i}static fromJson(i,a,p){return a=super.fromJson(i,a,p??new Ob),a.oldContents_=i.oldContents,a.newContents_=i.newContents,a}isNull(){return this.oldContents_===this.newContents_}run(i){var a=this.getEventWorkspace_();if(!this.commentId)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");if(a=a.getCommentById(this.commentId)){var p=i?this.newContents_:this.oldContents_;if(!p)throw Error(i?"The new contents is undefined. Either pass a value to the constructor, or call fromJson":"The old contents is undefined. Either pass a value to the constructor, or call fromJson");a.setContent(p)}else console.warn("Can't change non-existent comment: "+this.commentId)}};r(Ft.EVENT,yd,Ob);var Lb=class extends sg{constructor(i){super(i),this.type=cs,i&&(this.xml=i.toXmlWithXY())}toJson(){const i=super.toJson();if(!this.xml)throw Error("The comment XML is undefined. Either pass a comment to the constructor, or call fromJson");return i.xml=Qi(this.xml),i}static fromJson(i,a,p){return a=super.fromJson(i,a,p??new Lb),a.xml=t.textToDom$$module$build$src$core$utils$xml(i.xml),a}run(i){sg.CommentCreateDeleteHelper(this,i)}};r(Ft.EVENT,cs,Lb);var Nb=class extends sg{constructor(i){super(i),this.type=qh,i&&(this.xml=i.toXmlWithXY())}run(i){sg.CommentCreateDeleteHelper(this,!i)}toJson(){const i=super.toJson();if(!this.xml)throw Error("The comment XML is undefined. Either pass a comment to the constructor, or call fromJson");return i.xml=Qi(this.xml),i}static fromJson(i,a,p){return a=super.fromJson(i,a,p??new Nb),a.xml=t.textToDom$$module$build$src$core$utils$xml(i.xml),a}};r(Ft.EVENT,qh,Nb);var Db=class extends sg{constructor(i){super(i),this.type=Ta,i&&(this.comment_=i,this.oldCoordinate_=i.getRelativeToSurfaceXY())}recordNew(){if(this.newCoordinate_)throw Error("Tried to record the new position of a comment on the same event twice.");if(!this.comment_)throw Error("The comment is undefined. Pass a comment to the constructor if you want to use the record functionality");this.newCoordinate_=this.comment_.getRelativeToSurfaceXY()}setOldCoordinate(i){this.oldCoordinate_=i}toJson(){const i=super.toJson();if(!this.oldCoordinate_)throw Error("The old comment position is undefined. Either pass a comment to the constructor, or call fromJson");if(!this.newCoordinate_)throw Error("The new comment position is undefined. Either call recordNew, or call fromJson");return i.oldCoordinate=`${Math.round(this.oldCoordinate_.x)}, ${Math.round(this.oldCoordinate_.y)}`,i.newCoordinate=Math.round(this.newCoordinate_.x)+","+Math.round(this.newCoordinate_.y),i}static fromJson(i,a,p){return a=super.fromJson(i,a,p??new Db),p=i.oldCoordinate.split(","),a.oldCoordinate_=new _n(Number(p[0]),Number(p[1])),p=i.newCoordinate.split(","),a.newCoordinate_=new _n(Number(p[0]),Number(p[1])),a}isNull(){return _n.equals(this.oldCoordinate_,this.newCoordinate_)}run(i){var a=this.getEventWorkspace_();if(!this.commentId)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");if(a=a.getCommentById(this.commentId)){if(i=i?this.newCoordinate_:this.oldCoordinate_,!i)throw Error("Either oldCoordinate_ or newCoordinate_ is undefined. Either pass a comment to the constructor and call recordNew, or call fromJson");var p=a.getRelativeToSurfaceXY();a.moveBy(i.x-p.x,i.y-p.y)}else console.warn("Can't move non-existent comment: "+this.commentId)}};r(Ft.EVENT,Ta,Db);var Pb=class extends _{constructor(i,a,p){super(p),this.type=Xa,this.oldItem=i??void 0,this.newItem=a??void 0}toJson(){const i=super.toJson();return i.oldItem=this.oldItem,i.newItem=this.newItem,i}static fromJson(i,a,p){return a=super.fromJson(i,a,p??new Pb),a.oldItem=i.oldItem,a.newItem=i.newItem,a}};r(Ft.EVENT,Xa,Pb),t.CHANGE$$module$build$src$core$events$utils,t.CREATE$$module$build$src$core$events$utils,t.DELETE$$module$build$src$core$events$utils,t.MOVE$$module$build$src$core$events$utils,t.CHANGE$$module$build$src$core$events$utils,t.CREATE$$module$build$src$core$events$utils,t.DELETE$$module$build$src$core$events$utils,t.MOVE$$module$build$src$core$events$utils,t.disable$$module$build$src$core$events$utils,t.enable$$module$build$src$core$events$utils,t.getGroup$$module$build$src$core$events$utils,t.setGroup$$module$build$src$core$events$utils;var Qn={};Qn.Abstract=d,Qn.BLOCK_CHANGE=t.CHANGE$$module$build$src$core$events$utils,Qn.BLOCK_CREATE=t.CREATE$$module$build$src$core$events$utils,Qn.BLOCK_DELETE=t.DELETE$$module$build$src$core$events$utils,Qn.BLOCK_DRAG=Go,Qn.BLOCK_FIELD_INTERMEDIATE_CHANGE=Ch,Qn.BLOCK_MOVE=t.MOVE$$module$build$src$core$events$utils,Qn.BUBBLE_OPEN=vo,Qn.BUMP_EVENTS=Qh,Qn.BlockBase=vf,Qn.BlockChange=Jr,Qn.BlockCreate=$_,Qn.BlockDelete=bb,Qn.BlockDrag=Mb,Qn.BlockFieldIntermediateChange=Ab,Qn.BlockMove=Ib,Qn.BubbleOpen=Rb,Qn.BubbleType=kb,Qn.CHANGE=t.CHANGE$$module$build$src$core$events$utils,Qn.CLICK=rc,Qn.COMMENT_CHANGE=yd,Qn.COMMENT_CREATE=cs,Qn.COMMENT_DELETE=qh,Qn.COMMENT_MOVE=Ta,Qn.CREATE=t.CREATE$$module$build$src$core$events$utils,Qn.Click=$,Qn.ClickTarget=I,Qn.CommentBase=sg,Qn.CommentChange=Ob,Qn.CommentCreate=Lb,Qn.CommentDelete=Nb,Qn.CommentMove=Db,Qn.DELETE=t.DELETE$$module$build$src$core$events$utils,Qn.FINISHED_LOADING=Sa,Qn.FinishedLoading=LT,Qn.MARKER_MOVE=Dl,Qn.MOVE=t.MOVE$$module$build$src$core$events$utils,Qn.MarkerMove=N_,Qn.SELECTED=_o,Qn.Selected=Hd,Qn.THEME_CHANGE=uu,Qn.TOOLBOX_ITEM_SELECT=Xa,Qn.TRASHCAN_OPEN=Pl,Qn.ThemeChange=w0,Qn.ToolboxItemSelect=Pb,Qn.TrashcanOpen=yb,Qn.UI=wc,Qn.UiBase=_,Qn.VAR_CREATE=go,Qn.VAR_DELETE=Iu,Qn.VAR_RENAME=eh,Qn.VIEWPORT_CHANGE=ni,Qn.VarBase=zd,Qn.VarCreate=Ud,Qn.VarDelete=gb,Qn.VarRename=_b,Qn.ViewportChange=E0,Qn.clearPendingUndo=re,Qn.disable=t.disable$$module$build$src$core$events$utils,Qn.disableOrphans=Je,Qn.enable=t.enable$$module$build$src$core$events$utils,Qn.filter=J,Qn.fire=ue,Qn.fromJson=Fe,Qn.get=Ie,Qn.getDescendantIds=Te,Qn.getGroup=t.getGroup$$module$build$src$core$events$utils,Qn.getRecordUndo=ae,Qn.isEnabled=ie,Qn.setGroup=t.setGroup$$module$build$src$core$events$utils,Qn.setRecordUndo=he;var NT=class extends O_{constructor(){super(),this.GRID_UNIT=4,this.CURSOR_COLOUR="#ffa200",this.CURSOR_RADIUS=5,this.JAGGED_TEETH_WIDTH=this.JAGGED_TEETH_HEIGHT=0,this.START_HAT_HEIGHT=22,this.START_HAT_WIDTH=96,this.SHAPES={HEXAGONAL:1,ROUND:2,SQUARE:3,PUZZLE:4,NOTCH:5},this.SHAPE_IN_SHAPE_PADDING={1:{0:5*this.GRID_UNIT,1:2*this.GRID_UNIT,2:5*this.GRID_UNIT,3:5*this.GRID_UNIT},2:{0:3*this.GRID_UNIT,1:3*this.GRID_UNIT,2:1*this.GRID_UNIT,3:2*this.GRID_UNIT},3:{0:2*this.GRID_UNIT,1:2*this.GRID_UNIT,2:2*this.GRID_UNIT,3:2*this.GRID_UNIT}},this.FULL_BLOCK_FIELDS=!0,this.FIELD_TEXT_FONTWEIGHT="bold",this.FIELD_TEXT_FONTFAMILY='"Helvetica Neue", "Segoe UI", Helvetica, sans-serif',this.FIELD_COLOUR_FULL_BLOCK=this.FIELD_TEXTINPUT_BOX_SHADOW=this.FIELD_DROPDOWN_SVG_ARROW=this.FIELD_DROPDOWN_COLOURED_DIV=this.FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW=!0,this.SELECTED_GLOW_COLOUR="#fff200",this.SELECTED_GLOW_SIZE=.5,this.REPLACEMENT_GLOW_COLOUR="#fff200",this.REPLACEMENT_GLOW_SIZE=2,this.selectedGlowFilterId="",this.selectedGlowFilter=null,this.replacementGlowFilterId="",this.SQUARED=this.ROUNDED=this.HEXAGONAL=this.replacementGlowFilter=null,this.SMALL_PADDING=this.GRID_UNIT,this.MEDIUM_PADDING=2*this.GRID_UNIT,this.MEDIUM_LARGE_PADDING=3*this.GRID_UNIT,this.LARGE_PADDING=4*this.GRID_UNIT,this.CORNER_RADIUS=1*this.GRID_UNIT,this.NOTCH_WIDTH=9*this.GRID_UNIT,this.NOTCH_HEIGHT=2*this.GRID_UNIT,this.STATEMENT_INPUT_NOTCH_OFFSET=this.NOTCH_OFFSET_LEFT=3*this.GRID_UNIT,this.MIN_BLOCK_WIDTH=2*this.GRID_UNIT,this.MIN_BLOCK_HEIGHT=12*this.GRID_UNIT,this.EMPTY_STATEMENT_INPUT_HEIGHT=6*this.GRID_UNIT,this.TOP_ROW_MIN_HEIGHT=this.CORNER_RADIUS,this.TOP_ROW_PRECEDES_STATEMENT_MIN_HEIGHT=this.LARGE_PADDING,this.BOTTOM_ROW_MIN_HEIGHT=this.CORNER_RADIUS,this.BOTTOM_ROW_AFTER_STATEMENT_MIN_HEIGHT=6*this.GRID_UNIT,this.STATEMENT_BOTTOM_SPACER=-this.NOTCH_HEIGHT,this.STATEMENT_INPUT_SPACER_MIN_WIDTH=40*this.GRID_UNIT,this.STATEMENT_INPUT_PADDING_LEFT=4*this.GRID_UNIT,this.EMPTY_INLINE_INPUT_PADDING=4*this.GRID_UNIT,this.EMPTY_INLINE_INPUT_HEIGHT=8*this.GRID_UNIT,this.DUMMY_INPUT_MIN_HEIGHT=8*this.GRID_UNIT,this.DUMMY_INPUT_SHADOW_MIN_HEIGHT=6*this.GRID_UNIT,this.CURSOR_WS_WIDTH=20*this.GRID_UNIT,this.FIELD_TEXT_FONTSIZE=3*this.GRID_UNIT,this.FIELD_BORDER_RECT_RADIUS=this.CORNER_RADIUS,this.FIELD_BORDER_RECT_X_PADDING=2*this.GRID_UNIT,this.FIELD_BORDER_RECT_Y_PADDING=1.625*this.GRID_UNIT,this.FIELD_BORDER_RECT_HEIGHT=8*this.GRID_UNIT,this.FIELD_DROPDOWN_BORDER_RECT_HEIGHT=8*this.GRID_UNIT,this.FIELD_DROPDOWN_SVG_ARROW_PADDING=this.FIELD_BORDER_RECT_X_PADDING,this.FIELD_COLOUR_DEFAULT_WIDTH=6*this.GRID_UNIT,this.FIELD_COLOUR_DEFAULT_HEIGHT=8*this.GRID_UNIT,this.FIELD_CHECKBOX_X_OFFSET=1*this.GRID_UNIT,this.MAX_DYNAMIC_CONNECTION_SHAPE_WIDTH=12*this.GRID_UNIT}setFontConstants_(i){super.setFontConstants_(i),this.FIELD_DROPDOWN_BORDER_RECT_HEIGHT=this.FIELD_BORDER_RECT_HEIGHT=this.FIELD_TEXT_HEIGHT+2*this.FIELD_BORDER_RECT_Y_PADDING}init(){super.init(),this.HEXAGONAL=this.makeHexagonal(),this.ROUNDED=this.makeRounded(),this.SQUARED=this.makeSquared(),this.STATEMENT_INPUT_NOTCH_OFFSET=this.NOTCH_OFFSET_LEFT+this.INSIDE_CORNERS.rightWidth}setDynamicProperties_(i){super.setDynamicProperties_(i),this.SELECTED_GLOW_COLOUR=i.getComponentStyle("selectedGlowColour")||this.SELECTED_GLOW_COLOUR;const a=Number(i.getComponentStyle("selectedGlowSize"));this.SELECTED_GLOW_SIZE=a&&!isNaN(a)?a:this.SELECTED_GLOW_SIZE,this.REPLACEMENT_GLOW_COLOUR=i.getComponentStyle("replacementGlowColour")||this.REPLACEMENT_GLOW_COLOUR,this.REPLACEMENT_GLOW_SIZE=(i=Number(i.getComponentStyle("replacementGlowSize")))&&!isNaN(i)?i:this.REPLACEMENT_GLOW_SIZE}dispose(){super.dispose(),this.selectedGlowFilter&&pt(this.selectedGlowFilter),this.replacementGlowFilter&&pt(this.replacementGlowFilter)}makeStartHat(){const i=this.START_HAT_HEIGHT,a=this.START_HAT_WIDTH,p=Ws("c",[Kn(25,-i),Kn(71,-i),Kn(a,0)]);return{height:i,width:a,path:p}}makeHexagonal(){function i(p,S,O){var j=p/2;return j=j>a?a:j,O=O?-1:1,p=(S?-1:1)*p/2,iu(-O*j,p)+iu(O*j,p)}const a=this.MAX_DYNAMIC_CONNECTION_SHAPE_WIDTH;return{type:this.SHAPES.HEXAGONAL,isDynamic:!0,width(p){return p/=2,p>a?a:p},height(p){return p},connectionOffsetY(p){return p/2},connectionOffsetX(p){return-p},pathDown(p){return i(p,!1,!1)},pathUp(p){return i(p,!0,!1)},pathRightDown(p){return i(p,!1,!0)},pathRightUp(p){return i(p,!1,!0)}}}makeRounded(){function i(S,O,j){const ve=S>p?S-p:0;S=(S>p?p:S)/2;const Ue=j===O?"0":"1";return mi("a","0 0,"+Ue,S,Kn((j?1:-1)*S,(O?-1:1)*S))+xn("v",(O?-1:1)*ve)+mi("a","0 0,"+Ue,S,Kn((j?-1:1)*S,(O?-1:1)*S))}const a=this.MAX_DYNAMIC_CONNECTION_SHAPE_WIDTH,p=2*a;return{type:this.SHAPES.ROUND,isDynamic:!0,width(S){return S/=2,S>a?a:S},height(S){return S},connectionOffsetY(S){return S/2},connectionOffsetX(S){return-S},pathDown(S){return i(S,!1,!1)},pathUp(S){return i(S,!0,!1)},pathRightDown(S){return i(S,!1,!0)},pathRightUp(S){return i(S,!1,!0)}}}makeSquared(){function i(p,S,O){p-=2*a;const j=O===S?"0":"1";return mi("a","0 0,"+j,a,Kn((O?1:-1)*a,(S?-1:1)*a))+xn("v",(S?-1:1)*p)+mi("a","0 0,"+j,a,Kn((O?-1:1)*a,(S?-1:1)*a))}const a=this.CORNER_RADIUS;return{type:this.SHAPES.SQUARE,isDynamic:!0,width(p){return a},height(p){return p},connectionOffsetY(p){return p/2},connectionOffsetX(p){return-p},pathDown(p){return i(p,!1,!1)},pathUp(p){return i(p,!0,!1)},pathRightDown(p){return i(p,!1,!0)},pathRightUp(p){return i(p,!1,!0)}}}shapeFor(i){let a=i.getCheck();switch(!a&&i.targetConnection&&(a=i.targetConnection.getCheck()),i.type){case Un.INPUT_VALUE:case Un.OUTPUT_VALUE:if(i=i.getSourceBlock().getOutputShape(),i!==null)switch(i){case this.SHAPES.HEXAGONAL:return this.HEXAGONAL;case this.SHAPES.ROUND:return this.ROUNDED;case this.SHAPES.SQUARE:return this.SQUARED}return a&&a.indexOf("Boolean")!==-1?this.HEXAGONAL:a&&a.indexOf("Number")!==-1?this.ROUNDED:(a&&a.indexOf("String"),this.ROUNDED);case Un.PREVIOUS_STATEMENT:case Un.NEXT_STATEMENT:return this.NOTCH;default:throw Error("Unknown type")}}makeNotch(){function i(jn){return Ws("c",[Kn(jn*O/2,0),Kn(jn*O*3/4,ve/2),Kn(jn*O,ve)])+Fo([Kn(jn*O,j)])+Ws("c",[Kn(jn*O/4,ve/2),Kn(jn*O/2,ve),Kn(jn*O,ve)])+xn("h",jn*S)+Ws("c",[Kn(jn*O/2,0),Kn(jn*O*3/4,-(ve/2)),Kn(jn*O,-ve)])+Fo([Kn(jn*O,-j)])+Ws("c",[Kn(jn*O/4,-(ve/2)),Kn(jn*O/2,-ve),Kn(jn*O,-ve)])}const a=this.NOTCH_WIDTH,p=this.NOTCH_HEIGHT,S=a/3,O=S/3,j=p/2,ve=j/2,Ue=i(1),Yt=i(-1);return{type:this.SHAPES.NOTCH,width:a,height:p,pathLeft:Ue,pathRight:Yt}}makeInsideCorners(){const i=this.CORNER_RADIUS,a=mi("a","0 0,0",i,Kn(-i,i)),p=mi("a","0 0,1",i,Kn(-i,i)),S=mi("a","0 0,0",i,Kn(i,i)),O=mi("a","0 0,1",i,Kn(i,i));return{width:i,height:i,pathTop:a,pathBottom:S,rightWidth:i,rightHeight:i,pathTopRight:p,pathBottomRight:O}}generateSecondaryColour_(i){return Vc("#000",i,.15)||i}generateTertiaryColour_(i){return Vc("#000",i,.25)||i}createDom(i,a,p){super.createDom(i,a,p),i=se(Ve.DEFS,{},i),a=se(Ve.FILTER,{id:"blocklySelectedGlowFilter"+this.randomIdentifier,height:"160%",width:"180%",y:"-30%",x:"-40%"},i),se(Ve.FEGAUSSIANBLUR,{in:"SourceGraphic",stdDeviation:this.SELECTED_GLOW_SIZE},a),p=se(Ve.FECOMPONENTTRANSFER,{result:"outBlur"},a),se(Ve.FEFUNCA,{type:"table",tableValues:"0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1"},p),se(Ve.FEFLOOD,{"flood-color":this.SELECTED_GLOW_COLOUR,"flood-opacity":1,result:"outColor"},a),se(Ve.FECOMPOSITE,{in:"outColor",in2:"outBlur",operator:"in",result:"outGlow"},a),this.selectedGlowFilterId=a.id,this.selectedGlowFilter=a,i=se(Ve.FILTER,{id:"blocklyReplacementGlowFilter"+this.randomIdentifier,height:"160%",width:"180%",y:"-30%",x:"-40%"},i),se(Ve.FEGAUSSIANBLUR,{in:"SourceGraphic",stdDeviation:this.REPLACEMENT_GLOW_SIZE},i),a=se(Ve.FECOMPONENTTRANSFER,{result:"outBlur"},i),se(Ve.FEFUNCA,{type:"table",tableValues:"0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1"},a),se(Ve.FEFLOOD,{"flood-color":this.REPLACEMENT_GLOW_COLOUR,"flood-opacity":1,result:"outColor"},i),se(Ve.FECOMPOSITE,{in:"outColor",in2:"outBlur",operator:"in",result:"outGlow"},i),se(Ve.FECOMPOSITE,{in:"SourceGraphic",in2:"outGlow",operator:"over"},i),this.replacementGlowFilterId=i.id,this.replacementGlowFilter=i}getCSS_(i){return[`${i} .blocklyText,`,`${i} .blocklyFlyoutLabelText {`,`font: ${this.FIELD_TEXT_FONTWEIGHT} ${this.FIELD_TEXT_FONTSIZE}pt ${this.FIELD_TEXT_FONTFAMILY};`,"}",`${i} .blocklyText {`,"fill: #fff;","}",`${i} .blocklyNonEditableText>rect:not(.blocklyDropdownRect),`,`${i} .blocklyEditableText>rect:not(.blocklyDropdownRect) {`,`fill: ${this.FIELD_BORDER_RECT_COLOUR};`,"}",`${i} .blocklyNonEditableText>text,`,`${i} .blocklyEditableText>text,`,`${i} .blocklyNonEditableText>g>text,`,`${i} .blocklyEditableText>g>text {`,"fill: #575E75;","}",`${i} .blocklyFlyoutLabelText {`,"fill: #575E75;","}",`${i} .blocklyText.blocklyBubbleText {`,"fill: #575E75;","}",`${i} .blocklyDraggable:not(.blocklyDisabled)`," .blocklyEditableText:not(.editing):hover>rect,",`${i} .blocklyDraggable:not(.blocklyDisabled)`," .blocklyEditableText:not(.editing):hover>.blocklyPath {","stroke: #fff;","stroke-width: 2;","}",`${i} .blocklyHtmlInput {`,`font-family: ${this.FIELD_TEXT_FONTFAMILY};`,`font-weight: ${this.FIELD_TEXT_FONTWEIGHT};`,"color: #575E75;","}",`${i} .blocklyDropdownText {`,"fill: #fff !important;","}",`${i}.blocklyWidgetDiv .goog-menuitem,`,`${i}.blocklyDropDownDiv .goog-menuitem {`,`font-family: ${this.FIELD_TEXT_FONTFAMILY};`,"}",`${i}.blocklyDropDownDiv .goog-menuitem-content {`,"color: #fff;","}",`${i} .blocklyHighlightedConnectionPath {`,`stroke: ${this.SELECTED_GLOW_COLOUR};`,"}",`${i} .blocklyDisabled > .blocklyOutlinePath {`,`fill: url(#blocklyDisabledPattern${this.randomIdentifier})`,"}",`${i} .blocklyInsertionMarker>.blocklyPath {`,`fill-opacity: ${this.INSERTION_MARKER_OPACITY};`,"stroke: none;","}"]}},DT=class extends L_{constructor(i,a){super(i,a)}draw(){const i=this.block_.pathObject;i.beginDrawing(),this.drawOutline_(),this.drawInternals_(),this.updateConnectionHighlights(),i.setPath(this.outlinePath_+` -`+this.inlinePath_),this.info_.RTL&&i.flipRTL(),this.recordSizeOnBlock_(),this.info_.outputConnection&&(i.outputShapeType=this.info_.outputConnection.shape.type),i.endDrawing()}drawOutline_(){this.info_.outputConnection&&this.info_.outputConnection.isDynamicShape&&!this.info_.hasStatementInput&&!this.info_.bottomRow.hasNextConnection?(this.drawFlatTop_(),this.drawRightDynamicConnection_(),this.drawFlatBottom_(),this.drawLeftDynamicConnection_()):super.drawOutline_()}drawLeft_(){this.info_.outputConnection&&this.info_.outputConnection.isDynamicShape?this.drawLeftDynamicConnection_():super.drawLeft_()}drawRightSideRow_(i){if(!(0>=i.height)){if(ut.isSpacer(i)){const S=i.precedesStatement;var a=i.followsStatement;if(S||a){const O=this.constants_.INSIDE_CORNERS;var p=O.rightHeight;p=i.height-(S?p:0),a=a?O.pathBottomRight:"",i=0=p||0>=a)throw Error("Height and width values of an image field must be greater than 0.");this.size_=new eo(a,p+Fg.Y_PADDING),this.imageHeight=p,typeof O=="function"&&(this.clickHandler=O),i!==Gi.SKIP_SETUP&&(ve?this.configure_(ve):(this.flipRtl=!!j,this.altText=Vr(S)||""),this.setValue(Vr(i)))}configure_(i){super.configure_(i),i.flipRtl&&(this.flipRtl=i.flipRtl),i.alt&&(this.altText=Vr(i.alt))}initView(){this.imageElement=se(Ve.IMAGE,{height:this.imageHeight+"px",width:this.size_.width+"px",alt:this.altText},this.fieldGroup_),this.imageElement.setAttributeNS(Zs,"xlink:href",this.value_),this.clickHandler&&(this.imageElement.style.cursor="pointer")}updateSize_(){}doClassValidation_(i){return typeof i!="string"?null:i}doValueUpdate_(i){this.value_=i,this.imageElement&&this.imageElement.setAttributeNS(Zs,"xlink:href",this.value_)}getFlipRtl(){return this.flipRtl}setAlt(i){i!==this.altText&&(this.altText=i||"",this.imageElement&&this.imageElement.setAttribute("alt",this.altText))}showEditor_(){this.clickHandler&&this.clickHandler(this)}setOnClickHandler(i){this.clickHandler=i}getText_(){return this.altText}static fromJson(i){if(!i.src||!i.width||!i.height)throw Error("src, width, and height values for an image field arerequired. The width and height must be non-zero.");return new this(i.src,i.width,i.height,void 0,void 0,void 0,i)}};Fg.Y_PADDING=1,xs("field_image",Fg),Fg.prototype.DEFAULT_VALUE="";var W_=class extends Gi{constructor(i,a,p){super(Gi.SKIP_SETUP),this.spellcheck_=!0,this.htmlInput_=null,this.isTextValid_=this.isBeingEdited_=!1,this.onKeyInputWrapper_=this.onKeyDownWrapper_=this.valueWhenEditorWasOpened_=null,this.fullBlockClickTarget_=!1,this.workspace_=null,this.SERIALIZABLE=!0,this.CURSOR="text",i!==Gi.SKIP_SETUP&&(p&&this.configure_(p),this.setValue(i),a&&this.setValidator(a))}configure_(i){super.configure_(i),i.spellcheck!==void 0&&(this.spellcheck_=i.spellcheck)}initView(){if(!this.getSourceBlock())throw new Ro;super.initView(),this.isFullBlockField()&&(this.clickTarget_=this.sourceBlock_.getSvgRoot())}isFullBlockField(){const i=this.getSourceBlock();if(!i)throw new Ro;let a;return this.fullBlockClickTarget_=!((a=this.getConstants())==null||!a.FULL_BLOCK_FIELDS)&&i.isSimpleReporter()}doValueInvalid_(i){this.isBeingEdited_&&(this.isDirty_=!0,this.isTextValid_=!1,i=this.value_,this.value_=this.htmlInput_.getAttribute("data-untyped-default-value"),this.sourceBlock_&&ie()&&ue(new(Ie(t.CHANGE$$module$build$src$core$events$utils))(this.sourceBlock_,"field",this.name||null,i,this.value_)))}doValueUpdate_(i){this.isTextValid_=this.isDirty_=!0,this.value_=i}applyColour(){const i=this.getSourceBlock();if(!i)throw new Ro;this.getConstants().FULL_BLOCK_FIELDS&&this.fieldGroup_&&(!this.isFullBlockField()&&this.borderRect_?(this.borderRect_.style.display="block",this.borderRect_.setAttribute("stroke",i.style.colourTertiary)):(this.borderRect_.style.display="none",i.pathObject.svgPath.setAttribute("fill",this.getConstants().FIELD_BORDER_RECT_COLOUR)))}getSize(){let i;return(i=this.getConstants())!=null&&i.FULL_BLOCK_FIELDS&&(this.render_(),this.isDirty_=!1),super.getSize()}onLocationChange(){this.isBeingEdited_&&this.resizeEditor_()}render_(){if(super.render_(),this.isBeingEdited_){var i=this.htmlInput_;this.isTextValid_?(St(i,"blocklyInvalidInput"),Er(i,To.INVALID,!1)):($e(i,"blocklyInvalidInput"),Er(i,To.INVALID,!0))}if(i=this.getSourceBlock(),!i)throw new Ro;this.getConstants().FULL_BLOCK_FIELDS&&i.applyColour()}setSpellcheck(i){i!==this.spellcheck_&&(this.spellcheck_=i,this.htmlInput_&&this.htmlInput_.setAttribute("spellcheck",this.spellcheck_))}showEditor_(i,a=!1){this.workspace_=this.sourceBlock_.workspace,!a&&this.workspace_.options.modalInputs&&(Bl||Rn||zn)?this.showPromptEditor_():this.showInlineEditor_(a)}showPromptEditor_(){La(t.Msg$$module$build$src$core$msg.CHANGE_VALUE_TITLE,this.getText(),i=>{i!==null&&this.setValue(this.getValueFromEditorText_(i)),this.onFinishEditing_(this.value_)})}showInlineEditor_(i){const a=this.getSourceBlock();if(!a)throw new Ro;ql(this,a.RTL,this.widgetDispose_.bind(this)),this.htmlInput_=this.widgetCreate_(),this.isBeingEdited_=!0,this.valueWhenEditorWasOpened_=this.value_,i||(this.htmlInput_.focus({preventScroll:!0}),this.htmlInput_.select())}widgetCreate_(){var i=this.getSourceBlock();if(!i)throw new Ro;t.setGroup$$module$build$src$core$events$utils(!0);const a=oo();var p=this.getClickTarget_();if(!p)throw Error("A click target has not been set.");$e(p,"editing"),p=document.createElement("input"),p.className="blocklyHtmlInput",p.setAttribute("spellcheck",this.spellcheck_);const S=this.workspace_.getScale();var O=this.getConstants().FIELD_TEXT_FONTSIZE*S+"pt";return a.style.fontSize=O,p.style.fontSize=O,O=W_.BORDERRADIUS*S+"px",this.isFullBlockField()&&(O=this.getScaledBBox(),O=(O.bottom-O.top)/2+"px",i=i.getParent()?i.getParent().style.colourTertiary:this.sourceBlock_.style.colourTertiary,p.style.border=1*S+"px solid "+i,a.style.borderRadius=O,a.style.transition="box-shadow 0.25s ease 0s",this.getConstants().FIELD_TEXTINPUT_BOX_SHADOW&&(a.style.boxShadow="rgba(255, 255, 255, 0.3) 0 0 0 "+4*S+"px")),p.style.borderRadius=O,a.appendChild(p),p.value=p.defaultValue=this.getEditorText_(this.value_),p.setAttribute("data-untyped-default-value",String(this.value_)),this.resizeEditor_(),this.bindInputEvents_(p),p}widgetDispose_(){this.isBeingEdited_=!1,this.isTextValid_=!0,this.forceRerender(),this.onFinishEditing_(this.value_),this.sourceBlock_&&ie()&&this.valueWhenEditorWasOpened_!==null&&this.valueWhenEditorWasOpened_!==this.value_&&(ue(new(Ie(t.CHANGE$$module$build$src$core$events$utils))(this.sourceBlock_,"field",this.name||null,this.valueWhenEditorWasOpened_,this.value_)),this.valueWhenEditorWasOpened_=null),t.setGroup$$module$build$src$core$events$utils(!1),this.unbindInputEvents_();var i=oo().style;if(i.width="auto",i.height="auto",i.fontSize="",i.transition="",i.boxShadow="",this.htmlInput_=null,i=this.getClickTarget_(),!i)throw Error("A click target has not been set.");St(i,"editing")}onFinishEditing_(i){}bindInputEvents_(i){this.onKeyDownWrapper_=Ce(i,"keydown",this,this.onHtmlInputKeyDown_),this.onKeyInputWrapper_=Ce(i,"input",this,this.onHtmlInputChange_)}unbindInputEvents_(){this.onKeyDownWrapper_&&(rt(this.onKeyDownWrapper_),this.onKeyDownWrapper_=null),this.onKeyInputWrapper_&&(rt(this.onKeyInputWrapper_),this.onKeyInputWrapper_=null)}onHtmlInputKeyDown_(i){i.key==="Enter"?(Ql(),al()):i.key==="Escape"?(this.setValue(this.htmlInput_.getAttribute("data-untyped-default-value"),!1),Ql(),al()):i.key==="Tab"&&(Ql(),al(),this.sourceBlock_.tab(this,!i.shiftKey),i.preventDefault())}onHtmlInputChange_(i){i=this.value_,this.setValue(this.getValueFromEditorText_(this.htmlInput_.value),!1),this.sourceBlock_&&ie()&&this.value_!==i&&ue(new(Ie(Ch))(this.sourceBlock_,this.name||null,i,this.value_))}setEditorValue_(i,a=!0){this.isDirty_=!0,this.isBeingEdited_&&(this.htmlInput_.value=this.getEditorText_(i)),this.setValue(i,a)}resizeEditor_(){var i=this.getSourceBlock();if(!i)throw new Ro;const a=oo(),p=this.getScaledBBox();a.style.width=p.right-p.left+"px",a.style.height=p.bottom-p.top+"px",i=new _n(i.RTL?p.right-a.offsetWidth:p.left,p.top),a.style.left=i.x+"px",a.style.top=i.y+"px"}repositionForWindowResize(){const i=this.getSourceBlock();return i instanceof Dp?(Eh(this.workspace_,this.workspace_.getMetricsManager().getViewMetrics(!0),i)||this.resizeEditor_(),!0):!1}isTabNavigable(){return!0}getText_(){return this.isBeingEdited_&&this.htmlInput_?this.htmlInput_.value:null}getEditorText_(i){return`${i}`}getValueFromEditorText_(i){return i}};W_.BORDERRADIUS=4;var H0=class extends W_{constructor(i,a,p){super(i,a,p)}doClassValidation_(i){return i===void 0?null:`${i}`}static fromJson(i){return new this(Vr(i.text),void 0,i)}};xs("field_input",H0),H0.prototype.DEFAULT_VALUE="";var PT=class extends R_{constructor(i){super(i)}endsWithElemSpacer(){return!1}hasLeftSquareCorner(i){return!!i.outputConnection}hasRightSquareCorner(i){return!!i.outputConnection&&!i.statementInputCount&&!i.nextConnection}},jv=class extends k_{constructor(i,a){if(super(i,a),this.connectedBottomNextConnection=!1,this.connectedBlock){for(i=this.connectedBlock;a=i.getNextBlock();)i=a;i.nextConnection||(this.height=this.connectedBlockHeight,this.connectedBottomNextConnection=!0)}}},BT=class extends sr{constructor(i){super(i),this.width=this.height=0,this.type|=ut.getType("RIGHT_CONNECTION")}},FT=class extends pb{constructor(i){super(i)}endsWithElemSpacer(){return!1}hasLeftSquareCorner(i){const a=(i.hat?i.hat==="cap":this.constants_.ADD_START_HATS)&&!i.outputConnection&&!i.previousConnection;return!!i.outputConnection||a}hasRightSquareCorner(i){return!!i.outputConnection&&!i.statementInputCount&&!i.nextConnection}},zT=class extends k0{constructor(i,a){super(i,a),this.isInline=!0,this.renderer_=i,this.constants_=this.renderer_.getConstants(),this.topRow=new FT(this.constants_),this.bottomRow=new PT(this.constants_),this.isMultiRow=!a.getInputsInline()||a.isCollapsed(),this.hasStatementInput=0=this.rows.length-1?!!this.bottomRow.hasNextConnection:!!S.precedesStatement,ut.isInputRow(j)&&j.hasStatement){j.measure();let ve,Ue;a=j.width-((Ue=(ve=j.getLastInput())==null?void 0:ve.width)!=null?Ue:0)+i}else if(p&&(O===2||S)&&ut.isInputRow(j)&&!j.hasStatement){S=j.xPos,p=null;for(let ve=0;vep?p:this.height/2,a-p*(1-Math.sin(Math.acos((p-this.constants_.SMALL_PADDING)/p)));default:return 0}if(ut.isInlineInput(i)&&i instanceof ig){const O=i.connectedBlock;return i=O?O.pathObject.outputShapeType:i.shape.type,i==null||O&&O.outputConnection&&(O.statementInputCount||O.nextConnection)||p===S.SHAPES.HEXAGONAL&&p!==i?0:a-this.constants_.SHAPE_IN_SHAPE_PADDING[p][i]}return ut.isField(i)&&i instanceof R0?p===S.SHAPES.ROUND&&i.field instanceof H0?a-2.75*S.GRID_UNIT:a-this.constants_.SHAPE_IN_SHAPE_PADDING[p][0]:ut.isIcon(i)?this.constants_.SMALL_PADDING:0}finalizeVerticalAlignment_(){if(!this.outputConnection)for(let S=2;S=this.rows.length-1?!!this.bottomRow.hasNextConnection:!!ve.precedesStatement;if(i?this.topRow.hasPreviousConnection:O.followsStatement){var p=j.elements[1];if(p=j.elements.length===3&&p instanceof R0&&(p.field instanceof wi||p.field instanceof Fg),!i&&p)O.height-=this.constants_.SMALL_PADDING,ve.height-=this.constants_.SMALL_PADDING,j.height-=this.constants_.MEDIUM_PADDING;else if(!i&&!a)O.height+=this.constants_.SMALL_PADDING;else if(a){for(i=!1,a=0;ap;p+=15)se(Ve.LINE,{x1:K.HALF+K.RADIUS,y1:K.HALF,x2:K.HALF+K.RADIUS-(p%45===0?10:5),y2:K.HALF,class:"blocklyAngleMarks",transform:"rotate("+p+","+K.HALF+","+K.HALF+")"},i);return this.boundEvents.push(Ce(i,"click",this,this.hide)),this.boundEvents.push(Ce(a,"pointerdown",this,this.onMouseMove_,!0)),this.boundEvents.push(Ce(a,"pointermove",this,this.onMouseMove_,!0)),i}dropdownDispose(){for(const i of this.boundEvents)rt(i);this.boundEvents.length=0,this.line=this.gauge=null}hide(){Ti(this),Ql()}onMouseMove_(i){var a=this.gauge.ownerSVGElement.getBoundingClientRect();const p=i.clientX-a.left-K.HALF;i=i.clientY-a.top-K.HALF,a=Math.atan(-i/p),isNaN(a)||(a=is(a),0>p?a+=180:0i&&(i+=360),i>this.wrap&&(i-=360),i}static fromJson(i){return new this(i.angle,void 0,i)}};K.HALF=50,K.RADIUS=K.HALF-1,K.CLOCKWISE=!1,K.OFFSET=0,K.WRAP=360,K.ROUND=15,xs("field_angle",K),K.prototype.DEFAULT_VALUE=0,At(` +`+this.inlinePath_),this.info_.RTL&&this.block_.pathObject.flipRTL(),this.recordSizeOnBlock_()}hideHiddenIcons_(){xe("hideHiddenIcons_","v10","v11")}recordSizeOnBlock_(){this.block_.height=this.info_.height,this.block_.width=this.info_.widthWithChildren}drawOutline_(){this.drawTop_();for(let i=1;ii||i>this.fieldRow.length)throw Error("index "+i+" out of bounds.");return(a||a===""&&p)&&(typeof a=="string"&&(a=t.fromJson$$module$build$src$core$field_registry({type:"field_label",text:a})),a.setSourceBlock(this.sourceBlock),this.sourceBlock.rendered&&(a.init(),a.applyColour()),a.name=p,a.setVisible(this.isVisible()),a.prefixField&&(i=this.insertFieldAt(i,a.prefixField)),this.fieldRow.splice(i,0,a),i++,a.suffixField&&(i=this.insertFieldAt(i,a.suffixField)),this.sourceBlock.rendered&&(this.sourceBlock.queueRender(),this.sourceBlock.bumpNeighbours())),i}removeField(i,a){for(let p=0,S;S=this.fieldRow[p];p++)if(S.name===i)return S.dispose(),this.fieldRow.splice(p,1),this.sourceBlock.rendered&&(this.sourceBlock.queueRender(),this.sourceBlock.bumpNeighbours()),!0;if(a)return!1;throw Error('Field "'+i+'" not found.')}isVisible(){return this.visible}setVisible(i){let a=[];if(this.visible===i)return a;this.visible=i;for(let S=0,O;O=this.fieldRow[S];S++)O.setVisible(i);if(this.connection){var p=this.connection;i?a=p.startTrackingAll():p.stopTrackingAll(),(p=p.targetBlock())&&(p.getSvgRoot().style.display=i?"block":"none")}return a}markDirty(){for(let i=0,a;a=this.fieldRow[i];i++)a.markDirty()}setCheck(i){if(!this.connection)throw Error("This input does not have a connection.");return this.connection.setCheck(i),this}setAlign(i){return this.align=i,this.sourceBlock.rendered&&this.sourceBlock.queueRender(),this}setShadowDom(i){if(!this.connection)throw Error("This input does not have a connection.");return this.connection.setShadowDom(i),this}getShadowDom(){if(!this.connection)throw Error("This input does not have a connection.");return this.connection.getShadowDom()}init(){if(this.sourceBlock.workspace.rendered)for(let i=0;i{pa(p.getSourceBlock()),setTimeout(()=>{S.bringToFront()},0)})}}}update(i,a){const p=this.getCandidate(i);((this.wouldDeleteBlock=this.shouldDelete(!!p,a))||this.shouldUpdatePreviews(p,i))&&(t.disable$$module$build$src$core$events$utils(),this.maybeHidePreview(p),this.maybeShowPreview(p),t.enable$$module$build$src$core$events$utils())}createMarkerBlock(i){var a=i.type;t.disable$$module$build$src$core$events$utils();let p;try{if(p=this.workspace.newBlock(a),p.setInsertionMarker(!0),i.saveExtraState){var S=i.saveExtraState(!0);S&&p.loadExtraState&&p.loadExtraState(S)}else if(i.mutationToDom){const O=i.mutationToDom();O&&p.domToMutation&&p.domToMutation(O)}for(a=0;a{let Yt;(Yt=S)==null||Yt.positionNearConnection(Ue,j,ve);let jn;(jn=S)==null||jn.getSvgRoot().setAttribute("visibility","visible")}),this.markerConnection=O}hideInsertionMarker(){if(this.markerConnection){var i=this.markerConnection,a=i.getSourceBlock(),p=a.outputConnection,S;if((S=a.previousConnection)!=null&&S.targetConnection||p!=null&&p.targetConnection)a.unplug(!0);else{let O;(O=i.targetBlock())==null||O.unplug(!1)}if(i.targetConnection)throw Error("markerConnection still connected at the end of disconnectInsertionMarker");this.markerConnection=null,(i=a.getSvgRoot())&&i.setAttribute("visibility","hidden")}}showInsertionInputOutline(i){i=i.closest,this.highlightedBlock=i.getSourceBlock(),this.highlightedBlock.highlightShapeForInput(i,!0)}hideInsertionInputOutline(){if(this.highlightedBlock){if(!this.activeCandidate)throw Error("Cannot hide the insertion marker outline because there is no active candidate");this.highlightedBlock.highlightShapeForInput(this.activeCandidate.closest,!1),this.highlightedBlock=null}}showReplacementFade(i){if(this.fadedBlock=i.closest.targetBlock(),!this.fadedBlock)throw Error("Cannot show the replacement fade because the closest connection does not have a target block");this.fadedBlock.fadeForReplacement(!0)}hideReplacementFade(){this.fadedBlock&&(this.fadedBlock.fadeForReplacement(!1),this.fadedBlock=null)}getInsertionMarkers(){const i=[];return this.firstMarker&&i.push(this.firstMarker),this.lastMarker&&i.push(this.lastMarker),i}disposeInsertionMarker(i){if(i){t.disable$$module$build$src$core$events$utils();try{i.dispose()}finally{t.enable$$module$build$src$core$events$utils()}}}};(function(i){i=i.PREVIEW_TYPE||(i.PREVIEW_TYPE={}),i[i.INSERTION_MARKER=0]="INSERTION_MARKER",i[i.INPUT_OUTLINE=1]="INPUT_OUTLINE",i[i.REPLACEMENT_FADE=2]="REPLACEMENT_FADE"})(Sf||(Sf={})),Sf.PREVIEW_TYPE;var P_=class{constructor(i){this.overrides=null,this.name=i}getClassName(){return this.name+"-renderer"}init(i,a){this.constants_=this.makeConstants_(),a&&(this.overrides=a,Object.assign(this.constants_,a)),this.constants_.setTheme(i),this.constants_.init()}createDom(i,a){this.constants_.createDom(i,this.name+"-"+a.name,"."+this.getClassName()+"."+a.getClassName())}refreshDom(i,a){const p=this.getConstants();p.dispose(),this.constants_=this.makeConstants_(),this.overrides&&Object.assign(this.constants_,this.overrides),this.constants_.randomIdentifier=p.randomIdentifier,this.constants_.setTheme(a),this.constants_.init(),this.createDom(i,a)}dispose(){this.constants_&&this.constants_.dispose()}makeConstants_(){return new O_}makeRenderInfo_(i){return new k0(this,i)}makeDrawer_(i,a){return new L_(i,a)}makeMarkerDrawer(i,a){return new D_(i,this.getConstants(),a)}makePathObject(i,a){return new O0(i,a,this.constants_)}getConstants(){return this.constants_}shouldHighlightConnection(i){return!0}orphanCanConnectAtEnd(i,a,p){return!!fs.getConnectionForOrphanedConnection(i,p===Un.OUTPUT_VALUE?a.outputConnection:a.previousConnection)}getConnectionPreviewMethod(i,a,p){return xe("getConnectionPreviewMethod","v10","v12","an IConnectionPreviewer, if it fulfills your use case."),a.type===Un.OUTPUT_VALUE||a.type===Un.PREVIOUS_STATEMENT?!i.isConnected()||this.orphanCanConnectAtEnd(p,i.targetBlock(),a.type)?Sf.PREVIEW_TYPE.INSERTION_MARKER:Sf.PREVIEW_TYPE.REPLACEMENT_FADE:Sf.PREVIEW_TYPE.INSERTION_MARKER}render(i){const a=this.makeRenderInfo_(i);a.measure(),this.makeDrawer_(i,a).draw()}},Ns={};Ns.BottomRow=R_,Ns.Connection=rd,Ns.ConstantProvider=O_,Ns.Drawer=L_,Ns.ExternalValueInput=Fv,Ns.Field=R0,Ns.Hat=cb,Ns.Icon=bT,Ns.InRowSpacer=qd,Ns.InlineInput=hb,Ns.InputConnection=ig,Ns.InputRow=db,Ns.JaggedEdge=TT,Ns.MarkerSvg=D_,Ns.Measurable=sr,Ns.NextConnection=ST,Ns.OutputConnection=wT,Ns.PathObject=O0,Ns.PreviousConnection=ET,Ns.RenderInfo=k0,Ns.Renderer=P_,Ns.RoundCorner=ym,Ns.Row=I_,Ns.SpacerRow=fb,Ns.SquareCorner=bm,Ns.StatementInput=k_,Ns.TopRow=pb,Ns.Types=ct,Ns.init=Xc,Ns.register=ki,Ns.unregister=Nd;var CT=class{constructor(i,a){this.workspace=i,this.theme=a,this.subscribedWorkspaces_=[],this.componentDB=new Map}getTheme(){return this.theme}setTheme(i){var a=this.theme;this.theme=i,(i=this.workspace.getInjectionDiv())&&(a&&(a=a.getClassName())&&St(i,a),(a=this.theme.getClassName())&&Pe(i,a));for(let p=0,S;S=this.subscribedWorkspaces_[p];p++)S.refreshTheme();for(const[p,S]of this.componentDB)for(const O of S){i=O.element,a=O.propertyName;const j=this.theme&&this.theme.getComponentStyle(p);i.style.setProperty(a,j||"")}for(const p of this.subscribedWorkspaces_)p.hideChaff()}subscribeWorkspace(i){this.subscribedWorkspaces_.push(i)}unsubscribeWorkspace(i){if(!Ct(this.subscribedWorkspaces_,i))throw Error("Cannot unsubscribe a workspace that hasn't been subscribed.")}subscribe(i,a,p){this.componentDB.has(a)||this.componentDB.set(a,[]),this.componentDB.get(a).push({element:i,propertyName:p}),a=this.theme&&this.theme.getComponentStyle(a),i.style.setProperty(p,a||"")}unsubscribe(i){if(i)for(const[a,p]of this.componentDB){for(let S=p.length-1;0<=S;S--)p[S].element===i&&p.splice(S,1);p.length||this.componentDB.delete(a)}}dispose(){this.subscribedWorkspaces_.length=0,this.componentDB.clear()}},mb="VARIABLE_DYNAMIC",Sm={CATEGORY_NAME:mb};Sm.flyoutCategory=df,Sm.flyoutCategoryBlocks=Cu,Sm.onCreateVariableButtonClick_Colour=Co,Sm.onCreateVariableButtonClick_Number=Uo,Sm.onCreateVariableButtonClick_String=Kh;var Uv=class{canConnect(i,a,p,S){return this.canConnectWithReason(i,a,p,S)===fs.CAN_CONNECT}canConnectWithReason(i,a,p,S){const O=this.doSafetyChecks(i,a);return O!==fs.CAN_CONNECT?O:this.doTypeChecks(i,a)?p&&!this.doDragChecks(i,a,S||0)?fs.REASON_DRAG_CHECKS_FAILED:fs.CAN_CONNECT:fs.REASON_CHECKS_FAILED}getErrorMessage(i,a,p){switch(i){case fs.REASON_SELF_CONNECTION:return"Attempted to connect a block to itself.";case fs.REASON_DIFFERENT_WORKSPACES:return"Blocks not on same workspace.";case fs.REASON_WRONG_TYPE:return"Attempt to connect incompatible types.";case fs.REASON_TARGET_NULL:return"Target connection is null.";case fs.REASON_CHECKS_FAILED:return"Connection checks failed. "+(a+" expected "+a.getCheck()+", found "+p.getCheck());case fs.REASON_SHADOW_PARENT:return"Connecting non-shadow to shadow block.";case fs.REASON_DRAG_CHECKS_FAILED:return"Drag checks failed.";case fs.REASON_PREVIOUS_AND_OUTPUT:return"Block would have an output and a previous connection.";default:return"Unknown connection failure: this should never happen!"}}doSafetyChecks(i,a){if(!i||!a)return fs.REASON_TARGET_NULL;let p,S,O;return i.isSuperior()?(p=i.getSourceBlock(),S=a.getSourceBlock(),O=a):(S=i.getSourceBlock(),p=a.getSourceBlock(),O=i,i=a),p===S?fs.REASON_SELF_CONNECTION:O.type!==en[i.type]?fs.REASON_WRONG_TYPE:p.workspace!==S.workspace?fs.REASON_DIFFERENT_WORKSPACES:p.isShadow()&&!S.isShadow()?fs.REASON_SHADOW_PARENT:O.type===Un.OUTPUT_VALUE&&S.previousConnection&&S.previousConnection.isConnected()||O.type===Un.PREVIOUS_STATEMENT&&S.outputConnection&&S.outputConnection.isConnected()?fs.REASON_PREVIOUS_AND_OUTPUT:fs.CAN_CONNECT}doTypeChecks(i,a){if(i=i.getCheck(),a=a.getCheck(),!i||!a)return!0;for(let p=0;pp||a.getSourceBlock().isInsertionMarker())return!1;switch(a.type){case Un.PREVIOUS_STATEMENT:return this.canConnectToPrevious_(i,a);case Un.OUTPUT_VALUE:if(a.isConnected()&&!a.targetBlock().isInsertionMarker()||i.isConnected())return!1;break;case Un.INPUT_VALUE:if(a.isConnected()&&!a.targetBlock().isMovable()&&!a.targetBlock().isShadow())return!1;break;case Un.NEXT_STATEMENT:if(a.isConnected()&&!i.getSourceBlock().nextConnection&&!a.targetBlock().isShadow()&&a.targetBlock().nextConnection||a.targetBlock()&&!a.targetBlock().isMovable()&&!a.targetBlock().isShadow())return!1;break;default:return!1}return Xi.indexOf(a)===-1}canConnectToPrevious_(i,a){return i.targetConnection||Xi.indexOf(a)!==-1?!1:a.targetConnection?(i=a.targetBlock(),i.isInsertionMarker()?!i.getPreviousBlock():!1):!0}};r(Ft.CONNECTION_CHECKER,Nl,Uv);var gb=class extends zd{constructor(i){super(i),this.type=Iu,i&&(this.varType=i.type,this.varName=i.name)}toJson(){const i=super.toJson();if(this.varType===void 0)throw Error("The var type is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.varName)throw Error("The var name is undefined. Either pass a variable to the constructor, or call fromJson");return i.varType=this.varType,i.varName=this.varName,i}static fromJson(i,a,p){return a=super.fromJson(i,a,p??new gb),a.varType=i.varType,a.varName=i.varName,a}run(i){const a=this.getEventWorkspace_();if(!this.varId)throw Error("The var ID is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.varName)throw Error("The var name is undefined. Either pass a variable to the constructor, or call fromJson");i?a.deleteVariableById(this.varId):a.createVariable(this.varName,this.varType,this.varId)}};r(Ft.EVENT,Iu,gb);var _b=class extends zd{constructor(i,a){super(i),this.type=eh,i&&(this.oldName=i.name,this.newName=typeof a>"u"?"":a)}toJson(){const i=super.toJson();if(!this.oldName)throw Error("The old var name is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.newName)throw Error("The new var name is undefined. Either pass a value to the constructor, or call fromJson");return i.oldName=this.oldName,i.newName=this.newName,i}static fromJson(i,a,p){return a=super.fromJson(i,a,p??new _b),a.oldName=i.oldName,a.newName=i.newName,a}run(i){const a=this.getEventWorkspace_();if(!this.varId)throw Error("The var ID is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.oldName)throw Error("The old var name is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.newName)throw Error("The new var name is undefined. Either pass a value to the constructor, or call fromJson");i?a.renameVariableById(this.varId,this.newName):a.renameVariableById(this.varId,this.oldName)}};r(Ft.EVENT,eh,_b);var vb=class{constructor(i){this.workspace=i,this.variableMap=new Map}clear(){for(const i of this.variableMap.values())for(;0{O&&a&&this.deleteVariableInternal(a,S)})):this.deleteVariableInternal(a,S)}else console.warn("Can't delete non-existent variable: "+i)}deleteVariableInternal(i,a){const p=t.getGroup$$module$build$src$core$events$utils();p||t.setGroup$$module$build$src$core$events$utils(!0);try{for(let S=0;Si.name)}getVariableUsesById(i){const a=[],p=this.workspace.getAllBlocks(!1);for(let S=0;Sthis.remainingCapacityOfType(p))return!1;a+=i[p]}return!(a>this.remainingCapacity())}hasBlockLimits(){return this.options.maxBlocks!==1/0||!!this.options.maxInstances}getUndoStack(){return this.undoStack_}getRedoStack(){return this.redoStack_}undo(i){var a=i?this.redoStack_:this.undoStack_,p=i?this.undoStack_:this.redoStack_;const S=a.pop();if(S){for(var O=[S];a.length&&S.group&&S.group===a[a.length-1].group;){const j=a.pop();j&&O.push(j)}for(a=0;athis.MAX_UNDO&&0<=this.MAX_UNDO;)this.undoStack_.shift();for(let a=0;aj[0]-ve[0]);for(const[j,ve]of O)if(i{},document.body.addEventListener("wheel",this.dummyWheelListener),$e(this.svgGroup_,"wheel",this,this.onMouseWheel_)),this.options.hasCategories&&(this.toolbox_=new(y(Ft.TOOLBOX,this.options,!0))(this)),this.grid&&this.grid.update(this.scale),this.recordDragTargets(),(i=y(Ft.CURSOR,this.options))&&this.markerManager.setCursor(new i),this.renderer.createDom(this.svgGroup_,this.getTheme()),this.svgGroup_}dispose(){if(this.rendered=!1,this.currentGesture_&&this.currentGesture_.cancel(),this.svgGroup_&&mt(this.svgGroup_),this.toolbox_&&(this.toolbox_.dispose(),this.toolbox_=null),this.flyout&&(this.flyout.dispose(),this.flyout=null),this.trashcan&&(this.trashcan.dispose(),this.trashcan=null),this.scrollbar&&(this.scrollbar.dispose(),this.scrollbar=null),this.zoomControls_&&this.zoomControls_.dispose(),this.audioManager&&this.audioManager.dispose(),this.grid&&(this.grid=null),this.renderer.dispose(),this.markerManager&&this.markerManager.dispose(),super.dispose(),this.themeManager_&&(this.themeManager_.unsubscribeWorkspace(this),this.themeManager_.unsubscribe(this.svgBackground_),this.options.parentWorkspace||this.themeManager_.dispose()),this.connectionDBList.length=0,this.toolboxCategoryCallbacks.clear(),this.flyoutButtonCallbacks.clear(),!this.options.parentWorkspace){const i=this.getParentSvg();i&&i.parentNode&&mt(i.parentNode)}this.resizeHandlerWrapper&&(it(this.resizeHandlerWrapper),this.resizeHandlerWrapper=null),this.dummyWheelListener&&(document.body.removeEventListener("wheel",this.dummyWheelListener),this.dummyWheelListener=null)}addTrashcan(){this.trashcan=ep.newTrashcan(this);const i=this.trashcan.createDom();this.svgGroup_.insertBefore(i,this.getCanvas())}static newTrashcan(i){throw Error("The implementation of newTrashcan should be monkey-patched in by blockly.ts")}addZoomControls(){this.zoomControls_=new v0(this);const i=this.zoomControls_.createDom();this.svgGroup_.appendChild(i)}addFlyout(i){const a=new Hi({parentWorkspace:this,rtl:this.RTL,oneBasedIndex:this.options.oneBasedIndex,horizontalLayout:this.horizontalLayout,renderer:this.options.renderer,rendererOverrides:this.options.rendererOverrides,move:{scrollbars:!0}});return a.toolboxPosition=this.options.toolboxPosition,this.flyout=this.horizontalLayout?new(y(Ft.FLYOUTS_HORIZONTAL_TOOLBOX,this.options,!0))(a):new(y(Ft.FLYOUTS_VERTICAL_TOOLBOX,this.options,!0))(a),this.flyout.autoClose=!1,this.flyout.getWorkspace().setVisible(!0),this.flyout.createDom(i)}getFlyout(i){return this.flyout||i?this.flyout:this.toolbox_?this.toolbox_.getFlyout():null}getToolbox(){return this.toolbox_}updateScreenCalculations_(){this.updateInverseScreenCTM(),this.recordDragTargets()}resizeContents(){this.resizesEnabled&&this.rendered&&(this.scrollbar&&this.scrollbar.resize(),this.updateInverseScreenCTM())}resize(){this.toolbox_&&this.toolbox_.position(),this.flyout&&this.flyout.position();const i=this.componentManager.getComponents(gl.Capability.POSITIONABLE,!0),a=this.getMetricsManager().getUiMetrics(),p=[];for(let S=0,O;O=i[S];S++){O.position(a,p);const j=O.getBoundingRectangle();j&&p.push(j)}this.scrollbar&&this.scrollbar.resize(),this.updateScreenCalculations_()}updateScreenCalculationsIfScrolled(){const i=We();_n.equals(this.lastRecordedPageScroll,i)||(this.lastRecordedPageScroll=i,this.updateScreenCalculations_())}getLayerManager(){return this.layerManager}getCanvas(){return this.layerManager.getBlockLayer()}setCachedParentSvgSize(i,a){const p=this.getParentSvg();i!=null&&(this.cachedParentSvgSize.width=i,p.setAttribute("data-cached-width",`${i}`)),a!=null&&(this.cachedParentSvgSize.height=a,p.setAttribute("data-cached-height",`${a}`))}getBubbleCanvas(){return this.layerManager.getBubbleLayer()}getParentSvg(){if(!this.cachedParentSvg){let i=this.svgGroup_;for(;i;){if(i.tagName==="svg"){this.cachedParentSvg=i;break}i=i.parentNode}}return this.cachedParentSvg}maybeFireViewportChangeEvent(){if(se()){var i=this.scale,a=-this.scrollY,p=-this.scrollX;if(!(i===this.oldScale&&1>Math.abs(a-this.oldTop)&&1>Math.abs(p-this.oldLeft))){var S=new(Ie(ni))(a,p,i,this.id,this.oldScale);this.oldScale=i,this.oldTop=a,this.oldLeft=p,ue(S)}}}translate(i,a){let p;(p=this.layerManager)==null||p.translateLayers(new _n(i,a),this.scale);let S;(S=this.grid)==null||S.moveTo(i,a),this.maybeFireViewportChangeEvent()}getWidth(){const i=this.getMetrics();return i?i.viewWidth/this.scale:0}setVisible(i){this.isVisible_=i,this.svgGroup_&&(this.scrollbar&&this.scrollbar.setContainerVisible(i),this.getFlyout()&&this.getFlyout().setContainerVisible(i),this.getParentSvg().style.display=i?"block":"none",this.toolbox_&&this.toolbox_.setVisible(i),i||this.hideChaff(!0))}render(){for(var i=this.getAllBlocks(!1),a=i.length-1;0<=a;a--)i[a].queueRender();if(this.currentGesture_)for(i=this.currentGesture_.getInsertionMarkers(),a=0;avoid this.markerManager.updateMarkers())}highlightBlock(i,a){if(a===void 0){for(let p=0,S;S=this.highlightedBlocks[p];p++)S.setHighlighted(!1);this.highlightedBlocks.length=0}(i=i?this.getBlockById(i):null)&&((a=a===void 0||a)?this.highlightedBlocks.indexOf(i)===-1&&this.highlightedBlocks.push(i):Ct(this.highlightedBlocks,i),i.setHighlighted(a))}paste(i){if(xe("Blockly.WorkspaceSvg.prototype.paste","v10","v11","Blockly.clipboard.paste"),!this.rendered||!i.type&&!i.tagName)return null;this.currentGesture_&&this.currentGesture_.cancel();const a=t.getGroup$$module$build$src$core$events$utils();a||t.setGroup$$module$build$src$core$events$utils(!0);let p;try{p=i.type?this.pasteBlock_(null,i):i.tagName.toLowerCase()==="comment"?this.pasteWorkspaceComment_(i):this.pasteBlock_(i,null)}finally{t.setGroup$$module$build$src$core$events$utils(a)}return p}pasteBlock_(i,a){t.disable$$module$build$src$core$events$utils();let p;try{let S=0,O=0;if(i){p=io(i,this);let j;S=parseInt((j=i.getAttribute("x"))!=null?j:"0"),this.RTL&&(S=-S);let ve;O=parseInt((ve=i.getAttribute("y"))!=null?ve:"0")}else a&&(p=Vn(a,this),S=a.x||10,this.RTL&&(S=this.getWidth()-S),O=a.y||10);if(!isNaN(S)&&!isNaN(O)){let j;do{j=!1;const ve=this.getAllBlocks(!1);for(let Ue=0,Yt;Yt=ve[Ue];Ue++){const jn=Yt.getRelativeToSurfaceXY();if(1>=Math.abs(S-jn.x)&&1>=Math.abs(O-jn.y)){j=!0;break}}if(!j){const Ue=p.getConnections_(!1);for(let Yt=0,jn;jn=Ue[Yt];Yt++)if(jn.closest(t.config$$module$build$src$core$config.snapRadius,new _n(S,O)).connection){j=!0;break}}j&&(S=this.RTL?S-t.config$$module$build$src$core$config.snapRadius:S+t.config$$module$build$src$core$config.snapRadius,O+=2*t.config$$module$build$src$core$config.snapRadius)}while(j);p.moveTo(new _n(S,O))}}finally{t.enable$$module$build$src$core$events$utils()}return se()&&!p.isShadow()&&ue(new(Ie(t.CREATE$$module$build$src$core$events$utils))(p)),p.select(),p}pasteWorkspaceComment_(i){t.disable$$module$build$src$core$events$utils();let a;try{a=zl.fromXmlRendered(i,this);let p,S=parseInt((p=i.getAttribute("x"))!=null?p:"0"),O,j=parseInt((O=i.getAttribute("y"))!=null?O:"0");isNaN(S)||isNaN(j)||(this.RTL&&(S=-S),a.moveBy(S+50,j+50))}finally{t.enable$$module$build$src$core$events$utils()}return se()&&ih.fireCreateEvent(a),a.select(),a}refreshToolboxSelection(){const i=this.isFlyout?this.targetWorkspace:this;i&&!i.currentGesture_&&i.toolbox_&&i.toolbox_.getFlyout()&&i.toolbox_.refreshSelection()}renameVariableById(i,a){super.renameVariableById(i,a),this.refreshToolboxSelection()}deleteVariableById(i){super.deleteVariableById(i),this.refreshToolboxSelection()}createVariable(i,a,p){return i=super.createVariable(i,a,p),this.refreshToolboxSelection(),i}recordDragTargets(){const i=this.componentManager.getComponents(gl.Capability.DRAG_TARGET,!0);this.dragTargetAreas=[];for(let a=0,p;p=i[a];a++){const S=p.getClientRect();S&&this.dragTargetAreas.push({component:p,clientRect:S})}}newBlock(i,a){throw Error("The implementation of newBlock should be monkey-patched in by blockly.ts")}getDragTarget(i){for(let a=0,p;p=this.dragTargetAreas[a];a++)if(p.clientRect.contains(i.clientX,i.clientY))return p.component;return null}onMouseDown_(i){const a=this.getGesture(i);a&&a.handleWsStart(i,this)}startDrag(i,a){i=kt(i,this.getParentSvg(),this.getInverseScreenCTM()),i.x/=this.scale,i.y/=this.scale,this.dragDeltaXY=_n.difference(a,i)}moveDrag(i){return i=kt(i,this.getParentSvg(),this.getInverseScreenCTM()),i.x/=this.scale,i.y/=this.scale,_n.sum(this.dragDeltaXY,i)}isDragging(){return this.currentGesture_!==null&&this.currentGesture_.isDragging()}isDraggable(){return this.options.moveOptions&&this.options.moveOptions.drag}isMovable(){return this.options.moveOptions&&!!this.options.moveOptions.scrollbars||this.options.moveOptions&&this.options.moveOptions.wheel||this.options.moveOptions&&this.options.moveOptions.drag||this.options.zoomOptions&&this.options.zoomOptions.wheel||this.options.zoomOptions&&this.options.zoomOptions.pinch}isMovableHorizontally(){const i=!!this.scrollbar;return this.isMovable()&&(!i||i&&this.scrollbar.canScrollHorizontally())}isMovableVertically(){const i=!!this.scrollbar;return this.isMovable()&&(!i||i&&this.scrollbar.canScrollVertically())}onMouseWheel_(i){if(gm.inProgress())i.preventDefault(),i.stopPropagation();else{var a=this.options.zoomOptions&&this.options.zoomOptions.wheel,p=this.options.moveOptions&&this.options.moveOptions.wheel;if(a||p){var S=vt(i);if(Mr)var O=i.metaKey;a&&(i.ctrlKey||O||!p)?(S=-S.y/50,a=kt(i,this.getParentSvg(),this.getInverseScreenCTM()),this.zoom(a.x,a.y,S)):(a=this.scrollX-S.x,p=this.scrollY-S.y,i.shiftKey&&!S.x&&(a=this.scrollX-S.y,p=this.scrollY),this.scroll(a,p)),i.preventDefault()}}}getBlocksBoundingBox(){const i=this.getTopBoundedElements();if(!i.length)return new Oi(0,0,0,0);const a=i[0].getBoundingRectangle();for(let S=1;Sa.bottom&&(a.bottom=p.bottom),p.lefta.right&&(a.right=p.right))}return a}cleanUp(){this.setResizesEnabled(!1),t.setGroup$$module$build$src$core$events$utils(!0);const i=this.getTopBlocks(!0);let a=0;for(let p=0,S;S=i[p];p++){if(!S.isMovable())continue;const O=S.getRelativeToSurfaceXY();S.moveBy(-O.x,a-O.y,["cleanup"]),S.snapToGrid(),a=S.getRelativeToSurfaceXY().y+S.getHeightWidth().height+this.renderer.getConstants().MIN_BLOCK_HEIGHT}t.setGroup$$module$build$src$core$events$utils(!1),this.setResizesEnabled(!0)}showContextMenu(i){if(!this.options.readOnly&&!this.isFlyout){var a=Li.registry.getContextMenuOptions(Li.ScopeType.WORKSPACE,{workspace:this});this.configureContextMenu&&this.configureContextMenu(a,i),Wu(i,a,this.RTL)}}updateToolbox(i){if(i=_t(i)){if(!this.options.languageTree)throw Error("Existing toolbox is null. Can't create new toolbox.");if(Wt(i)){if(!this.toolbox_)throw Error("Existing toolbox has no categories. Can't change mode.");this.options.languageTree=i,this.toolbox_.render(i)}else{if(!this.flyout)throw Error("Existing toolbox has categories. Can't change mode.");this.options.languageTree=i,this.flyout.show(i)}}else if(this.options.languageTree)throw Error("Can't nullify an existing toolbox.")}markFocused(){this.options.parentWorkspace?this.options.parentWorkspace.markFocused():(k(this),this.getParentSvg().focus({preventScroll:!0}))}zoom(i,a,p){p=Math.pow(this.options.zoomOptions.scaleSpeed,p);const S=this.scale*p;if(this.scale!==S){S>this.options.zoomOptions.maxScale?p=this.options.zoomOptions.maxScale/this.scale:Sthis.options.zoomOptions.maxScale?i=this.options.zoomOptions.maxScale:this.options.zoomOptions.minScale&&ia.autoHide(i))}static setTopLevelWorkspaceMetrics_(i){const a=this.getMetrics();typeof i.x=="number"&&(this.scrollX=-(a.scrollLeft+(a.scrollWidth-a.viewWidth)*i.x)),typeof i.y=="number"&&(this.scrollY=-(a.scrollTop+(a.scrollHeight-a.viewHeight)*i.y)),this.translate(this.scrollX+a.absoluteLeft,this.scrollY+a.absoluteTop)}},yb=class extends _{constructor(i,a){super(a),this.type=Pl,this.isOpen=i}toJson(){const i=super.toJson();if(this.isOpen===void 0)throw Error("Whether this is already open or not is undefined. Either pass a value to the constructor, or call fromJson");return i.isOpen=this.isOpen,i}static fromJson(i,a,p){return a=super.fromJson(i,a,p??new yb),a.isOpen=i.isOpen,a}};r(Ft.EVENT,Pl,yb);var bb=class extends vf{constructor(i){if(super(i),this.type=t.DELETE$$module$build$src$core$events$utils,i){if(i.getParent())throw Error("Connected blocks cannot be deleted.");i.isShadow()&&(this.recordUndo=!1),this.oldXml=Tr(i),this.ids=Te(i),this.wasShadow=i.isShadow(),this.oldJson=$i(i,{addCoordinates:!0})}}toJson(){const i=super.toJson();if(!this.oldXml)throw Error("The old block XML is undefined. Either pass a block to the constructor, or call fromJson");if(!this.ids)throw Error("The block IDs are undefined. Either pass a block to the constructor, or call fromJson");if(this.wasShadow===void 0)throw Error("Whether the block was a shadow is undefined. Either pass a block to the constructor, or call fromJson");if(!this.oldJson)throw Error("The old block JSON is undefined. Either pass a block to the constructor, or call fromJson");return i.oldXml=Qi(this.oldXml),i.ids=this.ids,i.wasShadow=this.wasShadow,i.oldJson=this.oldJson,this.recordUndo||(i.recordUndo=this.recordUndo),i}static fromJson(i,a,p){return a=super.fromJson(i,a,p??new bb),a.oldXml=t.textToDom$$module$build$src$core$utils$xml(i.oldXml),a.ids=i.ids,a.wasShadow=i.wasShadow||a.oldXml.tagName.toLowerCase()==="shadow",a.oldJson=i.oldJson,i.recordUndo!==void 0&&(a.recordUndo=i.recordUndo),a}run(i){const a=this.getEventWorkspace_();if(!this.ids)throw Error("The block IDs are undefined. Either pass a block to the constructor, or call fromJson");if(!this.oldJson)throw Error("The old block JSON is undefined. Either pass a block to the constructor, or call fromJson");if(i)for(i=0;ii.disposeInternal()),this.inputList.forEach(i=>i.dispose()),this.inputList.length=0,this.getConnections_(!0).forEach(i=>i.dispose()),this.disposed=!0)}isDeadOrDying(){return this.disposing||this.disposed}initModel(){for(const i of this.inputList)for(const a of i.fieldRow)a.initModel&&a.initModel()}unplug(i){this.outputConnection&&this.unplugFromRow_(i),this.previousConnection&&this.unplugFromStack_(i)}unplugFromRow_(i){let a=null,p;(p=this.outputConnection)!=null&&p.isConnected()&&(a=this.outputConnection.targetConnection,this.outputConnection.disconnect()),a&&i&&(i=this.getOnlyValueConnection_())&&i.isConnected()&&!i.targetBlock().isShadow()&&(i=i.targetConnection,i==null||i.disconnect(),this.workspace.connectionChecker.canConnect(i,a,!1)?a.connect(i):i==null||i.onFailedConnect(a))}getOnlyValueConnection_(){let i=null;for(let a=0;a(S=S+(p==="("||O===")"?"":" ")+O,p=O[O.length-1],S),""),a=a.trim()||"???",i&&a.length>i&&(a=a.substring(0,i-3)+"..."),a}toTokens(i="?"){const a=[];for(const S of this.inputList)if(S.name!=Bg){for(const O of S.fieldRow)a.push(O.getText());if(S.connection){const O=S.connection.targetBlock();if(O){var p=S.connection;let j=p.getCheck();!j&&p.targetConnection&&(j=p.targetConnection.getCheck()),(p=!!j&&(j.indexOf("Boolean")!==-1||j.indexOf("Number")!==-1))&&a.push("("),a.push(...O.toTokens(i)),p&&a.push(")")}else a.push(i)}}return a}appendValueInput(i){return this.appendInput(new t.ValueInput$$module$build$src$core$inputs$value_input(i,this))}appendStatementInput(i){return this.statementInputCount++,this.appendInput(new id(i,this))}appendDummyInput(i=""){return this.appendInput(new Np(i,this))}appendEndRowInput(i=""){return this.appendInput(new Tm(i,this))}appendInput(i){return this.inputList.push(i),i}appendInputFromRegistry(i,a){return(i=h(Ft.INPUT,i,!1))?this.appendInput(new i(a,this)):null}jsonInit(i){var a=i.type?'Block "'+i.type+'": ':"";if(i.output&&i.previousStatement)throw Error(a+"Must not have both an output and a previousStatement.");for(var p=0;i["args"+p];){if(i["message"+p]===void 0)throw Error(a+`args${p} must have a corresponding message (message${p}).`);p++}if(i.style&&i.style.hat&&(this.hat=i.style.hat,i.style=null),i.style&&i.colour)throw Error(a+"Must not have both a colour and a style.");for(i.style?this.jsonInitStyle_(i,a):this.jsonInitColour_(i,a),p=0;i["message"+p]!==void 0;)this.interpolate_(i["message"+p],i["args"+p]||[],i["implicitAlign"+p]||i["lastDummyAlign"+p],a),p++;if(i.inputsInline!==void 0&&(t.disable$$module$build$src$core$events$utils(),this.setInputsInline(i.inputsInline),t.enable$$module$build$src$core$events$utils()),i.output!==void 0&&this.setOutput(!0,i.output),i.outputShape!==void 0&&this.setOutputShape(i.outputShape),i.previousStatement!==void 0&&this.setPreviousStatement(!0,i.previousStatement),i.nextStatement!==void 0&&this.setNextStatement(!0,i.nextStatement),i.tooltip!==void 0&&(p=Vr(i.tooltip),this.setTooltip(p)),i.enableContextMenu!==void 0&&(this.contextMenu=!!i.enableContextMenu),i.suppressPrefixSuffix!==void 0&&(this.suppressPrefixSuffix=!!i.suppressPrefixSuffix),i.helpUrl!==void 0&&(p=Vr(i.helpUrl),this.setHelpUrl(p)),typeof i.extensions=="string"&&(console.warn(a+"JSON attribute 'extensions' should be an array of strings. Found raw string in JSON for '"+i.type+"' block."),i.extensions=[i.extensions]),i.mutator!==void 0&&es(i.mutator,this,!0),i=i.extensions,Array.isArray(i))for(a=0;aj||j>a)throw Error('Block "'+this.type+'": Message index %'+j+" out of range.");if(p[j])throw Error('Block "'+this.type+'": Message index %'+j+" duplicated.");p[j]=!0,S++}}if(S!==a)throw Error('Block "'+this.type+'": Message does not reference all '+a+" arg(s).")}interpolateArguments_(i,a,p){const S=[];for(let j=0;j=this.inputList.length)throw RangeError("Input index "+i+" out of bounds.");if(a>this.inputList.length)throw RangeError("Reference input "+a+" out of bounds.");const p=this.inputList[i];this.inputList.splice(i,1),ia.getWeight()-p.getWeight()),i}removeIcon(i){if(!this.hasIcon(i))return!1;let a;return(a=this.getIcon(i))==null||a.dispose(),this.icons=this.icons.filter(p=>!p.getType().equals(i)),!0}hasIcon(i){return this.icons.some(a=>a.getType().equals(i))}getIcon(i){return i instanceof Wo?this.icons.find(a=>a.getType().equals(i)):this.icons.find(a=>a.getType().toString()===i)}getIcons(){return[...this.icons]}getRelativeToSurfaceXY(){return this.xy_}moveBy(i,a,p){if(this.parentBlock_)throw Error("Block has parent");const S=new(Ie(t.MOVE$$module$build$src$core$events$utils))(this);p&&S.setReason(p),this.xy_.translate(i,a),S.recordNew(),ue(S)}makeConnection_(i){return new fs(this,i)}allInputsFilled(i){if(i===void 0&&(i=!0),!i&&this.isShadow())return!1;for(let p=0,S;S=this.inputList[p];p++)if(S.connection){var a=S.connection.targetBlock();if(!a||!a.allInputsFilled(i))return!1}return(a=this.getNextBlock())?a.allInputsFilled(i):!0}toDevString(){let i=this.type?'"'+this.type+'" block':"Block";return this.id&&(i+=' (id="'+this.id+'")'),i}};L0.COLLAPSED_INPUT_NAME=Bg,L0.COLLAPSED_FIELD_NAME=zv;var AT=class{constructor(){this.drawer=this.curNode=this.colour=null,this.type="marker"}setDrawer(i){this.drawer=i}getDrawer(){return this.drawer}getCurNode(){return this.curNode}setCurNode(i){const a=this.curNode;this.curNode=i,this.drawer&&this.drawer.draw(a,this.curNode)}draw(){this.drawer&&this.drawer.draw(this.curNode,this.curNode)}hide(){this.drawer&&this.drawer.hide()}dispose(){this.getDrawer()&&this.getDrawer().dispose()}},Tb=class extends AT{constructor(){super(),this.type="cursor"}next(){var i=this.getCurNode();if(!i)return null;for(i=i.next();i&&i.next()&&(i.getType()===tn.types.NEXT||i.getType()===tn.types.BLOCK);)i=i.next();return i&&this.setCurNode(i),i}in(){var i=this.getCurNode();if(!i)return null;(i.getType()===tn.types.PREVIOUS||i.getType()===tn.types.OUTPUT)&&(i=i.next());let a,p;return(i=(p=(a=i)==null?void 0:a.in())!=null?p:null)&&this.setCurNode(i),i}prev(){var i=this.getCurNode();if(!i)return null;for(i=i.prev();i&&i.prev()&&(i.getType()===tn.types.NEXT||i.getType()===tn.types.BLOCK);)i=i.prev();return i&&this.setCurNode(i),i}out(){var i=this.getCurNode();return i?((i=i.out())&&i.getType()===tn.types.BLOCK&&(i=i.prev()||i),i&&this.setCurNode(i),i):null}};r(Ft.CURSOR,Nl,Tb);var F_=class extends Tb{constructor(){super()}next(){var i=this.getCurNode();return i?((i=this.getNextNode_(i,this.validNode_))&&this.setCurNode(i),i):null}in(){return this.next()}prev(){var i=this.getCurNode();return i?((i=this.getPreviousNode_(i,this.validNode_))&&this.setCurNode(i),i):null}out(){return this.prev()}getNextNode_(i,a){if(!i)return null;const p=i.in()||i.next();return a(p)?p:p?this.getNextNode_(p,a):(i=this.findSiblingOrParent(i.out()),a(i)?i:i?this.getNextNode_(i,a):null)}getPreviousNode_(i,a){if(!i)return null;let p=i.prev();return p=p?this.getRightMostChild(p):i.out(),a(p)?p:p?this.getPreviousNode_(p,a):null}validNode_(i){let a=!1;return i=i&&i.getType(),(i===tn.types.OUTPUT||i===tn.types.INPUT||i===tn.types.FIELD||i===tn.types.NEXT||i===tn.types.PREVIOUS||i===tn.types.WORKSPACE)&&(a=!0),a}findSiblingOrParent(i){if(!i)return null;const a=i.next();return a||this.findSiblingOrParent(i.out())}getRightMostChild(i){if(!i.in())return i;for(i=i.in();i&&i.next();)i=i.next();return this.getRightMostChild(i)}};F_.registrationName="basicCursor",r(Ft.CURSOR,F_.registrationName,F_);var IT=class extends F_{validNode_(i){let a=!1;const p=i&&i.getType();return i&&(i=i.getLocation(),p===tn.types.FIELD&&i&&i.isTabNavigable()&&i.isClickable()&&(a=!0)),a}},Sb=10,sd=class extends fs{constructor(i,a){super(i,a),this.highlighted=!1,this.targetConnection=null,this.db=i.workspace.connectionDBList[a],this.dbOpposite=i.workspace.connectionDBList[en[a]],this.offsetInBlock=new _n(0,0),this.trackedState=sd.TrackedState.WILL_TRACK}dispose(){super.dispose(),this.trackedState===sd.TrackedState.TRACKED&&this.db.removeConnection(this,this.y);let i,a;(a=(i=this.sourceBlock_.pathObject).removeConnectionHighlight)==null||a.call(i,this)}getSourceBlock(){return super.getSourceBlock()}targetBlock(){return super.targetBlock()}distanceFrom(i){const a=this.x-i.x;return i=this.y-i.y,Math.sqrt(a*a+i*i)}bumpAwayFrom(i){if(!this.sourceBlock_.workspace.isDragging()){var a=this.sourceBlock_.getRootBlock();if(!a.isInFlyout){var p=!1;if(!a.isMovable()){if(a=i.getSourceBlock().getRootBlock(),!a.isMovable())return;i=this,p=!0}var S=L()==a;S||a.addSelect();var O=i.x+t.config$$module$build$src$core$config.snapRadius+Math.floor(Math.random()*Sb)-this.x,j=i.y+t.config$$module$build$src$core$config.snapRadius+Math.floor(Math.random()*Sb)-this.y;p&&(j=-j),a.RTL&&(O=i.x-t.config$$module$build$src$core$config.snapRadius-Math.floor(Math.random()*Sb)-this.x),a.moveBy(O,j,["bump"]),S||a.removeSelect()}}}moveTo(i,a){let p=!1;return this.trackedState===sd.TrackedState.WILL_TRACK?(this.db.addConnection(this,a),this.trackedState=sd.TrackedState.TRACKED,p=!0):this.trackedState===sd.TrackedState.TRACKED&&(this.db.removeConnection(this,this.y),this.db.addConnection(this,a),p=!0),this.x=i,this.y=a,p}moveBy(i,a){return this.moveTo(this.x+i,this.y+a)}moveToOffset(i){return this.moveTo(i.x+this.offsetInBlock.x,i.y+this.offsetInBlock.y)}setOffsetInBlock(i,a){this.offsetInBlock.x=i,this.offsetInBlock.y=a}getOffsetInBlock(){return this.offsetInBlock}tightenEfficiently(){var i=this.targetConnection;const a=this.targetBlock();i&&a&&(i=_n.difference(this.offsetInBlock,i.offsetInBlock),a.translate(i.x,i.y))}closest(i,a){return this.dbOpposite.searchForClosest(this,i,a)}highlight(){this.highlighted=!0,this.getSourceBlock().queueRender()}unhighlight(){this.highlighted=!1,this.getSourceBlock().queueRender()}isHighlighted(){return this.highlighted}setTracking(i){i&&this.trackedState===sd.TrackedState.TRACKED||!i&&this.trackedState===sd.TrackedState.UNTRACKED||this.sourceBlock_.isInFlyout||(i?(this.db.addConnection(this,this.y),this.trackedState=sd.TrackedState.TRACKED):(this.trackedState===sd.TrackedState.TRACKED&&this.db.removeConnection(this,this.y),this.trackedState=sd.TrackedState.UNTRACKED))}stopTrackingAll(){if(this.setTracking(!1),this.targetConnection){const i=this.targetBlock().getDescendants(!1);for(let a=0;aclearTimeout(i)),this.warningTextDb.clear(),this.getIcons().forEach(i=>i.dispose()))}checkAndDelete(){this.workspace.isFlyout||(t.setGroup$$module$build$src$core$events$utils(!0),this.workspace.hideChaff(),this.outputConnection?this.dispose(!1,!0):this.dispose(!0,!0),t.setGroup$$module$build$src$core$events$utils(!1))}toCopyData(){return this.isInsertionMarker_?null:{paster:Rp.TYPE,blockState:$i(this,{addCoordinates:!0,addNextBlocks:!1}),typeCounts:V(this,!0)}}applyColour(){this.pathObject.applyColour(this);const i=this.getIcons();for(let a=0;a{this.isDeadOrDying()||(this.warningTextDb.delete(a),this.setWarningText(i,a))},100));else if(this.isInFlyout&&(i=null),p=this.getIcon(Zf.TYPE),i){let S=this.getSurroundParent(),O=null;for(;S;)S.isCollapsed()&&(O=S),S=S.getSurroundParent();O&&O.setWarningText(t.Msg$$module$build$src$core$msg.COLLAPSED_WARNINGS_WARNING,Dp.COLLAPSED_WARNING_ID),p?p.addMessage(i,a):this.addIcon(new Zf(this).addMessage(i,a))}else p&&(a?(p.addMessage("",a),p.getText()||this.removeIcon(Zf.TYPE)):this.removeIcon(Zf.TYPE))}setMutator(i){this.removeIcon(t.MutatorIcon$$module$build$src$core$icons$mutator_icon.TYPE),i&&this.addIcon(i)}addIcon(i){return super.addIcon(i),i instanceof Zf&&(this.warning=i),i instanceof t.MutatorIcon$$module$build$src$core$icons$mutator_icon&&(this.mutator=i),this.rendered&&(i.initView(this.createIconPointerDownListener(i)),i.applyColour(),i.updateEditable(),this.queueRender(),xi(),this.bumpNeighbours()),i}createIconPointerDownListener(i){return a=>{this.isDeadOrDying()||(a=this.workspace.getGesture(a))&&a.setStartIcon(i)}}removeIcon(i){const a=super.removeIcon(i);return i.equals(Zf.TYPE)&&(this.warning=null),i.equals(t.MutatorIcon$$module$build$src$core$icons$mutator_icon.TYPE)&&(this.mutator=null),this.rendered&&(this.queueRender(),xi(),this.bumpNeighbours()),a}setEnabled(i){this.isEnabled()!==i&&(super.setEnabled(i),this.rendered&&!this.getInheritedDisabled()&&this.updateDisabled())}setHighlighted(i){this.rendered&&this.pathObject.updateHighlighted(i)}addSelect(){this.pathObject.updateSelected(!0)}removeSelect(){this.pathObject.updateSelected(!1)}setDeleteStyle(i){this.pathObject.updateDraggingDelete(i)}getColour(){return this.style.colourPrimary}setColour(i){super.setColour(i),i=this.workspace.getRenderer().getConstants().getBlockStyleForColour(this.colour_),this.pathObject.setStyle(i.style),this.style=i.style,this.styleName_=i.name,this.applyColour()}setStyle(i){const a=this.workspace.getRenderer().getConstants().getBlockStyle(i);if(this.styleName_=i,a)this.hat=a.hat,this.pathObject.setStyle(a),this.colour_=a.colourPrimary,this.style=a,this.applyColour();else throw Error("Invalid style name: "+i)}bringToFront(i=!1){let a=this;if(!a.isDeadOrDying())do{const p=a.getSvgRoot(),S=p.parentNode,O=S.childNodes;if(O[O.length-1]!==p&&S.appendChild(p),i)break;a=a.getParent()}while(a)}setPreviousStatement(i,a){super.setPreviousStatement(i,a),this.rendered&&(this.queueRender(),this.bumpNeighbours())}setNextStatement(i,a){super.setNextStatement(i,a),this.rendered&&(this.queueRender(),this.bumpNeighbours())}setOutput(i,a){super.setOutput(i,a),this.rendered&&(this.queueRender(),this.bumpNeighbours())}setInputsInline(i){super.setInputsInline(i),this.rendered&&(this.queueRender(),this.bumpNeighbours())}removeInput(i,a){return i=super.removeInput(i,a),this.rendered&&(this.queueRender(),this.bumpNeighbours()),i}moveNumberedInputBefore(i,a){super.moveNumberedInputBefore(i,a),this.rendered&&(this.queueRender(),this.bumpNeighbours())}appendInput(i){return super.appendInput(i),this.rendered&&(this.queueRender(),this.bumpNeighbours()),i}setConnectionTracking(i){if(this.previousConnection&&this.previousConnection.setTracking(i),this.outputConnection&&this.outputConnection.setTracking(i),this.nextConnection){this.nextConnection.setTracking(i);var a=this.nextConnection.targetBlock();a&&a.setConnectionTracking(i)}if(!this.collapsed_)for(a=0;a{const a=t.getGroup$$module$build$src$core$events$utils();t.setGroup$$module$build$src$core$events$utils(i),this.getRootBlock().bumpNeighboursInternal(),t.setGroup$$module$build$src$core$events$utils(a),this.bumpNeighboursPid=0},t.config$$module$build$src$core$config.bumpDelay)}}bumpNeighboursInternal(){const i=this.getRootBlock();if(!(this.isDeadOrDying()||this.workspace.isDragging()||i.isInFlyout))for(const a of this.getConnections_(!1)){if(a.isSuperior()){let p;(p=a.targetBlock())==null||p.bumpNeighboursInternal()}for(const p of a.neighbours(t.config$$module$build$src$core$config.snapRadius))p.getSourceBlock().getRootBlock()!==i&&(a.isConnected()&&p.isConnected()||(a.isSuperior()?p.bumpAwayFrom(a):a.bumpAwayFrom(p)))}}scheduleSnapAndBump(){const i=t.getGroup$$module$build$src$core$events$utils();setTimeout(()=>{t.setGroup$$module$build$src$core$events$utils(i),this.snapToGrid(),t.setGroup$$module$build$src$core$events$utils(!1)},t.config$$module$build$src$core$config.bumpDelay/2),this.bumpNeighbours()}positionNearConnection(i,a,p){if(i.type===Un.NEXT_STATEMENT||i.type===Un.INPUT_VALUE){let S=a.x;a=a.y,S+=p.x-i.getOffsetInBlock().x,a+=p.y-i.getOffsetInBlock().y,this.moveBy(S,a)}}getChildren(i){return super.getChildren(i)}queueRender(){return qo(this)}render(){this.queueRender(),xi()}renderEfficiently(){this.rendered=!0,te(),this.isCollapsed()&&this.updateCollapsed_(),this.isEnabled()||this.updateDisabled(),this.workspace.getRenderer().render(this),this.tightenChildrenEfficiently(),pe(),this.updateMarkers_()}tightenChildrenEfficiently(){for(const i of this.inputList){const a=i.connection;a&&a.tightenEfficiently()}this.nextConnection&&this.nextConnection.tightenEfficiently()}updateMarkers_(){this.workspace.keyboardAccessibilityMode&&this.pathObject.cursorSvg&&this.workspace.getCursor().draw(),this.workspace.keyboardAccessibilityMode&&this.pathObject.markerSvg&&this.workspace.getMarker(Ca.LOCAL_MARKER).draw();for(const i of this.inputList)for(const a of i.fieldRow)a.updateMarkers_()}setCursorSvg(i){this.pathObject.setCursorSvg(i)}setMarkerSvg(i){this.pathObject.setMarkerSvg(i)}getHeightWidth(){let i=this.height,a=this.width;var p=this.getNextBlock();if(p){p=p.getHeightWidth();const S=this.workspace.getRenderer().getConstants().NOTCH_HEIGHT;i+=p.height-S,a=Math.max(a,p.width)}return{height:i,width:a}}fadeForReplacement(i){this.pathObject.updateReplacementFade(i)}highlightShapeForInput(i,a){this.pathObject.updateShapeForInputHighlight(i,a)}};Dp.INLINE=-1,Dp.COLLAPSED_WARNING_ID="TEMP_COLLAPSED_WARNING_";var RT=class{constructor(){}onDragEnter(i){}onDragOver(i){}onDragExit(i){}onDrop(i){}getClientRect(){return null}shouldPreventMove(i){return!1}},Hv=class extends RT{constructor(){super(),this.wouldDelete_=!1}wouldDelete(i,a){return i instanceof Dp?(i=!i.getParent()&&i.isDeletable(),this.updateWouldDelete_(i&&!a)):this.updateWouldDelete_(i.isDeletable()),this.wouldDelete_}updateWouldDelete_(i){this.wouldDelete_=i}},kT=class extends Hv{constructor(i){super(),this.workspace=i,this.id="trashcan",this.contents=[],this.flyout=null,this.isLidOpen=!1,this.minOpenness=0,this.lidTask=this.svgLid=this.svgGroup=null,this.top=this.left=this.lidOpen=0,this.initialized=!1,0>=this.workspace.options.maxTrashcanContents||(i=new Hi({scrollbars:!0,parentWorkspace:this.workspace,rtl:this.workspace.RTL,oneBasedIndex:this.workspace.options.oneBasedIndex,renderer:this.workspace.options.renderer,rendererOverrides:this.workspace.options.rendererOverrides,move:{scrollbars:!0}}),this.workspace.horizontalLayout?(i.toolboxPosition=this.workspace.toolboxPosition===dr.TOP?dr.BOTTOM:dr.TOP,this.flyout=new(y(Ft.FLYOUTS_HORIZONTAL_TOOLBOX,this.workspace.options,!0))(i)):(i.toolboxPosition=this.workspace.toolboxPosition===dr.RIGHT?dr.LEFT:dr.RIGHT,this.flyout=new(y(Ft.FLYOUTS_VERTICAL_TOOLBOX,this.workspace.options,!0))(i)),this.workspace.addChangeListener(this.onDelete.bind(this)))}createDom(){this.svgGroup=ie(Ve.G,{class:"blocklyTrash"});let i;const a=String(Math.random()).substring(2);i=ie(Ve.CLIPPATH,{id:"blocklyTrashBodyClipPath"+a},this.svgGroup),ie(Ve.RECT,{width:N0,height:Gv,y:D0},i);const p=ie(Ve.IMAGE,{width:Ru.width,x:-Eb,height:Ru.height,y:-xb,"clip-path":"url(#blocklyTrashBodyClipPath"+a+")"},this.svgGroup);return p.setAttributeNS(Zs,"xlink:href",this.workspace.options.pathToMedia+Ru.url),i=ie(Ve.CLIPPATH,{id:"blocklyTrashLidClipPath"+a},this.svgGroup),ie(Ve.RECT,{width:N0,height:D0},i),this.svgLid=ie(Ve.IMAGE,{width:Ru.width,x:-Eb,height:Ru.height,y:-xb,"clip-path":"url(#blocklyTrashLidClipPath"+a+")"},this.svgGroup),this.svgLid.setAttributeNS(Zs,"xlink:href",this.workspace.options.pathToMedia+Ru.url),He(this.svgGroup,"pointerdown",this,this.blockMouseDownWhenOpenable),He(this.svgGroup,"pointerup",this,this.click),He(p,"pointerover",this,this.mouseOver),He(p,"pointerout",this,this.mouseOut),this.animateLid(),this.svgGroup}init(){0{let p;(p=this.flyout)==null||p.show(i),a.cursor="";let S;(S=this.workspace.scrollbar)==null||S.setVisible(!1)},10),this.fireUiEvent(!0)}}closeFlyout(){if(this.contentsIsOpen()){var i;(i=this.flyout)==null||i.hide();var a;(a=this.workspace.scrollbar)==null||a.setVisible(!0),this.fireUiEvent(!1),this.workspace.recordDragTargets()}}autoHide(i){!i&&this.flyout&&this.closeFlyout()}emptyContents(){this.hasContents()&&(this.contents.length=0,this.setMinOpenness(0),this.closeFlyout())}position(i,a){if(this.initialized){var p=Ss(this.workspace,i);i=Yr(p,new eo(N0,Gv+D0),wb,P0,i,this.workspace),a=Oa(i,P0,p.vertical===Ja.TOP?Fd.DOWN:Fd.UP,a),this.top=a.top,this.left=a.left;var S;(S=this.svgGroup)==null||S.setAttribute("transform","translate("+this.left+","+this.top+")")}}getBoundingRectangle(){return new Oi(this.top,this.top+Gv+D0,this.left,this.left+N0)}getClientRect(){if(!this.svgGroup)return null;var i=this.svgGroup.getBoundingClientRect();const a=i.top+xb-B0;return i=i.left+Eb-B0,new Oi(a,a+D0+Gv+2*B0,i,i+N0+2*B0)}onDragOver(i){this.setLidOpen(this.wouldDelete_)}onDragExit(i){this.setLidOpen(!1)}onDrop(i){setTimeout(this.setLidOpen.bind(this,!1),100)}setLidOpen(i){this.isLidOpen!==i&&(this.lidTask&&clearTimeout(this.lidTask),this.isLidOpen=i,this.animateLid())}animateLid(){const i=RE;var a=1/(i+1);this.lidOpen+=this.isLidOpen?a:-a,this.lidOpen=Math.min(Math.max(this.lidOpen,this.minOpenness),1),this.setLidAngle(this.lidOpen*ko),a=OT+this.lidOpen*(kE-OT),this.svgGroup&&(this.svgGroup.style.opacity=`${a}`),this.lidOpen>this.minOpenness&&1>this.lidOpen&&(this.lidTask=setTimeout(this.animateLid.bind(this),z_/i))}setLidAngle(i){const a=this.workspace.toolboxPosition===dr.RIGHT||this.workspace.horizontalLayout&&this.workspace.RTL;let p;(p=this.svgLid)==null||p.setAttribute("transform","rotate("+(a?-i:i)+","+(a?4:N0-4)+","+(D0-2)+")")}setMinOpenness(i){this.minOpenness=i,this.isLidOpen||this.setLidAngle(i*ko)}closeLid(){this.setLidOpen(!1)}click(){this.hasContents()&&!this.workspace.isDragging()&&this.openFlyout()}fireUiEvent(i){i=new(Ie(Pl))(i,this.workspace.id),ue(i)}blockMouseDownWhenOpenable(i){!this.contentsIsOpen()&&this.hasContents()&&i.stopPropagation()}mouseOver(){this.hasContents()&&this.setLidOpen(!0)}mouseOut(){this.setLidOpen(!1)}onDelete(i){if(!(0>=this.workspace.options.maxTrashcanContents||i.type!==t.DELETE$$module$build$src$core$events$utils||i.type!==t.DELETE$$module$build$src$core$events$utils||i.wasShadow)){if(!i.oldJson)throw Error("Encountered a delete event without proper oldJson");if(i=JSON.stringify(this.cleanBlockJson(i.oldJson)),this.contents.indexOf(i)===-1){for(this.contents.unshift(i);this.contents.length>this.workspace.options.maxTrashcanContents;)this.contents.pop();this.setMinOpenness(IE)}}}cleanBlockJson(i){function a(p){if(p){if(delete p.id,delete p.x,delete p.y,delete p.enabled,p.icons&&p.icons.comment){var S=p.icons.comment;delete S.height,delete S.width,delete S.pinned}S=p.inputs;for(var O in S){var j=S[O];const ve=j.block;j=j.shadow,ve&&a(ve),j&&a(j)}p.next&&(O=p.next,p=O.block,O=O.shadow,p&&a(p),O&&a(O))}}return i=JSON.parse(JSON.stringify(i)),a(i),Object.assign({},{kind:"BLOCK"},i)}},N0=47,Gv=44,D0=16,P0=20,wb=20,B0=10,Eb=0,xb=32,IE=.1,z_=80,RE=4,OT=.4,kE=.8,ko=45,Ji=class{constructor(){this.shortcuts=new Map,this.keyMap=new Map,this.reset()}reset(){this.shortcuts.clear(),this.keyMap.clear()}register(i,a){if(this.shortcuts.get(i.name)&&!a)throw Error(`Shortcut named "${i.name}" already exists.`);if(this.shortcuts.set(i.name,i),(a=i.keyCodes)&&0Cs(a)),i.length?i:null}load(i,a){const p=a.getProcedureMap();for(const S of i)p.add(_i(this.procedureModelClass,this.parameterModelClass,S,a))}clear(i){i.getProcedureMap().clear()}},F0={};F0.ProcedureSerializer=H_,F0.loadParameter=ja,F0.loadProcedure=_i,F0.saveParameter=Kc,F0.saveProcedure=Cs;var z0=class{constructor(){this.priority=b0}save(i){const a=[];for(const p of i.getAllVariables())i={name:p.name,id:p.getId()},p.type&&(i.type=p.type),a.push(i);return a.length?a:null}load(i,a){for(const p of i)a.createVariable(p.name,p.type,p.id)}clear(i){i.getVariableMap().clear()}};Rs("variables",new z0);var LT={};LT.VariableSerializer=z0;var $b={};$b.load=ff,$b.save=bc;var OE={blocks:um,exceptions:Ap,priorities:lm,procedures:F0,registry:S0,variables:LT,workspaces:$b},Cb=class{constructor(i,a,p,S,O){this.workspace=i,this.oldHostMetrics_=this.corner_=this.vScroll=this.hScroll=null,a=a===void 0?!0:a,p=p===void 0?!0:p;const j=a&&p;a&&(this.hScroll=new xa(i,!0,j,S,O)),p&&(this.vScroll=new xa(i,!1,j,S,O)),j&&(this.corner_=ie(Ve.RECT,{height:xa.scrollbarThickness,width:xa.scrollbarThickness,class:"blocklyScrollbarBackground"}),Ke(this.corner_,i.getBubbleCanvas()))}dispose(){mt(this.corner_),this.oldHostMetrics_=this.corner_=null,this.hScroll&&(this.hScroll.dispose(),this.hScroll=null),this.vScroll&&(this.vScroll.dispose(),this.vScroll=null)}resize(){const i=this.workspace.getMetrics();if(i){var a=!1,p=!1;if(this.oldHostMetrics_&&this.oldHostMetrics_.viewWidth===i.viewWidth&&this.oldHostMetrics_.viewHeight===i.viewHeight&&this.oldHostMetrics_.absoluteTop===i.absoluteTop&&this.oldHostMetrics_.absoluteLeft===i.absoluteLeft?(this.oldHostMetrics_&&this.oldHostMetrics_.scrollWidth===i.scrollWidth&&this.oldHostMetrics_.viewLeft===i.viewLeft&&this.oldHostMetrics_.scrollLeft===i.scrollLeft||(a=!0),this.oldHostMetrics_&&this.oldHostMetrics_.scrollHeight===i.scrollHeight&&this.oldHostMetrics_.viewTop===i.viewTop&&this.oldHostMetrics_.scrollTop===i.scrollTop||(p=!0)):p=a=!0,a||p){try{t.disable$$module$build$src$core$events$utils(),this.hScroll&&a&&this.hScroll.resize(i),this.vScroll&&p&&this.vScroll.resize(i)}finally{t.enable$$module$build$src$core$events$utils()}this.workspace.maybeFireViewportChangeEvent()}if(this.hScroll&&this.vScroll){if(!this.oldHostMetrics_||this.oldHostMetrics_.viewWidth!==i.viewWidth||this.oldHostMetrics_.absoluteLeft!==i.absoluteLeft){let S;(S=this.corner_)==null||S.setAttribute("x",String(this.vScroll.position.x))}if(!this.oldHostMetrics_||this.oldHostMetrics_.viewHeight!==i.viewHeight||this.oldHostMetrics_.absoluteTop!==i.absoluteTop){let S;(S=this.corner_)==null||S.setAttribute("y",String(this.hScroll.position.y))}}this.oldHostMetrics_=i}}canScrollHorizontally(){return!!this.hScroll}canScrollVertically(){return!!this.vScroll}setOrigin(i,a){this.hScroll&&this.hScroll.setOrigin(i,a),this.vScroll&&this.vScroll.setOrigin(i,a)}set(i,a,p){this.hScroll&&this.hScroll.set(i,!1),this.vScroll&&this.vScroll.set(a,!1),(p||p===void 0)&&(i={},this.hScroll&&(i.x=this.hScroll.getRatio_()),this.vScroll&&(i.y=this.vScroll.getRatio_()),this.workspace.setMetrics(i))}setX(i){this.hScroll&&this.hScroll.set(i,!0)}setY(i){this.vScroll&&this.vScroll.set(i,!0)}setContainerVisible(i){this.hScroll&&this.hScroll.setContainerVisible(i),this.vScroll&&this.vScroll.setContainerVisible(i)}isVisible(){let i=!1;return this.hScroll&&(i=this.hScroll.isVisible()),this.vScroll&&(i=i||this.vScroll.isVisible()),i}setVisible(i){this.hScroll&&this.hScroll.setVisibleInternal(i),this.vScroll&&this.vScroll.setVisibleInternal(i)}resizeContent(i){this.hScroll&&this.hScroll.resizeContentHorizontal(i),this.vScroll&&this.vScroll.resizeContentVertical(i)}resizeView(i){this.hScroll&&this.hScroll.resizeViewHorizontal(i),this.vScroll&&this.vScroll.resizeViewVertical(i)}},G_=class{constructor(i){this.workspace_=i}getDimensionsPx_(i){let a=0,p=0;return i&&(a=i.getWidth(),p=i.getHeight()),new eo(a,p)}getFlyoutMetrics(i){return i=this.getDimensionsPx_(this.workspace_.getFlyout(i)),{width:i.width,height:i.height,position:this.workspace_.toolboxPosition}}getToolboxMetrics(){const i=this.getDimensionsPx_(this.workspace_.getToolbox());return{width:i.width,height:i.height,position:this.workspace_.toolboxPosition}}getSvgMetrics(){return this.workspace_.getCachedParentSvgSize()}getAbsoluteMetrics(){let i=0,a=0;const p=this.getToolboxMetrics(),S=this.getFlyoutMetrics(),O=!!this.workspace_.getToolbox();var j;const ve=!((j=this.workspace_.getFlyout())!=null&&j.autoClose);j=O?p.position:S.position;const Ue=j===dr.TOP;return j===dr.LEFT&&(O&&(i+=p.width),ve&&(i+=S.width)),Ue&&(O&&(a+=p.height),ve&&(a+=S.height)),{top:a,left:i}}getViewMetrics(i){i=i?this.workspace_.scale:1;const a=this.getSvgMetrics(),p=this.getToolboxMetrics(),S=this.getFlyoutMetrics(),O=!!this.workspace_.getToolbox();var j;const ve=!((j=this.workspace_.getFlyout())!=null&&j.autoClose);j=O?p.position:S.position;const Ue=j===dr.LEFT||j===dr.RIGHT;return(j===dr.TOP||j===dr.BOTTOM)&&(O&&(a.height-=p.height),ve&&(a.height-=S.height)),Ue&&(O&&(a.width-=p.width),ve&&(a.width-=S.width)),{height:a.height/i,width:a.width/i,top:-this.workspace_.scrollY/i,left:-this.workspace_.scrollX/i}}getContentMetrics(i){i=i?1:this.workspace_.scale;const a=this.workspace_.getBlocksBoundingBox();return{height:(a.bottom-a.top)*i,width:(a.right-a.left)*i,top:a.top*i,left:a.left*i}}hasFixedEdges(){return!this.workspace_.isMovableHorizontally()||!this.workspace_.isMovableVertically()}getComputedFixedEdges_(i){if(!this.hasFixedEdges())return{};const a=this.workspace_.isMovableHorizontally(),p=this.workspace_.isMovableVertically();i=i||this.getViewMetrics(!1);const S={};return p||(S.top=i.top,S.bottom=i.top+i.height),a||(S.left=i.left,S.right=i.left+i.width),S}getPaddedContent_(i,a){const p=a.top+a.height,S=a.left+a.width,O=i.width;i=i.height;const j=O/2,ve=i/2;return{top:Math.min(a.top-ve,p-i),bottom:Math.max(p+ve,a.top+i),left:Math.min(a.left-j,S-O),right:Math.max(S+j,a.left+O)}}getScrollMetrics(i,a,p){i=i?this.workspace_.scale:1,a=a||this.getViewMetrics(!1);var S=p||this.getContentMetrics();p=this.getComputedFixedEdges_(a),a=this.getPaddedContent_(a,S),S=p.top!==void 0?p.top:a.top;const O=p.left!==void 0?p.left:a.left;return{top:S/i,left:O/i,width:((p.right!==void 0?p.right:a.right)-O)/i,height:((p.bottom!==void 0?p.bottom:a.bottom)-S)/i}}getUiMetrics(){return{viewMetrics:this.getViewMetrics(),absoluteMetrics:this.getAbsoluteMetrics(),toolboxMetrics:this.getToolboxMetrics()}}getMetrics(){const i=this.getToolboxMetrics(),a=this.getFlyoutMetrics(!0),p=this.getSvgMetrics(),S=this.getAbsoluteMetrics(),O=this.getViewMetrics(),j=this.getContentMetrics(),ve=this.getScrollMetrics(!1,O,j);return{contentHeight:j.height,contentWidth:j.width,contentTop:j.top,contentLeft:j.left,scrollHeight:ve.height,scrollWidth:ve.width,scrollTop:ve.top,scrollLeft:ve.left,viewHeight:O.height,viewWidth:O.width,viewTop:O.top,viewLeft:O.left,absoluteTop:S.top,absoluteLeft:S.left,svgHeight:p.height,svgWidth:p.width,toolboxWidth:i.width,toolboxHeight:i.height,toolboxPosition:i.position,flyoutWidth:a.width,flyoutHeight:a.height}}};r(Ft.METRICS_MANAGER,Nl,G_);var NT=class extends d{constructor(i){super(),this.isBlank=!0,this.recordUndo=!1,this.type=Sa,this.isBlank=!!i,i&&(this.workspaceId=i.id)}};r(Ft.EVENT,Sa,NT);var Mb=class extends _{constructor(i,a,p){super(i?i.workspace.id:void 0),this.type=Go,i&&(this.blockId=i.id,this.isStart=a,this.blocks=p)}toJson(){const i=super.toJson();if(this.isStart===void 0)throw Error("Whether this event is the start of a drag is undefined. Either pass the value to the constructor, or call fromJson");if(this.blockId===void 0)throw Error("The block ID is undefined. Either pass a block to the constructor, or call fromJson");return i.isStart=this.isStart,i.blockId=this.blockId,i.blocks=this.blocks,i}static fromJson(i,a,p){return a=super.fromJson(i,a,p??new Mb),a.isStart=i.isStart,a.blockId=i.blockId,a.blocks=i.blocks,a}};r(Ft.EVENT,Go,Mb);var Vv={};Vv.bumpIntoBounds=Eh,Vv.bumpIntoBoundsHandler=ra,Vv.bumpTopObjectsIntoBounds=Pn;var U0=class{constructor(i,a){this.connectionCandidate=this.dragTarget_=null,this.wouldDeleteBlock_=!1,this.dragIconData_=[],this.draggingBlock_=i,this.workspace_=a,this.connectionPreviewer=new(y(Ft.CONNECTION_PREVIEWER,this.workspace_.options))(i),this.startXY_=this.draggingBlock_.getRelativeToSurfaceXY(),this.dragIconData_=tr(i,this.startXY_)}dispose(){this.dragIconData_.length=0,this.connectionPreviewer.dispose()}startDrag(i,a){t.getGroup$$module$build$src$core$events$utils()||t.setGroup$$module$build$src$core$events$utils(!0),this.fireDragStartEvent_(),this.draggingBlock_.bringToFront(!0),te(),this.workspace_.setResizesEnabled(!1),Ua(),this.shouldDisconnect_(a)&&this.disconnectBlock_(a,i),this.draggingBlock_.setDragging(!0);let p;(p=this.workspace_.getLayerManager())==null||p.moveToDragLayer(this.draggingBlock_)}shouldDisconnect_(i){return!!(this.draggingBlock_.getParent()||i&&this.draggingBlock_.nextConnection&&this.draggingBlock_.nextConnection.targetBlock())}disconnectBlock_(i,a){this.draggingBlock_.unplug(i),i=this.pixelsToWorkspaceUnits_(a),i=_n.sum(this.startXY_,i),this.draggingBlock_.translate(i.x,i.y),Ks(this.draggingBlock_)}fireDragStartEvent_(){const i=new(Ie(Go))(this.draggingBlock_,!0,this.draggingBlock_.getDescendants(!1));ue(i)}drag(i,a){const p=this.draggingBlock_;this.moveBlock(p,a),this.updateDragTargets(i,p),this.wouldDeleteBlock_=this.wouldDeleteBlock(i,p,a),this.updateCursorDuringBlockDrag_(),this.updateConnectionPreview(p,a)}moveBlock(i,a){a=this.pixelsToWorkspaceUnits_(a),a=_n.sum(this.startXY_,a),i.moveDuringDrag(a)}updateDragTargets(i,a){if(i=this.workspace_.getDragTarget(i),this.dragTarget_!==i){let p;(p=this.dragTarget_)==null||p.onDragExit(a),i==null||i.onDragEnter(a)}i==null||i.onDragOver(a),this.dragTarget_=i}wouldDeleteBlock(i,a,p){return(i=this.workspace_.getDragTarget(i))&&this.workspace_.getComponentManager().hasCapability(i.id,gl.Capability.DELETE_AREA)?i.wouldDelete(a,!!this.getConnectionCandidate(a,p)):!1}updateConnectionPreview(i,a){a=this.pixelsToWorkspaceUnits_(a);const p=this.connectionCandidate,S=this.getConnectionCandidate(i,a);if(S){this.connectionCandidate=a=p&&this.currCandidateIsBetter(p,a,S)?p:S;var{local:O,neighbour:j}=a;O.type!==Un.OUTPUT_VALUE&&O.type!==Un.PREVIOUS_STATEMENT||!j.isConnected()||j.targetBlock().isInsertionMarker()||this.orphanCanConnectAtEnd(i,j.targetBlock(),O.type)?this.connectionPreviewer.previewConnection(O,j):this.connectionPreviewer.previewReplacement(O,j,j.targetBlock())}else this.connectionPreviewer.hidePreview(),this.connectionCandidate=null}orphanCanConnectAtEnd(i,a,p){return!!fs.getConnectionForOrphanedConnection(i,p===Un.OUTPUT_VALUE?a.outputConnection:a.previousConnection)}currCandidateIsBetter(i,a,p){const{local:S,neighbour:O}=i;i=new _n(S.x,S.y);const j=new _n(O.x,O.y);return a=_n.distance(_n.sum(i,a),j),p.distance>a-t.config$$module$build$src$core$config.currentConnectionPreference}getConnectionCandidate(i,a){i=this.getLocalConnections(i);let p=this.connectionCandidate?t.config$$module$build$src$core$config.connectingSnapRadius:t.config$$module$build$src$core$config.snapRadius,S=null;for(const O of i){const{connection:j,radius:ve}=O.closest(p,a);j&&(S={local:O,neighbour:j,distance:ve},p=ve)}return S}getLocalConnections(i){const a=i.getConnections_(!1),p=i.lastConnectionInStack(!0);return p&&p!==i.nextConnection&&a.push(p),a}endDrag(i,a){if(this.drag(i,a),this.fireDragEndEvent_(),pe(),Ua(),this.connectionPreviewer.hidePreview(),i=null,this.dragTarget_&&this.dragTarget_.shouldPreventMove(this.draggingBlock_)||(i=this.getNewLocationAfterDrag_(a).delta),this.dragTarget_&&this.dragTarget_.onDrop(this.draggingBlock_),!this.maybeDeleteBlock_()){let p;(p=this.workspace_.getLayerManager())==null||p.moveOffDragLayer(this.draggingBlock_,ee),this.draggingBlock_.setDragging(!1),i?this.updateBlockAfterMove_():Eh(this.draggingBlock_.workspace,this.workspace_.getMetricsManager().getScrollMetrics(!0),this.draggingBlock_)}this.connectionPreviewer.dispose(),this.workspace_.setResizesEnabled(!0),t.setGroup$$module$build$src$core$events$utils(!1)}getNewLocationAfterDrag_(i){i=this.pixelsToWorkspaceUnits_(i);const a=_n.sum(this.startXY_,i);return{delta:i,newLocation:a}}maybeDeleteBlock_(){return this.wouldDeleteBlock_?(this.fireMoveEvent_(),this.draggingBlock_.dispose(!1,!0),Xi.length=0,!0):!1}updateBlockAfterMove_(){this.fireMoveEvent_(),this.connectionCandidate?this.applyConnections(this.connectionCandidate):this.draggingBlock_.queueRender(),this.draggingBlock_.scheduleSnapAndBump()}applyConnections(i){const{local:a,neighbour:p}=i;if(a.connect(p),this.draggingBlock_.rendered){const S=a.isSuperior()?p:a,O=this.draggingBlock_.getRootBlock();vr().then(()=>{pa(S.getSourceBlock()),setTimeout(()=>{O.bringToFront()},0)})}}fireDragEndEvent_(){const i=new(Ie(Go))(this.draggingBlock_,!1,this.draggingBlock_.getDescendants(!1));ue(i)}updateToolboxStyle_(i){const a=this.workspace_.getToolbox();if(a){const p=this.draggingBlock_.isDeletable()?"blocklyToolboxDelete":"blocklyToolboxGrab";i&&typeof a.removeStyle=="function"?a.removeStyle(p):i||typeof a.addStyle!="function"||a.addStyle(p)}}fireMoveEvent_(){if(!this.draggingBlock_.isDeadOrDying()){var i=new(Ie(t.MOVE$$module$build$src$core$events$utils))(this.draggingBlock_);i.setReason(["drag"]),i.oldCoordinate=this.startXY_,i.recordNew(),ue(i)}}updateCursorDuringBlockDrag_(){this.draggingBlock_.setDeleteStyle(this.wouldDeleteBlock_)}pixelsToWorkspaceUnits_(i){return i=new _n(i.x/this.workspace_.scale,i.y/this.workspace_.scale),this.workspace_.isMutator&&i.scale(1/this.workspace_.options.parentWorkspace.scale),i}dragIcons_(){xe("Blockly.BlockDragger.prototype.dragIcons_","v10","v11")}getInsertionMarkers(){return this.workspace_.getAllBlocks().filter(i=>i.isInsertionMarker())}};r(Ft.BLOCK_DRAGGER,Nl,U0);var wm={};wm.Bubble=As,wm.MiniWorkspaceBubble=_m,wm.TextBubble=vm,wm.TextInputBubble=aa;var Ab=class extends vf{constructor(i,a,p,S){super(i),this.type=Ch,this.recordUndo=!1,i&&(this.name=a,this.oldValue=p,this.newValue=S)}toJson(){const i=super.toJson();if(!this.name)throw Error("The changed field name is undefined. Either pass a name to the constructor, or call fromJson.");return i.name=this.name,i.oldValue=this.oldValue,i.newValue=this.newValue,i}static fromJson(i,a,p){return a=super.fromJson(i,a,p??new Ab),a.name=i.name,a.oldValue=i.oldValue,a.newValue=i.newValue,a}isNull(){return this.oldValue===this.newValue}run(i){var a=this.getEventWorkspace_();if(!this.blockId)throw Error("The block ID is undefined. Either pass a block to the constructor, or call fromJson");if(a=a.getBlockById(this.blockId),!a)throw Error("The associated block is undefined. Either pass a block to the constructor, or call fromJson");i=i?this.newValue:this.oldValue,(a=a.getField(this.name))?a.setValue(i):console.warn("Can't set non-existent field: "+this.name)}};r(Ft.EVENT,Ch,Ab);var Ib=class extends vf{constructor(i){super(i),this.type=t.MOVE$$module$build$src$core$events$utils,i&&(i.isShadow()&&(this.recordUndo=!1),i=this.currentLocation_(),this.oldParentId=i.parentId,this.oldInputName=i.inputName,this.oldCoordinate=i.coordinate)}toJson(){const i=super.toJson();return i.oldParentId=this.oldParentId,i.oldInputName=this.oldInputName,this.oldCoordinate&&(i.oldCoordinate=`${Math.round(this.oldCoordinate.x)}, ${Math.round(this.oldCoordinate.y)}`),i.newParentId=this.newParentId,i.newInputName=this.newInputName,this.newCoordinate&&(i.newCoordinate=`${Math.round(this.newCoordinate.x)}, ${Math.round(this.newCoordinate.y)}`),this.reason&&(i.reason=this.reason),this.recordUndo||(i.recordUndo=this.recordUndo),i}static fromJson(i,a,p){return a=super.fromJson(i,a,p??new Ib),a.oldParentId=i.oldParentId,a.oldInputName=i.oldInputName,i.oldCoordinate&&(p=i.oldCoordinate.split(","),a.oldCoordinate=new _n(Number(p[0]),Number(p[1]))),a.newParentId=i.newParentId,a.newInputName=i.newInputName,i.newCoordinate&&(p=i.newCoordinate.split(","),a.newCoordinate=new _n(Number(p[0]),Number(p[1]))),i.reason!==void 0&&(a.reason=i.reason),i.recordUndo!==void 0&&(a.recordUndo=i.recordUndo),a}recordNew(){const i=this.currentLocation_();this.newParentId=i.parentId,this.newInputName=i.inputName,this.newCoordinate=i.coordinate}setReason(i){this.reason=i}currentLocation_(){var i=this.getEventWorkspace_();if(!this.blockId)throw Error("The block ID is undefined. Either pass a block to the constructor, or call fromJson");var a=i.getBlockById(this.blockId);if(!a)throw Error("The block associated with the block move event could not be found");i={};const p=a.getParent();return p?(i.parentId=p.id,(a=p.getInputWithBlock(a))&&(i.inputName=a.name)):i.coordinate=a.getRelativeToSurfaceXY(),i}isNull(){return this.oldParentId===this.newParentId&&this.oldInputName===this.newInputName&&_n.equals(this.oldCoordinate,this.newCoordinate)}run(i){var a=this.getEventWorkspace_();if(!this.blockId)throw Error("The block ID is undefined. Either pass a block to the constructor, or call fromJson");var p=a.getBlockById(this.blockId);if(p){var S=i?this.newParentId:this.oldParentId,O=i?this.newInputName:this.oldInputName;if(i=i?this.newCoordinate:this.oldCoordinate,S){var j=a.getBlockById(S);if(!j){console.warn("Can't connect to non-existent block: "+S);return}}if(p.getParent()&&p.unplug(),i)O=p.getRelativeToSurfaceXY(),p.moveBy(i.x-O.x,i.y-O.y,this.reason);else{a=p.outputConnection,(!a||p.previousConnection&&p.previousConnection.isConnected())&&(a=p.previousConnection);let ve,Ue;p=(Ue=a)==null?void 0:Ue.type,O?(p=j.getInput(O))&&(ve=p.connection):p===Un.PREVIOUS_STATEMENT&&(ve=j.nextConnection),ve&&a?a.connect(ve):console.warn("Can't connect to non-existent input: "+O)}}else console.warn("Can't move non-existent block: "+this.blockId)}};r(Ft.EVENT,t.MOVE$$module$build$src$core$events$utils,Ib);var Rb=class extends _{constructor(i,a,p){super(i?i.workspace.id:void 0),this.type=vo,i&&(this.blockId=i.id,this.isOpen=a,this.bubbleType=p)}toJson(){const i=super.toJson();if(this.isOpen===void 0)throw Error("Whether this event is for opening the bubble is undefined. Either pass the value to the constructor, or call fromJson");if(!this.bubbleType)throw Error("The type of bubble is undefined. Either pass the value to the constructor, or call fromJson");return i.isOpen=this.isOpen,i.bubbleType=this.bubbleType,i.blockId=this.blockId||"",i}static fromJson(i,a,p){return a=super.fromJson(i,a,p??new Rb),a.isOpen=i.isOpen,a.bubbleType=i.bubbleType,a.blockId=i.blockId,a}},kb;(function(i){i.MUTATOR="mutator",i.COMMENT="comment",i.WARNING="warning"})(kb||(kb={})),r(Ft.EVENT,vo,Rb);var sg=class extends d{constructor(i){super(),this.isBlank=!i,i&&(this.commentId=i.id,this.workspaceId=i.workspace.id,this.group=t.getGroup$$module$build$src$core$events$utils(),this.recordUndo=ae())}toJson(){const i=super.toJson();if(!this.commentId)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");return i.commentId=this.commentId,i}static fromJson(i,a,p){return a=super.fromJson(i,a,p??new sg),a.commentId=i.commentId,a}static CommentCreateDeleteHelper(i,a){var p=i.getEventWorkspace_();if(a){if(a=t.createElement$$module$build$src$core$utils$xml("xml"),!i.xml)throw Error("Ecountered a comment event without proper xml");a.appendChild(i.xml),t.domToWorkspace$$module$build$src$core$xml(a,p)}else{if(!i.commentId)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");(p=p.getCommentById(i.commentId))?p.dispose():console.warn("Can't uncreate non-existent comment: "+i.commentId)}}},Ob=class extends sg{constructor(i,a,p){super(i),this.type=yd,i&&(this.oldContents_=typeof a>"u"?"":a,this.newContents_=typeof p>"u"?"":p)}toJson(){const i=super.toJson();if(!this.oldContents_)throw Error("The old contents is undefined. Either pass a value to the constructor, or call fromJson");if(!this.newContents_)throw Error("The new contents is undefined. Either pass a value to the constructor, or call fromJson");return i.oldContents=this.oldContents_,i.newContents=this.newContents_,i}static fromJson(i,a,p){return a=super.fromJson(i,a,p??new Ob),a.oldContents_=i.oldContents,a.newContents_=i.newContents,a}isNull(){return this.oldContents_===this.newContents_}run(i){var a=this.getEventWorkspace_();if(!this.commentId)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");if(a=a.getCommentById(this.commentId)){var p=i?this.newContents_:this.oldContents_;if(!p)throw Error(i?"The new contents is undefined. Either pass a value to the constructor, or call fromJson":"The old contents is undefined. Either pass a value to the constructor, or call fromJson");a.setContent(p)}else console.warn("Can't change non-existent comment: "+this.commentId)}};r(Ft.EVENT,yd,Ob);var Lb=class extends sg{constructor(i){super(i),this.type=cs,i&&(this.xml=i.toXmlWithXY())}toJson(){const i=super.toJson();if(!this.xml)throw Error("The comment XML is undefined. Either pass a comment to the constructor, or call fromJson");return i.xml=Qi(this.xml),i}static fromJson(i,a,p){return a=super.fromJson(i,a,p??new Lb),a.xml=t.textToDom$$module$build$src$core$utils$xml(i.xml),a}run(i){sg.CommentCreateDeleteHelper(this,i)}};r(Ft.EVENT,cs,Lb);var Nb=class extends sg{constructor(i){super(i),this.type=qh,i&&(this.xml=i.toXmlWithXY())}run(i){sg.CommentCreateDeleteHelper(this,!i)}toJson(){const i=super.toJson();if(!this.xml)throw Error("The comment XML is undefined. Either pass a comment to the constructor, or call fromJson");return i.xml=Qi(this.xml),i}static fromJson(i,a,p){return a=super.fromJson(i,a,p??new Nb),a.xml=t.textToDom$$module$build$src$core$utils$xml(i.xml),a}};r(Ft.EVENT,qh,Nb);var Db=class extends sg{constructor(i){super(i),this.type=Ta,i&&(this.comment_=i,this.oldCoordinate_=i.getRelativeToSurfaceXY())}recordNew(){if(this.newCoordinate_)throw Error("Tried to record the new position of a comment on the same event twice.");if(!this.comment_)throw Error("The comment is undefined. Pass a comment to the constructor if you want to use the record functionality");this.newCoordinate_=this.comment_.getRelativeToSurfaceXY()}setOldCoordinate(i){this.oldCoordinate_=i}toJson(){const i=super.toJson();if(!this.oldCoordinate_)throw Error("The old comment position is undefined. Either pass a comment to the constructor, or call fromJson");if(!this.newCoordinate_)throw Error("The new comment position is undefined. Either call recordNew, or call fromJson");return i.oldCoordinate=`${Math.round(this.oldCoordinate_.x)}, ${Math.round(this.oldCoordinate_.y)}`,i.newCoordinate=Math.round(this.newCoordinate_.x)+","+Math.round(this.newCoordinate_.y),i}static fromJson(i,a,p){return a=super.fromJson(i,a,p??new Db),p=i.oldCoordinate.split(","),a.oldCoordinate_=new _n(Number(p[0]),Number(p[1])),p=i.newCoordinate.split(","),a.newCoordinate_=new _n(Number(p[0]),Number(p[1])),a}isNull(){return _n.equals(this.oldCoordinate_,this.newCoordinate_)}run(i){var a=this.getEventWorkspace_();if(!this.commentId)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");if(a=a.getCommentById(this.commentId)){if(i=i?this.newCoordinate_:this.oldCoordinate_,!i)throw Error("Either oldCoordinate_ or newCoordinate_ is undefined. Either pass a comment to the constructor and call recordNew, or call fromJson");var p=a.getRelativeToSurfaceXY();a.moveBy(i.x-p.x,i.y-p.y)}else console.warn("Can't move non-existent comment: "+this.commentId)}};r(Ft.EVENT,Ta,Db);var Pb=class extends _{constructor(i,a,p){super(p),this.type=Xa,this.oldItem=i??void 0,this.newItem=a??void 0}toJson(){const i=super.toJson();return i.oldItem=this.oldItem,i.newItem=this.newItem,i}static fromJson(i,a,p){return a=super.fromJson(i,a,p??new Pb),a.oldItem=i.oldItem,a.newItem=i.newItem,a}};r(Ft.EVENT,Xa,Pb),t.CHANGE$$module$build$src$core$events$utils,t.CREATE$$module$build$src$core$events$utils,t.DELETE$$module$build$src$core$events$utils,t.MOVE$$module$build$src$core$events$utils,t.CHANGE$$module$build$src$core$events$utils,t.CREATE$$module$build$src$core$events$utils,t.DELETE$$module$build$src$core$events$utils,t.MOVE$$module$build$src$core$events$utils,t.disable$$module$build$src$core$events$utils,t.enable$$module$build$src$core$events$utils,t.getGroup$$module$build$src$core$events$utils,t.setGroup$$module$build$src$core$events$utils;var Qn={};Qn.Abstract=d,Qn.BLOCK_CHANGE=t.CHANGE$$module$build$src$core$events$utils,Qn.BLOCK_CREATE=t.CREATE$$module$build$src$core$events$utils,Qn.BLOCK_DELETE=t.DELETE$$module$build$src$core$events$utils,Qn.BLOCK_DRAG=Go,Qn.BLOCK_FIELD_INTERMEDIATE_CHANGE=Ch,Qn.BLOCK_MOVE=t.MOVE$$module$build$src$core$events$utils,Qn.BUBBLE_OPEN=vo,Qn.BUMP_EVENTS=Qh,Qn.BlockBase=vf,Qn.BlockChange=Jr,Qn.BlockCreate=$_,Qn.BlockDelete=bb,Qn.BlockDrag=Mb,Qn.BlockFieldIntermediateChange=Ab,Qn.BlockMove=Ib,Qn.BubbleOpen=Rb,Qn.BubbleType=kb,Qn.CHANGE=t.CHANGE$$module$build$src$core$events$utils,Qn.CLICK=rc,Qn.COMMENT_CHANGE=yd,Qn.COMMENT_CREATE=cs,Qn.COMMENT_DELETE=qh,Qn.COMMENT_MOVE=Ta,Qn.CREATE=t.CREATE$$module$build$src$core$events$utils,Qn.Click=$,Qn.ClickTarget=I,Qn.CommentBase=sg,Qn.CommentChange=Ob,Qn.CommentCreate=Lb,Qn.CommentDelete=Nb,Qn.CommentMove=Db,Qn.DELETE=t.DELETE$$module$build$src$core$events$utils,Qn.FINISHED_LOADING=Sa,Qn.FinishedLoading=NT,Qn.MARKER_MOVE=Dl,Qn.MOVE=t.MOVE$$module$build$src$core$events$utils,Qn.MarkerMove=N_,Qn.SELECTED=_o,Qn.Selected=Hd,Qn.THEME_CHANGE=uu,Qn.TOOLBOX_ITEM_SELECT=Xa,Qn.TRASHCAN_OPEN=Pl,Qn.ThemeChange=w0,Qn.ToolboxItemSelect=Pb,Qn.TrashcanOpen=yb,Qn.UI=wc,Qn.UiBase=_,Qn.VAR_CREATE=go,Qn.VAR_DELETE=Iu,Qn.VAR_RENAME=eh,Qn.VIEWPORT_CHANGE=ni,Qn.VarBase=zd,Qn.VarCreate=Ud,Qn.VarDelete=gb,Qn.VarRename=_b,Qn.ViewportChange=E0,Qn.clearPendingUndo=re,Qn.disable=t.disable$$module$build$src$core$events$utils,Qn.disableOrphans=qe,Qn.enable=t.enable$$module$build$src$core$events$utils,Qn.filter=J,Qn.fire=ue,Qn.fromJson=Fe,Qn.get=Ie,Qn.getDescendantIds=Te,Qn.getGroup=t.getGroup$$module$build$src$core$events$utils,Qn.getRecordUndo=ae,Qn.isEnabled=se,Qn.setGroup=t.setGroup$$module$build$src$core$events$utils,Qn.setRecordUndo=he;var DT=class extends O_{constructor(){super(),this.GRID_UNIT=4,this.CURSOR_COLOUR="#ffa200",this.CURSOR_RADIUS=5,this.JAGGED_TEETH_WIDTH=this.JAGGED_TEETH_HEIGHT=0,this.START_HAT_HEIGHT=22,this.START_HAT_WIDTH=96,this.SHAPES={HEXAGONAL:1,ROUND:2,SQUARE:3,PUZZLE:4,NOTCH:5},this.SHAPE_IN_SHAPE_PADDING={1:{0:5*this.GRID_UNIT,1:2*this.GRID_UNIT,2:5*this.GRID_UNIT,3:5*this.GRID_UNIT},2:{0:3*this.GRID_UNIT,1:3*this.GRID_UNIT,2:1*this.GRID_UNIT,3:2*this.GRID_UNIT},3:{0:2*this.GRID_UNIT,1:2*this.GRID_UNIT,2:2*this.GRID_UNIT,3:2*this.GRID_UNIT}},this.FULL_BLOCK_FIELDS=!0,this.FIELD_TEXT_FONTWEIGHT="bold",this.FIELD_TEXT_FONTFAMILY='"Helvetica Neue", "Segoe UI", Helvetica, sans-serif',this.FIELD_COLOUR_FULL_BLOCK=this.FIELD_TEXTINPUT_BOX_SHADOW=this.FIELD_DROPDOWN_SVG_ARROW=this.FIELD_DROPDOWN_COLOURED_DIV=this.FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW=!0,this.SELECTED_GLOW_COLOUR="#fff200",this.SELECTED_GLOW_SIZE=.5,this.REPLACEMENT_GLOW_COLOUR="#fff200",this.REPLACEMENT_GLOW_SIZE=2,this.selectedGlowFilterId="",this.selectedGlowFilter=null,this.replacementGlowFilterId="",this.SQUARED=this.ROUNDED=this.HEXAGONAL=this.replacementGlowFilter=null,this.SMALL_PADDING=this.GRID_UNIT,this.MEDIUM_PADDING=2*this.GRID_UNIT,this.MEDIUM_LARGE_PADDING=3*this.GRID_UNIT,this.LARGE_PADDING=4*this.GRID_UNIT,this.CORNER_RADIUS=1*this.GRID_UNIT,this.NOTCH_WIDTH=9*this.GRID_UNIT,this.NOTCH_HEIGHT=2*this.GRID_UNIT,this.STATEMENT_INPUT_NOTCH_OFFSET=this.NOTCH_OFFSET_LEFT=3*this.GRID_UNIT,this.MIN_BLOCK_WIDTH=2*this.GRID_UNIT,this.MIN_BLOCK_HEIGHT=12*this.GRID_UNIT,this.EMPTY_STATEMENT_INPUT_HEIGHT=6*this.GRID_UNIT,this.TOP_ROW_MIN_HEIGHT=this.CORNER_RADIUS,this.TOP_ROW_PRECEDES_STATEMENT_MIN_HEIGHT=this.LARGE_PADDING,this.BOTTOM_ROW_MIN_HEIGHT=this.CORNER_RADIUS,this.BOTTOM_ROW_AFTER_STATEMENT_MIN_HEIGHT=6*this.GRID_UNIT,this.STATEMENT_BOTTOM_SPACER=-this.NOTCH_HEIGHT,this.STATEMENT_INPUT_SPACER_MIN_WIDTH=40*this.GRID_UNIT,this.STATEMENT_INPUT_PADDING_LEFT=4*this.GRID_UNIT,this.EMPTY_INLINE_INPUT_PADDING=4*this.GRID_UNIT,this.EMPTY_INLINE_INPUT_HEIGHT=8*this.GRID_UNIT,this.DUMMY_INPUT_MIN_HEIGHT=8*this.GRID_UNIT,this.DUMMY_INPUT_SHADOW_MIN_HEIGHT=6*this.GRID_UNIT,this.CURSOR_WS_WIDTH=20*this.GRID_UNIT,this.FIELD_TEXT_FONTSIZE=3*this.GRID_UNIT,this.FIELD_BORDER_RECT_RADIUS=this.CORNER_RADIUS,this.FIELD_BORDER_RECT_X_PADDING=2*this.GRID_UNIT,this.FIELD_BORDER_RECT_Y_PADDING=1.625*this.GRID_UNIT,this.FIELD_BORDER_RECT_HEIGHT=8*this.GRID_UNIT,this.FIELD_DROPDOWN_BORDER_RECT_HEIGHT=8*this.GRID_UNIT,this.FIELD_DROPDOWN_SVG_ARROW_PADDING=this.FIELD_BORDER_RECT_X_PADDING,this.FIELD_COLOUR_DEFAULT_WIDTH=6*this.GRID_UNIT,this.FIELD_COLOUR_DEFAULT_HEIGHT=8*this.GRID_UNIT,this.FIELD_CHECKBOX_X_OFFSET=1*this.GRID_UNIT,this.MAX_DYNAMIC_CONNECTION_SHAPE_WIDTH=12*this.GRID_UNIT}setFontConstants_(i){super.setFontConstants_(i),this.FIELD_DROPDOWN_BORDER_RECT_HEIGHT=this.FIELD_BORDER_RECT_HEIGHT=this.FIELD_TEXT_HEIGHT+2*this.FIELD_BORDER_RECT_Y_PADDING}init(){super.init(),this.HEXAGONAL=this.makeHexagonal(),this.ROUNDED=this.makeRounded(),this.SQUARED=this.makeSquared(),this.STATEMENT_INPUT_NOTCH_OFFSET=this.NOTCH_OFFSET_LEFT+this.INSIDE_CORNERS.rightWidth}setDynamicProperties_(i){super.setDynamicProperties_(i),this.SELECTED_GLOW_COLOUR=i.getComponentStyle("selectedGlowColour")||this.SELECTED_GLOW_COLOUR;const a=Number(i.getComponentStyle("selectedGlowSize"));this.SELECTED_GLOW_SIZE=a&&!isNaN(a)?a:this.SELECTED_GLOW_SIZE,this.REPLACEMENT_GLOW_COLOUR=i.getComponentStyle("replacementGlowColour")||this.REPLACEMENT_GLOW_COLOUR,this.REPLACEMENT_GLOW_SIZE=(i=Number(i.getComponentStyle("replacementGlowSize")))&&!isNaN(i)?i:this.REPLACEMENT_GLOW_SIZE}dispose(){super.dispose(),this.selectedGlowFilter&&mt(this.selectedGlowFilter),this.replacementGlowFilter&&mt(this.replacementGlowFilter)}makeStartHat(){const i=this.START_HAT_HEIGHT,a=this.START_HAT_WIDTH,p=Ws("c",[Kn(25,-i),Kn(71,-i),Kn(a,0)]);return{height:i,width:a,path:p}}makeHexagonal(){function i(p,S,O){var j=p/2;return j=j>a?a:j,O=O?-1:1,p=(S?-1:1)*p/2,iu(-O*j,p)+iu(O*j,p)}const a=this.MAX_DYNAMIC_CONNECTION_SHAPE_WIDTH;return{type:this.SHAPES.HEXAGONAL,isDynamic:!0,width(p){return p/=2,p>a?a:p},height(p){return p},connectionOffsetY(p){return p/2},connectionOffsetX(p){return-p},pathDown(p){return i(p,!1,!1)},pathUp(p){return i(p,!0,!1)},pathRightDown(p){return i(p,!1,!0)},pathRightUp(p){return i(p,!1,!0)}}}makeRounded(){function i(S,O,j){const ve=S>p?S-p:0;S=(S>p?p:S)/2;const Ue=j===O?"0":"1";return mi("a","0 0,"+Ue,S,Kn((j?1:-1)*S,(O?-1:1)*S))+$n("v",(O?-1:1)*ve)+mi("a","0 0,"+Ue,S,Kn((j?-1:1)*S,(O?-1:1)*S))}const a=this.MAX_DYNAMIC_CONNECTION_SHAPE_WIDTH,p=2*a;return{type:this.SHAPES.ROUND,isDynamic:!0,width(S){return S/=2,S>a?a:S},height(S){return S},connectionOffsetY(S){return S/2},connectionOffsetX(S){return-S},pathDown(S){return i(S,!1,!1)},pathUp(S){return i(S,!0,!1)},pathRightDown(S){return i(S,!1,!0)},pathRightUp(S){return i(S,!1,!0)}}}makeSquared(){function i(p,S,O){p-=2*a;const j=O===S?"0":"1";return mi("a","0 0,"+j,a,Kn((O?1:-1)*a,(S?-1:1)*a))+$n("v",(S?-1:1)*p)+mi("a","0 0,"+j,a,Kn((O?-1:1)*a,(S?-1:1)*a))}const a=this.CORNER_RADIUS;return{type:this.SHAPES.SQUARE,isDynamic:!0,width(p){return a},height(p){return p},connectionOffsetY(p){return p/2},connectionOffsetX(p){return-p},pathDown(p){return i(p,!1,!1)},pathUp(p){return i(p,!0,!1)},pathRightDown(p){return i(p,!1,!0)},pathRightUp(p){return i(p,!1,!0)}}}shapeFor(i){let a=i.getCheck();switch(!a&&i.targetConnection&&(a=i.targetConnection.getCheck()),i.type){case Un.INPUT_VALUE:case Un.OUTPUT_VALUE:if(i=i.getSourceBlock().getOutputShape(),i!==null)switch(i){case this.SHAPES.HEXAGONAL:return this.HEXAGONAL;case this.SHAPES.ROUND:return this.ROUNDED;case this.SHAPES.SQUARE:return this.SQUARED}return a&&a.indexOf("Boolean")!==-1?this.HEXAGONAL:a&&a.indexOf("Number")!==-1?this.ROUNDED:(a&&a.indexOf("String"),this.ROUNDED);case Un.PREVIOUS_STATEMENT:case Un.NEXT_STATEMENT:return this.NOTCH;default:throw Error("Unknown type")}}makeNotch(){function i(jn){return Ws("c",[Kn(jn*O/2,0),Kn(jn*O*3/4,ve/2),Kn(jn*O,ve)])+Fo([Kn(jn*O,j)])+Ws("c",[Kn(jn*O/4,ve/2),Kn(jn*O/2,ve),Kn(jn*O,ve)])+$n("h",jn*S)+Ws("c",[Kn(jn*O/2,0),Kn(jn*O*3/4,-(ve/2)),Kn(jn*O,-ve)])+Fo([Kn(jn*O,-j)])+Ws("c",[Kn(jn*O/4,-(ve/2)),Kn(jn*O/2,-ve),Kn(jn*O,-ve)])}const a=this.NOTCH_WIDTH,p=this.NOTCH_HEIGHT,S=a/3,O=S/3,j=p/2,ve=j/2,Ue=i(1),Yt=i(-1);return{type:this.SHAPES.NOTCH,width:a,height:p,pathLeft:Ue,pathRight:Yt}}makeInsideCorners(){const i=this.CORNER_RADIUS,a=mi("a","0 0,0",i,Kn(-i,i)),p=mi("a","0 0,1",i,Kn(-i,i)),S=mi("a","0 0,0",i,Kn(i,i)),O=mi("a","0 0,1",i,Kn(i,i));return{width:i,height:i,pathTop:a,pathBottom:S,rightWidth:i,rightHeight:i,pathTopRight:p,pathBottomRight:O}}generateSecondaryColour_(i){return Vc("#000",i,.15)||i}generateTertiaryColour_(i){return Vc("#000",i,.25)||i}createDom(i,a,p){super.createDom(i,a,p),i=ie(Ve.DEFS,{},i),a=ie(Ve.FILTER,{id:"blocklySelectedGlowFilter"+this.randomIdentifier,height:"160%",width:"180%",y:"-30%",x:"-40%"},i),ie(Ve.FEGAUSSIANBLUR,{in:"SourceGraphic",stdDeviation:this.SELECTED_GLOW_SIZE},a),p=ie(Ve.FECOMPONENTTRANSFER,{result:"outBlur"},a),ie(Ve.FEFUNCA,{type:"table",tableValues:"0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1"},p),ie(Ve.FEFLOOD,{"flood-color":this.SELECTED_GLOW_COLOUR,"flood-opacity":1,result:"outColor"},a),ie(Ve.FECOMPOSITE,{in:"outColor",in2:"outBlur",operator:"in",result:"outGlow"},a),this.selectedGlowFilterId=a.id,this.selectedGlowFilter=a,i=ie(Ve.FILTER,{id:"blocklyReplacementGlowFilter"+this.randomIdentifier,height:"160%",width:"180%",y:"-30%",x:"-40%"},i),ie(Ve.FEGAUSSIANBLUR,{in:"SourceGraphic",stdDeviation:this.REPLACEMENT_GLOW_SIZE},i),a=ie(Ve.FECOMPONENTTRANSFER,{result:"outBlur"},i),ie(Ve.FEFUNCA,{type:"table",tableValues:"0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1"},a),ie(Ve.FEFLOOD,{"flood-color":this.REPLACEMENT_GLOW_COLOUR,"flood-opacity":1,result:"outColor"},i),ie(Ve.FECOMPOSITE,{in:"outColor",in2:"outBlur",operator:"in",result:"outGlow"},i),ie(Ve.FECOMPOSITE,{in:"SourceGraphic",in2:"outGlow",operator:"over"},i),this.replacementGlowFilterId=i.id,this.replacementGlowFilter=i}getCSS_(i){return[`${i} .blocklyText,`,`${i} .blocklyFlyoutLabelText {`,`font: ${this.FIELD_TEXT_FONTWEIGHT} ${this.FIELD_TEXT_FONTSIZE}pt ${this.FIELD_TEXT_FONTFAMILY};`,"}",`${i} .blocklyText {`,"fill: #fff;","}",`${i} .blocklyNonEditableText>rect:not(.blocklyDropdownRect),`,`${i} .blocklyEditableText>rect:not(.blocklyDropdownRect) {`,`fill: ${this.FIELD_BORDER_RECT_COLOUR};`,"}",`${i} .blocklyNonEditableText>text,`,`${i} .blocklyEditableText>text,`,`${i} .blocklyNonEditableText>g>text,`,`${i} .blocklyEditableText>g>text {`,"fill: #575E75;","}",`${i} .blocklyFlyoutLabelText {`,"fill: #575E75;","}",`${i} .blocklyText.blocklyBubbleText {`,"fill: #575E75;","}",`${i} .blocklyDraggable:not(.blocklyDisabled)`," .blocklyEditableText:not(.editing):hover>rect,",`${i} .blocklyDraggable:not(.blocklyDisabled)`," .blocklyEditableText:not(.editing):hover>.blocklyPath {","stroke: #fff;","stroke-width: 2;","}",`${i} .blocklyHtmlInput {`,`font-family: ${this.FIELD_TEXT_FONTFAMILY};`,`font-weight: ${this.FIELD_TEXT_FONTWEIGHT};`,"color: #575E75;","}",`${i} .blocklyDropdownText {`,"fill: #fff !important;","}",`${i}.blocklyWidgetDiv .goog-menuitem,`,`${i}.blocklyDropDownDiv .goog-menuitem {`,`font-family: ${this.FIELD_TEXT_FONTFAMILY};`,"}",`${i}.blocklyDropDownDiv .goog-menuitem-content {`,"color: #fff;","}",`${i} .blocklyHighlightedConnectionPath {`,`stroke: ${this.SELECTED_GLOW_COLOUR};`,"}",`${i} .blocklyDisabled > .blocklyOutlinePath {`,`fill: url(#blocklyDisabledPattern${this.randomIdentifier})`,"}",`${i} .blocklyInsertionMarker>.blocklyPath {`,`fill-opacity: ${this.INSERTION_MARKER_OPACITY};`,"stroke: none;","}"]}},PT=class extends L_{constructor(i,a){super(i,a)}draw(){const i=this.block_.pathObject;i.beginDrawing(),this.drawOutline_(),this.drawInternals_(),this.updateConnectionHighlights(),i.setPath(this.outlinePath_+` +`+this.inlinePath_),this.info_.RTL&&i.flipRTL(),this.recordSizeOnBlock_(),this.info_.outputConnection&&(i.outputShapeType=this.info_.outputConnection.shape.type),i.endDrawing()}drawOutline_(){this.info_.outputConnection&&this.info_.outputConnection.isDynamicShape&&!this.info_.hasStatementInput&&!this.info_.bottomRow.hasNextConnection?(this.drawFlatTop_(),this.drawRightDynamicConnection_(),this.drawFlatBottom_(),this.drawLeftDynamicConnection_()):super.drawOutline_()}drawLeft_(){this.info_.outputConnection&&this.info_.outputConnection.isDynamicShape?this.drawLeftDynamicConnection_():super.drawLeft_()}drawRightSideRow_(i){if(!(0>=i.height)){if(ct.isSpacer(i)){const S=i.precedesStatement;var a=i.followsStatement;if(S||a){const O=this.constants_.INSIDE_CORNERS;var p=O.rightHeight;p=i.height-(S?p:0),a=a?O.pathBottomRight:"",i=0=p||0>=a)throw Error("Height and width values of an image field must be greater than 0.");this.size_=new eo(a,p+Fg.Y_PADDING),this.imageHeight=p,typeof O=="function"&&(this.clickHandler=O),i!==Gi.SKIP_SETUP&&(ve?this.configure_(ve):(this.flipRtl=!!j,this.altText=Vr(S)||""),this.setValue(Vr(i)))}configure_(i){super.configure_(i),i.flipRtl&&(this.flipRtl=i.flipRtl),i.alt&&(this.altText=Vr(i.alt))}initView(){this.imageElement=ie(Ve.IMAGE,{height:this.imageHeight+"px",width:this.size_.width+"px",alt:this.altText},this.fieldGroup_),this.imageElement.setAttributeNS(Zs,"xlink:href",this.value_),this.clickHandler&&(this.imageElement.style.cursor="pointer")}updateSize_(){}doClassValidation_(i){return typeof i!="string"?null:i}doValueUpdate_(i){this.value_=i,this.imageElement&&this.imageElement.setAttributeNS(Zs,"xlink:href",this.value_)}getFlipRtl(){return this.flipRtl}setAlt(i){i!==this.altText&&(this.altText=i||"",this.imageElement&&this.imageElement.setAttribute("alt",this.altText))}showEditor_(){this.clickHandler&&this.clickHandler(this)}setOnClickHandler(i){this.clickHandler=i}getText_(){return this.altText}static fromJson(i){if(!i.src||!i.width||!i.height)throw Error("src, width, and height values for an image field arerequired. The width and height must be non-zero.");return new this(i.src,i.width,i.height,void 0,void 0,void 0,i)}};Fg.Y_PADDING=1,xs("field_image",Fg),Fg.prototype.DEFAULT_VALUE="";var W_=class extends Gi{constructor(i,a,p){super(Gi.SKIP_SETUP),this.spellcheck_=!0,this.htmlInput_=null,this.isTextValid_=this.isBeingEdited_=!1,this.onKeyInputWrapper_=this.onKeyDownWrapper_=this.valueWhenEditorWasOpened_=null,this.fullBlockClickTarget_=!1,this.workspace_=null,this.SERIALIZABLE=!0,this.CURSOR="text",i!==Gi.SKIP_SETUP&&(p&&this.configure_(p),this.setValue(i),a&&this.setValidator(a))}configure_(i){super.configure_(i),i.spellcheck!==void 0&&(this.spellcheck_=i.spellcheck)}initView(){if(!this.getSourceBlock())throw new Ro;super.initView(),this.isFullBlockField()&&(this.clickTarget_=this.sourceBlock_.getSvgRoot())}isFullBlockField(){const i=this.getSourceBlock();if(!i)throw new Ro;let a;return this.fullBlockClickTarget_=!((a=this.getConstants())==null||!a.FULL_BLOCK_FIELDS)&&i.isSimpleReporter()}doValueInvalid_(i){this.isBeingEdited_&&(this.isDirty_=!0,this.isTextValid_=!1,i=this.value_,this.value_=this.htmlInput_.getAttribute("data-untyped-default-value"),this.sourceBlock_&&se()&&ue(new(Ie(t.CHANGE$$module$build$src$core$events$utils))(this.sourceBlock_,"field",this.name||null,i,this.value_)))}doValueUpdate_(i){this.isTextValid_=this.isDirty_=!0,this.value_=i}applyColour(){const i=this.getSourceBlock();if(!i)throw new Ro;this.getConstants().FULL_BLOCK_FIELDS&&this.fieldGroup_&&(!this.isFullBlockField()&&this.borderRect_?(this.borderRect_.style.display="block",this.borderRect_.setAttribute("stroke",i.style.colourTertiary)):(this.borderRect_.style.display="none",i.pathObject.svgPath.setAttribute("fill",this.getConstants().FIELD_BORDER_RECT_COLOUR)))}getSize(){let i;return(i=this.getConstants())!=null&&i.FULL_BLOCK_FIELDS&&(this.render_(),this.isDirty_=!1),super.getSize()}onLocationChange(){this.isBeingEdited_&&this.resizeEditor_()}render_(){if(super.render_(),this.isBeingEdited_){var i=this.htmlInput_;this.isTextValid_?(St(i,"blocklyInvalidInput"),Er(i,To.INVALID,!1)):(Pe(i,"blocklyInvalidInput"),Er(i,To.INVALID,!0))}if(i=this.getSourceBlock(),!i)throw new Ro;this.getConstants().FULL_BLOCK_FIELDS&&i.applyColour()}setSpellcheck(i){i!==this.spellcheck_&&(this.spellcheck_=i,this.htmlInput_&&this.htmlInput_.setAttribute("spellcheck",this.spellcheck_))}showEditor_(i,a=!1){this.workspace_=this.sourceBlock_.workspace,!a&&this.workspace_.options.modalInputs&&(Bl||kn||zn)?this.showPromptEditor_():this.showInlineEditor_(a)}showPromptEditor_(){La(t.Msg$$module$build$src$core$msg.CHANGE_VALUE_TITLE,this.getText(),i=>{i!==null&&this.setValue(this.getValueFromEditorText_(i)),this.onFinishEditing_(this.value_)})}showInlineEditor_(i){const a=this.getSourceBlock();if(!a)throw new Ro;ql(this,a.RTL,this.widgetDispose_.bind(this)),this.htmlInput_=this.widgetCreate_(),this.isBeingEdited_=!0,this.valueWhenEditorWasOpened_=this.value_,i||(this.htmlInput_.focus({preventScroll:!0}),this.htmlInput_.select())}widgetCreate_(){var i=this.getSourceBlock();if(!i)throw new Ro;t.setGroup$$module$build$src$core$events$utils(!0);const a=oo();var p=this.getClickTarget_();if(!p)throw Error("A click target has not been set.");Pe(p,"editing"),p=document.createElement("input"),p.className="blocklyHtmlInput",p.setAttribute("spellcheck",this.spellcheck_);const S=this.workspace_.getScale();var O=this.getConstants().FIELD_TEXT_FONTSIZE*S+"pt";return a.style.fontSize=O,p.style.fontSize=O,O=W_.BORDERRADIUS*S+"px",this.isFullBlockField()&&(O=this.getScaledBBox(),O=(O.bottom-O.top)/2+"px",i=i.getParent()?i.getParent().style.colourTertiary:this.sourceBlock_.style.colourTertiary,p.style.border=1*S+"px solid "+i,a.style.borderRadius=O,a.style.transition="box-shadow 0.25s ease 0s",this.getConstants().FIELD_TEXTINPUT_BOX_SHADOW&&(a.style.boxShadow="rgba(255, 255, 255, 0.3) 0 0 0 "+4*S+"px")),p.style.borderRadius=O,a.appendChild(p),p.value=p.defaultValue=this.getEditorText_(this.value_),p.setAttribute("data-untyped-default-value",String(this.value_)),this.resizeEditor_(),this.bindInputEvents_(p),p}widgetDispose_(){this.isBeingEdited_=!1,this.isTextValid_=!0,this.forceRerender(),this.onFinishEditing_(this.value_),this.sourceBlock_&&se()&&this.valueWhenEditorWasOpened_!==null&&this.valueWhenEditorWasOpened_!==this.value_&&(ue(new(Ie(t.CHANGE$$module$build$src$core$events$utils))(this.sourceBlock_,"field",this.name||null,this.valueWhenEditorWasOpened_,this.value_)),this.valueWhenEditorWasOpened_=null),t.setGroup$$module$build$src$core$events$utils(!1),this.unbindInputEvents_();var i=oo().style;if(i.width="auto",i.height="auto",i.fontSize="",i.transition="",i.boxShadow="",this.htmlInput_=null,i=this.getClickTarget_(),!i)throw Error("A click target has not been set.");St(i,"editing")}onFinishEditing_(i){}bindInputEvents_(i){this.onKeyDownWrapper_=$e(i,"keydown",this,this.onHtmlInputKeyDown_),this.onKeyInputWrapper_=$e(i,"input",this,this.onHtmlInputChange_)}unbindInputEvents_(){this.onKeyDownWrapper_&&(it(this.onKeyDownWrapper_),this.onKeyDownWrapper_=null),this.onKeyInputWrapper_&&(it(this.onKeyInputWrapper_),this.onKeyInputWrapper_=null)}onHtmlInputKeyDown_(i){i.key==="Enter"?(Ql(),al()):i.key==="Escape"?(this.setValue(this.htmlInput_.getAttribute("data-untyped-default-value"),!1),Ql(),al()):i.key==="Tab"&&(Ql(),al(),this.sourceBlock_.tab(this,!i.shiftKey),i.preventDefault())}onHtmlInputChange_(i){i=this.value_,this.setValue(this.getValueFromEditorText_(this.htmlInput_.value),!1),this.sourceBlock_&&se()&&this.value_!==i&&ue(new(Ie(Ch))(this.sourceBlock_,this.name||null,i,this.value_))}setEditorValue_(i,a=!0){this.isDirty_=!0,this.isBeingEdited_&&(this.htmlInput_.value=this.getEditorText_(i)),this.setValue(i,a)}resizeEditor_(){var i=this.getSourceBlock();if(!i)throw new Ro;const a=oo(),p=this.getScaledBBox();a.style.width=p.right-p.left+"px",a.style.height=p.bottom-p.top+"px",i=new _n(i.RTL?p.right-a.offsetWidth:p.left,p.top),a.style.left=i.x+"px",a.style.top=i.y+"px"}repositionForWindowResize(){const i=this.getSourceBlock();return i instanceof Dp?(Eh(this.workspace_,this.workspace_.getMetricsManager().getViewMetrics(!0),i)||this.resizeEditor_(),!0):!1}isTabNavigable(){return!0}getText_(){return this.isBeingEdited_&&this.htmlInput_?this.htmlInput_.value:null}getEditorText_(i){return`${i}`}getValueFromEditorText_(i){return i}};W_.BORDERRADIUS=4;var H0=class extends W_{constructor(i,a,p){super(i,a,p)}doClassValidation_(i){return i===void 0?null:`${i}`}static fromJson(i){return new this(Vr(i.text),void 0,i)}};xs("field_input",H0),H0.prototype.DEFAULT_VALUE="";var BT=class extends R_{constructor(i){super(i)}endsWithElemSpacer(){return!1}hasLeftSquareCorner(i){return!!i.outputConnection}hasRightSquareCorner(i){return!!i.outputConnection&&!i.statementInputCount&&!i.nextConnection}},jv=class extends k_{constructor(i,a){if(super(i,a),this.connectedBottomNextConnection=!1,this.connectedBlock){for(i=this.connectedBlock;a=i.getNextBlock();)i=a;i.nextConnection||(this.height=this.connectedBlockHeight,this.connectedBottomNextConnection=!0)}}},FT=class extends sr{constructor(i){super(i),this.width=this.height=0,this.type|=ct.getType("RIGHT_CONNECTION")}},zT=class extends pb{constructor(i){super(i)}endsWithElemSpacer(){return!1}hasLeftSquareCorner(i){const a=(i.hat?i.hat==="cap":this.constants_.ADD_START_HATS)&&!i.outputConnection&&!i.previousConnection;return!!i.outputConnection||a}hasRightSquareCorner(i){return!!i.outputConnection&&!i.statementInputCount&&!i.nextConnection}},UT=class extends k0{constructor(i,a){super(i,a),this.isInline=!0,this.renderer_=i,this.constants_=this.renderer_.getConstants(),this.topRow=new zT(this.constants_),this.bottomRow=new BT(this.constants_),this.isMultiRow=!a.getInputsInline()||a.isCollapsed(),this.hasStatementInput=0=this.rows.length-1?!!this.bottomRow.hasNextConnection:!!S.precedesStatement,ct.isInputRow(j)&&j.hasStatement){j.measure();let ve,Ue;a=j.width-((Ue=(ve=j.getLastInput())==null?void 0:ve.width)!=null?Ue:0)+i}else if(p&&(O===2||S)&&ct.isInputRow(j)&&!j.hasStatement){S=j.xPos,p=null;for(let ve=0;vep?p:this.height/2,a-p*(1-Math.sin(Math.acos((p-this.constants_.SMALL_PADDING)/p)));default:return 0}if(ct.isInlineInput(i)&&i instanceof ig){const O=i.connectedBlock;return i=O?O.pathObject.outputShapeType:i.shape.type,i==null||O&&O.outputConnection&&(O.statementInputCount||O.nextConnection)||p===S.SHAPES.HEXAGONAL&&p!==i?0:a-this.constants_.SHAPE_IN_SHAPE_PADDING[p][i]}return ct.isField(i)&&i instanceof R0?p===S.SHAPES.ROUND&&i.field instanceof H0?a-2.75*S.GRID_UNIT:a-this.constants_.SHAPE_IN_SHAPE_PADDING[p][0]:ct.isIcon(i)?this.constants_.SMALL_PADDING:0}finalizeVerticalAlignment_(){if(!this.outputConnection)for(let S=2;S=this.rows.length-1?!!this.bottomRow.hasNextConnection:!!ve.precedesStatement;if(i?this.topRow.hasPreviousConnection:O.followsStatement){var p=j.elements[1];if(p=j.elements.length===3&&p instanceof R0&&(p.field instanceof wi||p.field instanceof Fg),!i&&p)O.height-=this.constants_.SMALL_PADDING,ve.height-=this.constants_.SMALL_PADDING,j.height-=this.constants_.MEDIUM_PADDING;else if(!i&&!a)O.height+=this.constants_.SMALL_PADDING;else if(a){for(i=!1,a=0;ap;p+=15)ie(Ve.LINE,{x1:K.HALF+K.RADIUS,y1:K.HALF,x2:K.HALF+K.RADIUS-(p%45===0?10:5),y2:K.HALF,class:"blocklyAngleMarks",transform:"rotate("+p+","+K.HALF+","+K.HALF+")"},i);return this.boundEvents.push($e(i,"click",this,this.hide)),this.boundEvents.push($e(a,"pointerdown",this,this.onMouseMove_,!0)),this.boundEvents.push($e(a,"pointermove",this,this.onMouseMove_,!0)),i}dropdownDispose(){for(const i of this.boundEvents)it(i);this.boundEvents.length=0,this.line=this.gauge=null}hide(){Ti(this),Ql()}onMouseMove_(i){var a=this.gauge.ownerSVGElement.getBoundingClientRect();const p=i.clientX-a.left-K.HALF;i=i.clientY-a.top-K.HALF,a=Math.atan(-i/p),isNaN(a)||(a=is(a),0>p?a+=180:0i&&(i+=360),i>this.wrap&&(i-=360),i}static fromJson(i){return new this(i.angle,void 0,i)}};K.HALF=50,K.RADIUS=K.HALF-1,K.CLOCKWISE=!1,K.OFFSET=0,K.WRAP=360,K.ROUND=15,xs("field_angle",K),K.prototype.DEFAULT_VALUE=0,At(` .blocklyAngleCircle { stroke: #444; stroke-width: 1; @@ -614,7 +614,7 @@ Blockly.YourGeneratorName.nameDB_.setVariableMap(workspace.getVariableMap());`), stroke-linecap: round; pointer-events: none; } -`);var ce;(function(i){i.COMPASS="compass",i.PROTRACTOR="protractor"})(ce||(ce={}));var _e=class extends Gi{constructor(i,a,p){super(Gi.SKIP_SETUP),this.SERIALIZABLE=!0,this.CURSOR="default",this.value_=this.value_,this.checkChar=_e.CHECK_CHAR,i!==Gi.SKIP_SETUP&&(p&&this.configure_(p),this.setValue(i),a&&this.setValidator(a))}configure_(i){super.configure_(i),i.checkCharacter&&(this.checkChar=i.checkCharacter)}saveState(){const i=this.saveLegacyState(_e);return i!==null?i:this.getValueBoolean()}initView(){super.initView();const i=this.getTextElement();$e(i,"blocklyCheckbox"),i.style.display=this.value_?"block":"none"}render_(){this.textContent_&&(this.textContent_.nodeValue=this.getDisplayText_()),this.updateSize_(this.getConstants().FIELD_CHECKBOX_X_OFFSET)}getDisplayText_(){return this.checkChar}setCheckCharacter(i){this.checkChar=i||_e.CHECK_CHAR,this.forceRerender()}showEditor_(){this.setValue(!this.value_)}doClassValidation_(i){return i===!0||i==="TRUE"?"TRUE":i===!1||i==="FALSE"?"FALSE":null}doValueUpdate_(i){this.value_=this.convertValueToBool_(i),this.textElement_&&(this.textElement_.style.display=this.value_?"block":"none")}getValue(){return this.value_?"TRUE":"FALSE"}getValueBoolean(){return this.value_}getText(){return String(this.convertValueToBool_(this.value_))}convertValueToBool_(i){return typeof i=="string"?i==="TRUE":!!i}static fromJson(i){return new this(i.checked,void 0,i)}};_e.CHECK_CHAR="✓",xs("field_checkbox",_e),_e.prototype.DEFAULT_VALUE=!1;var Ee=class extends Gi{constructor(i,a,p){super(Gi.SKIP_SETUP),this.highlightedIndex=this.picker=null,this.boundEvents=[],this.SERIALIZABLE=!0,this.CURSOR="default",this.isDirty_=!1,this.titles=this.colours=null,this.columns=0,i!==Gi.SKIP_SETUP&&(p&&this.configure_(p),this.setValue(i),a&&this.setValidator(a))}configure_(i){super.configure_(i),i.colourOptions&&(this.colours=i.colourOptions),i.colourTitles&&(this.titles=i.colourTitles),i.columns&&(this.columns=i.columns)}initView(){this.size_=new eo(this.getConstants().FIELD_COLOUR_DEFAULT_WIDTH,this.getConstants().FIELD_COLOUR_DEFAULT_HEIGHT),this.createBorderRect_(),this.getBorderRect().style.fillOpacity="1",this.getBorderRect().setAttribute("stroke","#fff"),this.isFullBlockField()&&(this.clickTarget_=this.sourceBlock_.getSvgRoot())}isFullBlockField(){const i=this.getSourceBlock();if(!i)throw new Ro;const a=this.getConstants();return i.isSimpleReporter()&&!(a==null||!a.FIELD_COLOUR_FULL_BLOCK)}applyColour(){const i=this.getSourceBlock();if(!i)throw new Ro;if(this.fieldGroup_){var a=this.borderRect_;if(!a)throw Error("The border rect has not been initialized");this.isFullBlockField()?(a.style.display="none",i.pathObject.svgPath.setAttribute("fill",this.getValue()),i.pathObject.svgPath.setAttribute("stroke","#fff")):(a.style.display="block",a.style.fill=this.getValue())}}getSize(){let i;return(i=this.getConstants())!=null&&i.FIELD_COLOUR_FULL_BLOCK&&(this.render_(),this.isDirty_=!1),super.getSize()}render_(){super.render_();const i=this.getSourceBlock();if(!i)throw new Ro;i.applyColour()}updateSize_(i){var a=this.getConstants();this.isFullBlockField()?(i=2*(i??0),a=a.FIELD_TEXT_HEIGHT):(i=a.FIELD_COLOUR_DEFAULT_WIDTH,a=a.FIELD_COLOUR_DEFAULT_HEIGHT),this.size_.height=a,this.size_.width=i,this.positionBorderRect_()}doClassValidation_(i){return typeof i!="string"?null:ta(i)}getText(){let i=this.value_;return/^#(.)\1(.)\2(.)\3$/.test(i)&&(i="#"+i[1]+i[3]+i[5]),i}setColours(i,a){return this.colours=i,a&&(this.titles=a),this}setColumns(i){return this.columns=i,this}showEditor_(){this.dropdownCreate(),xu().appendChild(this.picker),ye(this,this.dropdownDispose.bind(this)),this.picker.focus({preventScroll:!0})}onClick(i){i=(i=i.target)&&i.getAttribute("data-colour"),i!==null&&(this.setValue(i),Ti(this))}onKeyDown(i){let a=!0;var p;switch(i.key){case"ArrowUp":this.moveHighlightBy(0,-1);break;case"ArrowDown":this.moveHighlightBy(0,1);break;case"ArrowLeft":this.moveHighlightBy(-1,0);break;case"ArrowRight":this.moveHighlightBy(1,0);break;case"Enter":(p=this.getHighlighted())&&(p=p.getAttribute("data-colour"),p!==null&&this.setValue(p)),al();break;default:a=!1}a&&i.stopPropagation()}moveHighlightBy(i,a){if(this.highlightedIndex){var p=this.colours||Ee.COLOURS,S=this.columns||Ee.COLUMNS,O=this.highlightedIndex%S,j=Math.floor(this.highlightedIndex/S);O+=i,j+=a,0>i?0>O&&0O&&(O=0):0S-1&&jS-1&&O--:0>a?0>j&&(j=0):0Math.floor(p.length/S)-1&&(j=Math.floor(p.length/S)-1),this.setHighlightedCell(this.picker.childNodes[j].childNodes[O],j*S+O)}}onMouseMove(i){const a=(i=i.target)&&Number(i.getAttribute("data-index"));a!==null&&a!==this.highlightedIndex&&this.setHighlightedCell(i,a)}onMouseEnter(){let i;(i=this.picker)==null||i.focus({preventScroll:!0})}onMouseLeave(){var i;(i=this.picker)==null||i.blur(),(i=this.getHighlighted())&&St(i,"blocklyColourHighlighted")}getHighlighted(){if(!this.highlightedIndex)return null;const i=this.columns||Ee.COLUMNS,a=this.picker.childNodes[Math.floor(this.highlightedIndex/i)];return a?a.childNodes[this.highlightedIndex%i]:null}setHighlightedCell(i,a){const p=this.getHighlighted();p&&St(p,"blocklyColourHighlighted"),$e(i,"blocklyColourHighlighted"),this.highlightedIndex=a,(i=i.getAttribute("id"))&&this.picker&&Er(this.picker,To.ACTIVEDESCENDANT,i)}dropdownCreate(){const i=this.columns||Ee.COLUMNS,a=this.colours||Ee.COLOURS,p=this.titles||Ee.TITLES,S=this.getValue(),O=document.createElement("table");O.className="blocklyColourTable",O.tabIndex=0,O.dir="ltr",ci(O,oh.GRID),Er(O,To.EXPANDED,!0),Er(O,To.ROWCOUNT,Math.floor(a.length/i)),Er(O,To.COLCOUNT,i);let j;for(let ve=0;vei?0>O&&0O&&(O=0):0S-1&&jS-1&&O--:0>a?0>j&&(j=0):0Math.floor(p.length/S)-1&&(j=Math.floor(p.length/S)-1),this.setHighlightedCell(this.picker.childNodes[j].childNodes[O],j*S+O)}}onMouseMove(i){const a=(i=i.target)&&Number(i.getAttribute("data-index"));a!==null&&a!==this.highlightedIndex&&this.setHighlightedCell(i,a)}onMouseEnter(){let i;(i=this.picker)==null||i.focus({preventScroll:!0})}onMouseLeave(){var i;(i=this.picker)==null||i.blur(),(i=this.getHighlighted())&&St(i,"blocklyColourHighlighted")}getHighlighted(){if(!this.highlightedIndex)return null;const i=this.columns||Ee.COLUMNS,a=this.picker.childNodes[Math.floor(this.highlightedIndex/i)];return a?a.childNodes[this.highlightedIndex%i]:null}setHighlightedCell(i,a){const p=this.getHighlighted();p&&St(p,"blocklyColourHighlighted"),Pe(i,"blocklyColourHighlighted"),this.highlightedIndex=a,(i=i.getAttribute("id"))&&this.picker&&Er(this.picker,To.ACTIVEDESCENDANT,i)}dropdownCreate(){const i=this.columns||Ee.COLUMNS,a=this.colours||Ee.COLOURS,p=this.titles||Ee.TITLES,S=this.getValue(),O=document.createElement("table");O.className="blocklyColourTable",O.tabIndex=0,O.dir="ltr",ci(O,oh.GRID),Er(O,To.EXPANDED,!0),Er(O,To.ROWCOUNT,Math.floor(a.length/i)),Er(O,To.COLCOUNT,i);let j;for(let ve=0;vethis.maxDisplayLength?j=j.substring(0,this.maxDisplayLength-4)+"...":this.isOverflowedY_&&O===S-1&&(j=j.substring(0,j.length-3)+"..."),j=j.replace(/\s/g,Gi.NBSP),a+=j,O!==S-1&&(a+=` `)}return i.RTL&&(a+="‏"),a}doValueUpdate_(i){super.doValueUpdate_(i),this.value_!==null&&(this.isOverflowedY_=this.value_.split(` `).length>this.maxLines_)}render_(){var i=this.getSourceBlock();if(!i)throw new Ro;for(var a,p=this.textGroup;a=p.firstChild;)p.removeChild(a);a=this.getDisplayText_().split(` -`);let S=0;for(let O=0;OO&&(O=Ue),j+=this.getConstants().FIELD_TEXT_HEIGHT+(0this.maxDisplayLength&&(i[Ue]=i[Ue].substring(0,this.maxDisplayLength)),ve.textContent=i[Ue];const Yt=Xe(ve,a,p,S);Yt>O&&(O=Yt)}O+=this.htmlInput_.offsetWidth-this.htmlInput_.clientWidth}this.borderRect_&&(j+=2*this.getConstants().FIELD_BORDER_RECT_Y_PADDING,O+=2*this.getConstants().FIELD_BORDER_RECT_X_PADDING,this.borderRect_.setAttribute("width",`${O}`),this.borderRect_.setAttribute("height",`${j}`)),this.size_.width=O,this.size_.height=j,this.positionBorderRect_()}showEditor_(i,a){super.showEditor_(i,a),this.forceRerender()}widgetCreate_(){const i=oo(),a=this.workspace_.getScale(),p=document.createElement("textarea");p.className="blocklyHtmlInput blocklyHtmlTextAreaInput",p.setAttribute("spellcheck",String(this.spellcheck_));var S=this.getConstants().FIELD_TEXT_FONTSIZE*a+"pt";i.style.fontSize=S,p.style.fontSize=S,p.style.borderRadius=H0.BORDERRADIUS*a+"px",S=this.getConstants().FIELD_BORDER_RECT_X_PADDING*a;const O=this.getConstants().FIELD_BORDER_RECT_Y_PADDING*a/2;return p.style.padding=O+"px "+S+"px "+O+"px "+S+"px",S=this.getConstants().FIELD_TEXT_HEIGHT+this.getConstants().FIELD_BORDER_RECT_Y_PADDING,p.style.lineHeight=S*a+"px",i.appendChild(p),p.value=p.defaultValue=this.getEditorText_(this.value_),p.setAttribute("data-untyped-default-value",String(this.value_)),p.setAttribute("data-old-value",""),En?setTimeout(this.resizeEditor_.bind(this),0):this.resizeEditor_(),this.bindInputEvents_(p),p}setMaxLines(i){typeof i=="number"&&0O&&(O=Ue),j+=this.getConstants().FIELD_TEXT_HEIGHT+(0this.maxDisplayLength&&(i[Ue]=i[Ue].substring(0,this.maxDisplayLength)),ve.textContent=i[Ue];const Yt=Je(ve,a,p,S);Yt>O&&(O=Yt)}O+=this.htmlInput_.offsetWidth-this.htmlInput_.clientWidth}this.borderRect_&&(j+=2*this.getConstants().FIELD_BORDER_RECT_Y_PADDING,O+=2*this.getConstants().FIELD_BORDER_RECT_X_PADDING,this.borderRect_.setAttribute("width",`${O}`),this.borderRect_.setAttribute("height",`${j}`)),this.size_.width=O,this.size_.height=j,this.positionBorderRect_()}showEditor_(i,a){super.showEditor_(i,a),this.forceRerender()}widgetCreate_(){const i=oo(),a=this.workspace_.getScale(),p=document.createElement("textarea");p.className="blocklyHtmlInput blocklyHtmlTextAreaInput",p.setAttribute("spellcheck",String(this.spellcheck_));var S=this.getConstants().FIELD_TEXT_FONTSIZE*a+"pt";i.style.fontSize=S,p.style.fontSize=S,p.style.borderRadius=H0.BORDERRADIUS*a+"px",S=this.getConstants().FIELD_BORDER_RECT_X_PADDING*a;const O=this.getConstants().FIELD_BORDER_RECT_Y_PADDING*a/2;return p.style.padding=O+"px "+S+"px "+O+"px "+S+"px",S=this.getConstants().FIELD_TEXT_HEIGHT+this.getConstants().FIELD_BORDER_RECT_Y_PADDING,p.style.lineHeight=S*a+"px",i.appendChild(p),p.value=p.defaultValue=this.getEditorText_(this.value_),p.setAttribute("data-untyped-default-value",String(this.value_)),p.setAttribute("data-old-value",""),En?setTimeout(this.resizeEditor_.bind(this),0):this.resizeEditor_(),this.bindInputEvents_(p),p}setMaxLines(i){typeof i=="number"&&0this.max_&&(i.max=`${this.max_}`,Er(i,To.VALUEMAX,this.max_)),i}static fromJson(i){return new this(i.value,void 0,void 0,void 0,void 0,i)}};xs("field_number",ct),ct.prototype.DEFAULT_VALUE=0;var Rt=class extends Ah{constructor(i,a,p,S,O){super(Gi.SKIP_SETUP),this.defaultType="",this.variableTypes=[],this.variable=null,this.SERIALIZABLE=!0,this.menuGenerator_=Rt.dropdownCreate,this.defaultVariableName=typeof i=="string"?i:"",this.size_=new eo(0,0),i!==Gi.SKIP_SETUP&&(O?this.configure_(O):this.setTypes(p,S),a&&this.setValidator(a))}configure_(i){super.configure_(i),this.setTypes(i.variableTypes,i.defaultType)}initModel(){var i=this.getSourceBlock();if(!i)throw new Ro;this.variable||(i=t.getOrCreateVariablePackage$$module$build$src$core$variables(i.workspace,null,this.defaultVariableName,this.defaultType),this.doValueUpdate_(i.getId()))}shouldAddBorderRect_(){const i=this.getSourceBlock();if(!i)throw new Ro;return super.shouldAddBorderRect_()&&(!this.getConstants().FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW||i.type!=="variables_get")}fromXml(i){var a=this.getSourceBlock();if(!a)throw new Ro;const p=i.getAttribute("id"),S=i.textContent,O=i.getAttribute("variabletype")||i.getAttribute("variableType")||"";if(a=t.getOrCreateVariablePackage$$module$build$src$core$variables(a.workspace,p,S,O),O!==null&&O!==a.type)throw Error("Serialized variable type with id '"+a.getId()+"' had type "+a.type+", and does not match variable field that references it: "+Qi(i)+".");this.setValue(a.getId())}toXml(i){return this.initModel(),i.id=this.variable.getId(),i.textContent=this.variable.name,this.variable.type&&i.setAttribute("variabletype",this.variable.type),i}saveState(i){var a=this.saveLegacyState(Rt);return a!==null||(this.initModel(),a={id:this.variable.getId()},i&&(a.name=this.variable.name,a.type=this.variable.type)),a}loadState(i){const a=this.getSourceBlock();if(!a)throw new Ro;this.loadLegacyState(Rt,i)||(i=t.getOrCreateVariablePackage$$module$build$src$core$variables(a.workspace,i.id||null,i.name,i.type||""),this.setValue(i.getId()))}setSourceBlock(i){if(i.isShadow())throw Error("Variable fields are not allowed to exist on shadow blocks.");super.setSourceBlock(i)}getValue(){return this.variable?this.variable.getId():null}getText(){return this.variable?this.variable.name:""}getVariable(){return this.variable}getValidator(){return this.variable?this.validator_:null}doClassValidation_(i){if(i===null)return null;var a=this.getSourceBlock();if(!a)throw new Ro;return a=t.getVariable$$module$build$src$core$variables(a.workspace,i),a?(a=a.type,this.typeIsAllowed(a)?i:(console.warn("Variable type doesn't match this field! Type was "+a),null)):(console.warn("Variable id doesn't point to a real variable! ID was "+i),null)}doValueUpdate_(i){const a=this.getSourceBlock();if(!a)throw new Ro;this.variable=t.getVariable$$module$build$src$core$variables(a.workspace,i),super.doValueUpdate_(i)}typeIsAllowed(i){const a=this.getVariableTypes();if(!a)return!0;for(let p=0;pthis.max_&&(i.max=`${this.max_}`,Er(i,To.VALUEMAX,this.max_)),i}static fromJson(i){return new this(i.value,void 0,void 0,void 0,void 0,i)}};xs("field_number",ht),ht.prototype.DEFAULT_VALUE=0;var Rt=class extends Ah{constructor(i,a,p,S,O){super(Gi.SKIP_SETUP),this.defaultType="",this.variableTypes=[],this.variable=null,this.SERIALIZABLE=!0,this.menuGenerator_=Rt.dropdownCreate,this.defaultVariableName=typeof i=="string"?i:"",this.size_=new eo(0,0),i!==Gi.SKIP_SETUP&&(O?this.configure_(O):this.setTypes(p,S),a&&this.setValidator(a))}configure_(i){super.configure_(i),this.setTypes(i.variableTypes,i.defaultType)}initModel(){var i=this.getSourceBlock();if(!i)throw new Ro;this.variable||(i=t.getOrCreateVariablePackage$$module$build$src$core$variables(i.workspace,null,this.defaultVariableName,this.defaultType),this.doValueUpdate_(i.getId()))}shouldAddBorderRect_(){const i=this.getSourceBlock();if(!i)throw new Ro;return super.shouldAddBorderRect_()&&(!this.getConstants().FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW||i.type!=="variables_get")}fromXml(i){var a=this.getSourceBlock();if(!a)throw new Ro;const p=i.getAttribute("id"),S=i.textContent,O=i.getAttribute("variabletype")||i.getAttribute("variableType")||"";if(a=t.getOrCreateVariablePackage$$module$build$src$core$variables(a.workspace,p,S,O),O!==null&&O!==a.type)throw Error("Serialized variable type with id '"+a.getId()+"' had type "+a.type+", and does not match variable field that references it: "+Qi(i)+".");this.setValue(a.getId())}toXml(i){return this.initModel(),i.id=this.variable.getId(),i.textContent=this.variable.name,this.variable.type&&i.setAttribute("variabletype",this.variable.type),i}saveState(i){var a=this.saveLegacyState(Rt);return a!==null||(this.initModel(),a={id:this.variable.getId()},i&&(a.name=this.variable.name,a.type=this.variable.type)),a}loadState(i){const a=this.getSourceBlock();if(!a)throw new Ro;this.loadLegacyState(Rt,i)||(i=t.getOrCreateVariablePackage$$module$build$src$core$variables(a.workspace,i.id||null,i.name,i.type||""),this.setValue(i.getId()))}setSourceBlock(i){if(i.isShadow())throw Error("Variable fields are not allowed to exist on shadow blocks.");super.setSourceBlock(i)}getValue(){return this.variable?this.variable.getId():null}getText(){return this.variable?this.variable.name:""}getVariable(){return this.variable}getValidator(){return this.variable?this.validator_:null}doClassValidation_(i){if(i===null)return null;var a=this.getSourceBlock();if(!a)throw new Ro;return a=t.getVariable$$module$build$src$core$variables(a.workspace,i),a?(a=a.type,this.typeIsAllowed(a)?i:(console.warn("Variable type doesn't match this field! Type was "+a),null)):(console.warn("Variable id doesn't point to a real variable! ID was "+i),null)}doValueUpdate_(i){const a=this.getSourceBlock();if(!a)throw new Ro;this.variable=t.getVariable$$module$build$src$core$variables(a.workspace,i),super.doValueUpdate_(i)}typeIsAllowed(i){const a=this.getVariableTypes();if(!a)return!0;for(let p=0;p{this.targetWorkspace.isDragging()||a.addSelect()})),this.listeners.push(He(i,"pointerleave",a,()=>{this.targetWorkspace.isDragging()||a.removeSelect()})),this.listeners.push(He(p,"pointerenter",a,()=>{this.targetWorkspace.isDragging()||a.addSelect()})),this.listeners.push(He(p,"pointerleave",a,()=>{this.targetWorkspace.isDragging()||a.removeSelect()}))}blockMouseDown(i){return a=>{const p=this.targetWorkspace.getGesture(a);p&&(p.setStartBlock(i),p.handleFlyoutStart(a,this))}}onMouseDown(i){const a=this.targetWorkspace.getGesture(i);a&&a.handleFlyoutStart(i,this)}isBlockCreatable(i){return i.isEnabled()}createBlock(i){let a=null;t.disable$$module$build$src$core$events$utils();var p=this.targetWorkspace.getAllVariables();this.targetWorkspace.setResizesEnabled(!1);try{a=this.placeNewBlock(i)}finally{t.enable$$module$build$src$core$events$utils()}if(this.targetWorkspace.hideChaff(),i=Xl(this.targetWorkspace,p),ie()){for(t.setGroup$$module$build$src$core$events$utils(!0),p=0;p90-a||i>-90-a&&i<-90+a}getClientRect(){if(!this.svgGroup_||this.autoClose||!this.isVisible())return null;const i=this.svgGroup_.getBoundingClientRect(),a=i.top;return this.toolboxPosition_===dr.TOP?new Oi(-1e9,a+i.height,-1e9,1e9):new Oi(a,1e9,-1e9,1e9)}reflowInternal_(){this.workspace_.scale=this.getFlyoutScale();let i=0;const a=this.workspace_.getTopBlocks(!1);for(let S=0,O;O=a[S];S++)i=Math.max(i,O.getHeightWidth().height);const p=this.buttons_;for(let S=0,O;O=p[S];S++)i=Math.max(i,O.height);if(i+=1.5*this.MARGIN,i*=this.workspace_.scale,i+=xa.scrollbarThickness,this.height_!==i){for(let S=0,O;O=a[S];S++)this.rectMap_.has(O)&&this.moveRectToBlock_(this.rectMap_.get(O),O);this.targetWorkspace.scrollbar||this.autoClose||this.targetWorkspace.getFlyout()!==this||this.toolboxPosition_!==dr.TOP||this.targetWorkspace.translate(this.targetWorkspace.scrollX,this.targetWorkspace.scrollY+i),this.height_=i,this.position(),this.targetWorkspace.resizeContents(),this.targetWorkspace.recordDragTargets()}}};r(Ft.FLYOUTS_HORIZONTAL_TOOLBOX,Nl,Yn);var er=class extends dn{constructor(i){super(i)}setMetrics_(i){if(this.isVisible()){var a=this.workspace_.getMetricsManager(),p=a.getScrollMetrics(),S=a.getViewMetrics();a=a.getAbsoluteMetrics(),typeof i.y=="number"&&(this.workspace_.scrollY=-(p.top+(p.height-S.height)*i.y)),this.workspace_.translate(this.workspace_.scrollX+a.left,this.workspace_.scrollY+a.top)}}getX(){if(!this.isVisible())return 0;var i=this.targetWorkspace.getMetricsManager();const a=i.getAbsoluteMetrics(),p=i.getViewMetrics();return i=i.getToolboxMetrics(),this.targetWorkspace.toolboxPosition===this.toolboxPosition_?this.targetWorkspace.getToolbox()?this.toolboxPosition_===dr.LEFT?i.width:p.width-this.width_:this.toolboxPosition_===dr.LEFT?0:p.width:this.toolboxPosition_===dr.LEFT?0:p.width+a.left-this.width_}getY(){return 0}position(){if(this.isVisible()&&this.targetWorkspace.isVisible()){var i=this.targetWorkspace.getMetricsManager().getViewMetrics();this.height_=i.height,this.setBackgroundPath(this.width_-this.CORNER_RADIUS,i.height-2*this.CORNER_RADIUS),i=this.getX();var a=this.getY();this.positionAt_(this.width_,this.height_,i,a)}}setBackgroundPath(i,a){const p=this.toolboxPosition_===dr.RIGHT;var S=i+this.CORNER_RADIUS;S=["M "+(p?S:0)+",0"],S.push("h",p?-i:i),S.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,p?0:1,p?-this.CORNER_RADIUS:this.CORNER_RADIUS,this.CORNER_RADIUS),S.push("v",Math.max(0,a)),S.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,p?0:1,p?this.CORNER_RADIUS:-this.CORNER_RADIUS,this.CORNER_RADIUS),S.push("h",p?i:-i),S.push("z"),this.svgBackground_.setAttribute("d",S.join(" "))}scrollToStart(){let i;(i=this.workspace_.scrollbar)==null||i.setY(0)}wheel_(i){var a=vt(i);if(a.y){const p=this.workspace_.getMetricsManager(),S=p.getScrollMetrics();a=p.getViewMetrics().top-S.top+a.y;let O;(O=this.workspace_.scrollbar)==null||O.setY(a),Ql(),al()}i.preventDefault(),i.stopPropagation()}layout_(i,a){this.workspace_.scale=this.targetWorkspace.scale;var p=this.MARGIN;const S=this.RTL?p:p+this.tabWidth_;for(let Ue=0,Yt;Yt=i[Ue];Ue++)if(Yt.type==="block"){var O=Yt.block,j=O.getDescendants(!1);for(let bl=0,Qa;Qa=j[bl];bl++)Qa.isInFlyout=!0;j=O.getSvgRoot();const jn=O.getHeightWidth();var ve=O.outputConnection?S-this.tabWidth_:S;O.moveBy(ve,p),ve=this.createRect_(O,this.RTL?ve-jn.width:ve,p,jn,Ue),this.addBlockListeners_(j,O,ve),p+=jn.height+a[Ue]}else Yt.type==="button"&&(O=Yt.button,this.initFlyoutButton_(O,S,p),p+=O.height+a[Ue])}isDragTowardWorkspace(i){i=Math.atan2(i.y,i.x)/Math.PI*180;const a=this.dragAngleRange_;return i-a||i<-180+a||i>180-a}getClientRect(){if(!this.svgGroup_||this.autoClose||!this.isVisible())return null;const i=this.svgGroup_.getBoundingClientRect(),a=i.left;return this.toolboxPosition_===dr.LEFT?new Oi(-1e9,1e9,-1e9,a+i.width):new Oi(-1e9,1e9,a,1e9)}reflowInternal_(){this.workspace_.scale=this.getFlyoutScale();let i=0;var a=this.workspace_.getTopBlocks(!1);for(let S=0,O;O=a[S];S++){var p=O.getHeightWidth().width;O.outputConnection&&(p-=this.tabWidth_),i=Math.max(i,p)}for(let S=0,O;O=this.buttons_[S];S++)i=Math.max(i,O.width);if(i+=1.5*this.MARGIN+this.tabWidth_,i*=this.workspace_.scale,i+=xa.scrollbarThickness,this.width_!==i){for(let S=0,O;O=a[S];S++){if(this.RTL){p=O.getRelativeToSurfaceXY().x;let j=i/this.workspace_.scale-this.MARGIN;O.outputConnection||(j-=this.tabWidth_),O.moveBy(j-p,0)}this.rectMap_.has(O)&&this.moveRectToBlock_(this.rectMap_.get(O),O)}if(this.RTL)for(let S=0,O;O=this.buttons_[S];S++)a=O.getPosition().y,O.moveTo(i/this.workspace_.scale-O.width-this.MARGIN-this.tabWidth_,a);this.targetWorkspace.scrollbar||this.autoClose||this.targetWorkspace.getFlyout()!==this||this.toolboxPosition_!==dr.LEFT||this.targetWorkspace.translate(this.targetWorkspace.scrollX+i,this.targetWorkspace.scrollY),this.width_=i,this.position(),this.targetWorkspace.resizeContents(),this.targetWorkspace.recordDragTargets()}}};er.registryName="verticalFlyout",r(Ft.FLYOUTS_VERTICAL_TOOLBOX,Nl,er);var la;t.CodeGenerator$$module$build$src$core$generator=class{constructor(i){this.forBlock=Object.create(null),this.FUNCTION_NAME_PLACEHOLDER_="{leCUI8hutHZI4480Dc}",this.STATEMENT_SUFFIX=this.STATEMENT_PREFIX=this.INFINITE_LOOP_TRAP=null,this.INDENT=" ",this.COMMENT_WRAP=60,this.ORDER_OVERRIDES=[],this.isInitialized=null,this.RESERVED_WORDS_="",this.definitions_=Object.create(null),this.functionNames_=Object.create(null),this.nameDB_=void 0,this.name_=i,this.FUNCTION_NAME_PLACEHOLDER_REGEXP_=new RegExp(this.FUNCTION_NAME_PLACEHOLDER_,"g")}workspaceToCode(i){i||(console.warn("No workspace specified in workspaceToCode call. Guessing."),i=A());var a=[];this.init(i),i=i.getTopBlocks(!0);for(let p=0,S;S=i[p];p++){let O=this.blockToCode(S);Array.isArray(O)&&(O=O[0]),O&&(S.outputConnection&&(O=this.scrubNakedValue(O),this.STATEMENT_PREFIX&&!S.suppressPrefixSuffix&&(O=this.injectId(this.STATEMENT_PREFIX,S)+O),this.STATEMENT_SUFFIX&&!S.suppressPrefixSuffix&&(O+=this.injectId(this.STATEMENT_SUFFIX,S))),a.push(O))}return a=a.join(` +`);var pn=class extends G_{constructor(i,a){super(i),this.flyout_=a}getBoundingBox_(){let i;try{i=this.workspace_.getCanvas().getBBox()}catch{i={height:0,y:0,width:0,x:0}}return i}getContentMetrics(i){const a=this.getBoundingBox_();return i=i?1:this.workspace_.scale,{height:a.height*i,width:a.width*i,top:a.y*i,left:a.x*i}}getScrollMetrics(i,a,p){return a=p||this.getContentMetrics(),p=this.flyout_.MARGIN*this.workspace_.scale,i=i?this.workspace_.scale:1,{height:(a.height+2*p)/i,width:(a.width+a.left+p)/i,top:0,left:0}}},Ln;(function(i){i.BLOCK="block",i.BUTTON="button"})(Ln||(Ln={}));var dn=class extends Hv{constructor(i){super(),this.horizontalLayout=!1,this.boundEvents=[],this.filterWrapper=this.reflowWrapper=null,this.mats=[],this.buttons_=[],this.listeners=[],this.permanentlyDisabled=[],this.recycledBlocks=[],this.autoClose=!0,this.isVisible_=!1,this.containerVisible=!0,this.CORNER_RADIUS=8,this.SCROLLBAR_MARGIN=2.5,this.height_=this.width_=0,this.dragAngleRange_=70,this.svgGroup_=this.svgBackground_=null,i.setMetrics=this.setMetrics_.bind(this),this.workspace_=new ep(i),this.workspace_.setMetricsManager(new pn(this.workspace_,this)),this.workspace_.internalIsFlyout=!0,this.workspace_.setVisible(this.isVisible_),this.id=q(),this.RTL=!!i.RTL,this.toolboxPosition_=i.toolboxPosition,this.tabWidth_=this.workspace_.getRenderer().getConstants().TAB_WIDTH,this.rectMap_=new WeakMap,this.MARGIN=this.CORNER_RADIUS,this.GAP_X=3*this.MARGIN,this.GAP_Y=3*this.MARGIN}createDom(i){return this.svgGroup_=ie(i,{class:"blocklyFlyout"}),this.svgGroup_.style.display="none",this.svgBackground_=ie(Ve.PATH,{class:"blocklyFlyoutBackground"},this.svgGroup_),this.svgGroup_.appendChild(this.workspace_.createDom()),this.workspace_.getThemeManager().subscribe(this.svgBackground_,"flyoutBackgroundColour","fill"),this.workspace_.getThemeManager().subscribe(this.svgBackground_,"flyoutOpacity","fill-opacity"),this.svgGroup_}init(i){this.targetWorkspace=i,this.workspace_.targetWorkspace=i,this.workspace_.scrollbar=new Cb(this.workspace_,this.horizontalLayout,!this.horizontalLayout,"blocklyFlyoutScrollbar",this.SCROLLBAR_MARGIN),this.hide(),this.boundEvents.push($e(this.svgGroup_,"wheel",this,this.wheel_)),this.filterWrapper=this.filterForCapacity.bind(this),this.targetWorkspace.addChangeListener(this.filterWrapper),this.boundEvents.push($e(this.svgBackground_,"pointerdown",this,this.onMouseDown)),this.workspace_.getGesture=this.targetWorkspace.getGesture.bind(this.targetWorkspace),this.workspace_.setVariableMap(this.targetWorkspace.getVariableMap()),this.workspace_.createPotentialVariableMap(),i.getComponentManager().addComponent({component:this,weight:1,capabilities:[gl.Capability.AUTOHIDEABLE,gl.Capability.DELETE_AREA,gl.Capability.DRAG_TARGET]})}dispose(){this.hide(),this.targetWorkspace.getComponentManager().removeComponent(this.id);for(const i of this.boundEvents)it(i);this.boundEvents.length=0,this.filterWrapper&&this.targetWorkspace.removeChangeListener(this.filterWrapper),this.workspace_&&(this.workspace_.getThemeManager().unsubscribe(this.svgBackground_),this.workspace_.dispose()),this.svgGroup_&&mt(this.svgGroup_)}getWidth(){return this.width_}getHeight(){return this.height_}getFlyoutScale(){return this.targetWorkspace.scale}getWorkspace(){return this.workspace_}setAutoClose(i){this.autoClose=i,this.targetWorkspace.recordDragTargets(),this.targetWorkspace.resizeContents()}autoHide(i){!i&&this.targetWorkspace.getFlyout(!0)===this&&this.autoClose&&this.hide()}isVisible(){return this.isVisible_}setVisible(i){const a=i!==this.isVisible();this.isVisible_=i,a&&(this.autoClose||this.targetWorkspace.recordDragTargets(),this.updateDisplay())}setContainerVisible(i){const a=i!==this.containerVisible;this.containerVisible=i,a&&this.updateDisplay()}updateDisplay(){let i;i=this.containerVisible?this.isVisible():!1,this.svgGroup_&&(this.svgGroup_.style.display=i?"block":"none");let a;(a=this.workspace_.scrollbar)==null||a.setContainerVisible(i)}positionAt_(i,a,p,S){let O;(O=this.svgGroup_)==null||O.setAttribute("width",`${i}`);let j;(j=this.svgGroup_)==null||j.setAttribute("height",`${a}`),this.workspace_.setCachedParentSvgSize(i,a),this.svgGroup_&&Q(this.svgGroup_,"translate("+p+"px,"+S+"px)"),(i=this.workspace_.scrollbar)&&(i.setOrigin(p,S),i.resize(),i.hScroll&&i.hScroll.setPosition(i.hScroll.position.x,i.hScroll.position.y),i.vScroll&&i.vScroll.setPosition(i.vScroll.position.x,i.vScroll.position.y))}hide(){if(this.isVisible()){this.setVisible(!1);for(const i of this.listeners)it(i);this.listeners.length=0,this.reflowWrapper&&(this.workspace_.removeChangeListener(this.reflowWrapper),this.reflowWrapper=null)}}show(i){this.workspace_.setResizesEnabled(!1),this.hide(),this.clearOldBlocks(),typeof i=="string"&&(i=this.getDynamicCategoryContents(i)),this.setVisible(!0),i=bt(i),i=this.createFlyoutInfo(i),xi(this.workspace_),this.layout_(i.contents,i.gaps),this.horizontalLayout?this.height_=0:this.width_=0,this.workspace_.setResizesEnabled(!0),this.reflow(),this.filterForCapacity(),this.position(),this.reflowWrapper=this.reflow.bind(this),this.workspace_.addChangeListener(this.reflowWrapper),this.emptyRecycledBlocks()}createFlyoutInfo(i){const a=[],p=[];this.permanentlyDisabled.length=0;const S=this.horizontalLayout?this.GAP_X:this.GAP_Y;for(const O of i){if("custom"in O){i=this.getDynamicCategoryContents(O.custom),i=bt(i);const{contents:j,gaps:ve}=this.createFlyoutInfo(i);a.push(...j),p.push(...ve)}switch(O.kind.toUpperCase()){case"BLOCK":i=O;const j=this.createFlyoutBlock(i);a.push({type:Ln.BLOCK,block:j}),this.addBlockGap(i,p,S);break;case"SEP":this.addSeparatorGap(O,p,S);break;case"LABEL":i=this.createButton(O,!0),a.push({type:Ln.BUTTON,button:i}),p.push(S);break;case"BUTTON":i=this.createButton(O,!1),a.push({type:Ln.BUTTON,button:i}),p.push(S)}}return{contents:a,gaps:p}}getDynamicCategoryContents(i){if(i=this.workspace_.targetWorkspace.getToolboxCategoryCallback(i),typeof i!="function")throw TypeError("Couldn't find a callback function when opening a toolbox category.");return i(this.workspace_.targetWorkspace)}createButton(i,a){return new Kt(this.workspace_,this.targetWorkspace,i,a)}createFlyoutBlock(i){let a;return i.blockxml?(i=typeof i.blockxml=="string"?t.textToDom$$module$build$src$core$utils$xml(i.blockxml):i.blockxml,(a=this.getRecycledBlock(i.getAttribute("type")))||(a=io(i,this.workspace_))):(a=this.getRecycledBlock(i.type),a||(i.enabled===void 0&&(i.enabled=i.disabled!=="true"&&i.disabled!==!0),a=Mi(i,this.workspace_))),a.isEnabled()||this.permanentlyDisabled.push(a),a}getRecycledBlock(i){let a=-1;for(let p=0;p{this.targetWorkspace.isDragging()||a.addSelect()})),this.listeners.push(He(i,"pointerleave",a,()=>{this.targetWorkspace.isDragging()||a.removeSelect()})),this.listeners.push(He(p,"pointerenter",a,()=>{this.targetWorkspace.isDragging()||a.addSelect()})),this.listeners.push(He(p,"pointerleave",a,()=>{this.targetWorkspace.isDragging()||a.removeSelect()}))}blockMouseDown(i){return a=>{const p=this.targetWorkspace.getGesture(a);p&&(p.setStartBlock(i),p.handleFlyoutStart(a,this))}}onMouseDown(i){const a=this.targetWorkspace.getGesture(i);a&&a.handleFlyoutStart(i,this)}isBlockCreatable(i){return i.isEnabled()}createBlock(i){let a=null;t.disable$$module$build$src$core$events$utils();var p=this.targetWorkspace.getAllVariables();this.targetWorkspace.setResizesEnabled(!1);try{a=this.placeNewBlock(i)}finally{t.enable$$module$build$src$core$events$utils()}if(this.targetWorkspace.hideChaff(),i=Xl(this.targetWorkspace,p),se()){for(t.setGroup$$module$build$src$core$events$utils(!0),p=0;p90-a||i>-90-a&&i<-90+a}getClientRect(){if(!this.svgGroup_||this.autoClose||!this.isVisible())return null;const i=this.svgGroup_.getBoundingClientRect(),a=i.top;return this.toolboxPosition_===dr.TOP?new Oi(-1e9,a+i.height,-1e9,1e9):new Oi(a,1e9,-1e9,1e9)}reflowInternal_(){this.workspace_.scale=this.getFlyoutScale();let i=0;const a=this.workspace_.getTopBlocks(!1);for(let S=0,O;O=a[S];S++)i=Math.max(i,O.getHeightWidth().height);const p=this.buttons_;for(let S=0,O;O=p[S];S++)i=Math.max(i,O.height);if(i+=1.5*this.MARGIN,i*=this.workspace_.scale,i+=xa.scrollbarThickness,this.height_!==i){for(let S=0,O;O=a[S];S++)this.rectMap_.has(O)&&this.moveRectToBlock_(this.rectMap_.get(O),O);this.targetWorkspace.scrollbar||this.autoClose||this.targetWorkspace.getFlyout()!==this||this.toolboxPosition_!==dr.TOP||this.targetWorkspace.translate(this.targetWorkspace.scrollX,this.targetWorkspace.scrollY+i),this.height_=i,this.position(),this.targetWorkspace.resizeContents(),this.targetWorkspace.recordDragTargets()}}};r(Ft.FLYOUTS_HORIZONTAL_TOOLBOX,Nl,Yn);var er=class extends dn{constructor(i){super(i)}setMetrics_(i){if(this.isVisible()){var a=this.workspace_.getMetricsManager(),p=a.getScrollMetrics(),S=a.getViewMetrics();a=a.getAbsoluteMetrics(),typeof i.y=="number"&&(this.workspace_.scrollY=-(p.top+(p.height-S.height)*i.y)),this.workspace_.translate(this.workspace_.scrollX+a.left,this.workspace_.scrollY+a.top)}}getX(){if(!this.isVisible())return 0;var i=this.targetWorkspace.getMetricsManager();const a=i.getAbsoluteMetrics(),p=i.getViewMetrics();return i=i.getToolboxMetrics(),this.targetWorkspace.toolboxPosition===this.toolboxPosition_?this.targetWorkspace.getToolbox()?this.toolboxPosition_===dr.LEFT?i.width:p.width-this.width_:this.toolboxPosition_===dr.LEFT?0:p.width:this.toolboxPosition_===dr.LEFT?0:p.width+a.left-this.width_}getY(){return 0}position(){if(this.isVisible()&&this.targetWorkspace.isVisible()){var i=this.targetWorkspace.getMetricsManager().getViewMetrics();this.height_=i.height,this.setBackgroundPath(this.width_-this.CORNER_RADIUS,i.height-2*this.CORNER_RADIUS),i=this.getX();var a=this.getY();this.positionAt_(this.width_,this.height_,i,a)}}setBackgroundPath(i,a){const p=this.toolboxPosition_===dr.RIGHT;var S=i+this.CORNER_RADIUS;S=["M "+(p?S:0)+",0"],S.push("h",p?-i:i),S.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,p?0:1,p?-this.CORNER_RADIUS:this.CORNER_RADIUS,this.CORNER_RADIUS),S.push("v",Math.max(0,a)),S.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,p?0:1,p?this.CORNER_RADIUS:-this.CORNER_RADIUS,this.CORNER_RADIUS),S.push("h",p?i:-i),S.push("z"),this.svgBackground_.setAttribute("d",S.join(" "))}scrollToStart(){let i;(i=this.workspace_.scrollbar)==null||i.setY(0)}wheel_(i){var a=vt(i);if(a.y){const p=this.workspace_.getMetricsManager(),S=p.getScrollMetrics();a=p.getViewMetrics().top-S.top+a.y;let O;(O=this.workspace_.scrollbar)==null||O.setY(a),Ql(),al()}i.preventDefault(),i.stopPropagation()}layout_(i,a){this.workspace_.scale=this.targetWorkspace.scale;var p=this.MARGIN;const S=this.RTL?p:p+this.tabWidth_;for(let Ue=0,Yt;Yt=i[Ue];Ue++)if(Yt.type==="block"){var O=Yt.block,j=O.getDescendants(!1);for(let bl=0,Qa;Qa=j[bl];bl++)Qa.isInFlyout=!0;j=O.getSvgRoot();const jn=O.getHeightWidth();var ve=O.outputConnection?S-this.tabWidth_:S;O.moveBy(ve,p),ve=this.createRect_(O,this.RTL?ve-jn.width:ve,p,jn,Ue),this.addBlockListeners_(j,O,ve),p+=jn.height+a[Ue]}else Yt.type==="button"&&(O=Yt.button,this.initFlyoutButton_(O,S,p),p+=O.height+a[Ue])}isDragTowardWorkspace(i){i=Math.atan2(i.y,i.x)/Math.PI*180;const a=this.dragAngleRange_;return i-a||i<-180+a||i>180-a}getClientRect(){if(!this.svgGroup_||this.autoClose||!this.isVisible())return null;const i=this.svgGroup_.getBoundingClientRect(),a=i.left;return this.toolboxPosition_===dr.LEFT?new Oi(-1e9,1e9,-1e9,a+i.width):new Oi(-1e9,1e9,a,1e9)}reflowInternal_(){this.workspace_.scale=this.getFlyoutScale();let i=0;var a=this.workspace_.getTopBlocks(!1);for(let S=0,O;O=a[S];S++){var p=O.getHeightWidth().width;O.outputConnection&&(p-=this.tabWidth_),i=Math.max(i,p)}for(let S=0,O;O=this.buttons_[S];S++)i=Math.max(i,O.width);if(i+=1.5*this.MARGIN+this.tabWidth_,i*=this.workspace_.scale,i+=xa.scrollbarThickness,this.width_!==i){for(let S=0,O;O=a[S];S++){if(this.RTL){p=O.getRelativeToSurfaceXY().x;let j=i/this.workspace_.scale-this.MARGIN;O.outputConnection||(j-=this.tabWidth_),O.moveBy(j-p,0)}this.rectMap_.has(O)&&this.moveRectToBlock_(this.rectMap_.get(O),O)}if(this.RTL)for(let S=0,O;O=this.buttons_[S];S++)a=O.getPosition().y,O.moveTo(i/this.workspace_.scale-O.width-this.MARGIN-this.tabWidth_,a);this.targetWorkspace.scrollbar||this.autoClose||this.targetWorkspace.getFlyout()!==this||this.toolboxPosition_!==dr.LEFT||this.targetWorkspace.translate(this.targetWorkspace.scrollX+i,this.targetWorkspace.scrollY),this.width_=i,this.position(),this.targetWorkspace.resizeContents(),this.targetWorkspace.recordDragTargets()}}};er.registryName="verticalFlyout",r(Ft.FLYOUTS_VERTICAL_TOOLBOX,Nl,er);var la;t.CodeGenerator$$module$build$src$core$generator=class{constructor(i){this.forBlock=Object.create(null),this.FUNCTION_NAME_PLACEHOLDER_="{leCUI8hutHZI4480Dc}",this.STATEMENT_SUFFIX=this.STATEMENT_PREFIX=this.INFINITE_LOOP_TRAP=null,this.INDENT=" ",this.COMMENT_WRAP=60,this.ORDER_OVERRIDES=[],this.isInitialized=null,this.RESERVED_WORDS_="",this.definitions_=Object.create(null),this.functionNames_=Object.create(null),this.nameDB_=void 0,this.name_=i,this.FUNCTION_NAME_PLACEHOLDER_REGEXP_=new RegExp(this.FUNCTION_NAME_PLACEHOLDER_,"g")}workspaceToCode(i){i||(console.warn("No workspace specified in workspaceToCode call. Guessing."),i=A());var a=[];this.init(i),i=i.getTopBlocks(!0);for(let p=0,S;S=i[p];p++){let O=this.blockToCode(S);Array.isArray(O)&&(O=O[0]),O&&(S.outputConnection&&(O=this.scrubNakedValue(O),this.STATEMENT_PREFIX&&!S.suppressPrefixSuffix&&(O=this.injectId(this.STATEMENT_PREFIX,S)+O),this.STATEMENT_SUFFIX&&!S.suppressPrefixSuffix&&(O+=this.injectId(this.STATEMENT_SUFFIX,S))),a.push(O))}return a=a.join(` `),a=this.finish(a),a=a.replace(/^\s+\n/,""),a=a.replace(/\n\s+$/,` `),a=a.replace(/[ \t]+\n/g,` `)}prefixLines(i,a){return a+i.replace(/(?!\n$)\n/g,` `+a)}allNestedComments(i){const a=[];i=i.getDescendants(!0);for(let p=0;p{S==null||S.positionNearConnection(O,j,ve),S==null||S.getSvgRoot().setAttribute("visibility","visible")}),O}createInsertionMarker(i){const a=this.workspace.newBlock(i.type);if(a.setInsertionMarker(!0),i.saveExtraState){var p=i.saveExtraState(!0);p&&a.loadExtraState&&a.loadExtraState(p)}else i.mutationToDom&&(p=i.mutationToDom())&&a.domToMutation&&a.domToMutation(p);for(p=0;p.blocklyPathLight,`,`${i} .blocklyInsertionMarker>.blocklyPathDark {`,`fill-opacity: ${this.INSERTION_MARKER_OPACITY};`,"stroke: none;","}"])}},Yv=class{constructor(i){this.inlineSteps_=this.steps_="",this.info_=i,this.RTL_=this.info_.RTL,i=i.getRenderer(),this.constants_=i.getConstants(),this.highlightConstants_=i.getHighlightConstants(),this.highlightOffset=this.highlightConstants_.OFFSET,this.outsideCornerPaths_=this.highlightConstants_.OUTSIDE_CORNER,this.insideCornerPaths_=this.highlightConstants_.INSIDE_CORNER,this.puzzleTabPaths_=this.highlightConstants_.PUZZLE_TAB,this.notchPaths_=this.highlightConstants_.NOTCH,this.startPaths_=this.highlightConstants_.START_HAT,this.jaggedTeethPaths_=this.highlightConstants_.JAGGED_TEETH}getPath(){return this.steps_+` -`+this.inlineSteps_}drawTopCorner(i){this.steps_+=Ui(i.xPos,this.info_.startY);for(let a=0,p;p=i.elements[a];a++)ut.isLeftSquareCorner(p)?this.steps_+=this.highlightConstants_.START_POINT:ut.isLeftRoundedCorner(p)?this.steps_+=this.outsideCornerPaths_.topLeft(this.RTL_):ut.isPreviousConnection(p)?this.steps_+=this.notchPaths_.pathLeft:ut.isHat(p)?this.steps_+=this.startPaths_.path(this.RTL_):ut.isSpacer(p)&&p.width!==0&&(this.steps_+=xn("H",p.xPos+p.width-this.highlightOffset));this.steps_+=xn("H",i.xPos+i.width-this.highlightOffset)}drawJaggedEdge_(i){this.info_.RTL&&(this.steps_+=this.jaggedTeethPaths_.pathLeft+xn("v",i.height-this.jaggedTeethPaths_.height-this.highlightOffset))}drawValueInput(i){const a=i.getLastInput();if(this.RTL_){const p=i.height-a.connectionHeight;this.steps_+=Js(a.xPos+a.width-this.highlightOffset,i.yPos)+this.puzzleTabPaths_.pathDown(this.RTL_)+xn("v",p)}else this.steps_+=Js(a.xPos+a.width,i.yPos)+this.puzzleTabPaths_.pathDown(this.RTL_)}drawStatementInput(i){const a=i.getLastInput();if(a)if(this.RTL_){const p=i.height-2*this.insideCornerPaths_.height;this.steps_+=Js(a.xPos,i.yPos)+this.insideCornerPaths_.pathTop(this.RTL_)+xn("v",p)+this.insideCornerPaths_.pathBottom(this.RTL_)+iu(i.width-a.xPos-this.insideCornerPaths_.width,0)}else this.steps_+=Js(a.xPos,i.yPos+i.height)+this.insideCornerPaths_.pathBottom(this.RTL_)+iu(i.width-a.xPos-this.insideCornerPaths_.width,0)}drawRightSideRow(i){const a=i.xPos+i.width-this.highlightOffset;i instanceof fb&&i.followsStatement&&(this.steps_+=xn("H",a)),this.RTL_&&(this.steps_+=xn("H",a),i.height>this.highlightOffset&&(this.steps_+=xn("V",i.yPos+i.height-this.highlightOffset)))}drawBottomRow(i){if(this.RTL_)this.steps_+=xn("V",i.baseline-this.highlightOffset);else{const a=this.info_.bottomRow.elements[0];ut.isLeftSquareCorner(a)?this.steps_+=Js(i.xPos+this.highlightOffset,i.baseline-this.highlightOffset):ut.isLeftRoundedCorner(a)&&(this.steps_+=Js(i.xPos,i.baseline),this.steps_+=this.outsideCornerPaths_.bottomLeft())}}drawLeft(){var i=this.info_.outputConnection;i&&(i=i.connectionOffsetY+i.height,this.RTL_?this.steps_+=Js(this.info_.startX,i):(this.steps_+=Js(this.info_.startX+this.highlightOffset,this.info_.bottomRow.baseline-this.highlightOffset),this.steps_+=xn("V",i)),this.steps_+=this.puzzleTabPaths_.pathUp(this.RTL_)),this.RTL_||(i=this.info_.topRow,ut.isLeftRoundedCorner(i.elements[0])?this.steps_+=xn("V",this.outsideCornerPaths_.height):this.steps_+=xn("V",i.capline+this.highlightOffset))}drawInlineInput(i){const a=this.highlightOffset,p=i.xPos+i.connectionWidth;var S=i.centerline-i.height/2;const O=i.width-i.connectionWidth,j=S+a;this.RTL_?(S=i.connectionOffsetY-a,i=i.height-(i.connectionOffsetY+i.connectionHeight)+a,this.inlineSteps_+=Js(p-a,j)+xn("v",S)+this.puzzleTabPaths_.pathDown(this.RTL_)+xn("v",i)+xn("h",O)):this.inlineSteps_+=Js(i.xPos+i.width+a,j)+xn("v",i.height)+xn("h",-O)+Js(p,S+i.connectionOffsetY)+this.puzzleTabPaths_.pathDown(this.RTL_)}},cz=class extends L_{constructor(i,a){super(i,a),this.highlighter_=new Yv(a)}draw(){this.drawOutline_(),this.drawInternals_(),this.updateConnectionHighlights();const i=this.block_.pathObject;i.setPath(this.outlinePath_+` -`+this.inlinePath_),i.setHighlightPath(this.highlighter_.getPath()),this.info_.RTL&&i.flipRTL(),this.recordSizeOnBlock_()}drawTop_(){this.highlighter_.drawTopCorner(this.info_.topRow),this.highlighter_.drawRightSideRow(this.info_.topRow),super.drawTop_()}drawJaggedEdge_(i){this.highlighter_.drawJaggedEdge_(i),super.drawJaggedEdge_(i)}drawValueInput_(i){this.highlighter_.drawValueInput(i),super.drawValueInput_(i)}drawStatementInput_(i){this.highlighter_.drawStatementInput(i),super.drawStatementInput_(i)}drawRightSideRow_(i){this.highlighter_.drawRightSideRow(i),this.outlinePath_+=xn("H",i.xPos+i.width)+xn("V",i.yPos+i.height)}drawBottom_(){this.highlighter_.drawBottomRow(this.info_.bottomRow),super.drawBottom_()}drawLeft_(){this.highlighter_.drawLeft(),super.drawLeft_()}drawInlineInput_(i){this.highlighter_.drawInlineInput(i),super.drawInlineInput_(i)}positionInlineInputConnection_(i){const a=i.centerline-i.height/2;if(i.connectionModel){let p=i.xPos+i.connectionWidth+this.constants_.DARK_PATH_OFFSET;this.info_.RTL&&(p*=-1),i.connectionModel.setOffsetInBlock(p,a+i.connectionOffsetY+this.constants_.DARK_PATH_OFFSET)}}positionStatementInputConnection_(i){const a=i.getLastInput();if(a!=null&&a.connectionModel){let p=i.xPos+i.statementEdge+a.notchOffset;p=this.info_.RTL?-1*p:p+this.constants_.DARK_PATH_OFFSET,a.connectionModel.setOffsetInBlock(p,i.yPos+this.constants_.DARK_PATH_OFFSET)}}positionExternalValueConnection_(i){const a=i.getLastInput();if(a&&a.connectionModel){let p=i.xPos+i.width+this.constants_.DARK_PATH_OFFSET;this.info_.RTL&&(p*=-1),a.connectionModel.setOffsetInBlock(p,i.yPos)}}positionNextConnection_(){const i=this.info_.bottomRow;if(i.connection){const a=i.connection,p=a.xPos;a.connectionModel.setOffsetInBlock((this.info_.RTL?-p:p)+this.constants_.DARK_PATH_OFFSET/2,i.baseline+this.constants_.DARK_PATH_OFFSET)}}},hz=class{constructor(i){this.OFFSET=.5,this.constantProvider=i,this.START_POINT=Ui(this.OFFSET,this.OFFSET)}init(){this.INSIDE_CORNER=this.makeInsideCorner(),this.OUTSIDE_CORNER=this.makeOutsideCorner(),this.PUZZLE_TAB=this.makePuzzleTab(),this.NOTCH=this.makeNotch(),this.JAGGED_TEETH=this.makeJaggedTeeth(),this.START_HAT=this.makeStartHat()}makeInsideCorner(){const i=this.constantProvider.CORNER_RADIUS,a=this.OFFSET,p=(1-Math.SQRT1_2)*(i+a)-a,S=Ui(p,p)+mi("a","0 0,0",i,Kn(-p-a,i-p)),O=mi("a","0 0,0",i+a,Kn(i+a,i+a)),j=Ui(p,-p)+mi("a","0 0,0",i+a,Kn(i-p,p+a));return{width:i+a,height:i,pathTop(ve){return ve?S:""},pathBottom(ve){return ve?O:j}}}makeOutsideCorner(){const i=this.constantProvider.CORNER_RADIUS,a=this.OFFSET,p=(1-Math.SQRT1_2)*(i-a)+a,S=Ui(p,p)+mi("a","0 0,1",i-a,Kn(i-p,-p+a)),O=Ui(a,i)+mi("a","0 0,1",i-a,Kn(i,-i+a)),j=-p,ve=Ui(p,j)+mi("a","0 0,1",i-a,Kn(-p+a,-j-i));return{height:i,topLeft(Ue){return Ue?S:O},bottomLeft(){return ve}}}makePuzzleTab(){const i=this.constantProvider.TAB_WIDTH,a=this.constantProvider.TAB_HEIGHT,p=Ui(-2,-a+3.4)+iu(-.45*i,-2.1),S=xn("v",2.5)+Ui(.97*-i,2.5)+Ws("q",[Kn(.05*-i,10),Kn(.3*i,9.5)])+Ui(.67*i,-1.9)+xn("v",2.5),O=xn("v",-1.5)+Ui(-.92*i,-.5)+Ws("q",[Kn(-.19*i,-5.5),Kn(0,-11)])+Ui(.92*i,1),j=Ui(-5,a-.7)+iu(.46*i,-2.1);return{width:i,height:a,pathUp(ve){return ve?p:O},pathDown(ve){return ve?S:j}}}makeNotch(){return{pathLeft:xn("h",this.OFFSET)+this.constantProvider.NOTCH.pathLeft}}makeJaggedTeeth(){return{pathLeft:iu(5.1,2.6)+Ui(-10.2,6.8)+iu(5.1,2.6),height:12,width:10.2}}makeStartHat(){const i=this.constantProvider.START_HAT.height,a=Ui(25,-8.7)+Ws("c",[Kn(29.7,-6.2),Kn(57.2,-.5),Kn(75,8.7)]),p=Ws("c",[Kn(17.8,-9.2),Kn(45.3,-14.9),Kn(75,-8.7)])+Js(100.5,i+.5);return{path(S){return S?a:p}}}},dz=class extends hb{constructor(i,a){super(i,a),this.constants_=i,this.connectedBlock&&(this.width+=this.constants_.DARK_PATH_OFFSET,this.height+=this.constants_.DARK_PATH_OFFSET)}},fz=class extends k_{constructor(i,a){super(i,a),this.constants_=i,this.connectedBlock&&(this.height+=this.constants_.DARK_PATH_OFFSET)}},pz=class extends k0{constructor(i,a){super(i,a),this.renderer_=i}getRenderer(){return this.renderer_}populateBottomRow_(){super.populateBottomRow_(),this.block_.inputList.length&&this.block_.inputList[this.block_.inputList.length-1]instanceof id||(this.bottomRow.minHeight=this.constants_.MEDIUM_PADDING-this.constants_.DARK_PATH_OFFSET)}addInput_(i,a){this.isInline&&i instanceof t.ValueInput$$module$build$src$core$inputs$value_input?(a.elements.push(new dz(this.constants_,i)),a.hasInlineInput=!0):i instanceof id?(a.elements.push(new fz(this.constants_,i)),a.hasStatement=!0):i instanceof t.ValueInput$$module$build$src$core$inputs$value_input?(a.elements.push(new Fv(this.constants_,i)),a.hasExternalInput=!0):(i instanceof Np||i instanceof Tm)&&(a.minHeight=Math.max(a.minHeight,this.constants_.DUMMY_INPUT_MIN_HEIGHT),a.hasDummyInput=!0),this.isInline||a.align!==null||(a.align=i.align)}addElemSpacing_(){let i=!1;for(let p=0,S;S=this.rows[p];p++)S.hasExternalInput&&(i=!0);for(let p=0,S;S=this.rows[p];p++){var a=S.elements;if(S.elements=[],S.startsWithElemSpacer()&&S.elements.push(new qd(this.constants_,this.getInRowSpacing_(null,a[0]))),a.length){for(let O=0;Othis.highlightOffset&&(this.steps_+=$n("V",i.yPos+i.height-this.highlightOffset)))}drawBottomRow(i){if(this.RTL_)this.steps_+=$n("V",i.baseline-this.highlightOffset);else{const a=this.info_.bottomRow.elements[0];ct.isLeftSquareCorner(a)?this.steps_+=Js(i.xPos+this.highlightOffset,i.baseline-this.highlightOffset):ct.isLeftRoundedCorner(a)&&(this.steps_+=Js(i.xPos,i.baseline),this.steps_+=this.outsideCornerPaths_.bottomLeft())}}drawLeft(){var i=this.info_.outputConnection;i&&(i=i.connectionOffsetY+i.height,this.RTL_?this.steps_+=Js(this.info_.startX,i):(this.steps_+=Js(this.info_.startX+this.highlightOffset,this.info_.bottomRow.baseline-this.highlightOffset),this.steps_+=$n("V",i)),this.steps_+=this.puzzleTabPaths_.pathUp(this.RTL_)),this.RTL_||(i=this.info_.topRow,ct.isLeftRoundedCorner(i.elements[0])?this.steps_+=$n("V",this.outsideCornerPaths_.height):this.steps_+=$n("V",i.capline+this.highlightOffset))}drawInlineInput(i){const a=this.highlightOffset,p=i.xPos+i.connectionWidth;var S=i.centerline-i.height/2;const O=i.width-i.connectionWidth,j=S+a;this.RTL_?(S=i.connectionOffsetY-a,i=i.height-(i.connectionOffsetY+i.connectionHeight)+a,this.inlineSteps_+=Js(p-a,j)+$n("v",S)+this.puzzleTabPaths_.pathDown(this.RTL_)+$n("v",i)+$n("h",O)):this.inlineSteps_+=Js(i.xPos+i.width+a,j)+$n("v",i.height)+$n("h",-O)+Js(p,S+i.connectionOffsetY)+this.puzzleTabPaths_.pathDown(this.RTL_)}},cz=class extends L_{constructor(i,a){super(i,a),this.highlighter_=new Yv(a)}draw(){this.drawOutline_(),this.drawInternals_(),this.updateConnectionHighlights();const i=this.block_.pathObject;i.setPath(this.outlinePath_+` +`+this.inlinePath_),i.setHighlightPath(this.highlighter_.getPath()),this.info_.RTL&&i.flipRTL(),this.recordSizeOnBlock_()}drawTop_(){this.highlighter_.drawTopCorner(this.info_.topRow),this.highlighter_.drawRightSideRow(this.info_.topRow),super.drawTop_()}drawJaggedEdge_(i){this.highlighter_.drawJaggedEdge_(i),super.drawJaggedEdge_(i)}drawValueInput_(i){this.highlighter_.drawValueInput(i),super.drawValueInput_(i)}drawStatementInput_(i){this.highlighter_.drawStatementInput(i),super.drawStatementInput_(i)}drawRightSideRow_(i){this.highlighter_.drawRightSideRow(i),this.outlinePath_+=$n("H",i.xPos+i.width)+$n("V",i.yPos+i.height)}drawBottom_(){this.highlighter_.drawBottomRow(this.info_.bottomRow),super.drawBottom_()}drawLeft_(){this.highlighter_.drawLeft(),super.drawLeft_()}drawInlineInput_(i){this.highlighter_.drawInlineInput(i),super.drawInlineInput_(i)}positionInlineInputConnection_(i){const a=i.centerline-i.height/2;if(i.connectionModel){let p=i.xPos+i.connectionWidth+this.constants_.DARK_PATH_OFFSET;this.info_.RTL&&(p*=-1),i.connectionModel.setOffsetInBlock(p,a+i.connectionOffsetY+this.constants_.DARK_PATH_OFFSET)}}positionStatementInputConnection_(i){const a=i.getLastInput();if(a!=null&&a.connectionModel){let p=i.xPos+i.statementEdge+a.notchOffset;p=this.info_.RTL?-1*p:p+this.constants_.DARK_PATH_OFFSET,a.connectionModel.setOffsetInBlock(p,i.yPos+this.constants_.DARK_PATH_OFFSET)}}positionExternalValueConnection_(i){const a=i.getLastInput();if(a&&a.connectionModel){let p=i.xPos+i.width+this.constants_.DARK_PATH_OFFSET;this.info_.RTL&&(p*=-1),a.connectionModel.setOffsetInBlock(p,i.yPos)}}positionNextConnection_(){const i=this.info_.bottomRow;if(i.connection){const a=i.connection,p=a.xPos;a.connectionModel.setOffsetInBlock((this.info_.RTL?-p:p)+this.constants_.DARK_PATH_OFFSET/2,i.baseline+this.constants_.DARK_PATH_OFFSET)}}},hz=class{constructor(i){this.OFFSET=.5,this.constantProvider=i,this.START_POINT=Ui(this.OFFSET,this.OFFSET)}init(){this.INSIDE_CORNER=this.makeInsideCorner(),this.OUTSIDE_CORNER=this.makeOutsideCorner(),this.PUZZLE_TAB=this.makePuzzleTab(),this.NOTCH=this.makeNotch(),this.JAGGED_TEETH=this.makeJaggedTeeth(),this.START_HAT=this.makeStartHat()}makeInsideCorner(){const i=this.constantProvider.CORNER_RADIUS,a=this.OFFSET,p=(1-Math.SQRT1_2)*(i+a)-a,S=Ui(p,p)+mi("a","0 0,0",i,Kn(-p-a,i-p)),O=mi("a","0 0,0",i+a,Kn(i+a,i+a)),j=Ui(p,-p)+mi("a","0 0,0",i+a,Kn(i-p,p+a));return{width:i+a,height:i,pathTop(ve){return ve?S:""},pathBottom(ve){return ve?O:j}}}makeOutsideCorner(){const i=this.constantProvider.CORNER_RADIUS,a=this.OFFSET,p=(1-Math.SQRT1_2)*(i-a)+a,S=Ui(p,p)+mi("a","0 0,1",i-a,Kn(i-p,-p+a)),O=Ui(a,i)+mi("a","0 0,1",i-a,Kn(i,-i+a)),j=-p,ve=Ui(p,j)+mi("a","0 0,1",i-a,Kn(-p+a,-j-i));return{height:i,topLeft(Ue){return Ue?S:O},bottomLeft(){return ve}}}makePuzzleTab(){const i=this.constantProvider.TAB_WIDTH,a=this.constantProvider.TAB_HEIGHT,p=Ui(-2,-a+3.4)+iu(-.45*i,-2.1),S=$n("v",2.5)+Ui(.97*-i,2.5)+Ws("q",[Kn(.05*-i,10),Kn(.3*i,9.5)])+Ui(.67*i,-1.9)+$n("v",2.5),O=$n("v",-1.5)+Ui(-.92*i,-.5)+Ws("q",[Kn(-.19*i,-5.5),Kn(0,-11)])+Ui(.92*i,1),j=Ui(-5,a-.7)+iu(.46*i,-2.1);return{width:i,height:a,pathUp(ve){return ve?p:O},pathDown(ve){return ve?S:j}}}makeNotch(){return{pathLeft:$n("h",this.OFFSET)+this.constantProvider.NOTCH.pathLeft}}makeJaggedTeeth(){return{pathLeft:iu(5.1,2.6)+Ui(-10.2,6.8)+iu(5.1,2.6),height:12,width:10.2}}makeStartHat(){const i=this.constantProvider.START_HAT.height,a=Ui(25,-8.7)+Ws("c",[Kn(29.7,-6.2),Kn(57.2,-.5),Kn(75,8.7)]),p=Ws("c",[Kn(17.8,-9.2),Kn(45.3,-14.9),Kn(75,-8.7)])+Js(100.5,i+.5);return{path(S){return S?a:p}}}},dz=class extends hb{constructor(i,a){super(i,a),this.constants_=i,this.connectedBlock&&(this.width+=this.constants_.DARK_PATH_OFFSET,this.height+=this.constants_.DARK_PATH_OFFSET)}},fz=class extends k_{constructor(i,a){super(i,a),this.constants_=i,this.connectedBlock&&(this.height+=this.constants_.DARK_PATH_OFFSET)}},pz=class extends k0{constructor(i,a){super(i,a),this.renderer_=i}getRenderer(){return this.renderer_}populateBottomRow_(){super.populateBottomRow_(),this.block_.inputList.length&&this.block_.inputList[this.block_.inputList.length-1]instanceof id||(this.bottomRow.minHeight=this.constants_.MEDIUM_PADDING-this.constants_.DARK_PATH_OFFSET)}addInput_(i,a){this.isInline&&i instanceof t.ValueInput$$module$build$src$core$inputs$value_input?(a.elements.push(new dz(this.constants_,i)),a.hasInlineInput=!0):i instanceof id?(a.elements.push(new fz(this.constants_,i)),a.hasStatement=!0):i instanceof t.ValueInput$$module$build$src$core$inputs$value_input?(a.elements.push(new Fv(this.constants_,i)),a.hasExternalInput=!0):(i instanceof Np||i instanceof Tm)&&(a.minHeight=Math.max(a.minHeight,this.constants_.DUMMY_INPUT_MIN_HEIGHT),a.hasDummyInput=!0),this.isInline||a.align!==null||(a.align=i.align)}addElemSpacing_(){let i=!1;for(let p=0,S;S=this.rows[p];p++)S.hasExternalInput&&(i=!0);for(let p=0,S;S=this.rows[p];p++){var a=S.elements;if(S.elements=[],S.startsWithElemSpacer()&&S.elements.push(new qd(this.constants_,this.getInRowSpacing_(null,a[0]))),a.length){for(let O=0;O>>/handdelete.cur"), auto; } @@ -808,22 +808,22 @@ Blockly.YourGeneratorName.nameDB_.setVariableMap(workspace.getVariableMap());`), .blocklyToolboxContents:focus { outline: none; } -`),r(Ft.TOOLBOX,Nl,wz);var Ate="10.4.3",Ite=t.Align$$module$build$src$core$inputs$align.LEFT,Rte=t.Align$$module$build$src$core$inputs$align.CENTRE,kte=t.Align$$module$build$src$core$inputs$align.RIGHT,Ote=Un.INPUT_VALUE,Lte=Un.OUTPUT_VALUE,Nte=Un.NEXT_STATEMENT,Dte=Un.PREVIOUS_STATEMENT,Pte=t.inputTypes$$module$build$src$core$inputs$input_types.DUMMY,Bte=dr.TOP,Fte=dr.BOTTOM,zte=dr.LEFT,Ute=dr.RIGHT;B_.prototype.newBlock=function(i,a){return new L0(this,i,a)},ep.prototype.newBlock=function(i,a){return new Dp(this,i,a)},ep.newTrashcan=function(i){return new RT(i)},zl.prototype.showContextMenu=function(i){if(!this.workspace.options.readOnly){var a=[];this.isDeletable()&&this.isMovable()&&(a.push(Uh(this)),a.push(eu(this))),Wu(i,a,this.RTL)}},_m.prototype.newWorkspaceSvg=function(i){return new ep(i)},t.Names$$module$build$src$core$names.prototype.populateProcedures=function(i){i=wh(i),i=i[0].concat(i[1]);for(let a=0;a{this.updateType_(te)}),this.appendValueInput("TEXT").appendField(Q,"TYPE"),this.setOutput(!0,"String"),this.setTooltip(()=>this.getFieldValue("TYPE")==="TEXT"?r.Msg$$module$build$src$core$msg.TEXT_PROMPT_TOOLTIP_TEXT:r.Msg$$module$build$src$core$msg.TEXT_PROMPT_TOOLTIP_NUMBER)}});var k=Object.assign({},A,{init:function(){this.mixin(L);var Q=[[r.Msg$$module$build$src$core$msg.TEXT_PROMPT_TYPE_TEXT,"TEXT"],[r.Msg$$module$build$src$core$msg.TEXT_PROMPT_TYPE_NUMBER,"NUMBER"]];this.setHelpUrl(r.Msg$$module$build$src$core$msg.TEXT_PROMPT_HELPURL),this.setStyle("text_blocks"),Q=r.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:Q}),Q.setValidator(te=>{this.updateType_(te)}),this.appendDummyInput().appendField(Q,"TYPE").appendField(this.newQuote_(!0)).appendField(r.fromJson$$module$build$src$core$field_registry({type:"field_input",text:""}),"TEXT").appendField(this.newQuote_(!1)),this.setOutput(!0,"String"),this.setTooltip(()=>this.getFieldValue("TYPE")==="TEXT"?r.Msg$$module$build$src$core$msg.TEXT_PROMPT_TOOLTIP_TEXT:r.Msg$$module$build$src$core$msg.TEXT_PROMPT_TOOLTIP_NUMBER)}});C.text_prompt=k,C.text_count={init:function(){this.jsonInit({message0:r.Msg$$module$build$src$core$msg.TEXT_COUNT_MESSAGE0,args0:[{type:"input_value",name:"SUB",check:"String"},{type:"input_value",name:"TEXT",check:"String"}],output:"Number",inputsInline:!0,style:"text_blocks",tooltip:r.Msg$$module$build$src$core$msg.TEXT_COUNT_TOOLTIP,helpUrl:r.Msg$$module$build$src$core$msg.TEXT_COUNT_HELPURL})}},C.text_replace={init:function(){this.jsonInit({message0:r.Msg$$module$build$src$core$msg.TEXT_REPLACE_MESSAGE0,args0:[{type:"input_value",name:"FROM",check:"String"},{type:"input_value",name:"TO",check:"String"},{type:"input_value",name:"TEXT",check:"String"}],output:"String",inputsInline:!0,style:"text_blocks",tooltip:r.Msg$$module$build$src$core$msg.TEXT_REPLACE_TOOLTIP,helpUrl:r.Msg$$module$build$src$core$msg.TEXT_REPLACE_HELPURL})}},C.text_reverse={init:function(){this.jsonInit({message0:r.Msg$$module$build$src$core$msg.TEXT_REVERSE_MESSAGE0,args0:[{type:"input_value",name:"TEXT",check:"String"}],output:"String",inputsInline:!0,style:"text_blocks",tooltip:r.Msg$$module$build$src$core$msg.TEXT_REVERSE_TOOLTIP,helpUrl:r.Msg$$module$build$src$core$msg.TEXT_REVERSE_HELPURL})}};var L={QUOTE_IMAGE_LEFT_DATAURI:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAn0lEQVQI1z3OMa5BURSF4f/cQhAKjUQhuQmFNwGJEUi0RKN5rU7FHKhpjEH3TEMtkdBSCY1EIv8r7nFX9e29V7EBAOvu7RPjwmWGH/VuF8CyN9/OAdvqIXYLvtRaNjx9mMTDyo+NjAN1HNcl9ZQ5oQMM3dgDUqDo1l8DzvwmtZN7mnD+PkmLa+4mhrxVA9fRowBWmVBhFy5gYEjKMfz9AylsaRRgGzvZAAAAAElFTkSuQmCC",QUOTE_IMAGE_RIGHT_DATAURI:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAqUlEQVQI1z3KvUpCcRiA8ef9E4JNHhI0aFEacm1o0BsI0Slx8wa8gLauoDnoBhq7DcfWhggONDmJJgqCPA7neJ7p934EOOKOnM8Q7PDElo/4x4lFb2DmuUjcUzS3URnGib9qaPNbuXvBO3sGPHJDRG6fGVdMSeWDP2q99FQdFrz26Gu5Tq7dFMzUvbXy8KXeAj57cOklgA+u1B5AoslLtGIHQMaCVnwDnADZIFIrXsoXrgAAAABJRU5ErkJggg==",QUOTE_IMAGE_WIDTH:12,QUOTE_IMAGE_HEIGHT:12,quoteField_:function(Q){for(let te=0,me;me=this.inputList[te];te++)for(let ke=0,Xe;Xe=me.fieldRow[ke];ke++)if(Q===Xe.name){me.insertFieldAt(ke,this.newQuote_(!0)),me.insertFieldAt(ke+2,this.newQuote_(!1));return}console.warn('field named "'+Q+'" not found in '+this.toDevString())},newQuote_:function(Q){return Q=this.RTL?!Q:Q,r.fromJson$$module$build$src$core$field_registry({type:"field_image",src:Q?this.QUOTE_IMAGE_LEFT_DATAURI:this.QUOTE_IMAGE_RIGHT_DATAURI,width:this.QUOTE_IMAGE_WIDTH,height:this.QUOTE_IMAGE_HEIGHT,alt:Q?"“":"”"})}},P=function(){this.mixin(L),this.quoteField_("TEXT")},D={itemCount_:0,mutationToDom:function(){const Q=r.createElement$$module$build$src$core$utils$xml("mutation");return Q.setAttribute("items",`${this.itemCount_}`),Q},domToMutation:function(Q){this.itemCount_=parseInt(Q.getAttribute("items"),10),this.updateShape_()},saveExtraState:function(){return{itemCount:this.itemCount_}},loadExtraState:function(Q){this.itemCount_=Q.itemCount,this.updateShape_()},decompose:function(Q){const te=Q.newBlock("text_create_join_container");te.initSvg();let me=te.getInput("STACK").connection;for(let ke=0;ker.Msg$$module$build$src$core$msg.TEXT_INDEXOF_TOOLTIP.replace("%1",this.workspace.options.oneBasedIndex?"0":"-1"))},V={isAt_:!1,mutationToDom:function(){const Q=r.createElement$$module$build$src$core$utils$xml("mutation");return Q.setAttribute("at",`${this.isAt_}`),Q},domToMutation:function(Q){Q=Q.getAttribute("at")!=="false",this.updateAt_(Q)},updateAt_:function(Q){this.removeInput("AT",!0),this.removeInput("ORDINAL",!0),Q&&(this.appendValueInput("AT").setCheck("Number"),r.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX&&this.appendDummyInput("ORDINAL").appendField(r.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX)),r.Msg$$module$build$src$core$msg.TEXT_CHARAT_TAIL&&(this.removeInput("TAIL",!0),this.appendDummyInput("TAIL").appendField(r.Msg$$module$build$src$core$msg.TEXT_CHARAT_TAIL)),this.isAt_=Q}},H=function(){this.getField("WHERE").setValidator(function(Q){Q=Q==="FROM_START"||Q==="FROM_END";const te=this.getSourceBlock();Q!==te.isAt_&&te.updateAt_(Q)}),this.updateAt_(!0),this.setTooltip(()=>{var Q=this.getFieldValue("WHERE");let te=r.Msg$$module$build$src$core$msg.TEXT_CHARAT_TOOLTIP;return(Q==="FROM_START"||Q==="FROM_END")&&(Q=Q==="FROM_START"?r.Msg$$module$build$src$core$msg.LISTS_INDEX_FROM_START_TOOLTIP:r.Msg$$module$build$src$core$msg.LISTS_INDEX_FROM_END_TOOLTIP)&&(te+=" "+Q.replace("%1",this.workspace.options.oneBasedIndex?"#1":"#0")),te})};r.register$$module$build$src$core$extensions("text_indexOf_tooltip",U),r.register$$module$build$src$core$extensions("text_quotes",P),r.registerMixin$$module$build$src$core$extensions("quote_image_mixin",L),r.registerMutator$$module$build$src$core$extensions("text_join_mutator",D,z),r.registerMutator$$module$build$src$core$extensions("text_charAt_mutator",V,H),r.defineBlocks$$module$build$src$core$common(C);var oe={blocks:C},le={},Z={setStatements_:function(Q){this.hasStatements_!==Q&&(Q?(this.appendStatementInput("STACK").appendField(r.Msg$$module$build$src$core$msg.PROCEDURES_DEFNORETURN_DO),this.getInput("RETURN")&&this.moveInputBefore("STACK","RETURN")):this.removeInput("STACK",!0),this.hasStatements_=Q)},updateParams_:function(){let Q="";this.arguments_.length&&(Q=r.Msg$$module$build$src$core$msg.PROCEDURES_BEFORE_PARAMS+" "+this.arguments_.join(", ")),r.disable$$module$build$src$core$events$utils();try{this.setFieldValue(Q,"PARAMS")}finally{r.enable$$module$build$src$core$events$utils()}},mutationToDom:function(Q){const te=r.createElement$$module$build$src$core$utils$xml("mutation");Q&&te.setAttribute("name",this.getFieldValue("NAME"));for(let me=0;me{this.updateType_(te)}),this.appendValueInput("TEXT").appendField(Q,"TYPE"),this.setOutput(!0,"String"),this.setTooltip(()=>this.getFieldValue("TYPE")==="TEXT"?r.Msg$$module$build$src$core$msg.TEXT_PROMPT_TOOLTIP_TEXT:r.Msg$$module$build$src$core$msg.TEXT_PROMPT_TOOLTIP_NUMBER)}});var k=Object.assign({},A,{init:function(){this.mixin(L);var Q=[[r.Msg$$module$build$src$core$msg.TEXT_PROMPT_TYPE_TEXT,"TEXT"],[r.Msg$$module$build$src$core$msg.TEXT_PROMPT_TYPE_NUMBER,"NUMBER"]];this.setHelpUrl(r.Msg$$module$build$src$core$msg.TEXT_PROMPT_HELPURL),this.setStyle("text_blocks"),Q=r.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:Q}),Q.setValidator(te=>{this.updateType_(te)}),this.appendDummyInput().appendField(Q,"TYPE").appendField(this.newQuote_(!0)).appendField(r.fromJson$$module$build$src$core$field_registry({type:"field_input",text:""}),"TEXT").appendField(this.newQuote_(!1)),this.setOutput(!0,"String"),this.setTooltip(()=>this.getFieldValue("TYPE")==="TEXT"?r.Msg$$module$build$src$core$msg.TEXT_PROMPT_TOOLTIP_TEXT:r.Msg$$module$build$src$core$msg.TEXT_PROMPT_TOOLTIP_NUMBER)}});C.text_prompt=k,C.text_count={init:function(){this.jsonInit({message0:r.Msg$$module$build$src$core$msg.TEXT_COUNT_MESSAGE0,args0:[{type:"input_value",name:"SUB",check:"String"},{type:"input_value",name:"TEXT",check:"String"}],output:"Number",inputsInline:!0,style:"text_blocks",tooltip:r.Msg$$module$build$src$core$msg.TEXT_COUNT_TOOLTIP,helpUrl:r.Msg$$module$build$src$core$msg.TEXT_COUNT_HELPURL})}},C.text_replace={init:function(){this.jsonInit({message0:r.Msg$$module$build$src$core$msg.TEXT_REPLACE_MESSAGE0,args0:[{type:"input_value",name:"FROM",check:"String"},{type:"input_value",name:"TO",check:"String"},{type:"input_value",name:"TEXT",check:"String"}],output:"String",inputsInline:!0,style:"text_blocks",tooltip:r.Msg$$module$build$src$core$msg.TEXT_REPLACE_TOOLTIP,helpUrl:r.Msg$$module$build$src$core$msg.TEXT_REPLACE_HELPURL})}},C.text_reverse={init:function(){this.jsonInit({message0:r.Msg$$module$build$src$core$msg.TEXT_REVERSE_MESSAGE0,args0:[{type:"input_value",name:"TEXT",check:"String"}],output:"String",inputsInline:!0,style:"text_blocks",tooltip:r.Msg$$module$build$src$core$msg.TEXT_REVERSE_TOOLTIP,helpUrl:r.Msg$$module$build$src$core$msg.TEXT_REVERSE_HELPURL})}};var L={QUOTE_IMAGE_LEFT_DATAURI:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAn0lEQVQI1z3OMa5BURSF4f/cQhAKjUQhuQmFNwGJEUi0RKN5rU7FHKhpjEH3TEMtkdBSCY1EIv8r7nFX9e29V7EBAOvu7RPjwmWGH/VuF8CyN9/OAdvqIXYLvtRaNjx9mMTDyo+NjAN1HNcl9ZQ5oQMM3dgDUqDo1l8DzvwmtZN7mnD+PkmLa+4mhrxVA9fRowBWmVBhFy5gYEjKMfz9AylsaRRgGzvZAAAAAElFTkSuQmCC",QUOTE_IMAGE_RIGHT_DATAURI:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAqUlEQVQI1z3KvUpCcRiA8ef9E4JNHhI0aFEacm1o0BsI0Slx8wa8gLauoDnoBhq7DcfWhggONDmJJgqCPA7neJ7p934EOOKOnM8Q7PDElo/4x4lFb2DmuUjcUzS3URnGib9qaPNbuXvBO3sGPHJDRG6fGVdMSeWDP2q99FQdFrz26Gu5Tq7dFMzUvbXy8KXeAj57cOklgA+u1B5AoslLtGIHQMaCVnwDnADZIFIrXsoXrgAAAABJRU5ErkJggg==",QUOTE_IMAGE_WIDTH:12,QUOTE_IMAGE_HEIGHT:12,quoteField_:function(Q){for(let te=0,pe;pe=this.inputList[te];te++)for(let Ae=0,Je;Je=pe.fieldRow[Ae];Ae++)if(Q===Je.name){pe.insertFieldAt(Ae,this.newQuote_(!0)),pe.insertFieldAt(Ae+2,this.newQuote_(!1));return}console.warn('field named "'+Q+'" not found in '+this.toDevString())},newQuote_:function(Q){return Q=this.RTL?!Q:Q,r.fromJson$$module$build$src$core$field_registry({type:"field_image",src:Q?this.QUOTE_IMAGE_LEFT_DATAURI:this.QUOTE_IMAGE_RIGHT_DATAURI,width:this.QUOTE_IMAGE_WIDTH,height:this.QUOTE_IMAGE_HEIGHT,alt:Q?"“":"”"})}},P=function(){this.mixin(L),this.quoteField_("TEXT")},D={itemCount_:0,mutationToDom:function(){const Q=r.createElement$$module$build$src$core$utils$xml("mutation");return Q.setAttribute("items",`${this.itemCount_}`),Q},domToMutation:function(Q){this.itemCount_=parseInt(Q.getAttribute("items"),10),this.updateShape_()},saveExtraState:function(){return{itemCount:this.itemCount_}},loadExtraState:function(Q){this.itemCount_=Q.itemCount,this.updateShape_()},decompose:function(Q){const te=Q.newBlock("text_create_join_container");te.initSvg();let pe=te.getInput("STACK").connection;for(let Ae=0;Aer.Msg$$module$build$src$core$msg.TEXT_INDEXOF_TOOLTIP.replace("%1",this.workspace.options.oneBasedIndex?"0":"-1"))},V={isAt_:!1,mutationToDom:function(){const Q=r.createElement$$module$build$src$core$utils$xml("mutation");return Q.setAttribute("at",`${this.isAt_}`),Q},domToMutation:function(Q){Q=Q.getAttribute("at")!=="false",this.updateAt_(Q)},updateAt_:function(Q){this.removeInput("AT",!0),this.removeInput("ORDINAL",!0),Q&&(this.appendValueInput("AT").setCheck("Number"),r.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX&&this.appendDummyInput("ORDINAL").appendField(r.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX)),r.Msg$$module$build$src$core$msg.TEXT_CHARAT_TAIL&&(this.removeInput("TAIL",!0),this.appendDummyInput("TAIL").appendField(r.Msg$$module$build$src$core$msg.TEXT_CHARAT_TAIL)),this.isAt_=Q}},H=function(){this.getField("WHERE").setValidator(function(Q){Q=Q==="FROM_START"||Q==="FROM_END";const te=this.getSourceBlock();Q!==te.isAt_&&te.updateAt_(Q)}),this.updateAt_(!0),this.setTooltip(()=>{var Q=this.getFieldValue("WHERE");let te=r.Msg$$module$build$src$core$msg.TEXT_CHARAT_TOOLTIP;return(Q==="FROM_START"||Q==="FROM_END")&&(Q=Q==="FROM_START"?r.Msg$$module$build$src$core$msg.LISTS_INDEX_FROM_START_TOOLTIP:r.Msg$$module$build$src$core$msg.LISTS_INDEX_FROM_END_TOOLTIP)&&(te+=" "+Q.replace("%1",this.workspace.options.oneBasedIndex?"#1":"#0")),te})};r.register$$module$build$src$core$extensions("text_indexOf_tooltip",U),r.register$$module$build$src$core$extensions("text_quotes",P),r.registerMixin$$module$build$src$core$extensions("quote_image_mixin",L),r.registerMutator$$module$build$src$core$extensions("text_join_mutator",D,z),r.registerMutator$$module$build$src$core$extensions("text_charAt_mutator",V,H),r.defineBlocks$$module$build$src$core$common(C);var oe={blocks:C},le={},Z={setStatements_:function(Q){this.hasStatements_!==Q&&(Q?(this.appendStatementInput("STACK").appendField(r.Msg$$module$build$src$core$msg.PROCEDURES_DEFNORETURN_DO),this.getInput("RETURN")&&this.moveInputBefore("STACK","RETURN")):this.removeInput("STACK",!0),this.hasStatements_=Q)},updateParams_:function(){let Q="";this.arguments_.length&&(Q=r.Msg$$module$build$src$core$msg.PROCEDURES_BEFORE_PARAMS+" "+this.arguments_.join(", ")),r.disable$$module$build$src$core$events$utils();try{this.setFieldValue(Q,"PARAMS")}finally{r.enable$$module$build$src$core$events$utils()}},mutationToDom:function(Q){const te=r.createElement$$module$build$src$core$utils$xml("mutation");Q&&te.setAttribute("name",this.getFieldValue("NAME"));for(let pe=0;pe","GT"],["‏≥","GTE"]]},{type:"input_value",name:"B"}],inputsInline:!0,output:"Boolean",style:"logic_blocks",helpUrl:"%{BKY_LOGIC_COMPARE_HELPURL}",extensions:["logic_compare","logic_op_tooltip"]},{type:"logic_operation",message0:"%1 %2 %3",args0:[{type:"input_value",name:"A",check:"Boolean"},{type:"field_dropdown",name:"OP",options:[["%{BKY_LOGIC_OPERATION_AND}","AND"],["%{BKY_LOGIC_OPERATION_OR}","OR"]]},{type:"input_value",name:"B",check:"Boolean"}],inputsInline:!0,output:"Boolean",style:"logic_blocks",helpUrl:"%{BKY_LOGIC_OPERATION_HELPURL}",extensions:["logic_op_tooltip"]},{type:"logic_negate",message0:"%{BKY_LOGIC_NEGATE_TITLE}",args0:[{type:"input_value",name:"BOOL",check:"Boolean"}],output:"Boolean",style:"logic_blocks",tooltip:"%{BKY_LOGIC_NEGATE_TOOLTIP}",helpUrl:"%{BKY_LOGIC_NEGATE_HELPURL}"},{type:"logic_null",message0:"%{BKY_LOGIC_NULL}",output:null,style:"logic_blocks",tooltip:"%{BKY_LOGIC_NULL_TOOLTIP}",helpUrl:"%{BKY_LOGIC_NULL_HELPURL}"},{type:"logic_ternary",message0:"%{BKY_LOGIC_TERNARY_CONDITION} %1",args0:[{type:"input_value",name:"IF",check:"Boolean"}],message1:"%{BKY_LOGIC_TERNARY_IF_TRUE} %1",args1:[{type:"input_value",name:"THEN"}],message2:"%{BKY_LOGIC_TERNARY_IF_FALSE} %1",args2:[{type:"input_value",name:"ELSE"}],output:null,style:"logic_blocks",tooltip:"%{BKY_LOGIC_TERNARY_TOOLTIP}",helpUrl:"%{BKY_LOGIC_TERNARY_HELPURL}",extensions:["logic_ternary"]},{type:"controls_if_if",message0:"%{BKY_CONTROLS_IF_IF_TITLE_IF}",nextStatement:null,enableContextMenu:!1,style:"logic_blocks",tooltip:"%{BKY_CONTROLS_IF_IF_TOOLTIP}"},{type:"controls_if_elseif",message0:"%{BKY_CONTROLS_IF_ELSEIF_TITLE_ELSEIF}",previousStatement:null,nextStatement:null,enableContextMenu:!1,style:"logic_blocks",tooltip:"%{BKY_CONTROLS_IF_ELSEIF_TOOLTIP}"},{type:"controls_if_else",message0:"%{BKY_CONTROLS_IF_ELSE_TITLE_ELSE}",previousStatement:null,enableContextMenu:!1,style:"logic_blocks",tooltip:"%{BKY_CONTROLS_IF_ELSE_TOOLTIP}"}]),Ce={EQ:"%{BKY_LOGIC_COMPARE_TOOLTIP_EQ}",NEQ:"%{BKY_LOGIC_COMPARE_TOOLTIP_NEQ}",LT:"%{BKY_LOGIC_COMPARE_TOOLTIP_LT}",LTE:"%{BKY_LOGIC_COMPARE_TOOLTIP_LTE}",GT:"%{BKY_LOGIC_COMPARE_TOOLTIP_GT}",GTE:"%{BKY_LOGIC_COMPARE_TOOLTIP_GTE}",AND:"%{BKY_LOGIC_OPERATION_TOOLTIP_AND}",OR:"%{BKY_LOGIC_OPERATION_TOOLTIP_OR}"};r.register$$module$build$src$core$extensions("logic_op_tooltip",r.buildTooltipForDropdown$$module$build$src$core$extensions("OP",Ce));var He={elseifCount_:0,elseCount_:0,mutationToDom:function(){if(!this.elseifCount_&&!this.elseCount_)return null;const Q=r.createElement$$module$build$src$core$utils$xml("mutation");return this.elseifCount_&&Q.setAttribute("elseif",String(this.elseifCount_)),this.elseCount_&&Q.setAttribute("else","1"),Q},domToMutation:function(Q){this.elseifCount_=parseInt(Q.getAttribute("elseif"),10)||0,this.elseCount_=parseInt(Q.getAttribute("else"),10)||0,this.rebuildShape_()},saveExtraState:function(){if(!this.elseifCount_&&!this.elseCount_)return null;const Q=Object.create(null);return this.elseifCount_&&(Q.elseIfCount=this.elseifCount_),this.elseCount_&&(Q.hasElse=!0),Q},loadExtraState:function(Q){this.elseifCount_=Q.elseIfCount||0,this.elseCount_=Q.hasElse?1:0,this.updateShape_()},decompose:function(Q){const te=Q.newBlock("controls_if_if");te.initSvg();let me=te.nextConnection;for(let ke=1;ke<=this.elseifCount_;ke++){const Xe=Q.newBlock("controls_if_elseif");Xe.initSvg(),me.connect(Xe.previousConnection),me=Xe.nextConnection}return this.elseCount_&&(Q=Q.newBlock("controls_if_else"),Q.initSvg(),me.connect(Q.previousConnection)),te},compose:function(Q){Q=Q.nextConnection.targetBlock(),this.elseCount_=this.elseifCount_=0;const te=[null],me=[null];let ke=null;for(;Q;){if(!Q.isInsertionMarker())switch(Q.type){case"controls_if_elseif":this.elseifCount_++,te.push(Q.valueConnection_),me.push(Q.statementConnection_);break;case"controls_if_else":this.elseCount_++,ke=Q.statementConnection_;break;default:throw TypeError("Unknown block type: "+Q.type)}Q=Q.getNextBlock()}this.updateShape_(),this.reconnectChildBlocks_(te,me,ke)},saveConnections:function(Q){Q=Q.nextConnection.targetBlock();let te=1;for(;Q;){if(!Q.isInsertionMarker())switch(Q.type){case"controls_if_elseif":var me=this.getInput("IF"+te);const ke=this.getInput("DO"+te);Q.valueConnection_=me&&me.connection.targetConnection,Q.statementConnection_=ke&&ke.connection.targetConnection,te++;break;case"controls_if_else":me=this.getInput("ELSE"),Q.statementConnection_=me&&me.connection.targetConnection;break;default:throw TypeError("Unknown block type: "+Q.type)}Q=Q.getNextBlock()}},rebuildShape_:function(){const Q=[null],te=[null];let me=null;this.getInput("ELSE")&&(me=this.getInput("ELSE").connection.targetConnection);for(let ke=1;this.getInput("IF"+ke);ke++){const Xe=this.getInput("IF"+ke),Wt=this.getInput("DO"+ke);Q.push(Xe.connection.targetConnection),te.push(Wt.connection.targetConnection)}this.updateShape_(),this.reconnectChildBlocks_(Q,te,me)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var Q=1;this.getInput("IF"+Q);Q++)this.removeInput("IF"+Q),this.removeInput("DO"+Q);for(Q=1;Q<=this.elseifCount_;Q++)this.appendValueInput("IF"+Q).setCheck("Boolean").appendField(r.Msg$$module$build$src$core$msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+Q).appendField(r.Msg$$module$build$src$core$msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(r.Msg$$module$build$src$core$msg.CONTROLS_IF_MSG_ELSE)},reconnectChildBlocks_:function(Q,te,me){for(let ke=1;ke<=this.elseifCount_;ke++){let Xe;(Xe=Q[ke])==null||Xe.reconnect(this,"IF"+ke);let Wt;(Wt=te[ke])==null||Wt.reconnect(this,"DO"+ke)}me==null||me.reconnect(this,"ELSE")}};r.registerMutator$$module$build$src$core$extensions("controls_if_mutator",He,null,["controls_if_elseif","controls_if_else"]);var rt=function(){this.setTooltip((function(){if(this.elseifCount_||this.elseCount_){if(!this.elseifCount_&&this.elseCount_)return r.Msg$$module$build$src$core$msg.CONTROLS_IF_TOOLTIP_2;if(this.elseifCount_&&!this.elseCount_)return r.Msg$$module$build$src$core$msg.CONTROLS_IF_TOOLTIP_3;if(this.elseifCount_&&this.elseCount_)return r.Msg$$module$build$src$core$msg.CONTROLS_IF_TOOLTIP_4}else return r.Msg$$module$build$src$core$msg.CONTROLS_IF_TOOLTIP_1;return""}).bind(this))};r.register$$module$build$src$core$extensions("controls_if_tooltip",rt);var it={onchange:function(Q){this.prevBlocks_||(this.prevBlocks_=[null,null]);var te=this.getInputTargetBlock("A");const me=this.getInputTargetBlock("B");te&&me&&!this.workspace.connectionChecker.doTypeChecks(te.outputConnection,me.outputConnection)&&(r.setGroup$$module$build$src$core$events$utils(Q.group),Q=this.prevBlocks_[0],Q!==te&&(te.unplug(),!Q||Q.isDisposed()||Q.isShadow()||this.getInput("A").connection.connect(Q.outputConnection)),te=this.prevBlocks_[1],te!==me&&(me.unplug(),!te||te.isDisposed()||te.isShadow()||this.getInput("B").connection.connect(te.outputConnection)),this.bumpNeighbours(),r.setGroup$$module$build$src$core$events$utils(!1)),this.prevBlocks_[0]=this.getInputTargetBlock("A"),this.prevBlocks_[1]=this.getInputTargetBlock("B")}},Nt=function(){this.mixin(it)};r.register$$module$build$src$core$extensions("logic_compare",Nt);var kt={prevParentConnection_:null,onchange:function(Q){const te=this.getInputTargetBlock("THEN"),me=this.getInputTargetBlock("ELSE"),ke=this.outputConnection.targetConnection;if((te||me)&&ke)for(let Xe=0;2>Xe;Xe++){const Wt=Xe===1?te:me;Wt&&!Wt.workspace.connectionChecker.doTypeChecks(Wt.outputConnection,ke)&&(r.setGroup$$module$build$src$core$events$utils(Q.group),ke===this.prevParentConnection_?(this.unplug(),ke.getSourceBlock().bumpNeighbours()):(Wt.unplug(),Wt.bumpNeighbours()),r.setGroup$$module$build$src$core$events$utils(!1))}this.prevParentConnection_=ke}};r.registerMixin$$module$build$src$core$extensions("logic_ternary",kt),r.defineBlocks$$module$build$src$core$common(ze);var vt=r.createBlockDefinitionsFromJsonArray$$module$build$src$core$common([{type:"lists_create_empty",message0:"%{BKY_LISTS_CREATE_EMPTY_TITLE}",output:"Array",style:"list_blocks",tooltip:"%{BKY_LISTS_CREATE_EMPTY_TOOLTIP}",helpUrl:"%{BKY_LISTS_CREATE_EMPTY_HELPURL}"},{type:"lists_repeat",message0:"%{BKY_LISTS_REPEAT_TITLE}",args0:[{type:"input_value",name:"ITEM"},{type:"input_value",name:"NUM",check:"Number"}],output:"Array",style:"list_blocks",tooltip:"%{BKY_LISTS_REPEAT_TOOLTIP}",helpUrl:"%{BKY_LISTS_REPEAT_HELPURL}"},{type:"lists_reverse",message0:"%{BKY_LISTS_REVERSE_MESSAGE0}",args0:[{type:"input_value",name:"LIST",check:"Array"}],output:"Array",inputsInline:!0,style:"list_blocks",tooltip:"%{BKY_LISTS_REVERSE_TOOLTIP}",helpUrl:"%{BKY_LISTS_REVERSE_HELPURL}"},{type:"lists_isEmpty",message0:"%{BKY_LISTS_ISEMPTY_TITLE}",args0:[{type:"input_value",name:"VALUE",check:["String","Array"]}],output:"Boolean",style:"list_blocks",tooltip:"%{BKY_LISTS_ISEMPTY_TOOLTIP}",helpUrl:"%{BKY_LISTS_ISEMPTY_HELPURL}"},{type:"lists_length",message0:"%{BKY_LISTS_LENGTH_TITLE}",args0:[{type:"input_value",name:"VALUE",check:["String","Array"]}],output:"Number",style:"list_blocks",tooltip:"%{BKY_LISTS_LENGTH_TOOLTIP}",helpUrl:"%{BKY_LISTS_LENGTH_HELPURL}"}]),Mt={init:function(){this.setHelpUrl(r.Msg$$module$build$src$core$msg.LISTS_CREATE_WITH_HELPURL),this.setStyle("list_blocks"),this.itemCount_=3,this.updateShape_(),this.setOutput(!0,"Array"),this.setMutator(new r.MutatorIcon$$module$build$src$core$icons$mutator_icon(["lists_create_with_item"],this)),this.setTooltip(r.Msg$$module$build$src$core$msg.LISTS_CREATE_WITH_TOOLTIP)},mutationToDom:function(){const Q=r.createElement$$module$build$src$core$utils$xml("mutation");return Q.setAttribute("items",String(this.itemCount_)),Q},domToMutation:function(Q){if(Q=Q.getAttribute("items"),!Q)throw new TypeError("element did not have items");this.itemCount_=parseInt(Q,10),this.updateShape_()},saveExtraState:function(){return{itemCount:this.itemCount_}},loadExtraState:function(Q){this.itemCount_=Q.itemCount,this.updateShape_()},decompose:function(Q){const te=Q.newBlock("lists_create_with_container");te.initSvg();let me=te.getInput("STACK").connection;for(let ke=0;ker.Msg$$module$build$src$core$msg.LISTS_INDEX_OF_TOOLTIP.replace("%1",this.workspace.options.oneBasedIndex?"0":"-1"))}};vt.lists_indexOf=xe;var se={init:function(){var Q=[[r.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_GET,"GET"],[r.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_GET_REMOVE,"GET_REMOVE"],[r.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_REMOVE,"REMOVE"]];this.WHERE_OPTIONS=[[r.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[r.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[r.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_FIRST,"FIRST"],[r.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_LAST,"LAST"],[r.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_RANDOM,"RANDOM"]],this.setHelpUrl(r.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_HELPURL),this.setStyle("list_blocks"),Q=r.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:Q}),Q.setValidator(function(te){te=te==="REMOVE",this.getSourceBlock().updateStatement_(te)}),this.appendValueInput("VALUE").setCheck("Array").appendField(r.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_INPUT_IN_LIST),this.appendDummyInput().appendField(Q,"MODE").appendField("","SPACE"),this.appendDummyInput("AT"),r.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TAIL&&this.appendDummyInput("TAIL").appendField(r.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TAIL),this.setInputsInline(!0),this.setOutput(!0),this.updateAt_(!0),this.setTooltip(()=>{const te=this.getFieldValue("MODE"),me=this.getFieldValue("WHERE");let ke="";switch(te+" "+me){case"GET FROM_START":case"GET FROM_END":ke=r.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM;break;case"GET FIRST":ke=r.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_GET_FIRST;break;case"GET LAST":ke=r.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_GET_LAST;break;case"GET RANDOM":ke=r.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM;break;case"GET_REMOVE FROM_START":case"GET_REMOVE FROM_END":ke=r.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM;break;case"GET_REMOVE FIRST":ke=r.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FIRST;break;case"GET_REMOVE LAST":ke=r.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_LAST;break;case"GET_REMOVE RANDOM":ke=r.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM;break;case"REMOVE FROM_START":case"REMOVE FROM_END":ke=r.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FROM;break;case"REMOVE FIRST":ke=r.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FIRST;break;case"REMOVE LAST":ke=r.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_LAST;break;case"REMOVE RANDOM":ke=r.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_RANDOM}return(me==="FROM_START"||me==="FROM_END")&&(ke+=" "+(me==="FROM_START"?r.Msg$$module$build$src$core$msg.LISTS_INDEX_FROM_START_TOOLTIP:r.Msg$$module$build$src$core$msg.LISTS_INDEX_FROM_END_TOOLTIP).replace("%1",this.workspace.options.oneBasedIndex?"#1":"#0")),ke})},mutationToDom:function(){const Q=r.createElement$$module$build$src$core$utils$xml("mutation");Q.setAttribute("statement",String(!this.outputConnection));const te=this.getInput("AT")instanceof r.ValueInput$$module$build$src$core$inputs$value_input;return Q.setAttribute("at",String(te)),Q},domToMutation:function(Q){const te=Q.getAttribute("statement")==="true";this.updateStatement_(te),Q=Q.getAttribute("at")!=="false",this.updateAt_(Q)},saveExtraState:function(){return this.outputConnection?null:{isStatement:!0}},loadExtraState:function(Q){Q.isStatement?this.updateStatement_(!0):typeof Q=="string"&&this.domToMutation(r.textToDom$$module$build$src$core$utils$xml(Q))},updateStatement_:function(Q){Q!==!this.outputConnection&&(this.unplug(!0,!0),Q?(this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)):(this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)))},updateAt_:function(Q){this.removeInput("AT"),this.removeInput("ORDINAL",!0),Q?(this.appendValueInput("AT").setCheck("Number"),r.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX&&this.appendDummyInput("ORDINAL").appendField(r.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX)):this.appendDummyInput("AT");const te=r.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:this.WHERE_OPTIONS});te.setValidator(function(me){const ke=me==="FROM_START"||me==="FROM_END";if(ke!==Q){const Xe=this.getSourceBlock();return Xe.updateAt_(ke),Xe.setFieldValue(me,"WHERE"),null}}),this.getInput("AT").appendField(te,"WHERE"),r.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TAIL&&this.moveInputBefore("TAIL",null)}};vt.lists_getIndex=se;var $e={init:function(){var Q=[[r.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_SET,"SET"],[r.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_INSERT,"INSERT"]];this.WHERE_OPTIONS=[[r.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[r.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[r.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_FIRST,"FIRST"],[r.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_LAST,"LAST"],[r.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_RANDOM,"RANDOM"]],this.setHelpUrl(r.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_HELPURL),this.setStyle("list_blocks"),this.appendValueInput("LIST").setCheck("Array").appendField(r.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_INPUT_IN_LIST),Q=r.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:Q}),this.appendDummyInput().appendField(Q,"MODE").appendField("","SPACE"),this.appendDummyInput("AT"),this.appendValueInput("TO").appendField(r.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_INPUT_TO),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(r.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP),this.updateAt_(!0),this.setTooltip(()=>{const te=this.getFieldValue("MODE"),me=this.getFieldValue("WHERE");let ke="";switch(te+" "+me){case"SET FROM_START":case"SET FROM_END":ke=r.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM;break;case"SET FIRST":ke=r.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP_SET_FIRST;break;case"SET LAST":ke=r.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST;break;case"SET RANDOM":ke=r.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM;break;case"INSERT FROM_START":case"INSERT FROM_END":ke=r.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FROM;break;case"INSERT FIRST":ke=r.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FIRST;break;case"INSERT LAST":ke=r.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP_INSERT_LAST;break;case"INSERT RANDOM":ke=r.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP_INSERT_RANDOM}return(me==="FROM_START"||me==="FROM_END")&&(ke+=" "+r.Msg$$module$build$src$core$msg.LISTS_INDEX_FROM_START_TOOLTIP.replace("%1",this.workspace.options.oneBasedIndex?"#1":"#0")),ke})},mutationToDom:function(){const Q=r.createElement$$module$build$src$core$utils$xml("mutation"),te=this.getInput("AT")instanceof r.ValueInput$$module$build$src$core$inputs$value_input;return Q.setAttribute("at",String(te)),Q},domToMutation:function(Q){Q=Q.getAttribute("at")!=="false",this.updateAt_(Q)},saveExtraState:function(){return null},loadExtraState:function(){},updateAt_:function(Q){this.removeInput("AT"),this.removeInput("ORDINAL",!0),Q?(this.appendValueInput("AT").setCheck("Number"),r.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX&&this.appendDummyInput("ORDINAL").appendField(r.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX)):this.appendDummyInput("AT");const te=r.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:this.WHERE_OPTIONS});te.setValidator(function(me){const ke=me==="FROM_START"||me==="FROM_END";if(ke!==Q){const Xe=this.getSourceBlock();return Xe.updateAt_(ke),Xe.setFieldValue(me,"WHERE"),null}}),this.moveInputBefore("AT","TO"),this.getInput("ORDINAL")&&this.moveInputBefore("ORDINAL","TO"),this.getInput("AT").appendField(te,"WHERE")}};vt.lists_setIndex=$e;var ht={init:function(){this.WHERE_OPTIONS_1=[[r.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_START_FROM_START,"FROM_START"],[r.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_START_FROM_END,"FROM_END"],[r.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_START_FIRST,"FIRST"]],this.WHERE_OPTIONS_2=[[r.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_END_FROM_START,"FROM_START"],[r.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_END_FROM_END,"FROM_END"],[r.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_END_LAST,"LAST"]],this.setHelpUrl(r.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_HELPURL),this.setStyle("list_blocks"),this.appendValueInput("LIST").setCheck("Array").appendField(r.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_INPUT_IN_LIST),this.appendDummyInput("AT1"),this.appendDummyInput("AT2"),r.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_TAIL&&this.appendDummyInput("TAIL").appendField(r.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_TAIL),this.setInputsInline(!0),this.setOutput(!0,"Array"),this.updateAt_(1,!0),this.updateAt_(2,!0),this.setTooltip(r.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_TOOLTIP)},mutationToDom:function(){const Q=r.createElement$$module$build$src$core$utils$xml("mutation");var te=this.getInput("AT1")instanceof r.ValueInput$$module$build$src$core$inputs$value_input;return Q.setAttribute("at1",String(te)),te=this.getInput("AT2")instanceof r.ValueInput$$module$build$src$core$inputs$value_input,Q.setAttribute("at2",String(te)),Q},domToMutation:function(Q){const te=Q.getAttribute("at1")==="true";Q=Q.getAttribute("at2")==="true",this.updateAt_(1,te),this.updateAt_(2,Q)},saveExtraState:function(){return null},loadExtraState:function(){},updateAt_:function(Q,te){this.removeInput("AT"+Q),this.removeInput("ORDINAL"+Q,!0),te?(this.appendValueInput("AT"+Q).setCheck("Number"),r.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX&&this.appendDummyInput("ORDINAL"+Q).appendField(r.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX)):this.appendDummyInput("AT"+Q);const me=r.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:this["WHERE_OPTIONS_"+Q]});me.setValidator(function(ke){const Xe=ke==="FROM_START"||ke==="FROM_END";if(Xe!==te){const Wt=this.getSourceBlock();return Wt.updateAt_(Q,Xe),Wt.setFieldValue(ke,"WHERE"+Q),null}}),this.getInput("AT"+Q).appendField(me,"WHERE"+Q),Q===1&&(this.moveInputBefore("AT1","AT2"),this.getInput("ORDINAL1")&&this.moveInputBefore("ORDINAL1","AT2")),r.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_TAIL&&this.moveInputBefore("TAIL",null)}};vt.lists_getSublist=ht,vt.lists_sort={init:function(){this.jsonInit({message0:"%{BKY_LISTS_SORT_TITLE}",args0:[{type:"field_dropdown",name:"TYPE",options:[["%{BKY_LISTS_SORT_TYPE_NUMERIC}","NUMERIC"],["%{BKY_LISTS_SORT_TYPE_TEXT}","TEXT"],["%{BKY_LISTS_SORT_TYPE_IGNORECASE}","IGNORE_CASE"]]},{type:"field_dropdown",name:"DIRECTION",options:[["%{BKY_LISTS_SORT_ORDER_ASCENDING}","1"],["%{BKY_LISTS_SORT_ORDER_DESCENDING}","-1"]]},{type:"input_value",name:"LIST",check:"Array"}],output:"Array",style:"list_blocks",tooltip:"%{BKY_LISTS_SORT_TOOLTIP}",helpUrl:"%{BKY_LISTS_SORT_HELPURL}"})}},vt.lists_split={init:function(){const Q=r.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:[[r.Msg$$module$build$src$core$msg.LISTS_SPLIT_LIST_FROM_TEXT,"SPLIT"],[r.Msg$$module$build$src$core$msg.LISTS_SPLIT_TEXT_FROM_LIST,"JOIN"]]});if(!Q)throw Error("field_dropdown not found");Q.setValidator(te=>{this.updateType_(te)}),this.setHelpUrl(r.Msg$$module$build$src$core$msg.LISTS_SPLIT_HELPURL),this.setStyle("list_blocks"),this.appendValueInput("INPUT").setCheck("String").appendField(Q,"MODE"),this.appendValueInput("DELIM").setCheck("String").appendField(r.Msg$$module$build$src$core$msg.LISTS_SPLIT_WITH_DELIMITER),this.setInputsInline(!0),this.setOutput(!0,"Array"),this.setTooltip(()=>{const te=this.getFieldValue("MODE");if(te==="SPLIT")return r.Msg$$module$build$src$core$msg.LISTS_SPLIT_TOOLTIP_SPLIT;if(te==="JOIN")return r.Msg$$module$build$src$core$msg.LISTS_SPLIT_TOOLTIP_JOIN;throw Error("Unknown mode: "+te)})},updateType_:function(Q){if(this.getFieldValue("MODE")!==Q){const te=this.getInput("INPUT").connection;te.setShadowDom(null);const me=te.targetBlock();me&&(te.disconnect(),me.isShadow()?me.dispose(!1):this.bumpNeighbours())}Q==="SPLIT"?(this.outputConnection.setCheck("Array"),this.getInput("INPUT").setCheck("String")):(this.outputConnection.setCheck("String"),this.getInput("INPUT").setCheck("Array"))},mutationToDom:function(){const Q=r.createElement$$module$build$src$core$utils$xml("mutation");return Q.setAttribute("mode",this.getFieldValue("MODE")),Q},domToMutation:function(Q){this.updateType_(Q.getAttribute("mode"))},saveExtraState:function(){return null},loadExtraState:function(){}},r.defineBlocks$$module$build$src$core$common(vt);var St={blocks:vt},It=r.createBlockDefinitionsFromJsonArray$$module$build$src$core$common([{type:"colour_picker",message0:"%1",args0:[{type:"field_colour",name:"COLOUR",colour:"#ff0000"}],output:"Colour",helpUrl:"%{BKY_COLOUR_PICKER_HELPURL}",style:"colour_blocks",tooltip:"%{BKY_COLOUR_PICKER_TOOLTIP}",extensions:["parent_tooltip_when_inline"]},{type:"colour_random",message0:"%{BKY_COLOUR_RANDOM_TITLE}",output:"Colour",helpUrl:"%{BKY_COLOUR_RANDOM_HELPURL}",style:"colour_blocks",tooltip:"%{BKY_COLOUR_RANDOM_TOOLTIP}"},{type:"colour_rgb",message0:"%{BKY_COLOUR_RGB_TITLE} %{BKY_COLOUR_RGB_RED} %1 %{BKY_COLOUR_RGB_GREEN} %2 %{BKY_COLOUR_RGB_BLUE} %3",args0:[{type:"input_value",name:"RED",check:"Number",align:"RIGHT"},{type:"input_value",name:"GREEN",check:"Number",align:"RIGHT"},{type:"input_value",name:"BLUE",check:"Number",align:"RIGHT"}],output:"Colour",helpUrl:"%{BKY_COLOUR_RGB_HELPURL}",style:"colour_blocks",tooltip:"%{BKY_COLOUR_RGB_TOOLTIP}"},{type:"colour_blend",message0:"%{BKY_COLOUR_BLEND_TITLE} %{BKY_COLOUR_BLEND_COLOUR1} %1 %{BKY_COLOUR_BLEND_COLOUR2} %2 %{BKY_COLOUR_BLEND_RATIO} %3",args0:[{type:"input_value",name:"COLOUR1",check:"Colour",align:"RIGHT"},{type:"input_value",name:"COLOUR2",check:"Colour",align:"RIGHT"},{type:"input_value",name:"RATIO",check:"Number",align:"RIGHT"}],output:"Colour",helpUrl:"%{BKY_COLOUR_BLEND_HELPURL}",style:"colour_blocks",tooltip:"%{BKY_COLOUR_BLEND_TOOLTIP}"}]);r.defineBlocks$$module$build$src$core$common(It);var pt={blocks:It},Ke=Object.assign({},It,vt,ze,Ie,we,le,f,s),Le={blocks:Ke,colour:pt,lists:St,loops:lt,math:Fe,procedures:ge,texts:oe,variables:w,variablesDynamic:h};return Le.__namespace__=r,Le})}(cO)),cO.exports}var HU;function yie(){return HU||(HU=1,function(n,e){(function(t,r){n.exports=r(vie())})(Vl,function(t){/** +`))this.quarkIds_=te;else{if(te.length!==Q.length)throw RangeError("paramNames and paramIds must be the same length.");this.quarkIds_||(this.quarkConnections_={},this.quarkIds_=[]);for(let Je=0;Je","GT"],["‏≥","GTE"]]},{type:"input_value",name:"B"}],inputsInline:!0,output:"Boolean",style:"logic_blocks",helpUrl:"%{BKY_LOGIC_COMPARE_HELPURL}",extensions:["logic_compare","logic_op_tooltip"]},{type:"logic_operation",message0:"%1 %2 %3",args0:[{type:"input_value",name:"A",check:"Boolean"},{type:"field_dropdown",name:"OP",options:[["%{BKY_LOGIC_OPERATION_AND}","AND"],["%{BKY_LOGIC_OPERATION_OR}","OR"]]},{type:"input_value",name:"B",check:"Boolean"}],inputsInline:!0,output:"Boolean",style:"logic_blocks",helpUrl:"%{BKY_LOGIC_OPERATION_HELPURL}",extensions:["logic_op_tooltip"]},{type:"logic_negate",message0:"%{BKY_LOGIC_NEGATE_TITLE}",args0:[{type:"input_value",name:"BOOL",check:"Boolean"}],output:"Boolean",style:"logic_blocks",tooltip:"%{BKY_LOGIC_NEGATE_TOOLTIP}",helpUrl:"%{BKY_LOGIC_NEGATE_HELPURL}"},{type:"logic_null",message0:"%{BKY_LOGIC_NULL}",output:null,style:"logic_blocks",tooltip:"%{BKY_LOGIC_NULL_TOOLTIP}",helpUrl:"%{BKY_LOGIC_NULL_HELPURL}"},{type:"logic_ternary",message0:"%{BKY_LOGIC_TERNARY_CONDITION} %1",args0:[{type:"input_value",name:"IF",check:"Boolean"}],message1:"%{BKY_LOGIC_TERNARY_IF_TRUE} %1",args1:[{type:"input_value",name:"THEN"}],message2:"%{BKY_LOGIC_TERNARY_IF_FALSE} %1",args2:[{type:"input_value",name:"ELSE"}],output:null,style:"logic_blocks",tooltip:"%{BKY_LOGIC_TERNARY_TOOLTIP}",helpUrl:"%{BKY_LOGIC_TERNARY_HELPURL}",extensions:["logic_ternary"]},{type:"controls_if_if",message0:"%{BKY_CONTROLS_IF_IF_TITLE_IF}",nextStatement:null,enableContextMenu:!1,style:"logic_blocks",tooltip:"%{BKY_CONTROLS_IF_IF_TOOLTIP}"},{type:"controls_if_elseif",message0:"%{BKY_CONTROLS_IF_ELSEIF_TITLE_ELSEIF}",previousStatement:null,nextStatement:null,enableContextMenu:!1,style:"logic_blocks",tooltip:"%{BKY_CONTROLS_IF_ELSEIF_TOOLTIP}"},{type:"controls_if_else",message0:"%{BKY_CONTROLS_IF_ELSE_TITLE_ELSE}",previousStatement:null,enableContextMenu:!1,style:"logic_blocks",tooltip:"%{BKY_CONTROLS_IF_ELSE_TOOLTIP}"}]),$e={EQ:"%{BKY_LOGIC_COMPARE_TOOLTIP_EQ}",NEQ:"%{BKY_LOGIC_COMPARE_TOOLTIP_NEQ}",LT:"%{BKY_LOGIC_COMPARE_TOOLTIP_LT}",LTE:"%{BKY_LOGIC_COMPARE_TOOLTIP_LTE}",GT:"%{BKY_LOGIC_COMPARE_TOOLTIP_GT}",GTE:"%{BKY_LOGIC_COMPARE_TOOLTIP_GTE}",AND:"%{BKY_LOGIC_OPERATION_TOOLTIP_AND}",OR:"%{BKY_LOGIC_OPERATION_TOOLTIP_OR}"};r.register$$module$build$src$core$extensions("logic_op_tooltip",r.buildTooltipForDropdown$$module$build$src$core$extensions("OP",$e));var He={elseifCount_:0,elseCount_:0,mutationToDom:function(){if(!this.elseifCount_&&!this.elseCount_)return null;const Q=r.createElement$$module$build$src$core$utils$xml("mutation");return this.elseifCount_&&Q.setAttribute("elseif",String(this.elseifCount_)),this.elseCount_&&Q.setAttribute("else","1"),Q},domToMutation:function(Q){this.elseifCount_=parseInt(Q.getAttribute("elseif"),10)||0,this.elseCount_=parseInt(Q.getAttribute("else"),10)||0,this.rebuildShape_()},saveExtraState:function(){if(!this.elseifCount_&&!this.elseCount_)return null;const Q=Object.create(null);return this.elseifCount_&&(Q.elseIfCount=this.elseifCount_),this.elseCount_&&(Q.hasElse=!0),Q},loadExtraState:function(Q){this.elseifCount_=Q.elseIfCount||0,this.elseCount_=Q.hasElse?1:0,this.updateShape_()},decompose:function(Q){const te=Q.newBlock("controls_if_if");te.initSvg();let pe=te.nextConnection;for(let Ae=1;Ae<=this.elseifCount_;Ae++){const Je=Q.newBlock("controls_if_elseif");Je.initSvg(),pe.connect(Je.previousConnection),pe=Je.nextConnection}return this.elseCount_&&(Q=Q.newBlock("controls_if_else"),Q.initSvg(),pe.connect(Q.previousConnection)),te},compose:function(Q){Q=Q.nextConnection.targetBlock(),this.elseCount_=this.elseifCount_=0;const te=[null],pe=[null];let Ae=null;for(;Q;){if(!Q.isInsertionMarker())switch(Q.type){case"controls_if_elseif":this.elseifCount_++,te.push(Q.valueConnection_),pe.push(Q.statementConnection_);break;case"controls_if_else":this.elseCount_++,Ae=Q.statementConnection_;break;default:throw TypeError("Unknown block type: "+Q.type)}Q=Q.getNextBlock()}this.updateShape_(),this.reconnectChildBlocks_(te,pe,Ae)},saveConnections:function(Q){Q=Q.nextConnection.targetBlock();let te=1;for(;Q;){if(!Q.isInsertionMarker())switch(Q.type){case"controls_if_elseif":var pe=this.getInput("IF"+te);const Ae=this.getInput("DO"+te);Q.valueConnection_=pe&&pe.connection.targetConnection,Q.statementConnection_=Ae&&Ae.connection.targetConnection,te++;break;case"controls_if_else":pe=this.getInput("ELSE"),Q.statementConnection_=pe&&pe.connection.targetConnection;break;default:throw TypeError("Unknown block type: "+Q.type)}Q=Q.getNextBlock()}},rebuildShape_:function(){const Q=[null],te=[null];let pe=null;this.getInput("ELSE")&&(pe=this.getInput("ELSE").connection.targetConnection);for(let Ae=1;this.getInput("IF"+Ae);Ae++){const Je=this.getInput("IF"+Ae),jt=this.getInput("DO"+Ae);Q.push(Je.connection.targetConnection),te.push(jt.connection.targetConnection)}this.updateShape_(),this.reconnectChildBlocks_(Q,te,pe)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var Q=1;this.getInput("IF"+Q);Q++)this.removeInput("IF"+Q),this.removeInput("DO"+Q);for(Q=1;Q<=this.elseifCount_;Q++)this.appendValueInput("IF"+Q).setCheck("Boolean").appendField(r.Msg$$module$build$src$core$msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+Q).appendField(r.Msg$$module$build$src$core$msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(r.Msg$$module$build$src$core$msg.CONTROLS_IF_MSG_ELSE)},reconnectChildBlocks_:function(Q,te,pe){for(let Ae=1;Ae<=this.elseifCount_;Ae++){let Je;(Je=Q[Ae])==null||Je.reconnect(this,"IF"+Ae);let jt;(jt=te[Ae])==null||jt.reconnect(this,"DO"+Ae)}pe==null||pe.reconnect(this,"ELSE")}};r.registerMutator$$module$build$src$core$extensions("controls_if_mutator",He,null,["controls_if_elseif","controls_if_else"]);var it=function(){this.setTooltip((function(){if(this.elseifCount_||this.elseCount_){if(!this.elseifCount_&&this.elseCount_)return r.Msg$$module$build$src$core$msg.CONTROLS_IF_TOOLTIP_2;if(this.elseifCount_&&!this.elseCount_)return r.Msg$$module$build$src$core$msg.CONTROLS_IF_TOOLTIP_3;if(this.elseifCount_&&this.elseCount_)return r.Msg$$module$build$src$core$msg.CONTROLS_IF_TOOLTIP_4}else return r.Msg$$module$build$src$core$msg.CONTROLS_IF_TOOLTIP_1;return""}).bind(this))};r.register$$module$build$src$core$extensions("controls_if_tooltip",it);var st={onchange:function(Q){this.prevBlocks_||(this.prevBlocks_=[null,null]);var te=this.getInputTargetBlock("A");const pe=this.getInputTargetBlock("B");te&&pe&&!this.workspace.connectionChecker.doTypeChecks(te.outputConnection,pe.outputConnection)&&(r.setGroup$$module$build$src$core$events$utils(Q.group),Q=this.prevBlocks_[0],Q!==te&&(te.unplug(),!Q||Q.isDisposed()||Q.isShadow()||this.getInput("A").connection.connect(Q.outputConnection)),te=this.prevBlocks_[1],te!==pe&&(pe.unplug(),!te||te.isDisposed()||te.isShadow()||this.getInput("B").connection.connect(te.outputConnection)),this.bumpNeighbours(),r.setGroup$$module$build$src$core$events$utils(!1)),this.prevBlocks_[0]=this.getInputTargetBlock("A"),this.prevBlocks_[1]=this.getInputTargetBlock("B")}},Nt=function(){this.mixin(st)};r.register$$module$build$src$core$extensions("logic_compare",Nt);var kt={prevParentConnection_:null,onchange:function(Q){const te=this.getInputTargetBlock("THEN"),pe=this.getInputTargetBlock("ELSE"),Ae=this.outputConnection.targetConnection;if((te||pe)&&Ae)for(let Je=0;2>Je;Je++){const jt=Je===1?te:pe;jt&&!jt.workspace.connectionChecker.doTypeChecks(jt.outputConnection,Ae)&&(r.setGroup$$module$build$src$core$events$utils(Q.group),Ae===this.prevParentConnection_?(this.unplug(),Ae.getSourceBlock().bumpNeighbours()):(jt.unplug(),jt.bumpNeighbours()),r.setGroup$$module$build$src$core$events$utils(!1))}this.prevParentConnection_=Ae}};r.registerMixin$$module$build$src$core$extensions("logic_ternary",kt),r.defineBlocks$$module$build$src$core$common(ze);var vt=r.createBlockDefinitionsFromJsonArray$$module$build$src$core$common([{type:"lists_create_empty",message0:"%{BKY_LISTS_CREATE_EMPTY_TITLE}",output:"Array",style:"list_blocks",tooltip:"%{BKY_LISTS_CREATE_EMPTY_TOOLTIP}",helpUrl:"%{BKY_LISTS_CREATE_EMPTY_HELPURL}"},{type:"lists_repeat",message0:"%{BKY_LISTS_REPEAT_TITLE}",args0:[{type:"input_value",name:"ITEM"},{type:"input_value",name:"NUM",check:"Number"}],output:"Array",style:"list_blocks",tooltip:"%{BKY_LISTS_REPEAT_TOOLTIP}",helpUrl:"%{BKY_LISTS_REPEAT_HELPURL}"},{type:"lists_reverse",message0:"%{BKY_LISTS_REVERSE_MESSAGE0}",args0:[{type:"input_value",name:"LIST",check:"Array"}],output:"Array",inputsInline:!0,style:"list_blocks",tooltip:"%{BKY_LISTS_REVERSE_TOOLTIP}",helpUrl:"%{BKY_LISTS_REVERSE_HELPURL}"},{type:"lists_isEmpty",message0:"%{BKY_LISTS_ISEMPTY_TITLE}",args0:[{type:"input_value",name:"VALUE",check:["String","Array"]}],output:"Boolean",style:"list_blocks",tooltip:"%{BKY_LISTS_ISEMPTY_TOOLTIP}",helpUrl:"%{BKY_LISTS_ISEMPTY_HELPURL}"},{type:"lists_length",message0:"%{BKY_LISTS_LENGTH_TITLE}",args0:[{type:"input_value",name:"VALUE",check:["String","Array"]}],output:"Number",style:"list_blocks",tooltip:"%{BKY_LISTS_LENGTH_TOOLTIP}",helpUrl:"%{BKY_LISTS_LENGTH_HELPURL}"}]),Ct={init:function(){this.setHelpUrl(r.Msg$$module$build$src$core$msg.LISTS_CREATE_WITH_HELPURL),this.setStyle("list_blocks"),this.itemCount_=3,this.updateShape_(),this.setOutput(!0,"Array"),this.setMutator(new r.MutatorIcon$$module$build$src$core$icons$mutator_icon(["lists_create_with_item"],this)),this.setTooltip(r.Msg$$module$build$src$core$msg.LISTS_CREATE_WITH_TOOLTIP)},mutationToDom:function(){const Q=r.createElement$$module$build$src$core$utils$xml("mutation");return Q.setAttribute("items",String(this.itemCount_)),Q},domToMutation:function(Q){if(Q=Q.getAttribute("items"),!Q)throw new TypeError("element did not have items");this.itemCount_=parseInt(Q,10),this.updateShape_()},saveExtraState:function(){return{itemCount:this.itemCount_}},loadExtraState:function(Q){this.itemCount_=Q.itemCount,this.updateShape_()},decompose:function(Q){const te=Q.newBlock("lists_create_with_container");te.initSvg();let pe=te.getInput("STACK").connection;for(let Ae=0;Aer.Msg$$module$build$src$core$msg.LISTS_INDEX_OF_TOOLTIP.replace("%1",this.workspace.options.oneBasedIndex?"0":"-1"))}};vt.lists_indexOf=xe;var ie={init:function(){var Q=[[r.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_GET,"GET"],[r.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_GET_REMOVE,"GET_REMOVE"],[r.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_REMOVE,"REMOVE"]];this.WHERE_OPTIONS=[[r.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[r.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[r.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_FIRST,"FIRST"],[r.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_LAST,"LAST"],[r.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_RANDOM,"RANDOM"]],this.setHelpUrl(r.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_HELPURL),this.setStyle("list_blocks"),Q=r.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:Q}),Q.setValidator(function(te){te=te==="REMOVE",this.getSourceBlock().updateStatement_(te)}),this.appendValueInput("VALUE").setCheck("Array").appendField(r.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_INPUT_IN_LIST),this.appendDummyInput().appendField(Q,"MODE").appendField("","SPACE"),this.appendDummyInput("AT"),r.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TAIL&&this.appendDummyInput("TAIL").appendField(r.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TAIL),this.setInputsInline(!0),this.setOutput(!0),this.updateAt_(!0),this.setTooltip(()=>{const te=this.getFieldValue("MODE"),pe=this.getFieldValue("WHERE");let Ae="";switch(te+" "+pe){case"GET FROM_START":case"GET FROM_END":Ae=r.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM;break;case"GET FIRST":Ae=r.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_GET_FIRST;break;case"GET LAST":Ae=r.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_GET_LAST;break;case"GET RANDOM":Ae=r.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM;break;case"GET_REMOVE FROM_START":case"GET_REMOVE FROM_END":Ae=r.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM;break;case"GET_REMOVE FIRST":Ae=r.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FIRST;break;case"GET_REMOVE LAST":Ae=r.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_LAST;break;case"GET_REMOVE RANDOM":Ae=r.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM;break;case"REMOVE FROM_START":case"REMOVE FROM_END":Ae=r.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FROM;break;case"REMOVE FIRST":Ae=r.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FIRST;break;case"REMOVE LAST":Ae=r.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_LAST;break;case"REMOVE RANDOM":Ae=r.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_RANDOM}return(pe==="FROM_START"||pe==="FROM_END")&&(Ae+=" "+(pe==="FROM_START"?r.Msg$$module$build$src$core$msg.LISTS_INDEX_FROM_START_TOOLTIP:r.Msg$$module$build$src$core$msg.LISTS_INDEX_FROM_END_TOOLTIP).replace("%1",this.workspace.options.oneBasedIndex?"#1":"#0")),Ae})},mutationToDom:function(){const Q=r.createElement$$module$build$src$core$utils$xml("mutation");Q.setAttribute("statement",String(!this.outputConnection));const te=this.getInput("AT")instanceof r.ValueInput$$module$build$src$core$inputs$value_input;return Q.setAttribute("at",String(te)),Q},domToMutation:function(Q){const te=Q.getAttribute("statement")==="true";this.updateStatement_(te),Q=Q.getAttribute("at")!=="false",this.updateAt_(Q)},saveExtraState:function(){return this.outputConnection?null:{isStatement:!0}},loadExtraState:function(Q){Q.isStatement?this.updateStatement_(!0):typeof Q=="string"&&this.domToMutation(r.textToDom$$module$build$src$core$utils$xml(Q))},updateStatement_:function(Q){Q!==!this.outputConnection&&(this.unplug(!0,!0),Q?(this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)):(this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)))},updateAt_:function(Q){this.removeInput("AT"),this.removeInput("ORDINAL",!0),Q?(this.appendValueInput("AT").setCheck("Number"),r.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX&&this.appendDummyInput("ORDINAL").appendField(r.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX)):this.appendDummyInput("AT");const te=r.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:this.WHERE_OPTIONS});te.setValidator(function(pe){const Ae=pe==="FROM_START"||pe==="FROM_END";if(Ae!==Q){const Je=this.getSourceBlock();return Je.updateAt_(Ae),Je.setFieldValue(pe,"WHERE"),null}}),this.getInput("AT").appendField(te,"WHERE"),r.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TAIL&&this.moveInputBefore("TAIL",null)}};vt.lists_getIndex=ie;var Pe={init:function(){var Q=[[r.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_SET,"SET"],[r.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_INSERT,"INSERT"]];this.WHERE_OPTIONS=[[r.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[r.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[r.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_FIRST,"FIRST"],[r.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_LAST,"LAST"],[r.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_RANDOM,"RANDOM"]],this.setHelpUrl(r.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_HELPURL),this.setStyle("list_blocks"),this.appendValueInput("LIST").setCheck("Array").appendField(r.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_INPUT_IN_LIST),Q=r.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:Q}),this.appendDummyInput().appendField(Q,"MODE").appendField("","SPACE"),this.appendDummyInput("AT"),this.appendValueInput("TO").appendField(r.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_INPUT_TO),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(r.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP),this.updateAt_(!0),this.setTooltip(()=>{const te=this.getFieldValue("MODE"),pe=this.getFieldValue("WHERE");let Ae="";switch(te+" "+pe){case"SET FROM_START":case"SET FROM_END":Ae=r.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM;break;case"SET FIRST":Ae=r.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP_SET_FIRST;break;case"SET LAST":Ae=r.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST;break;case"SET RANDOM":Ae=r.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM;break;case"INSERT FROM_START":case"INSERT FROM_END":Ae=r.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FROM;break;case"INSERT FIRST":Ae=r.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FIRST;break;case"INSERT LAST":Ae=r.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP_INSERT_LAST;break;case"INSERT RANDOM":Ae=r.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP_INSERT_RANDOM}return(pe==="FROM_START"||pe==="FROM_END")&&(Ae+=" "+r.Msg$$module$build$src$core$msg.LISTS_INDEX_FROM_START_TOOLTIP.replace("%1",this.workspace.options.oneBasedIndex?"#1":"#0")),Ae})},mutationToDom:function(){const Q=r.createElement$$module$build$src$core$utils$xml("mutation"),te=this.getInput("AT")instanceof r.ValueInput$$module$build$src$core$inputs$value_input;return Q.setAttribute("at",String(te)),Q},domToMutation:function(Q){Q=Q.getAttribute("at")!=="false",this.updateAt_(Q)},saveExtraState:function(){return null},loadExtraState:function(){},updateAt_:function(Q){this.removeInput("AT"),this.removeInput("ORDINAL",!0),Q?(this.appendValueInput("AT").setCheck("Number"),r.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX&&this.appendDummyInput("ORDINAL").appendField(r.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX)):this.appendDummyInput("AT");const te=r.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:this.WHERE_OPTIONS});te.setValidator(function(pe){const Ae=pe==="FROM_START"||pe==="FROM_END";if(Ae!==Q){const Je=this.getSourceBlock();return Je.updateAt_(Ae),Je.setFieldValue(pe,"WHERE"),null}}),this.moveInputBefore("AT","TO"),this.getInput("ORDINAL")&&this.moveInputBefore("ORDINAL","TO"),this.getInput("AT").appendField(te,"WHERE")}};vt.lists_setIndex=Pe;var Ye={init:function(){this.WHERE_OPTIONS_1=[[r.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_START_FROM_START,"FROM_START"],[r.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_START_FROM_END,"FROM_END"],[r.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_START_FIRST,"FIRST"]],this.WHERE_OPTIONS_2=[[r.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_END_FROM_START,"FROM_START"],[r.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_END_FROM_END,"FROM_END"],[r.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_END_LAST,"LAST"]],this.setHelpUrl(r.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_HELPURL),this.setStyle("list_blocks"),this.appendValueInput("LIST").setCheck("Array").appendField(r.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_INPUT_IN_LIST),this.appendDummyInput("AT1"),this.appendDummyInput("AT2"),r.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_TAIL&&this.appendDummyInput("TAIL").appendField(r.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_TAIL),this.setInputsInline(!0),this.setOutput(!0,"Array"),this.updateAt_(1,!0),this.updateAt_(2,!0),this.setTooltip(r.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_TOOLTIP)},mutationToDom:function(){const Q=r.createElement$$module$build$src$core$utils$xml("mutation");var te=this.getInput("AT1")instanceof r.ValueInput$$module$build$src$core$inputs$value_input;return Q.setAttribute("at1",String(te)),te=this.getInput("AT2")instanceof r.ValueInput$$module$build$src$core$inputs$value_input,Q.setAttribute("at2",String(te)),Q},domToMutation:function(Q){const te=Q.getAttribute("at1")==="true";Q=Q.getAttribute("at2")==="true",this.updateAt_(1,te),this.updateAt_(2,Q)},saveExtraState:function(){return null},loadExtraState:function(){},updateAt_:function(Q,te){this.removeInput("AT"+Q),this.removeInput("ORDINAL"+Q,!0),te?(this.appendValueInput("AT"+Q).setCheck("Number"),r.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX&&this.appendDummyInput("ORDINAL"+Q).appendField(r.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX)):this.appendDummyInput("AT"+Q);const pe=r.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:this["WHERE_OPTIONS_"+Q]});pe.setValidator(function(Ae){const Je=Ae==="FROM_START"||Ae==="FROM_END";if(Je!==te){const jt=this.getSourceBlock();return jt.updateAt_(Q,Je),jt.setFieldValue(Ae,"WHERE"+Q),null}}),this.getInput("AT"+Q).appendField(pe,"WHERE"+Q),Q===1&&(this.moveInputBefore("AT1","AT2"),this.getInput("ORDINAL1")&&this.moveInputBefore("ORDINAL1","AT2")),r.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_TAIL&&this.moveInputBefore("TAIL",null)}};vt.lists_getSublist=Ye,vt.lists_sort={init:function(){this.jsonInit({message0:"%{BKY_LISTS_SORT_TITLE}",args0:[{type:"field_dropdown",name:"TYPE",options:[["%{BKY_LISTS_SORT_TYPE_NUMERIC}","NUMERIC"],["%{BKY_LISTS_SORT_TYPE_TEXT}","TEXT"],["%{BKY_LISTS_SORT_TYPE_IGNORECASE}","IGNORE_CASE"]]},{type:"field_dropdown",name:"DIRECTION",options:[["%{BKY_LISTS_SORT_ORDER_ASCENDING}","1"],["%{BKY_LISTS_SORT_ORDER_DESCENDING}","-1"]]},{type:"input_value",name:"LIST",check:"Array"}],output:"Array",style:"list_blocks",tooltip:"%{BKY_LISTS_SORT_TOOLTIP}",helpUrl:"%{BKY_LISTS_SORT_HELPURL}"})}},vt.lists_split={init:function(){const Q=r.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:[[r.Msg$$module$build$src$core$msg.LISTS_SPLIT_LIST_FROM_TEXT,"SPLIT"],[r.Msg$$module$build$src$core$msg.LISTS_SPLIT_TEXT_FROM_LIST,"JOIN"]]});if(!Q)throw Error("field_dropdown not found");Q.setValidator(te=>{this.updateType_(te)}),this.setHelpUrl(r.Msg$$module$build$src$core$msg.LISTS_SPLIT_HELPURL),this.setStyle("list_blocks"),this.appendValueInput("INPUT").setCheck("String").appendField(Q,"MODE"),this.appendValueInput("DELIM").setCheck("String").appendField(r.Msg$$module$build$src$core$msg.LISTS_SPLIT_WITH_DELIMITER),this.setInputsInline(!0),this.setOutput(!0,"Array"),this.setTooltip(()=>{const te=this.getFieldValue("MODE");if(te==="SPLIT")return r.Msg$$module$build$src$core$msg.LISTS_SPLIT_TOOLTIP_SPLIT;if(te==="JOIN")return r.Msg$$module$build$src$core$msg.LISTS_SPLIT_TOOLTIP_JOIN;throw Error("Unknown mode: "+te)})},updateType_:function(Q){if(this.getFieldValue("MODE")!==Q){const te=this.getInput("INPUT").connection;te.setShadowDom(null);const pe=te.targetBlock();pe&&(te.disconnect(),pe.isShadow()?pe.dispose(!1):this.bumpNeighbours())}Q==="SPLIT"?(this.outputConnection.setCheck("Array"),this.getInput("INPUT").setCheck("String")):(this.outputConnection.setCheck("String"),this.getInput("INPUT").setCheck("Array"))},mutationToDom:function(){const Q=r.createElement$$module$build$src$core$utils$xml("mutation");return Q.setAttribute("mode",this.getFieldValue("MODE")),Q},domToMutation:function(Q){this.updateType_(Q.getAttribute("mode"))},saveExtraState:function(){return null},loadExtraState:function(){}},r.defineBlocks$$module$build$src$core$common(vt);var St={blocks:vt},It=r.createBlockDefinitionsFromJsonArray$$module$build$src$core$common([{type:"colour_picker",message0:"%1",args0:[{type:"field_colour",name:"COLOUR",colour:"#ff0000"}],output:"Colour",helpUrl:"%{BKY_COLOUR_PICKER_HELPURL}",style:"colour_blocks",tooltip:"%{BKY_COLOUR_PICKER_TOOLTIP}",extensions:["parent_tooltip_when_inline"]},{type:"colour_random",message0:"%{BKY_COLOUR_RANDOM_TITLE}",output:"Colour",helpUrl:"%{BKY_COLOUR_RANDOM_HELPURL}",style:"colour_blocks",tooltip:"%{BKY_COLOUR_RANDOM_TOOLTIP}"},{type:"colour_rgb",message0:"%{BKY_COLOUR_RGB_TITLE} %{BKY_COLOUR_RGB_RED} %1 %{BKY_COLOUR_RGB_GREEN} %2 %{BKY_COLOUR_RGB_BLUE} %3",args0:[{type:"input_value",name:"RED",check:"Number",align:"RIGHT"},{type:"input_value",name:"GREEN",check:"Number",align:"RIGHT"},{type:"input_value",name:"BLUE",check:"Number",align:"RIGHT"}],output:"Colour",helpUrl:"%{BKY_COLOUR_RGB_HELPURL}",style:"colour_blocks",tooltip:"%{BKY_COLOUR_RGB_TOOLTIP}"},{type:"colour_blend",message0:"%{BKY_COLOUR_BLEND_TITLE} %{BKY_COLOUR_BLEND_COLOUR1} %1 %{BKY_COLOUR_BLEND_COLOUR2} %2 %{BKY_COLOUR_BLEND_RATIO} %3",args0:[{type:"input_value",name:"COLOUR1",check:"Colour",align:"RIGHT"},{type:"input_value",name:"COLOUR2",check:"Colour",align:"RIGHT"},{type:"input_value",name:"RATIO",check:"Number",align:"RIGHT"}],output:"Colour",helpUrl:"%{BKY_COLOUR_BLEND_HELPURL}",style:"colour_blocks",tooltip:"%{BKY_COLOUR_BLEND_TOOLTIP}"}]);r.defineBlocks$$module$build$src$core$common(It);var mt={blocks:It},Ke=Object.assign({},It,vt,ze,Ie,we,le,f,s),Oe={blocks:Ke,colour:mt,lists:St,loops:ut,math:Fe,procedures:ge,texts:oe,variables:w,variablesDynamic:h};return Oe.__namespace__=r,Oe})}(cO)),cO.exports}var HU;function bie(){return HU||(HU=1,function(n,e){(function(t,r){n.exports=r(yie())})(Vl,function(t){/** * @license * Copyright 2020 Google LLC * SPDX-License-Identifier: Apache-2.0 - */return t})}(uO)),uO.exports}var fj={exports:{}},hO={exports:{}},GU;function bie(){return GU||(GU=1,function(n,e){(function(t,r){n.exports=r(L3())})(Vl,function(t){var r=t.__namespace__,s=function(ne,Se){return[Se.quote_(ne.getFieldValue("COLOUR")),Le.ATOMIC]},o=function(ne,Se){return[Se.provideFunction_("colourRandom",` + */return t})}(uO)),uO.exports}var pj={exports:{}},hO={exports:{}},GU;function Tie(){return GU||(GU=1,function(n,e){(function(t,r){n.exports=r(L3())})(Vl,function(t){var r=t.__namespace__,s=function(ne,Se){return[Se.quote_(ne.getFieldValue("COLOUR")),Oe.ATOMIC]},o=function(ne,Se){return[Se.provideFunction_("colourRandom",` function ${Se.FUNCTION_NAME_PLACEHOLDER_}() { var num = Math.floor(Math.random() * Math.pow(2, 24)); return '#' + ('00000' + num.toString(16)).substr(-6); } -`)+"()",Le.FUNCTION_CALL]},l=function(ne,Se){const We=Se.valueToCode(ne,"RED",Le.NONE)||0,ot=Se.valueToCode(ne,"GREEN",Le.NONE)||0;return ne=Se.valueToCode(ne,"BLUE",Le.NONE)||0,[Se.provideFunction_("colourRgb",` +`)+"()",Oe.FUNCTION_CALL]},l=function(ne,Se){const We=Se.valueToCode(ne,"RED",Oe.NONE)||0,at=Se.valueToCode(ne,"GREEN",Oe.NONE)||0;return ne=Se.valueToCode(ne,"BLUE",Oe.NONE)||0,[Se.provideFunction_("colourRgb",` function ${Se.FUNCTION_NAME_PLACEHOLDER_}(r, g, b) { r = Math.max(Math.min(Number(r), 100), 0) * 2.55; g = Math.max(Math.min(Number(g), 100), 0) * 2.55; @@ -833,7 +833,7 @@ function ${Se.FUNCTION_NAME_PLACEHOLDER_}(r, g, b) { b = ('0' + (Math.round(b) || 0).toString(16)).slice(-2); return '#' + r + g + b; } -`)+"("+We+", "+ot+", "+ne+")",Le.FUNCTION_CALL]},u=function(ne,Se){const We=Se.valueToCode(ne,"COLOUR1",Le.NONE)||"'#000000'",ot=Se.valueToCode(ne,"COLOUR2",Le.NONE)||"'#000000'";return ne=Se.valueToCode(ne,"RATIO",Le.NONE)||.5,[Se.provideFunction_("colourBlend",` +`)+"("+We+", "+at+", "+ne+")",Oe.FUNCTION_CALL]},u=function(ne,Se){const We=Se.valueToCode(ne,"COLOUR1",Oe.NONE)||"'#000000'",at=Se.valueToCode(ne,"COLOUR2",Oe.NONE)||"'#000000'";return ne=Se.valueToCode(ne,"RATIO",Oe.NONE)||.5,[Se.provideFunction_("colourBlend",` function ${Se.FUNCTION_NAME_PLACEHOLDER_}(c1, c2, ratio) { ratio = Math.max(Math.min(Number(ratio), 1), 0); var r1 = parseInt(c1.substring(1, 3), 16); @@ -850,7 +850,7 @@ function ${Se.FUNCTION_NAME_PLACEHOLDER_}(c1, c2, ratio) { b = ('0' + (b || 0).toString(16)).slice(-2); return '#' + r + g + b; } -`)+"("+We+", "+ot+", "+ne+")",Le.FUNCTION_CALL]},h=function(ne,Se){return["[]",Le.ATOMIC]},f=function(ne,Se){const We=Array(ne.itemCount_);for(let ot=0;ot",GTE:">="}[ne.getFieldValue("OP")],ot=We==="=="||We==="!="?Le.EQUALITY:Le.RELATIONAL,zt=Se.valueToCode(ne,"A",ot)||"0";return ne=Se.valueToCode(ne,"B",ot)||"0",[zt+" "+We+" "+ne,ot]},U=function(ne,Se){const We=ne.getFieldValue("OP")==="AND"?"&&":"||",ot=We==="&&"?Le.LOGICAL_AND:Le.LOGICAL_OR;let zt=Se.valueToCode(ne,"A",ot);return ne=Se.valueToCode(ne,"B",ot),zt||ne?(Se=We==="&&"?"true":"false",zt||(zt=Se),ne||(ne=Se)):ne=zt="false",[zt+" "+We+" "+ne,ot]},V=function(ne,Se){const We=Le.LOGICAL_NOT;return["!"+(Se.valueToCode(ne,"BOOL",We)||"true"),We]},H=function(ne,Se){return[ne.getFieldValue("BOOL")==="TRUE"?"true":"false",Le.ATOMIC]},oe=function(ne,Se){return["null",Le.ATOMIC]},le=function(ne,Se){const We=Se.valueToCode(ne,"IF",Le.CONDITIONAL)||"false",ot=Se.valueToCode(ne,"THEN",Le.CONDITIONAL)||"null";return ne=Se.valueToCode(ne,"ELSE",Le.CONDITIONAL)||"null",[We+" ? "+ot+" : "+ne,Le.CONDITIONAL]},Z=function(ne,Se){let We;We=ne.getField("TIMES")?String(Number(ne.getFieldValue("TIMES"))):Se.valueToCode(ne,"TIMES",Le.ASSIGNMENT)||"0";let ot=Se.statementToCode(ne,"DO");ot=Se.addLoopTrap(ot,ne),ne="";const zt=Se.nameDB_.getDistinctName("count",r.NameType$$module$build$src$core$names.VARIABLE);let sn=We;return We.match(/^\w+$/)||r.isNumber$$module$build$src$core$utils$string(We)||(sn=Se.nameDB_.getDistinctName("repeat_end",r.NameType$$module$build$src$core$names.VARIABLE),ne+="var "+sn+" = "+We+`; + `),[We+".slice().sort("+Se+'("'+ne+'", '+at+"))",Oe.FUNCTION_CALL]},L=function(ne,Se){let We=Se.valueToCode(ne,"INPUT",Oe.MEMBER);if(Se=Se.valueToCode(ne,"DELIM",Oe.NONE)||"''",ne=ne.getFieldValue("MODE"),ne==="SPLIT")We||(We="''"),ne="split";else if(ne==="JOIN")We||(We="[]"),ne="join";else throw Error("Unknown mode: "+ne);return[We+"."+ne+"("+Se+")",Oe.FUNCTION_CALL]},P=function(ne,Se){return[(Se.valueToCode(ne,"LIST",Oe.FUNCTION_CALL)||"[]")+".slice().reverse()",Oe.FUNCTION_CALL]},D=function(ne,Se){var We=0;let at="";Se.STATEMENT_PREFIX&&(at+=Se.injectId(Se.STATEMENT_PREFIX,ne));do{const zt=Se.valueToCode(ne,"IF"+We,Oe.NONE)||"false";let sn=Se.statementToCode(ne,"DO"+We);Se.STATEMENT_SUFFIX&&(sn=Se.prefixLines(Se.injectId(Se.STATEMENT_SUFFIX,ne),Se.INDENT)+sn),at+=(0",GTE:">="}[ne.getFieldValue("OP")],at=We==="=="||We==="!="?Oe.EQUALITY:Oe.RELATIONAL,zt=Se.valueToCode(ne,"A",at)||"0";return ne=Se.valueToCode(ne,"B",at)||"0",[zt+" "+We+" "+ne,at]},U=function(ne,Se){const We=ne.getFieldValue("OP")==="AND"?"&&":"||",at=We==="&&"?Oe.LOGICAL_AND:Oe.LOGICAL_OR;let zt=Se.valueToCode(ne,"A",at);return ne=Se.valueToCode(ne,"B",at),zt||ne?(Se=We==="&&"?"true":"false",zt||(zt=Se),ne||(ne=Se)):ne=zt="false",[zt+" "+We+" "+ne,at]},V=function(ne,Se){const We=Oe.LOGICAL_NOT;return["!"+(Se.valueToCode(ne,"BOOL",We)||"true"),We]},H=function(ne,Se){return[ne.getFieldValue("BOOL")==="TRUE"?"true":"false",Oe.ATOMIC]},oe=function(ne,Se){return["null",Oe.ATOMIC]},le=function(ne,Se){const We=Se.valueToCode(ne,"IF",Oe.CONDITIONAL)||"false",at=Se.valueToCode(ne,"THEN",Oe.CONDITIONAL)||"null";return ne=Se.valueToCode(ne,"ELSE",Oe.CONDITIONAL)||"null",[We+" ? "+at+" : "+ne,Oe.CONDITIONAL]},Z=function(ne,Se){let We;We=ne.getField("TIMES")?String(Number(ne.getFieldValue("TIMES"))):Se.valueToCode(ne,"TIMES",Oe.ASSIGNMENT)||"0";let at=Se.statementToCode(ne,"DO");at=Se.addLoopTrap(at,ne),ne="";const zt=Se.nameDB_.getDistinctName("count",r.NameType$$module$build$src$core$names.VARIABLE);let sn=We;return We.match(/^\w+$/)||r.isNumber$$module$build$src$core$utils$string(We)||(sn=Se.nameDB_.getDistinctName("repeat_end",r.NameType$$module$build$src$core$names.VARIABLE),ne+="var "+sn+" = "+We+`; `),ne+("for (var "+zt+" = 0; "+zt+" < "+sn+"; "+zt+`++) { -`+ot+`} -`)},q=function(ne,Se){const We=ne.getFieldValue("MODE")==="UNTIL";let ot=Se.valueToCode(ne,"BOOL",We?Le.LOGICAL_NOT:Le.NONE)||"false",zt=Se.statementToCode(ne,"DO");return zt=Se.addLoopTrap(zt,ne),We&&(ot="!"+ot),"while ("+ot+`) { +`+at+`} +`)},q=function(ne,Se){const We=ne.getFieldValue("MODE")==="UNTIL";let at=Se.valueToCode(ne,"BOOL",We?Oe.LOGICAL_NOT:Oe.NONE)||"false",zt=Se.statementToCode(ne,"DO");return zt=Se.addLoopTrap(zt,ne),We&&(at="!"+at),"while ("+at+`) { `+zt+`} -`},he=function(ne,Se){var We=Se.getVariableName(ne.getFieldValue("VAR")),ot=Se.valueToCode(ne,"FROM",Le.ASSIGNMENT)||"0",zt=Se.valueToCode(ne,"TO",Le.ASSIGNMENT)||"0";const sn=Se.valueToCode(ne,"BY",Le.ASSIGNMENT)||"1";let Nn=Se.statementToCode(ne,"DO");if(Nn=Se.addLoopTrap(Nn,ne),r.isNumber$$module$build$src$core$utils$string(ot)&&r.isNumber$$module$build$src$core$utils$string(zt)&&r.isNumber$$module$build$src$core$utils$string(sn))Se=Number(ot)<=Number(zt),ne="for ("+We+" = "+ot+"; "+We+(Se?" <= ":" >= ")+zt+"; "+We,We=Math.abs(Number(sn)),ne=We===1?ne+(Se?"++":"--"):ne+((Se?" += ":" -= ")+We),ne+=`) { +`},he=function(ne,Se){var We=Se.getVariableName(ne.getFieldValue("VAR")),at=Se.valueToCode(ne,"FROM",Oe.ASSIGNMENT)||"0",zt=Se.valueToCode(ne,"TO",Oe.ASSIGNMENT)||"0";const sn=Se.valueToCode(ne,"BY",Oe.ASSIGNMENT)||"1";let Nn=Se.statementToCode(ne,"DO");if(Nn=Se.addLoopTrap(Nn,ne),r.isNumber$$module$build$src$core$utils$string(at)&&r.isNumber$$module$build$src$core$utils$string(zt)&&r.isNumber$$module$build$src$core$utils$string(sn))Se=Number(at)<=Number(zt),ne="for ("+We+" = "+at+"; "+We+(Se?" <= ":" >= ")+zt+"; "+We,We=Math.abs(Number(sn)),ne=We===1?ne+(Se?"++":"--"):ne+((Se?" += ":" -= ")+We),ne+=`) { `+Nn+`} -`;else{ne="";let Pe=ot;ot.match(/^\w+$/)||r.isNumber$$module$build$src$core$utils$string(ot)||(Pe=Se.nameDB_.getDistinctName(We+"_start",r.NameType$$module$build$src$core$names.VARIABLE),ne+="var "+Pe+" = "+ot+`; -`),ot=zt,zt.match(/^\w+$/)||r.isNumber$$module$build$src$core$utils$string(zt)||(ot=Se.nameDB_.getDistinctName(We+"_end",r.NameType$$module$build$src$core$names.VARIABLE),ne+="var "+ot+" = "+zt+`; +`;else{ne="";let De=at;at.match(/^\w+$/)||r.isNumber$$module$build$src$core$utils$string(at)||(De=Se.nameDB_.getDistinctName(We+"_start",r.NameType$$module$build$src$core$names.VARIABLE),ne+="var "+De+" = "+at+`; +`),at=zt,zt.match(/^\w+$/)||r.isNumber$$module$build$src$core$utils$string(zt)||(at=Se.nameDB_.getDistinctName(We+"_end",r.NameType$$module$build$src$core$names.VARIABLE),ne+="var "+at+" = "+zt+`; `),zt=Se.nameDB_.getDistinctName(We+"_inc",r.NameType$$module$build$src$core$names.VARIABLE),ne+="var "+zt+" = ",ne=r.isNumber$$module$build$src$core$utils$string(sn)?ne+(Math.abs(Number(sn))+`; `):ne+("Math.abs("+sn+`); -`),ne+="if ("+Pe+" > "+ot+`) { +`),ne+="if ("+De+" > "+at+`) { `,ne+=Se.INDENT+zt+" = -"+zt+`; `,ne=ne+`} -for (`+(We+" = "+Pe+"; "+zt+" >= 0 ? "+We+" <= "+ot+" : "+We+" >= "+ot+"; "+We+" += "+zt+`) { +for (`+(We+" = "+De+"; "+zt+" >= 0 ? "+We+" <= "+at+" : "+We+" >= "+at+"; "+We+" += "+zt+`) { `+Nn+`} -`)}return ne},ae=function(ne,Se){const We=Se.getVariableName(ne.getFieldValue("VAR"));var ot=Se.valueToCode(ne,"LIST",Le.ASSIGNMENT)||"[]";let zt=Se.statementToCode(ne,"DO");zt=Se.addLoopTrap(zt,ne),ne="";let sn=ot;return ot.match(/^\w+$/)||(sn=Se.nameDB_.getDistinctName(We+"_list",r.NameType$$module$build$src$core$names.VARIABLE),ne+="var "+sn+" = "+ot+`; -`),ot=Se.nameDB_.getDistinctName(We+"_index",r.NameType$$module$build$src$core$names.VARIABLE),zt=Se.INDENT+We+" = "+sn+"["+ot+`]; -`+zt,ne+("for (var "+ot+" in "+sn+`) { +`)}return ne},ae=function(ne,Se){const We=Se.getVariableName(ne.getFieldValue("VAR"));var at=Se.valueToCode(ne,"LIST",Oe.ASSIGNMENT)||"[]";let zt=Se.statementToCode(ne,"DO");zt=Se.addLoopTrap(zt,ne),ne="";let sn=at;return at.match(/^\w+$/)||(sn=Se.nameDB_.getDistinctName(We+"_list",r.NameType$$module$build$src$core$names.VARIABLE),ne+="var "+sn+" = "+at+`; +`),at=Se.nameDB_.getDistinctName(We+"_index",r.NameType$$module$build$src$core$names.VARIABLE),zt=Se.INDENT+We+" = "+sn+"["+at+`]; +`+zt,ne+("for (var "+at+" in "+sn+`) { `+zt+`} -`)},ue=function(ne,Se){let We="";if(Se.STATEMENT_PREFIX&&(We+=Se.injectId(Se.STATEMENT_PREFIX,ne)),Se.STATEMENT_SUFFIX&&(We+=Se.injectId(Se.STATEMENT_SUFFIX,ne)),Se.STATEMENT_PREFIX){const ot=ne.getSurroundLoop();ot&&!ot.suppressPrefixSuffix&&(We+=Se.injectId(Se.STATEMENT_PREFIX,ot))}switch(ne.getFieldValue("FLOW")){case"BREAK":return We+`break; +`)},ue=function(ne,Se){let We="";if(Se.STATEMENT_PREFIX&&(We+=Se.injectId(Se.STATEMENT_PREFIX,ne)),Se.STATEMENT_SUFFIX&&(We+=Se.injectId(Se.STATEMENT_SUFFIX,ne)),Se.STATEMENT_PREFIX){const at=ne.getSurroundLoop();at&&!at.suppressPrefixSuffix&&(We+=Se.injectId(Se.STATEMENT_PREFIX,at))}switch(ne.getFieldValue("FLOW")){case"BREAK":return We+`break; `;case"CONTINUE":return We+`continue; -`}throw Error("Unknown flow statement.")},ge=function(ne,Se){return ne=Number(ne.getFieldValue("NUM")),[String(ne),0<=ne?Le.ATOMIC:Le.UNARY_NEGATION]},we=function(ne,Se){var We={ADD:[" + ",Le.ADDITION],MINUS:[" - ",Le.SUBTRACTION],MULTIPLY:[" * ",Le.MULTIPLICATION],DIVIDE:[" / ",Le.DIVISION],POWER:[null,Le.NONE]}[ne.getFieldValue("OP")];const ot=We[0];We=We[1];const zt=Se.valueToCode(ne,"A",We)||"0";return ne=Se.valueToCode(ne,"B",We)||"0",ot?[zt+ot+ne,We]:["Math.pow("+zt+", "+ne+")",Le.FUNCTION_CALL]},J=function(ne,Se){const We=ne.getFieldValue("OP");let ot;if(We==="NEG")return ne=Se.valueToCode(ne,"NUM",Le.UNARY_NEGATION)||"0",ne[0]==="-"&&(ne=" "+ne),["-"+ne,Le.UNARY_NEGATION];switch(ne=We==="SIN"||We==="COS"||We==="TAN"?Se.valueToCode(ne,"NUM",Le.DIVISION)||"0":Se.valueToCode(ne,"NUM",Le.NONE)||"0",We){case"ABS":ot="Math.abs("+ne+")";break;case"ROOT":ot="Math.sqrt("+ne+")";break;case"LN":ot="Math.log("+ne+")";break;case"EXP":ot="Math.exp("+ne+")";break;case"POW10":ot="Math.pow(10,"+ne+")";break;case"ROUND":ot="Math.round("+ne+")";break;case"ROUNDUP":ot="Math.ceil("+ne+")";break;case"ROUNDDOWN":ot="Math.floor("+ne+")";break;case"SIN":ot="Math.sin("+ne+" / 180 * Math.PI)";break;case"COS":ot="Math.cos("+ne+" / 180 * Math.PI)";break;case"TAN":ot="Math.tan("+ne+" / 180 * Math.PI)"}if(ot)return[ot,Le.FUNCTION_CALL];switch(We){case"LOG10":ot="Math.log("+ne+") / Math.log(10)";break;case"ASIN":ot="Math.asin("+ne+") / Math.PI * 180";break;case"ACOS":ot="Math.acos("+ne+") / Math.PI * 180";break;case"ATAN":ot="Math.atan("+ne+") / Math.PI * 180";break;default:throw Error("Unknown math operator: "+We)}return[ot,Le.DIVISION]},re=function(ne,Se){return{PI:["Math.PI",Le.MEMBER],E:["Math.E",Le.MEMBER],GOLDEN_RATIO:["(1 + Math.sqrt(5)) / 2",Le.DIVISION],SQRT2:["Math.SQRT2",Le.MEMBER],SQRT1_2:["Math.SQRT1_2",Le.MEMBER],INFINITY:["Infinity",Le.ATOMIC]}[ne.getFieldValue("CONSTANT")]},ie=function(ne,Se){var We={EVEN:[" % 2 === 0",Le.MODULUS,Le.EQUALITY],ODD:[" % 2 === 1",Le.MODULUS,Le.EQUALITY],WHOLE:[" % 1 === 0",Le.MODULUS,Le.EQUALITY],POSITIVE:[" > 0",Le.RELATIONAL,Le.RELATIONAL],NEGATIVE:[" < 0",Le.RELATIONAL,Le.RELATIONAL],DIVISIBLE_BY:[null,Le.MODULUS,Le.EQUALITY],PRIME:[null,Le.NONE,Le.FUNCTION_CALL]};const ot=ne.getFieldValue("PROPERTY"),[zt,sn,Nn]=We[ot];return We=Se.valueToCode(ne,"NUMBER_TO_CHECK",sn)||"0",ot==="PRIME"?ne=Se.provideFunction_("mathIsPrime",` +`}throw Error("Unknown flow statement.")},ge=function(ne,Se){return ne=Number(ne.getFieldValue("NUM")),[String(ne),0<=ne?Oe.ATOMIC:Oe.UNARY_NEGATION]},we=function(ne,Se){var We={ADD:[" + ",Oe.ADDITION],MINUS:[" - ",Oe.SUBTRACTION],MULTIPLY:[" * ",Oe.MULTIPLICATION],DIVIDE:[" / ",Oe.DIVISION],POWER:[null,Oe.NONE]}[ne.getFieldValue("OP")];const at=We[0];We=We[1];const zt=Se.valueToCode(ne,"A",We)||"0";return ne=Se.valueToCode(ne,"B",We)||"0",at?[zt+at+ne,We]:["Math.pow("+zt+", "+ne+")",Oe.FUNCTION_CALL]},J=function(ne,Se){const We=ne.getFieldValue("OP");let at;if(We==="NEG")return ne=Se.valueToCode(ne,"NUM",Oe.UNARY_NEGATION)||"0",ne[0]==="-"&&(ne=" "+ne),["-"+ne,Oe.UNARY_NEGATION];switch(ne=We==="SIN"||We==="COS"||We==="TAN"?Se.valueToCode(ne,"NUM",Oe.DIVISION)||"0":Se.valueToCode(ne,"NUM",Oe.NONE)||"0",We){case"ABS":at="Math.abs("+ne+")";break;case"ROOT":at="Math.sqrt("+ne+")";break;case"LN":at="Math.log("+ne+")";break;case"EXP":at="Math.exp("+ne+")";break;case"POW10":at="Math.pow(10,"+ne+")";break;case"ROUND":at="Math.round("+ne+")";break;case"ROUNDUP":at="Math.ceil("+ne+")";break;case"ROUNDDOWN":at="Math.floor("+ne+")";break;case"SIN":at="Math.sin("+ne+" / 180 * Math.PI)";break;case"COS":at="Math.cos("+ne+" / 180 * Math.PI)";break;case"TAN":at="Math.tan("+ne+" / 180 * Math.PI)"}if(at)return[at,Oe.FUNCTION_CALL];switch(We){case"LOG10":at="Math.log("+ne+") / Math.log(10)";break;case"ASIN":at="Math.asin("+ne+") / Math.PI * 180";break;case"ACOS":at="Math.acos("+ne+") / Math.PI * 180";break;case"ATAN":at="Math.atan("+ne+") / Math.PI * 180";break;default:throw Error("Unknown math operator: "+We)}return[at,Oe.DIVISION]},re=function(ne,Se){return{PI:["Math.PI",Oe.MEMBER],E:["Math.E",Oe.MEMBER],GOLDEN_RATIO:["(1 + Math.sqrt(5)) / 2",Oe.DIVISION],SQRT2:["Math.SQRT2",Oe.MEMBER],SQRT1_2:["Math.SQRT1_2",Oe.MEMBER],INFINITY:["Infinity",Oe.ATOMIC]}[ne.getFieldValue("CONSTANT")]},se=function(ne,Se){var We={EVEN:[" % 2 === 0",Oe.MODULUS,Oe.EQUALITY],ODD:[" % 2 === 1",Oe.MODULUS,Oe.EQUALITY],WHOLE:[" % 1 === 0",Oe.MODULUS,Oe.EQUALITY],POSITIVE:[" > 0",Oe.RELATIONAL,Oe.RELATIONAL],NEGATIVE:[" < 0",Oe.RELATIONAL,Oe.RELATIONAL],DIVISIBLE_BY:[null,Oe.MODULUS,Oe.EQUALITY],PRIME:[null,Oe.NONE,Oe.FUNCTION_CALL]};const at=ne.getFieldValue("PROPERTY"),[zt,sn,Nn]=We[at];return We=Se.valueToCode(ne,"NUMBER_TO_CHECK",sn)||"0",at==="PRIME"?ne=Se.provideFunction_("mathIsPrime",` function ${Se.FUNCTION_NAME_PLACEHOLDER_}(n) { // https://en.wikipedia.org/wiki/Primality_test#Naive_methods if (n == 2 || n == 3) { @@ -946,12 +946,12 @@ function ${Se.FUNCTION_NAME_PLACEHOLDER_}(n) { } return true; } -`)+"("+We+")":ot==="DIVISIBLE_BY"?(ne=Se.valueToCode(ne,"DIVISOR",Le.MODULUS)||"0",ne=We+" % "+ne+" === 0"):ne=We+zt,[ne,Nn]},fe=function(ne,Se){const We=Se.valueToCode(ne,"DELTA",Le.ADDITION)||"0";return ne=Se.getVariableName(ne.getFieldValue("VAR")),ne+" = (typeof "+ne+" === 'number' ? "+ne+" : 0) + "+We+`; -`},Te=function(ne,Se){var We=ne.getFieldValue("OP");switch(We){case"SUM":ne=Se.valueToCode(ne,"LIST",Le.MEMBER)||"[]",ne+=".reduce(function(x, y) {return x + y;}, 0)";break;case"MIN":ne=Se.valueToCode(ne,"LIST",Le.NONE)||"[]",ne="Math.min.apply(null, "+ne+")";break;case"MAX":ne=Se.valueToCode(ne,"LIST",Le.NONE)||"[]",ne="Math.max.apply(null, "+ne+")";break;case"AVERAGE":We=Se.provideFunction_("mathMean",` +`)+"("+We+")":at==="DIVISIBLE_BY"?(ne=Se.valueToCode(ne,"DIVISOR",Oe.MODULUS)||"0",ne=We+" % "+ne+" === 0"):ne=We+zt,[ne,Nn]},fe=function(ne,Se){const We=Se.valueToCode(ne,"DELTA",Oe.ADDITION)||"0";return ne=Se.getVariableName(ne.getFieldValue("VAR")),ne+" = (typeof "+ne+" === 'number' ? "+ne+" : 0) + "+We+`; +`},Te=function(ne,Se){var We=ne.getFieldValue("OP");switch(We){case"SUM":ne=Se.valueToCode(ne,"LIST",Oe.MEMBER)||"[]",ne+=".reduce(function(x, y) {return x + y;}, 0)";break;case"MIN":ne=Se.valueToCode(ne,"LIST",Oe.NONE)||"[]",ne="Math.min.apply(null, "+ne+")";break;case"MAX":ne=Se.valueToCode(ne,"LIST",Oe.NONE)||"[]",ne="Math.max.apply(null, "+ne+")";break;case"AVERAGE":We=Se.provideFunction_("mathMean",` function ${Se.FUNCTION_NAME_PLACEHOLDER_}(myList) { return myList.reduce(function(x, y) {return x + y;}, 0) / myList.length; } -`),ne=Se.valueToCode(ne,"LIST",Le.NONE)||"[]",ne=We+"("+ne+")";break;case"MEDIAN":We=Se.provideFunction_("mathMedian",` +`),ne=Se.valueToCode(ne,"LIST",Oe.NONE)||"[]",ne=We+"("+ne+")";break;case"MEDIAN":We=Se.provideFunction_("mathMedian",` function ${Se.FUNCTION_NAME_PLACEHOLDER_}(myList) { var localList = myList.filter(function (x) {return typeof x === 'number';}); if (!localList.length) return null; @@ -962,7 +962,7 @@ function ${Se.FUNCTION_NAME_PLACEHOLDER_}(myList) { return localList[(localList.length - 1) / 2]; } } -`),ne=Se.valueToCode(ne,"LIST",Le.NONE)||"[]",ne=We+"("+ne+")";break;case"MODE":We=Se.provideFunction_("mathModes",` +`),ne=Se.valueToCode(ne,"LIST",Oe.NONE)||"[]",ne=We+"("+ne+")";break;case"MODE":We=Se.provideFunction_("mathModes",` function ${Se.FUNCTION_NAME_PLACEHOLDER_}(values) { var modes = []; var counts = []; @@ -991,7 +991,7 @@ function ${Se.FUNCTION_NAME_PLACEHOLDER_}(values) { } return modes; } -`),ne=Se.valueToCode(ne,"LIST",Le.NONE)||"[]",ne=We+"("+ne+")";break;case"STD_DEV":We=Se.provideFunction_("mathStandardDeviation",` +`),ne=Se.valueToCode(ne,"LIST",Oe.NONE)||"[]",ne=We+"("+ne+")";break;case"STD_DEV":We=Se.provideFunction_("mathStandardDeviation",` function ${Se.FUNCTION_NAME_PLACEHOLDER_}(numbers) { var n = numbers.length; if (!n) return null; @@ -1003,12 +1003,12 @@ function ${Se.FUNCTION_NAME_PLACEHOLDER_}(numbers) { variance = variance / n; return Math.sqrt(variance); } -`),ne=Se.valueToCode(ne,"LIST",Le.NONE)||"[]",ne=We+"("+ne+")";break;case"RANDOM":We=Se.provideFunction_("mathRandomList",` +`),ne=Se.valueToCode(ne,"LIST",Oe.NONE)||"[]",ne=We+"("+ne+")";break;case"RANDOM":We=Se.provideFunction_("mathRandomList",` function ${Se.FUNCTION_NAME_PLACEHOLDER_}(list) { var x = Math.floor(Math.random() * list.length); return list[x]; } -`),ne=Se.valueToCode(ne,"LIST",Le.NONE)||"[]",ne=We+"("+ne+")";break;default:throw Error("Unknown operator: "+We)}return[ne,Le.FUNCTION_CALL]},Fe=function(ne,Se){const We=Se.valueToCode(ne,"DIVIDEND",Le.MODULUS)||"0";return ne=Se.valueToCode(ne,"DIVISOR",Le.MODULUS)||"0",[We+" % "+ne,Le.MODULUS]},Ie=function(ne,Se){const We=Se.valueToCode(ne,"VALUE",Le.NONE)||"0",ot=Se.valueToCode(ne,"LOW",Le.NONE)||"0";return ne=Se.valueToCode(ne,"HIGH",Le.NONE)||"Infinity",["Math.min(Math.max("+We+", "+ot+"), "+ne+")",Le.FUNCTION_CALL]},Je=function(ne,Se){const We=Se.valueToCode(ne,"FROM",Le.NONE)||"0";return ne=Se.valueToCode(ne,"TO",Le.NONE)||"0",[Se.provideFunction_("mathRandomInt",` +`),ne=Se.valueToCode(ne,"LIST",Oe.NONE)||"[]",ne=We+"("+ne+")";break;default:throw Error("Unknown operator: "+We)}return[ne,Oe.FUNCTION_CALL]},Fe=function(ne,Se){const We=Se.valueToCode(ne,"DIVIDEND",Oe.MODULUS)||"0";return ne=Se.valueToCode(ne,"DIVISOR",Oe.MODULUS)||"0",[We+" % "+ne,Oe.MODULUS]},Ie=function(ne,Se){const We=Se.valueToCode(ne,"VALUE",Oe.NONE)||"0",at=Se.valueToCode(ne,"LOW",Oe.NONE)||"0";return ne=Se.valueToCode(ne,"HIGH",Oe.NONE)||"Infinity",["Math.min(Math.max("+We+", "+at+"), "+ne+")",Oe.FUNCTION_CALL]},qe=function(ne,Se){const We=Se.valueToCode(ne,"FROM",Oe.NONE)||"0";return ne=Se.valueToCode(ne,"TO",Oe.NONE)||"0",[Se.provideFunction_("mathRandomInt",` function ${Se.FUNCTION_NAME_PLACEHOLDER_}(a, b) { if (a > b) { // Swap a and b to ensure a is smaller. @@ -1018,32 +1018,32 @@ function ${Se.FUNCTION_NAME_PLACEHOLDER_}(a, b) { } return Math.floor(Math.random() * (b - a + 1) + a); } -`)+"("+We+", "+ne+")",Le.FUNCTION_CALL]},Re=function(ne,Se){return["Math.random()",Le.FUNCTION_CALL]},Qe=function(ne,Se){const We=Se.valueToCode(ne,"X",Le.NONE)||"0";return["Math.atan2("+(Se.valueToCode(ne,"Y",Le.NONE)||"0")+", "+We+") / Math.PI * 180",Le.DIVISION]},nt=function(ne,Se){const We=Se.getProcedureName(ne.getFieldValue("NAME"));var ot="";Se.STATEMENT_PREFIX&&(ot+=Se.injectId(Se.STATEMENT_PREFIX,ne)),Se.STATEMENT_SUFFIX&&(ot+=Se.injectId(Se.STATEMENT_SUFFIX,ne)),ot&&(ot=Se.prefixLines(ot,Se.INDENT));let zt="";Se.INFINITE_LOOP_TRAP&&(zt=Se.prefixLines(Se.injectId(Se.INFINITE_LOOP_TRAP,ne),Se.INDENT));const sn=Se.statementToCode(ne,"STACK");let Nn=Se.valueToCode(ne,"RETURN",Le.NONE)||"",Pe="";sn&&Nn&&(Pe=ot),Nn&&(Nn=Se.INDENT+"return "+Nn+`; -`);const gt=[],Ct=ne.getVars();for(let bt=0;btWe?Nn=Le.SUBTRACTION:ot&&(Nn=Le.UNARY_NEGATION),ne=this.valueToCode(ne,Se,Nn)||sn,We===0&&!ot?ne:r.isNumber$$module$build$src$core$utils$string(ne)?(ne=String(Number(ne)+We),ot&&(ne=String(-Number(ne))),ne):(0We&&(ne=`${ne} - ${-We}`),ot&&(ne=We?`-(${ne})`:`-${ne}`),Math.floor(zt)>=Math.floor(Nn)&&(ne=`(${ne})`),ne)}},te={};te.colour_blend=u,te.colour_picker=s,te.colour_random=o,te.colour_rgb=l;var me=function(ne,Se,We){return Se==="FIRST"?"0":Se==="FROM_END"?ne+".length - 1 - "+We:Se==="LAST"?ne+".length - 1":We},ke={};ke.lists_create_empty=h,ke.lists_create_with=f,ke.lists_getIndex=C,ke.lists_getSublist=A,ke.lists_indexOf=w,ke.lists_isEmpty=b,ke.lists_length=y,ke.lists_repeat=g,ke.lists_reverse=P,ke.lists_setIndex=M,ke.lists_sort=k,ke.lists_split=L;var Xe={};Xe.controls_if=D,Xe.controls_ifelse=D,Xe.logic_boolean=H,Xe.logic_compare=z,Xe.logic_negate=V,Xe.logic_null=oe,Xe.logic_operation=U,Xe.logic_ternary=le;var Wt={};Wt.controls_flow_statements=ue,Wt.controls_for=he,Wt.controls_forEach=ae,Wt.controls_repeat=Z,Wt.controls_repeat_ext=Z,Wt.controls_whileUntil=q;var Ge={};Ge.math_arithmetic=we,Ge.math_atan2=Qe,Ge.math_change=fe,Ge.math_constant=re,Ge.math_constrain=Ie,Ge.math_modulo=Fe,Ge.math_number=ge,Ge.math_number_property=ie,Ge.math_on_list=Te,Ge.math_random_float=Re,Ge.math_random_int=Je,Ge.math_round=J,Ge.math_single=J,Ge.math_trig=J;var tn={};tn.procedures_callnoreturn=lt,tn.procedures_callreturn=ft,tn.procedures_defnoreturn=nt,tn.procedures_defreturn=nt,tn.procedures_ifreturn=ze;var _t=/^\s*'([^']|\\')*'\s*$/,Jt=function(ne){return _t.test(ne)?[ne,Le.ATOMIC]:["String("+ne+")",Le.FUNCTION_CALL]},Kt=function(ne,Se,We){return Se==="FIRST"?"0":Se==="FROM_END"?ne+".length - 1 - "+We:Se==="LAST"?ne+".length - 1":We},On={};On.text=Ce,On.text_append=it,On.text_changeCase=mt,On.text_charAt=Mt,On.text_count=ht,On.text_getSubstring=At,On.text_indexOf=vt,On.text_isEmpty=kt,On.text_join=rt,On.text_length=Nt,On.text_multiline=He,On.text_print=se,On.text_prompt=$e,On.text_prompt_ext=$e,On.text_replace=St,On.text_reverse=It,On.text_trim=xe;var ii={};ii.variables_get=pt,ii.variables_set=Ke;var Pr={};Pr.variables_get_dynamic=pt,Pr.variables_set_dynamic=Ke;var Ei=new Q,xr=Object.assign({},te,ke,Xe,Wt,Ge,tn,On,ii,Pr);for(const ne in xr)Ei.forBlock[ne]=xr[ne];var mr={};return mr.JavascriptGenerator=Q,mr.Order=Le,mr.javascriptGenerator=Ei,mr.__namespace__=r,mr})}(hO)),hO.exports}(function(n,e){(function(t,r){n.exports=r(N3(),bie())})(Vl,function(t,r){/** +`)}scrub_(ne,Se,We=!1){let at="";if(!ne.outputConnection||!ne.outputConnection.targetConnection){var zt=ne.getCommentText();zt&&(zt=r.wrap$$module$build$src$core$utils$string(zt,this.COMMENT_WRAP-3),at+=this.prefixLines(zt+` +`,"// "));for(let sn=0;snWe?Nn=Oe.SUBTRACTION:at&&(Nn=Oe.UNARY_NEGATION),ne=this.valueToCode(ne,Se,Nn)||sn,We===0&&!at?ne:r.isNumber$$module$build$src$core$utils$string(ne)?(ne=String(Number(ne)+We),at&&(ne=String(-Number(ne))),ne):(0We&&(ne=`${ne} - ${-We}`),at&&(ne=We?`-(${ne})`:`-${ne}`),Math.floor(zt)>=Math.floor(Nn)&&(ne=`(${ne})`),ne)}},te={};te.colour_blend=u,te.colour_picker=s,te.colour_random=o,te.colour_rgb=l;var pe=function(ne,Se,We){return Se==="FIRST"?"0":Se==="FROM_END"?ne+".length - 1 - "+We:Se==="LAST"?ne+".length - 1":We},Ae={};Ae.lists_create_empty=h,Ae.lists_create_with=f,Ae.lists_getIndex=C,Ae.lists_getSublist=A,Ae.lists_indexOf=w,Ae.lists_isEmpty=b,Ae.lists_length=y,Ae.lists_repeat=g,Ae.lists_reverse=P,Ae.lists_setIndex=M,Ae.lists_sort=k,Ae.lists_split=L;var Je={};Je.controls_if=D,Je.controls_ifelse=D,Je.logic_boolean=H,Je.logic_compare=z,Je.logic_negate=V,Je.logic_null=oe,Je.logic_operation=U,Je.logic_ternary=le;var jt={};jt.controls_flow_statements=ue,jt.controls_for=he,jt.controls_forEach=ae,jt.controls_repeat=Z,jt.controls_repeat_ext=Z,jt.controls_whileUntil=q;var Ge={};Ge.math_arithmetic=we,Ge.math_atan2=Ze,Ge.math_change=fe,Ge.math_constant=re,Ge.math_constrain=Ie,Ge.math_modulo=Fe,Ge.math_number=ge,Ge.math_number_property=se,Ge.math_on_list=Te,Ge.math_random_float=Re,Ge.math_random_int=qe,Ge.math_round=J,Ge.math_single=J,Ge.math_trig=J;var qt={};qt.procedures_callnoreturn=ut,qt.procedures_callreturn=ft,qt.procedures_defnoreturn=rt,qt.procedures_defreturn=rt,qt.procedures_ifreturn=ze;var pt=/^\s*'([^']|\\')*'\s*$/,Jt=function(ne){return pt.test(ne)?[ne,Oe.ATOMIC]:["String("+ne+")",Oe.FUNCTION_CALL]},Xt=function(ne,Se,We){return Se==="FIRST"?"0":Se==="FROM_END"?ne+".length - 1 - "+We:Se==="LAST"?ne+".length - 1":We},xn={};xn.text=$e,xn.text_append=st,xn.text_changeCase=gt,xn.text_charAt=Ct,xn.text_count=Ye,xn.text_getSubstring=At,xn.text_indexOf=vt,xn.text_isEmpty=kt,xn.text_join=it,xn.text_length=Nt,xn.text_multiline=He,xn.text_print=ie,xn.text_prompt=Pe,xn.text_prompt_ext=Pe,xn.text_replace=St,xn.text_reverse=It,xn.text_trim=xe;var ii={};ii.variables_get=mt,ii.variables_set=Ke;var Pr={};Pr.variables_get_dynamic=mt,Pr.variables_set_dynamic=Ke;var Ei=new Q,xr=Object.assign({},te,Ae,Je,jt,Ge,qt,xn,ii,Pr);for(const ne in xr)Ei.forBlock[ne]=xr[ne];var mr={};return mr.JavascriptGenerator=Q,mr.Order=Oe,mr.javascriptGenerator=Ei,mr.__namespace__=r,mr})}(hO)),hO.exports}(function(n,e){(function(t,r){n.exports=r(N3(),Tie())})(Vl,function(t,r){/** * @license * Copyright 2020 Google LLC * SPDX-License-Identifier: Apache-2.0 - */return r})})(fj);var Cw=fj.exports,WU;function Tie(){return WU||(WU=1,function(n,e){(function(t,r){n.exports=r(N3(),_ie(),yie(),Cw)})(Vl,function(t,r,s,o){return t.setLocale(r),t})}(iO)),iO.exports}(function(n,e){(function(t,r){n.exports=r(Tie())})(Vl,function(t){/** + */return r})})(pj);var Cw=pj.exports,WU;function Sie(){return WU||(WU=1,function(n,e){(function(t,r){n.exports=r(N3(),vie(),bie(),Cw)})(Vl,function(t,r,s,o){return t.setLocale(r),t})}(iO)),iO.exports}(function(n,e){(function(t,r){n.exports=r(Sie())})(Vl,function(t){/** * @license * Copyright 2019 Google LLC * SPDX-License-Identifier: Apache-2.0 - */return t})})(dj);var Zg=dj.exports,$t=N3();const Sie={colour:"#5f86b7"},wie={colour:"#5f86b7"},Eie={colour:"#0b522e"},xie={colour:"#0b522e"},$ie={colour:"#c86949"},Cie={colour:"#50b166"},Mie={colour:"#802639"},Aie={colour:"#2dadb8"},Iie={colour:"#d20e4d"},Rie={colour:"#96a467"},Pt={trigger_category:Sie,procedure_category:wie,logic_category:Eie,loop_category:xie,math_category:$ie,movement_category:Cie,light_category:Mie,speech_category:Aie,face_category:Iie,audio_category:Rie};/** + */return t})})(fj);var Zg=fj.exports,$t=N3();const wie={colour:"#5f86b7"},Eie={colour:"#5f86b7"},xie={colour:"#0b522e"},$ie={colour:"#0b522e"},Cie={colour:"#c86949"},Mie={colour:"#50b166"},Aie={colour:"#802639"},Iie={colour:"#2dadb8"},Rie={colour:"#d20e4d"},kie={colour:"#96a467"},Bt={trigger_category:wie,procedure_category:Eie,logic_category:xie,loop_category:$ie,math_category:Cie,movement_category:Mie,light_category:Aie,speech_category:Iie,face_category:Rie,audio_category:kie};/** * @license * Copyright 2020 Google LLC * SPDX-License-Identifier: Apache-2.0 @@ -1168,7 +1168,7 @@ function ${Se.FUNCTION_NAME_PLACEHOLDER_}(haystack, needle, replacement) { * @license * Copyright 2023 Google LLC * SPDX-License-Identifier: Apache-2.0 - */let Ut=[];const kie={type:"add_text",message0:"Add text %1 with color %2",args0:[{type:"input_value",name:"TEXT",check:"String"},{type:"input_value",name:"COLOR",check:"Colour"}],previousStatement:null,nextStatement:null,colour:160,tooltip:"",helpUrl:""};let pj="ChangeLED";Ut.push(pj);$t.Blocks[pj]={init:function(){this.setColour(Pt.light_category.colour),this.appendValueInput("FIELD_ChangeLED").setCheck("Colour").appendField("Change the LED color to"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setOutput(!1),this.setTooltip("Changes Misty's LED to a specified color")}};let mj="TransitionLED";Ut.push(mj);$t.Blocks[mj]={init:function(){this.setColour(Pt.light_category.colour),this.appendValueInput("COLOR1").setCheck("Colour").appendField("Transition LED from"),this.appendValueInput("COLOR2").setCheck("Colour").appendField("to"),this.appendDummyInput().appendField("using the").appendField(new $t.FieldDropdown([["Breathe","BREATHE"],["Blink","BLINK"],["Transition Once","TRANSITION_ONCE"]]),"TRANSITION_TYPE").appendField("transition"),this.appendDummyInput().appendField("for a duration of").appendField(new $t.FieldNumber(1,0,60,1),"FIELD_TransitionTime_TimeMs").appendField("secs"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("Transition LED between two colors with the specified transition type and time.")}};let gj="DisplayImage";Ut.push(gj);$t.Blocks[gj]={init:function(){this.setColour(Pt.face_category.colour),this.appendValueInput("FIELD_DisplayImage_Filename").setCheck("Face").appendField("Change face expression to: "),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("Displays an image on Misty's screen, Alpha specifies transparency (0 is completely transparent, 1 is completely opaque) ***WARNING: MUST connect with ListFilesAvailable to select the image file to display***")}};let _j="DisplayAnimation";Ut.push(_j);$t.Blocks[_j]={init:function(){this.setColour(Pt.misc_category.colour),this.appendValueInput("FIELD_DisplayAnimation_Filename").setCheck("Animation").appendField("Show this animation on Misty: "),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("Runs a specified animation on Misty")}};let vj="MoveHead";Ut.push(vj);$t.Blocks[vj]={init:function(){this.setColour(Pt.movement_category.colour),this.appendDummyInput().appendField("Move head").appendField(new $t.FieldDropdown([["Up","U"],["Down","D"]]),"FIELD_MoveHead_Pitch"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("Moves Misty's head Up or Down")}};let yj="MoveArm";Ut.push(yj);$t.Blocks[yj]={init:function(){this.setColour(Pt.movement_category.colour),this.appendDummyInput().appendField("Move ").appendField(new $t.FieldDropdown([["Right","Right"],["Left","Left"]]),"FIELD_MoveArm_Arm").appendField("arm to position").appendField(new mp(45,-29,90,1,"Up","Down"),"FIELD_MoveArm_Position").appendField("at a speed of (0 to 100)").appendField(new mp(50,0,100,1,"Slow","Fast"),"FIELD_MoveArm_Velocity"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("Moves one of Misty's arms to a specified position (expects a value from 0-10, 5 points the arm straight forward) at a specified speed (between 0 and 100)")}};let bj="MoveArm2";Ut.push(bj);$t.Blocks[bj]={init:function(){this.setColour(Pt.movement_category.colour),this.appendDummyInput().appendField("Move both arms to position").appendField(new mp(45,-29,90,1,"Up","Down"),"FIELD_MoveArm2_Position").appendField("at a speed of (0 to 100)").appendField(new mp(50,0,100,1,"Slow","Fast"),"FIELD_MoveArm2_Velocity"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("Moves both of Misty's arms to a specified position (expects a value from 0-10, 5 points the arm straight forward) at a specified speed (between 0 and 100)")}};let Tj="BasicSlider";Ut.push(Tj);$t.Blocks[Tj]={init:function(){this.setColour(Pt.math_category.colour),this.appendDummyInput().appendField("Slider Value: ").appendField(new mp(0,0,100,1,"Min","Max"),"FIELD_slider_value"),this.setInputsInline(!1),this.setPreviousStatement(!1,null),this.setNextStatement(!1,null),this.setOutput(!0,null)}};let Sj="ArmPositionSlider";Ut.push(Sj);$t.Blocks[Sj]={init:function(){this.setColour(Pt.math_category.colour),this.appendDummyInput().appendField(new mp(45,-29,90,1,"Up","Down"),"FIELD_slider_value"),this.setInputsInline(!1),this.setPreviousStatement(!1,null),this.setNextStatement(!1,null),this.setOutput(!0,null)}};let wj="SpeedSlider";Ut.push(wj);$t.Blocks[wj]={init:function(){this.setColour(Pt.math_category.colour),this.appendDummyInput().appendField(new mp(1,1,100,1,"Slow","Fast"),"FIELD_slider_value"),this.setInputsInline(!1),this.setPreviousStatement(!1,null),this.setNextStatement(!1,null),this.setOutput(!0,null)}};let Ej="TimeSlider";Ut.push(Ej);$t.Blocks[Ej]={init:function(){this.setColour(Pt.math_category.colour),this.appendDummyInput().appendField(new mp(1,1,60,1,"Short","Long"),"FIELD_slider_value"),this.setInputsInline(!1),this.setPreviousStatement(!1,null),this.setNextStatement(!1,null),this.setOutput(!0,null)}};let xj="HeadPitchSlider";Ut.push(xj);$t.Blocks[xj]={init:function(){this.setColour(Pt.math_category.colour),this.appendDummyInput().appendField(new mp(0,-40,25,1,"Up","Down"),"FIELD_slider_value"),this.setInputsInline(!1),this.setPreviousStatement(!1,null),this.setNextStatement(!1,null),this.setOutput(!0,null)}};let $j="HeadRollSlider";Ut.push($j);$t.Blocks[$j]={init:function(){this.setColour(Pt.math_category.colour),this.appendDummyInput().appendField(new mp(0,-40,40,1,"Right","Left"),"FIELD_slider_value"),this.setInputsInline(!1),this.setPreviousStatement(!1,null),this.setNextStatement(!1,null),this.setOutput(!0,null)}};let Cj="HeadYawSlider";Ut.push(Cj);$t.Blocks[Cj]={init:function(){this.setColour(Pt.math_category.colour),this.appendDummyInput().appendField(new mp(0,-81,81,1,"Right","Left"),"FIELD_slider_value"),this.setInputsInline(!1),this.setOutput(!0,null)}};let Mj="MoveArms2";Ut.push(Mj);$t.Blocks[Mj]={init:function(){var n=this.workspace.newBlock("ArmPositionSlider");n.setShadow(!0),n.initSvg(),n.render();var e=n.outputConnection,t=this.workspace.newBlock("SpeedSlider");t.setShadow(!0),t.initSvg(),t.render();var r=t.outputConnection,s=this.workspace.newBlock("ArmPositionSlider");s.setShadow(!0),s.initSvg(),s.render();var o=s.outputConnection,l=this.workspace.newBlock("SpeedSlider");l.setShadow(!0),l.initSvg(),l.render();var u=l.outputConnection;this.setColour(Pt.movement_category.colour),this.appendValueInput("FIELD_MoveArm_LeftPosition").setCheck("Number").appendField("Left Arm Position");var h=this.getInput("FIELD_MoveArm_LeftPosition").connection;h.connect(e),this.appendValueInput("FIELD_MoveArm_LeftVelocity").setCheck("Number").appendField("Left Arm Speed");var g=this.getInput("FIELD_MoveArm_LeftVelocity").connection;g.connect(r),this.appendValueInput("FIELD_MoveArm_RightPosition").setCheck("Number").appendField("Right Arm Position");var f=this.getInput("FIELD_MoveArm_RightPosition").connection;f.connect(o),this.appendValueInput("FIELD_MoveArm_RightVelocity").setCheck("Number").appendField("Right Arm Speed");var g=this.getInput("FIELD_MoveArm_RightVelocity").connection;g.connect(u),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("Moves both of Misty's arms to a specified position (expects a value from 0-10, 5 points the arm straight forward) at a specified speed")}};let Aj="MoveArm3";Ut.push(Aj);$t.Blocks[Aj]={init:function(){var n=this.workspace.newBlock("ArmPositionSlider");n.setShadow(!0),n.initSvg(),n.render();var e=n.outputConnection,t=this.workspace.newBlock("SpeedSlider");t.setShadow(!0),t.initSvg(),t.render();var r=t.outputConnection;this.appendDummyInput().appendField("Move Arm: ").appendField(new $t.FieldDropdown([["Right","Right"],["Left","Left"]]),"FIELD_MoveArm_Arm"),this.setColour(Pt.movement_category.colour),this.appendValueInput("FIELD_MoveArm_Position").setCheck("Number").appendField("Left Arm Position");var s=this.getInput("FIELD_MoveArm_Position").connection;s.connect(e),this.appendValueInput("FIELD_MoveArm_Velocity").setCheck("Number").appendField("Left Arm Speed");var o=this.getInput("FIELD_MoveArm_Velocity").connection;o.connect(r),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("Moves both of Misty's arms to a specified position (expects a value from 0-10, 5 points the arm straight forward) at a specified speed")}};let Ij="DriveTime";Ut.push(Ij);$t.Blocks[Ij]={init:function(){this.setColour(Pt.movement_category.colour),this.appendDummyInput().appendField("Move ").appendField(new $t.FieldDropdown([["Forward","F"],["Backward","B"]]),"FIELD_DriveTime_Direction").appendField("at a speed of (0 to 100)").appendField(new $t.FieldNumber(25,0,100,1),"FIELD_DriveTime_Velocity").appendField("for a duration of").appendField(new $t.FieldNumber(1,0,60,1),"FIELD_DriveTime_TimeMs").appendField("secs"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("Drives Misty straight in a specified direction at a specified speed for a specified amount of time (1000ms = 1 second)")}};let Rj="MoveHead3";Ut.push(Rj);$t.Blocks[Rj]={init:function(){var n=this.workspace.newBlock("HeadPitchSlider");n.setShadow(!0),n.initSvg(),n.render();var e=n.outputConnection,t=this.workspace.newBlock("HeadRollSlider");t.setShadow(!0),t.initSvg(),t.render();var r=t.outputConnection,s=this.workspace.newBlock("HeadYawSlider");s.setShadow(!0),s.initSvg(),s.render();var o=s.outputConnection,l=this.workspace.newBlock("TimeSlider");l.setShadow(!0),l.initSvg(),l.render();var u=l.outputConnection;this.setColour(Pt.movement_category.colour),this.appendDummyInput("FIELD_TEXT_IGNORE").appendField("Move head"),this.appendValueInput("FIELD_MoveHead_Pitch").setCheck("Number").appendField("Look Up/Down:");var h=this.getInput("FIELD_MoveHead_Pitch").connection;h.connect(e),this.appendValueInput("FIELD_MoveHead_Roll").setCheck("Number").appendField("Tilt Left/Right:");var f=this.getInput("FIELD_MoveHead_Roll").connection;f.connect(r),this.appendValueInput("FIELD_MoveHead_Yaw").setCheck("Number").appendField("Look Right/Left:");var g=this.getInput("FIELD_MoveHead_Yaw").connection;g.connect(o),this.appendValueInput("FIELD_MoveHead_Time").setCheck("Number").appendField("Time (seconds):");var y=this.getInput("FIELD_MoveHead_Time").connection;y.connect(u),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("Moves Misty's head a specified amount of degrees with roll, pitch, and/or yaw")}};let kj="DriveTime2";Ut.push(kj);$t.Blocks[kj]={init:function(){var n=this.workspace.newBlock("math_number");n.setShadow(!0),n.initSvg(),n.render();var e=n.outputConnection,t=this.workspace.newBlock("math_number");t.setShadow(!0),t.initSvg(),t.render();var r=t.outputConnection,s=this.workspace.newBlock("math_number");s.setShadow(!0),s.initSvg(),s.render();var o=s.outputConnection;this.setColour(Pt.movement_category.colour),this.appendValueInput("FIELD_DriveTime_Velocity").setCheck("Number").appendField("Move at a speed of (-100 to 100)");var l=this.getInput("FIELD_DriveTime_Velocity").connection;l.connect(e),this.appendValueInput("FIELD_DriveTime_Angular").setCheck("Number").appendField("with angular velocity of (-100 CW to 100 CCW)");var u=this.getInput("FIELD_DriveTime_Angular").connection;u.connect(r),this.appendValueInput("FIELD_DriveTime_TimeMs").setCheck("Number").appendField("for a duration of secs");var h=this.getInput("FIELD_DriveTime_TimeMs").connection;h.connect(o),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("Drives Misty forward (positive speed) or backward (negative speed) with possible turning using angular velocity (0 for straight) for the specified duration (1000 ms = 1 second)")}};let Oj="Turn";Ut.push(Oj);$t.Blocks[Oj]={init:function(){this.setColour(Pt.movement_category.colour),this.appendDummyInput().appendField("Turn").appendField(new $t.FieldDropdown([["Left","L"],["Right","R"]]),"FIELD_Turn_Direction").appendField("for time of").appendField(new $t.FieldNumber(4500),"FIELD_Turn_Duration").appendField("milliseconds"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("Turns Misty in the specified direction (1000ms = 1 second and 4500ms is approximately 90 degrees)")}};let Lj="Turn2";Ut.push(Lj);$t.Blocks[Lj]={init:function(){var n=this.workspace.newBlock("math_number");n.setShadow(!0),n.initSvg(),n.render();var e=n.outputConnection;this.setColour(Pt.movement_category.colour),this.appendDummyInput().appendField("Turn").appendField(new $t.FieldDropdown([["Left","L"],["Right","R"]]),"FIELD_Turn_Direction"),this.appendValueInput("FIELD_Turn_Duration").setCheck("Number").appendField("for time of");var t=this.getInput("FIELD_Turn_Duration").connection;t.connect(e),this.appendDummyInput().appendField("milliseconds"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("Turns Misty in the specified direction (1000ms = 1 second and 4500ms is approximately 90 degrees)")}};let Nj="Speak";Ut.push(Nj);$t.Blocks[Nj]={init:function(){this.setColour(Pt.speech_category.colour),this.appendValueInput("FIELD_Speak_Text").setCheck("String").appendField("Speak: "),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("Speak given input text")}};let Dj="SpeakDefault";Ut.push(Dj);$t.Blocks[Dj]={init:function(){this.setColour(Pt.speech_category.colour),this.appendDummyInput().appendField("Speak: ").appendField(new $t.FieldDropdown([["Hi","Hi"],["Hello","Hello"],["How are you today?","How are you today?"],["Goodbye","Goodbye"]]),"FIELD_SpeakDefault_Text"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("Speak given selected default text")}};let Pj="TurnOnFlashlight";Ut.push(Pj);$t.Blocks[Pj]={init:function(){this.setColour(Pt.light_category.colour),this.appendDummyInput().appendField("Turn on flashlight "),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("Turn on flashlight")}};let Bj="TurnOffFlashlight";Ut.push(Bj);$t.Blocks[Bj]={init:function(){this.setColour(Pt.light_category.colour),this.appendDummyInput().appendField("Turn off flashlight "),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("Turn off flashlight")}};let Fj="WaitForSeconds";Ut.push(Fj);$t.Blocks[Fj]={init:function(){this.appendDummyInput().appendField("wait for"),this.appendDummyInput().setAlign($t.ALIGN_CENTRE).appendField(new $t.FieldNumber(0,-1/0,1/0,.1),"NumSeconds"),this.appendDummyInput().appendField("Seconds"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Pt.movement_category.colour),this.setTooltip("Delay the execution of the next block by some number of seconds")}};let zj="PlayAudio";Ut.push(zj);$t.Blocks[zj]={init:function(){this.setColour(Pt.audio_category.colour),this.appendValueInput("FIELD_PlayAudio_Filename").setCheck("Audio").appendField("Play audio: "),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("")}};let Uj="SetVolume";Ut.push(Uj);$t.Blocks[Uj]={init:function(){this.setColour(Pt.audio_category.colour);var n=this.workspace.newBlock("math_number");n.setShadow(!0),n.initSvg(),n.render();var e=n.outputConnection;this.appendValueInput("FIELD_Volume").setCheck("Number").appendField("Set volume to (0-100): ");var t=this.getInput("FIELD_Volume").connection;t.connect(e),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("Adjusts Misty's volume level for audio playback")}};let Hj="DisplayText";Ut.push(Hj);$t.Blocks[Hj]={init:function(){this.setColour(Pt.face_category.colour),this.appendDummyInput().appendField("Display Text: ").appendField(new $t.FieldTextInput("default"),"FIELD_DisplayText_Text"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("")}};let Gj="ClearText";Ut.push(Gj);$t.Blocks[Gj]={init:function(){this.setColour(Pt.face_category.colour),this.appendDummyInput().appendField("Clear Text"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("")}};let Wj="Start";Ut.push(Wj);$t.Blocks[Wj]={init:function(){this.setStyle("hat_blocks"),this.appendDummyInput().appendField("Program starts here"),this.setColour(Pt.trigger_category.colour),this.setTooltip("This is the starting block"),this.setNextStatement(!0,null),this.setHelpUrl(""),this.setDeletable(!1)}};let Vj="FrontLeftBumperPress";Ut.push(Vj);$t.Blocks[Vj]={init:function(){this.setStyle("hat_blocks"),this.setColour(Pt.trigger_category.colour),this.appendDummyInput().appendField("Front Left Bumper Pressed"),this.setNextStatement(!0,null),this.setTooltip("")}};let jj="FrontRightBumperPress";Ut.push(jj);$t.Blocks[jj]={init:function(){this.setStyle("hat_blocks"),this.setColour(Pt.trigger_category.colour),this.appendDummyInput().appendField("Front Right Bumper Pressed"),this.setNextStatement(!0,null),this.setTooltip("")}};let Yj="RearLeftBumperPress";Ut.push(Yj);$t.Blocks[Yj]={init:function(){this.setStyle("hat_blocks"),this.setColour(Pt.trigger_category.colour),this.appendDummyInput().appendField("Rear Left Bumper Pressed"),this.setNextStatement(!0,null),this.setTooltip("")}};let Xj="RearRightBumperPress";Ut.push(Xj);$t.Blocks[Xj]={init:function(){this.setStyle("hat_blocks"),this.setColour(Pt.trigger_category.colour),this.appendDummyInput().appendField("Right Rear Bumper Pressed"),this.setNextStatement(!0,null),this.setTooltip("")}};let Kj="eyes_acceptance";Ut.push(Kj);$t.Blocks[Kj]={init:function(){this.appendDummyInput().appendField("Expression: acceptance"),this.setOutput(!0,"Face"),this.setColour(Pt.face_category.colour),this.setTooltip("Represents the facial expression 'acceptance'")}};let Jj="eyes_admiration";Ut.push(Jj);$t.Blocks[Jj]={init:function(){this.appendDummyInput().appendField("Expression: admiration"),this.setOutput(!0,"Face"),this.setColour(Pt.face_category.colour),this.setTooltip("Represents the facial expression 'admiration'")}};let qj="eyes_amazement";Ut.push(qj);$t.Blocks[qj]={init:function(){this.appendDummyInput().appendField("Expression: amazement"),this.setOutput(!0,"Face"),this.setColour(Pt.face_category.colour),this.setTooltip("Represents the facial expression 'amazement'")}};let Qj="eyes_anger";Ut.push(Qj);$t.Blocks[Qj]={init:function(){this.appendDummyInput().appendField("Expression: anger"),this.setOutput(!0,"Face"),this.setColour(Pt.face_category.colour),this.setTooltip("Represents the facial expression 'anger'")}};let Zj="eyes_annoyed";Ut.push(Zj);$t.Blocks[Zj]={init:function(){this.appendDummyInput().appendField("Expression: annoyed"),this.setOutput(!0,"Face"),this.setColour(Pt.face_category.colour),this.setTooltip("Represents the facial expression 'annoyed'")}};let e7="eyes_anticipation";Ut.push(e7);$t.Blocks[e7]={init:function(){this.appendDummyInput().appendField("Expression: anticipation"),this.setOutput(!0,"Face"),this.setColour(Pt.face_category.colour),this.setTooltip("Represents the facial expression 'anticipation'")}};let t7="eyes_apprehension";Ut.push(t7);$t.Blocks[t7]={init:function(){this.appendDummyInput().appendField("Expression: apprehension"),this.setOutput(!0,"Face"),this.setColour(Pt.face_category.colour),this.setTooltip("Represents the facial expression 'apprehension'")}};let n7="eyes_boredom";Ut.push(n7);$t.Blocks[n7]={init:function(){this.appendDummyInput().appendField("Expression: boredom"),this.setOutput(!0,"Face"),this.setColour(Pt.face_category.colour),this.setTooltip("Represents the facial expression 'boredom'")}};let r7="eyes_default";Ut.push(r7);$t.Blocks[r7]={init:function(){this.appendDummyInput().appendField("Expression: default"),this.setOutput(!0,"Face"),this.setColour(Pt.face_category.colour),this.setTooltip("Represents the facial expression 'default'")}};let i7="eyes_disgust";Ut.push(i7);$t.Blocks[i7]={init:function(){this.appendDummyInput().appendField("Expression: disgust"),this.setOutput(!0,"Face"),this.setColour(Pt.face_category.colour),this.setTooltip("Represents the facial expression 'disgust'")}};let s7="eyes_distraction";Ut.push(s7);$t.Blocks[s7]={init:function(){this.appendDummyInput().appendField("Expression: distraction"),this.setOutput(!0,"Face"),this.setColour(Pt.face_category.colour),this.setTooltip("Represents the facial expression 'distraction'")}};let o7="eyes_ecstasy_frame_1";Ut.push(o7);$t.Blocks[o7]={init:function(){this.appendDummyInput().appendField("Expression: ecstasy 1"),this.setOutput(!0,"Face"),this.setColour(Pt.face_category.colour),this.setTooltip("Represents the facial expression 'ecstasy 1'")}};let a7="eyes_ecstasy_frame_2";Ut.push(a7);$t.Blocks[a7]={init:function(){this.appendDummyInput().appendField("Expression: ecstasy 2"),this.setOutput(!0,"Face"),this.setColour(Pt.face_category.colour),this.setTooltip("Represents the facial expression 'ecstasy 2'")}};let l7="eyes_fear";Ut.push(l7);$t.Blocks[l7]={init:function(){this.appendDummyInput().appendField("Expression: fear"),this.setOutput(!0,"Face"),this.setColour(Pt.face_category.colour),this.setTooltip("Represents the facial expression 'fear'")}};let u7="eyes_grief";Ut.push(u7);$t.Blocks[u7]={init:function(){this.appendDummyInput().appendField("Expression: grief"),this.setOutput(!0,"Face"),this.setColour(Pt.face_category.colour),this.setTooltip("Represents the facial expression 'grief'")}};let c7="eyes_interest";Ut.push(c7);$t.Blocks[c7]={init:function(){this.appendDummyInput().appendField("Expression: interest"),this.setOutput(!0,"Face"),this.setColour(Pt.face_category.colour),this.setTooltip("Represents the facial expression 'interest'")}};let h7="eyes_joy";Ut.push(h7);$t.Blocks[h7]={init:function(){this.appendDummyInput().appendField("Expression: joy"),this.setOutput(!0,"Face"),this.setColour(Pt.face_category.colour),this.setTooltip("Represents the facial expression 'joy'")}};let d7="eyes_loathing";Ut.push(d7);$t.Blocks[d7]={init:function(){this.appendDummyInput().appendField("Expression: loathing"),this.setOutput(!0,"Face"),this.setColour(Pt.face_category.colour),this.setTooltip("Represents the facial expression 'loathing'")}};let f7="eyes_pensiveness";Ut.push(f7);$t.Blocks[f7]={init:function(){this.appendDummyInput().appendField("Expression: pensiveness"),this.setOutput(!0,"Face"),this.setColour(Pt.face_category.colour),this.setTooltip("Represents the facial expression 'pensiveness'")}};let p7="eyes_rage";Ut.push(p7);$t.Blocks[p7]={init:function(){this.appendDummyInput().appendField("Expression: rage eyes"),this.setOutput(!0,"Face"),this.setColour(Pt.face_category.colour),this.setTooltip("Represents the facial expression 'rage eyes'")}};let m7="eyes_sad";Ut.push(m7);$t.Blocks[m7]={init:function(){this.appendDummyInput().appendField("Expression: sad"),this.setOutput(!0,"Face"),this.setColour(Pt.face_category.colour),this.setTooltip("Represents the facial expression 'sad'")}};let g7="eyes_serenity";Ut.push(g7);$t.Blocks[g7]={init:function(){this.appendDummyInput().appendField("Expression: serenity"),this.setOutput(!0,"Face"),this.setColour(Pt.face_category.colour),this.setTooltip("Represents the facial expression 'serenity'")}};let _7="eyes_surprise";Ut.push(_7);$t.Blocks[_7]={init:function(){this.appendDummyInput().appendField("Expression: surprise"),this.setOutput(!0,"Face"),this.setColour(Pt.face_category.colour),this.setTooltip("Represents the facial expression 'surprise'")}};let v7="eyes_terror";Ut.push(v7);$t.Blocks[v7]={init:function(){this.appendDummyInput().appendField("Expression: terror"),this.setOutput(!0,"Face"),this.setColour(Pt.face_category.colour),this.setTooltip("Represents the facial expression 'terror'")}};let y7="eyes_trust";Ut.push(y7);$t.Blocks[y7]={init:function(){this.appendDummyInput().appendField("Expression: trust"),this.setOutput(!0,"Face"),this.setColour(Pt.face_category.colour),this.setTooltip("Represents the facial expression 'trust'")}};let b7="eyes_vigilance";Ut.push(b7);$t.Blocks[b7]={init:function(){this.appendDummyInput().appendField("Expression: vigilance"),this.setOutput(!0,"Face"),this.setColour(Pt.face_category.colour),this.setTooltip("Represents the facial expression 'vigilance'")}};let T7="e_Sleeping";Ut.push(T7);$t.Blocks[T7]={init:function(){this.appendDummyInput().appendField("Expression: sleeping"),this.setOutput(!0,"Face"),this.setColour(Pt.face_category.colour),this.setTooltip("Represents the facial expression 'sleeping'")}};let S7="e_SleepingZZZ";Ut.push(S7);$t.Blocks[S7]={init:function(){this.appendDummyInput().appendField("Expression: sleeping ZZZ"),this.setOutput(!0,"Face"),this.setColour(Pt.face_category.colour),this.setTooltip("Represents the facial expression 'sleeping ZZZ'")}};let w7="e_Contempt";Ut.push(w7);$t.Blocks[w7]={init:function(){this.appendDummyInput().appendField("Expression: contempt"),this.setOutput(!0,"Face"),this.setColour(Pt.face_category.colour),this.setTooltip("Represents the facial expression 'contempt'")}};let E7="e_ContentLeft";Ut.push(E7);$t.Blocks[E7]={init:function(){this.appendDummyInput().appendField("Expression: content (left)"),this.setOutput(!0,"Face"),this.setColour(Pt.face_category.colour),this.setTooltip("Represents the facial expression 'content (left)'")}};let x7="e_ContentRight";Ut.push(x7);$t.Blocks[x7]={init:function(){this.appendDummyInput().appendField("Expression: content (right)"),this.setOutput(!0,"Face"),this.setColour(Pt.face_category.colour),this.setTooltip("Represents the facial expression 'content (right)'")}};let $7="e_Disoriented";Ut.push($7);$t.Blocks[$7]={init:function(){this.appendDummyInput().appendField("Expression: disoriented"),this.setOutput(!0,"Face"),this.setColour(Pt.face_category.colour),this.setTooltip("Represents the facial expression 'disoriented'")}};let C7="e_EcstacyHilarious";Ut.push(C7);$t.Blocks[C7]={init:function(){this.appendDummyInput().appendField("Expression: ecstacy hilarious"),this.setOutput(!0,"Face"),this.setColour(Pt.face_category.colour),this.setTooltip("Represents the facial expression 'ecstacy hilarious'")}};let M7="e_EcstacyStarryEyed";Ut.push(M7);$t.Blocks[M7]={init:function(){this.appendDummyInput().appendField("Expression: ecstacy starry eyed"),this.setOutput(!0,"Face"),this.setColour(Pt.face_category.colour),this.setTooltip("Represents the facial expression 'ecstacy starry eyed'")}};let A7="e_JoyGoofy";Ut.push(A7);$t.Blocks[A7]={init:function(){this.appendDummyInput().appendField("Expression: joy goofy"),this.setOutput(!0,"Face"),this.setColour(Pt.face_category.colour),this.setTooltip("Represents the facial expression 'joy goofy'")}};let I7="e_JoyGoofy2";Ut.push(I7);$t.Blocks[I7]={init:function(){this.appendDummyInput().appendField("Expression: joy goofy 2"),this.setOutput(!0,"Face"),this.setColour(Pt.face_category.colour),this.setTooltip("Represents the facial expression 'joy goofy 2'")}};let R7="e_JoyGoofy3";Ut.push(R7);$t.Blocks[R7]={init:function(){this.appendDummyInput().appendField("Expression: joy goofy 3"),this.setOutput(!0,"Face"),this.setColour(Pt.face_category.colour),this.setTooltip("Represents the facial expression 'joy goofy 3'")}};let k7="e_Love";Ut.push(k7);$t.Blocks[k7]={init:function(){this.appendDummyInput().appendField("Expression: love"),this.setOutput(!0,"Face"),this.setColour(Pt.face_category.colour),this.setTooltip("Represents the facial expression 'love'")}};let O7="e_Rage";Ut.push(O7);$t.Blocks[O7]={init:function(){this.appendDummyInput().appendField("Expression: rage"),this.setOutput(!0,"Face"),this.setColour(Pt.face_category.colour),this.setTooltip("Represents the facial expression 'rage'")}};let L7="e_Rage2";Ut.push(L7);$t.Blocks[L7]={init:function(){this.appendDummyInput().appendField("Expression: rage 2"),this.setOutput(!0,"Face"),this.setColour(Pt.face_category.colour),this.setTooltip("Represents the facial expression 'rage 2'")}};let N7="e_Rage3";Ut.push(N7);$t.Blocks[N7]={init:function(){this.appendDummyInput().appendField("Expression: rage 3"),this.setOutput(!0,"Face"),this.setColour(Pt.face_category.colour),this.setTooltip("Represents the facial expression 'rage 3'")}};let D7="e_Rage4";Ut.push(D7);$t.Blocks[D7]={init:function(){this.appendDummyInput().appendField("Expression: rage 4"),this.setOutput(!0,"Face"),this.setColour(Pt.face_category.colour),this.setTooltip("Represents the facial expression 'rage 4'")}};let P7="e_RemorseShame";Ut.push(P7);$t.Blocks[P7]={init:function(){this.appendDummyInput().appendField("Expression: remorse shame"),this.setOutput(!0,"Face"),this.setColour(Pt.face_category.colour),this.setTooltip("Represents the facial expression 'remorse shame'")}};$t.Blocks["animation_sleepy.bv"]={init:function(){this.appendDummyInput().appendField("Animation: Sleeping"),this.setOutput(!0,"Animation"),this.setColour(Pt.face_category.colour),this.setTooltip("Run the animation 'sleepy'")}};$t.Blocks["animation_dancing.bv"]={init:function(){this.appendDummyInput().appendField("Animation: Dancing"),this.setOutput(!0,"Animation"),this.setColour(Pt.face_category.colour),this.setTooltip("Run the animation 'dancing'")}};$t.Blocks["animation_spooked.bv"]={init:function(){this.appendDummyInput().appendField("Animation: Spooked"),this.setOutput(!0,"Animation"),this.setColour(Pt.face_category.colour),this.setTooltip("Run the animation 'spooked'")}};let B7="s_Acceptance";Ut.push(B7);$t.Blocks[B7]={init:function(){this.appendDummyInput().appendField("Sound: acceptance"),this.setOutput(!0,"Audio"),this.setColour(Pt.audio_category.colour),this.setTooltip("Represents the audio 'acceptance'")}};let F7="s_Amazement";Ut.push(F7);$t.Blocks[F7]={init:function(){this.appendDummyInput().appendField("Sound: amazement"),this.setOutput(!0,"Audio"),this.setColour(Pt.audio_category.colour),this.setTooltip("Represents the audio 'amazement'")}};let z7="s_Amazement2";Ut.push(z7);$t.Blocks[z7]={init:function(){this.appendDummyInput().appendField("Sound: amazement 2"),this.setOutput(!0,"Audio"),this.setColour(Pt.audio_category.colour),this.setTooltip("Represents the audio 'amazement 2'")}};let U7="s_Anger";Ut.push(U7);$t.Blocks[U7]={init:function(){this.appendDummyInput().appendField("Sound: anger"),this.setOutput(!0,"Audio"),this.setColour(Pt.audio_category.colour),this.setTooltip("Represents the audio 'anger'")}};let H7="s_Anger2";Ut.push(H7);$t.Blocks[H7]={init:function(){this.appendDummyInput().appendField("Sound: anger 2"),this.setOutput(!0,"Audio"),this.setColour(Pt.audio_category.colour),this.setTooltip("Represents the audio 'anger 2'")}};let G7="s_Anger3";Ut.push(G7);$t.Blocks[G7]={init:function(){this.appendDummyInput().appendField("Sound: anger 3"),this.setOutput(!0,"Audio"),this.setColour(Pt.audio_category.colour),this.setTooltip("Represents the audio 'anger 3'")}};let W7="s_Anger4";Ut.push(W7);$t.Blocks[W7]={init:function(){this.appendDummyInput().appendField("Sound: anger 4"),this.setOutput(!0,"Audio"),this.setColour(Pt.audio_category.colour),this.setTooltip("Represents the audio 'anger 4'")}};let V7="s_Annoyance";Ut.push(V7);$t.Blocks[V7]={init:function(){this.appendDummyInput().appendField("Sound: annoyance"),this.setOutput(!0,"Audio"),this.setColour(Pt.audio_category.colour),this.setTooltip("Represents the audio 'annoyance'")}};let j7="s_Annoyance2";Ut.push(j7);$t.Blocks[j7]={init:function(){this.appendDummyInput().appendField("Sound: annoyance 2"),this.setOutput(!0,"Audio"),this.setColour(Pt.audio_category.colour),this.setTooltip("Represents the audio 'annoyance 2'")}};let Y7="s_Annoyance3";Ut.push(Y7);$t.Blocks[Y7]={init:function(){this.appendDummyInput().appendField("Sound: annoyance 3"),this.setOutput(!0,"Audio"),this.setColour(Pt.audio_category.colour),this.setTooltip("Represents the audio 'annoyance 3'")}};let X7="s_Annoyance4";Ut.push(X7);$t.Blocks[X7]={init:function(){this.appendDummyInput().appendField("Sound: annoyance 4"),this.setOutput(!0,"Audio"),this.setColour(Pt.audio_category.colour),this.setTooltip("Represents the audio 'annoyance 4'")}};let K7="s_Awe";Ut.push(K7);$t.Blocks[K7]={init:function(){this.appendDummyInput().appendField("Sound: awe"),this.setOutput(!0,"Audio"),this.setColour(Pt.audio_category.colour),this.setTooltip("Represents the audio 'awe'")}};let J7="s_Awe2";Ut.push(J7);$t.Blocks[J7]={init:function(){this.appendDummyInput().appendField("Sound: awe 2"),this.setOutput(!0,"Audio"),this.setColour(Pt.audio_category.colour),this.setTooltip("Represents the audio 'awe 2'")}};let q7="s_Awe3";Ut.push(q7);$t.Blocks[q7]={init:function(){this.appendDummyInput().appendField("Sound: awe 3"),this.setOutput(!0,"Audio"),this.setColour(Pt.audio_category.colour),this.setTooltip("Represents the audio 'awe 3'")}};let Q7="s_Boredom";Ut.push(Q7);$t.Blocks[Q7]={init:function(){this.appendDummyInput().appendField("Sound: boredom"),this.setOutput(!0,"Audio"),this.setColour(Pt.audio_category.colour),this.setTooltip("Represents the audio 'boredom'")}};let Z7="s_Disapproval";Ut.push(Z7);$t.Blocks[Z7]={init:function(){this.appendDummyInput().appendField("Sound: disapproval"),this.setOutput(!0,"Audio"),this.setColour(Pt.audio_category.colour),this.setTooltip("Represents the audio 'disapproval'")}};let eY="s_Disgust";Ut.push(eY);$t.Blocks[eY]={init:function(){this.appendDummyInput().appendField("Sound: disgust"),this.setOutput(!0,"Audio"),this.setColour(Pt.audio_category.colour),this.setTooltip("Represents the audio 'disgust'")}};let tY="s_Disgust2";Ut.push(tY);$t.Blocks[tY]={init:function(){this.appendDummyInput().appendField("Sound: disgust 2"),this.setOutput(!0,"Audio"),this.setColour(Pt.audio_category.colour),this.setTooltip("Represents the audio 'disgust 2'")}};let nY="s_Disgust3";Ut.push(nY);$t.Blocks[nY]={init:function(){this.appendDummyInput().appendField("Sound: disgust 3"),this.setOutput(!0,"Audio"),this.setColour(Pt.audio_category.colour),this.setTooltip("Represents the audio 'disgust 3'")}};let rY="s_DisorientedConfused";Ut.push(rY);$t.Blocks[rY]={init:function(){this.appendDummyInput().appendField("Sound: disoriented confused"),this.setOutput(!0,"Audio"),this.setColour(Pt.audio_category.colour),this.setTooltip("Represents the audio 'disoriented confused'")}};let iY="s_DisorientedConfused2";Ut.push(iY);$t.Blocks[iY]={init:function(){this.appendDummyInput().appendField("Sound: disoriented confused 2"),this.setOutput(!0,"Audio"),this.setColour(Pt.audio_category.colour),this.setTooltip("Represents the audio 'disoriented confused 2'")}};let sY="s_DisorientedConfused3";Ut.push(sY);$t.Blocks[sY]={init:function(){this.appendDummyInput().appendField("Sound: disoriented confused 3"),this.setOutput(!0,"Audio"),this.setColour(Pt.audio_category.colour),this.setTooltip("Represents the audio 'disoriented confused 3'")}};let oY="s_DisorientedConfused4";Ut.push(oY);$t.Blocks[oY]={init:function(){this.appendDummyInput().appendField("Sound: disoriented confused 4"),this.setOutput(!0,"Audio"),this.setColour(Pt.audio_category.colour),this.setTooltip("Represents the audio 'disoriented confused 4'")}};let aY="s_DisorientedConfused5";Ut.push(aY);$t.Blocks[aY]={init:function(){this.appendDummyInput().appendField("Sound: disoriented confused 5"),this.setOutput(!0,"Audio"),this.setColour(Pt.audio_category.colour),this.setTooltip("Represents the audio 'disoriented confused 5'")}};let lY="s_DisorientedConfused6";Ut.push(lY);$t.Blocks[lY]={init:function(){this.appendDummyInput().appendField("Sound: disoriented confused 6"),this.setOutput(!0,"Audio"),this.setColour(Pt.audio_category.colour),this.setTooltip("Represents the audio 'disoriented confused 6'")}};let uY="s_Distraction";Ut.push(uY);$t.Blocks[uY]={init:function(){this.appendDummyInput().appendField("Sound: distraction"),this.setOutput(!0,"Audio"),this.setColour(Pt.audio_category.colour),this.setTooltip("Represents the audio 'distraction'")}};let cY="s_Ecstacy";Ut.push(cY);$t.Blocks[cY]={init:function(){this.appendDummyInput().appendField("Sound: ecstacy"),this.setOutput(!0,"Audio"),this.setColour(Pt.audio_category.colour),this.setTooltip("Represents the audio 'ecstacy'")}};let hY="s_Ecstacy2";Ut.push(hY);$t.Blocks[hY]={init:function(){this.appendDummyInput().appendField("Sound: ecstacy 2"),this.setOutput(!0,"Audio"),this.setColour(Pt.audio_category.colour),this.setTooltip("Represents the audio 'ecstacy 2'")}};let dY="s_Fear";Ut.push(dY);$t.Blocks[dY]={init:function(){this.appendDummyInput().appendField("Sound: fear"),this.setOutput(!0,"Audio"),this.setColour(Pt.audio_category.colour),this.setTooltip("Represents the audio 'fear'")}};let fY="s_Grief";Ut.push(fY);$t.Blocks[fY]={init:function(){this.appendDummyInput().appendField("Sound: grief"),this.setOutput(!0,"Audio"),this.setColour(Pt.audio_category.colour),this.setTooltip("Represents the audio 'grief'")}};let pY="s_Grief2";Ut.push(pY);$t.Blocks[pY]={init:function(){this.appendDummyInput().appendField("Sound: grief 2"),this.setOutput(!0,"Audio"),this.setColour(Pt.audio_category.colour),this.setTooltip("Represents the audio 'grief 2'")}};let mY="s_Grief3";Ut.push(mY);$t.Blocks[mY]={init:function(){this.appendDummyInput().appendField("Sound: grief 3"),this.setOutput(!0,"Audio"),this.setColour(Pt.audio_category.colour),this.setTooltip("Represents the audio 'grief 3'")}};let gY="s_Grief4";Ut.push(gY);$t.Blocks[gY]={init:function(){this.appendDummyInput().appendField("Sound: grief 4"),this.setOutput(!0,"Audio"),this.setColour(Pt.audio_category.colour),this.setTooltip("Represents the audio 'grief 4'")}};let _Y="s_Joy";Ut.push(_Y);$t.Blocks[_Y]={init:function(){this.appendDummyInput().appendField("Sound: joy"),this.setOutput(!0,"Audio"),this.setColour(Pt.audio_category.colour),this.setTooltip("Represents the audio 'joy'")}};let vY="s_Joy2";Ut.push(vY);$t.Blocks[vY]={init:function(){this.appendDummyInput().appendField("Sound: joy 2"),this.setOutput(!0,"Audio"),this.setColour(Pt.audio_category.colour),this.setTooltip("Represents the audio 'joy 2'")}};let yY="s_Joy3";Ut.push(yY);$t.Blocks[yY]={init:function(){this.appendDummyInput().appendField("Sound: joy 3"),this.setOutput(!0,"Audio"),this.setColour(Pt.audio_category.colour),this.setTooltip("Represents the audio 'joy 3'")}};let bY="s_Joy4";Ut.push(bY);$t.Blocks[bY]={init:function(){this.appendDummyInput().appendField("Sound: joy 4"),this.setOutput(!0,"Audio"),this.setColour(Pt.audio_category.colour),this.setTooltip("Represents the audio 'joy 4'")}};let TY="s_Loathing";Ut.push(TY);$t.Blocks[TY]={init:function(){this.appendDummyInput().appendField("Sound: loathing"),this.setOutput(!0,"Audio"),this.setColour(Pt.audio_category.colour),this.setTooltip("Represents the audio 'loathing'")}};let SY="s_Love";Ut.push(SY);$t.Blocks[SY]={init:function(){this.appendDummyInput().appendField("Sound: love"),this.setOutput(!0,"Audio"),this.setColour(Pt.audio_category.colour),this.setTooltip("Represents the audio 'love'")}};let wY="s_PhraseByeBye";Ut.push(wY);$t.Blocks[wY]={init:function(){this.appendDummyInput().appendField("Sound: Bye Bye"),this.setOutput(!0,"Audio"),this.setColour(Pt.audio_category.colour),this.setTooltip("Represents the audio 'phrase: Bye Bye'")}};let EY="s_PhraseEvilAhHa";Ut.push(EY);$t.Blocks[EY]={init:function(){this.appendDummyInput().appendField("Sound: Evil Ah Ha"),this.setOutput(!0,"Audio"),this.setColour(Pt.audio_category.colour),this.setTooltip("Represents the audio 'phrase: Evil Ah Ha'")}};let xY="s_PhraseHello";Ut.push(xY);$t.Blocks[xY]={init:function(){this.appendDummyInput().appendField("Sound: Hello"),this.setOutput(!0,"Audio"),this.setColour(Pt.audio_category.colour),this.setTooltip("Represents the audio 'phrase: Hello'")}};let $Y="s_PhraseNoNoNo";Ut.push($Y);$t.Blocks[$Y]={init:function(){this.appendDummyInput().appendField("Sound: No No No"),this.setOutput(!0,"Audio"),this.setColour(Pt.audio_category.colour),this.setTooltip("Represents the audio 'phrase: No No No'")}};let CY="s_PhraseOopsy";Ut.push(CY);$t.Blocks[CY]={init:function(){this.appendDummyInput().appendField("Sound: Oopsy"),this.setOutput(!0,"Audio"),this.setColour(Pt.audio_category.colour),this.setTooltip("Represents the audio 'phrase: Oopsy'")}};let MY="s_PhraseOwOwOw";Ut.push(MY);$t.Blocks[MY]={init:function(){this.appendDummyInput().appendField("Sound: Ow Ow Ow"),this.setOutput(!0,"Audio"),this.setColour(Pt.audio_category.colour),this.setTooltip("Represents the audio 'phrase: Ow Ow Ow'")}};let AY="s_PhraseOwwww";Ut.push(AY);$t.Blocks[AY]={init:function(){this.appendDummyInput().appendField("Sound: Owwww"),this.setOutput(!0,"Audio"),this.setColour(Pt.audio_category.colour),this.setTooltip("Represents the audio 'phrase: Owwww'")}};let IY="s_PhraseUhOh";Ut.push(IY);$t.Blocks[IY]={init:function(){this.appendDummyInput().appendField("Sound: Uh Oh"),this.setOutput(!0,"Audio"),this.setColour(Pt.audio_category.colour),this.setTooltip("Represents the audio 'phrase: Uh Oh'")}};let RY="s_Rage";Ut.push(RY);$t.Blocks[RY]={init:function(){this.appendDummyInput().appendField("Sound: rage"),this.setOutput(!0,"Audio"),this.setColour(Pt.audio_category.colour),this.setTooltip("Represents the audio 'rage'")}};let kY="s_Sadness";Ut.push(kY);$t.Blocks[kY]={init:function(){this.appendDummyInput().appendField("Sound: sadness"),this.setOutput(!0,"Audio"),this.setColour(Pt.audio_category.colour),this.setTooltip("Represents the audio 'sadness'")}};let OY="s_Sadness2";Ut.push(OY);$t.Blocks[OY]={init:function(){this.appendDummyInput().appendField("Sound: sadness 2"),this.setOutput(!0,"Audio"),this.setColour(Pt.audio_category.colour),this.setTooltip("Represents the audio 'sadness 2'")}};let LY="s_Sadness3";Ut.push(LY);$t.Blocks[LY]={init:function(){this.appendDummyInput().appendField("Sound: sadness 3"),this.setOutput(!0,"Audio"),this.setColour(Pt.audio_category.colour),this.setTooltip("Represents the audio 'sadness 3'")}};let NY="s_Sadness4";Ut.push(NY);$t.Blocks[NY]={init:function(){this.appendDummyInput().appendField("Sound: sadness 4"),this.setOutput(!0,"Audio"),this.setColour(Pt.audio_category.colour),this.setTooltip("Represents the audio 'sadness 4'")}};let DY="s_Sadness5";Ut.push(DY);$t.Blocks[DY]={init:function(){this.appendDummyInput().appendField("Sound: sadness 5"),this.setOutput(!0,"Audio"),this.setColour(Pt.audio_category.colour),this.setTooltip("Represents the audio 'sadness 5'")}};let PY="s_Sadness6";Ut.push(PY);$t.Blocks[PY]={init:function(){this.appendDummyInput().appendField("Sound: sadness 6"),this.setOutput(!0,"Audio"),this.setColour(Pt.audio_category.colour),this.setTooltip("Represents the audio 'sadness 6'")}};let BY="s_Sadness7";Ut.push(BY);$t.Blocks[BY]={init:function(){this.appendDummyInput().appendField("Sound: sadness 7"),this.setOutput(!0,"Audio"),this.setColour(Pt.audio_category.colour),this.setTooltip("Represents the audio 'sadness 7'")}};let FY="s_Sleepy";Ut.push(FY);$t.Blocks[FY]={init:function(){this.appendDummyInput().appendField("Sound: sleepy"),this.setOutput(!0,"Audio"),this.setColour(Pt.audio_category.colour),this.setTooltip("Represents the audio 'sleepy'")}};let zY="s_Sleepy2";Ut.push(zY);$t.Blocks[zY]={init:function(){this.appendDummyInput().appendField("Sound: sleepy 2"),this.setOutput(!0,"Audio"),this.setColour(Pt.audio_category.colour),this.setTooltip("Represents the audio 'sleepy 2'")}};let UY="s_Sleepy3";Ut.push(UY);$t.Blocks[UY]={init:function(){this.appendDummyInput().appendField("Sound: sleepy 3"),this.setOutput(!0,"Audio"),this.setColour(Pt.audio_category.colour),this.setTooltip("Represents the audio 'sleepy 3'")}};let HY="s_Sleepy4";Ut.push(HY);$t.Blocks[HY]={init:function(){this.appendDummyInput().appendField("Sound: sleepy 4"),this.setOutput(!0,"Audio"),this.setColour(Pt.audio_category.colour),this.setTooltip("Represents the audio 'sleepy 4'")}};let GY="s_SleepySnore";Ut.push(GY);$t.Blocks[GY]={init:function(){this.appendDummyInput().appendField("Sound: sleepy snore"),this.setOutput(!0,"Audio"),this.setColour(Pt.audio_category.colour),this.setTooltip("Represents the audio 'sleepy snore'")}};let WY="s_SystemCameraShutter";Ut.push(WY);$t.Blocks[WY]={init:function(){this.appendDummyInput().appendField("Sound: system camera shutter"),this.setOutput(!0,"Audio"),this.setColour(Pt.audio_category.colour),this.setTooltip("Represents the audio 'system camera shutter'")}};const Oie=$t.common.createBlockDefinitionsFromJsonArray([kie]),Lie=Ut;/** + */let Ut=[];const Oie={type:"add_text",message0:"Add text %1 with color %2",args0:[{type:"input_value",name:"TEXT",check:"String"},{type:"input_value",name:"COLOR",check:"Colour"}],previousStatement:null,nextStatement:null,colour:160,tooltip:"",helpUrl:""};let mj="ChangeLED";Ut.push(mj);$t.Blocks[mj]={init:function(){this.setColour(Bt.light_category.colour),this.appendValueInput("FIELD_ChangeLED").setCheck("Colour").appendField("Change the LED color to"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setOutput(!1),this.setTooltip("Changes Misty's LED to a specified color")}};let gj="TransitionLED";Ut.push(gj);$t.Blocks[gj]={init:function(){this.setColour(Bt.light_category.colour),this.appendValueInput("COLOR1").setCheck("Colour").appendField("Transition LED from"),this.appendValueInput("COLOR2").setCheck("Colour").appendField("to"),this.appendDummyInput().appendField("using the").appendField(new $t.FieldDropdown([["Breathe","BREATHE"],["Blink","BLINK"],["Transition Once","TRANSITION_ONCE"]]),"TRANSITION_TYPE").appendField("transition"),this.appendDummyInput().appendField("for a duration of").appendField(new $t.FieldNumber(1,0,60,1),"FIELD_TransitionTime_TimeMs").appendField("secs"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("Transition LED between two colors with the specified transition type and time.")}};let _j="DisplayImage";Ut.push(_j);$t.Blocks[_j]={init:function(){this.setColour(Bt.face_category.colour),this.appendValueInput("FIELD_DisplayImage_Filename").setCheck("Face").appendField("Change face expression to: "),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("Displays an image on Misty's screen, Alpha specifies transparency (0 is completely transparent, 1 is completely opaque) ***WARNING: MUST connect with ListFilesAvailable to select the image file to display***")}};let vj="DisplayAnimation";Ut.push(vj);$t.Blocks[vj]={init:function(){this.setColour(Bt.misc_category.colour),this.appendValueInput("FIELD_DisplayAnimation_Filename").setCheck("Animation").appendField("Show this animation on Misty: "),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("Runs a specified animation on Misty")}};let yj="MoveHead";Ut.push(yj);$t.Blocks[yj]={init:function(){this.setColour(Bt.movement_category.colour),this.appendDummyInput().appendField("Move head").appendField(new $t.FieldDropdown([["Up","U"],["Down","D"]]),"FIELD_MoveHead_Pitch"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("Moves Misty's head Up or Down")}};let bj="MoveArm";Ut.push(bj);$t.Blocks[bj]={init:function(){this.setColour(Bt.movement_category.colour),this.appendDummyInput().appendField("Move ").appendField(new $t.FieldDropdown([["Right","Right"],["Left","Left"]]),"FIELD_MoveArm_Arm").appendField("arm to position").appendField(new mp(45,-29,90,1,"Up","Down"),"FIELD_MoveArm_Position").appendField("at a speed of (0 to 100)").appendField(new mp(50,0,100,1,"Slow","Fast"),"FIELD_MoveArm_Velocity"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("Moves one of Misty's arms to a specified position (expects a value from 0-10, 5 points the arm straight forward) at a specified speed (between 0 and 100)")}};let Tj="MoveArm2";Ut.push(Tj);$t.Blocks[Tj]={init:function(){this.setColour(Bt.movement_category.colour),this.appendDummyInput().appendField("Move both arms to position").appendField(new mp(45,-29,90,1,"Up","Down"),"FIELD_MoveArm2_Position").appendField("at a speed of (0 to 100)").appendField(new mp(50,0,100,1,"Slow","Fast"),"FIELD_MoveArm2_Velocity"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("Moves both of Misty's arms to a specified position (expects a value from 0-10, 5 points the arm straight forward) at a specified speed (between 0 and 100)")}};let Sj="BasicSlider";Ut.push(Sj);$t.Blocks[Sj]={init:function(){this.setColour(Bt.math_category.colour),this.appendDummyInput().appendField("Slider Value: ").appendField(new mp(0,0,100,1,"Min","Max"),"FIELD_slider_value"),this.setInputsInline(!1),this.setPreviousStatement(!1,null),this.setNextStatement(!1,null),this.setOutput(!0,null)}};let wj="ArmPositionSlider";Ut.push(wj);$t.Blocks[wj]={init:function(){this.setColour(Bt.math_category.colour),this.appendDummyInput().appendField(new mp(45,-29,90,1,"Up","Down"),"FIELD_slider_value"),this.setInputsInline(!1),this.setPreviousStatement(!1,null),this.setNextStatement(!1,null),this.setOutput(!0,null)}};let Ej="SpeedSlider";Ut.push(Ej);$t.Blocks[Ej]={init:function(){this.setColour(Bt.math_category.colour),this.appendDummyInput().appendField(new mp(1,1,100,1,"Slow","Fast"),"FIELD_slider_value"),this.setInputsInline(!1),this.setPreviousStatement(!1,null),this.setNextStatement(!1,null),this.setOutput(!0,null)}};let xj="TimeSlider";Ut.push(xj);$t.Blocks[xj]={init:function(){this.setColour(Bt.math_category.colour),this.appendDummyInput().appendField(new mp(1,1,60,1,"Short","Long"),"FIELD_slider_value"),this.setInputsInline(!1),this.setPreviousStatement(!1,null),this.setNextStatement(!1,null),this.setOutput(!0,null)}};let $j="HeadPitchSlider";Ut.push($j);$t.Blocks[$j]={init:function(){this.setColour(Bt.math_category.colour),this.appendDummyInput().appendField(new mp(0,-40,25,1,"Up","Down"),"FIELD_slider_value"),this.setInputsInline(!1),this.setPreviousStatement(!1,null),this.setNextStatement(!1,null),this.setOutput(!0,null)}};let Cj="HeadRollSlider";Ut.push(Cj);$t.Blocks[Cj]={init:function(){this.setColour(Bt.math_category.colour),this.appendDummyInput().appendField(new mp(0,-40,40,1,"Right","Left"),"FIELD_slider_value"),this.setInputsInline(!1),this.setPreviousStatement(!1,null),this.setNextStatement(!1,null),this.setOutput(!0,null)}};let Mj="HeadYawSlider";Ut.push(Mj);$t.Blocks[Mj]={init:function(){this.setColour(Bt.math_category.colour),this.appendDummyInput().appendField(new mp(0,-81,81,1,"Right","Left"),"FIELD_slider_value"),this.setInputsInline(!1),this.setOutput(!0,null)}};let Aj="MoveArms2";Ut.push(Aj);$t.Blocks[Aj]={init:function(){var n=this.workspace.newBlock("ArmPositionSlider");n.setShadow(!0),n.initSvg(),n.render();var e=n.outputConnection,t=this.workspace.newBlock("SpeedSlider");t.setShadow(!0),t.initSvg(),t.render();var r=t.outputConnection,s=this.workspace.newBlock("ArmPositionSlider");s.setShadow(!0),s.initSvg(),s.render();var o=s.outputConnection,l=this.workspace.newBlock("SpeedSlider");l.setShadow(!0),l.initSvg(),l.render();var u=l.outputConnection;this.setColour(Bt.movement_category.colour),this.appendValueInput("FIELD_MoveArm_LeftPosition").setCheck("Number").appendField("Left Arm Position");var h=this.getInput("FIELD_MoveArm_LeftPosition").connection;h.connect(e),this.appendValueInput("FIELD_MoveArm_LeftVelocity").setCheck("Number").appendField("Left Arm Speed");var g=this.getInput("FIELD_MoveArm_LeftVelocity").connection;g.connect(r),this.appendValueInput("FIELD_MoveArm_RightPosition").setCheck("Number").appendField("Right Arm Position");var f=this.getInput("FIELD_MoveArm_RightPosition").connection;f.connect(o),this.appendValueInput("FIELD_MoveArm_RightVelocity").setCheck("Number").appendField("Right Arm Speed");var g=this.getInput("FIELD_MoveArm_RightVelocity").connection;g.connect(u),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("Moves both of Misty's arms to a specified position (expects a value from 0-10, 5 points the arm straight forward) at a specified speed")}};let Ij="MoveArm3";Ut.push(Ij);$t.Blocks[Ij]={init:function(){var n=this.workspace.newBlock("ArmPositionSlider");n.setShadow(!0),n.initSvg(),n.render();var e=n.outputConnection,t=this.workspace.newBlock("SpeedSlider");t.setShadow(!0),t.initSvg(),t.render();var r=t.outputConnection;this.appendDummyInput().appendField("Move Arm: ").appendField(new $t.FieldDropdown([["Right","Right"],["Left","Left"]]),"FIELD_MoveArm_Arm"),this.setColour(Bt.movement_category.colour),this.appendValueInput("FIELD_MoveArm_Position").setCheck("Number").appendField("Left Arm Position");var s=this.getInput("FIELD_MoveArm_Position").connection;s.connect(e),this.appendValueInput("FIELD_MoveArm_Velocity").setCheck("Number").appendField("Left Arm Speed");var o=this.getInput("FIELD_MoveArm_Velocity").connection;o.connect(r),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("Moves both of Misty's arms to a specified position (expects a value from 0-10, 5 points the arm straight forward) at a specified speed")}};let Rj="DriveTime";Ut.push(Rj);$t.Blocks[Rj]={init:function(){this.setColour(Bt.movement_category.colour),this.appendDummyInput().appendField("Move ").appendField(new $t.FieldDropdown([["Forward","F"],["Backward","B"]]),"FIELD_DriveTime_Direction").appendField("at a speed of (0 to 100)").appendField(new $t.FieldNumber(25,0,100,1),"FIELD_DriveTime_Velocity").appendField("for a duration of").appendField(new $t.FieldNumber(1,0,60,1),"FIELD_DriveTime_TimeMs").appendField("secs"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("Drives Misty straight in a specified direction at a specified speed for a specified amount of time (1000ms = 1 second)")}};let kj="MoveHead3";Ut.push(kj);$t.Blocks[kj]={init:function(){var n=this.workspace.newBlock("HeadPitchSlider");n.setShadow(!0),n.initSvg(),n.render();var e=n.outputConnection,t=this.workspace.newBlock("HeadRollSlider");t.setShadow(!0),t.initSvg(),t.render();var r=t.outputConnection,s=this.workspace.newBlock("HeadYawSlider");s.setShadow(!0),s.initSvg(),s.render();var o=s.outputConnection,l=this.workspace.newBlock("TimeSlider");l.setShadow(!0),l.initSvg(),l.render();var u=l.outputConnection;this.setColour(Bt.movement_category.colour),this.appendDummyInput("FIELD_TEXT_IGNORE").appendField("Move head"),this.appendValueInput("FIELD_MoveHead_Pitch").setCheck("Number").appendField("Look Up/Down:");var h=this.getInput("FIELD_MoveHead_Pitch").connection;h.connect(e),this.appendValueInput("FIELD_MoveHead_Roll").setCheck("Number").appendField("Tilt Left/Right:");var f=this.getInput("FIELD_MoveHead_Roll").connection;f.connect(r),this.appendValueInput("FIELD_MoveHead_Yaw").setCheck("Number").appendField("Look Right/Left:");var g=this.getInput("FIELD_MoveHead_Yaw").connection;g.connect(o),this.appendValueInput("FIELD_MoveHead_Time").setCheck("Number").appendField("Time (seconds):");var y=this.getInput("FIELD_MoveHead_Time").connection;y.connect(u),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("Moves Misty's head a specified amount of degrees with roll, pitch, and/or yaw")}};let Oj="DriveTime2";Ut.push(Oj);$t.Blocks[Oj]={init:function(){var n=this.workspace.newBlock("math_number");n.setShadow(!0),n.initSvg(),n.render();var e=n.outputConnection,t=this.workspace.newBlock("math_number");t.setShadow(!0),t.initSvg(),t.render();var r=t.outputConnection,s=this.workspace.newBlock("math_number");s.setShadow(!0),s.initSvg(),s.render();var o=s.outputConnection;this.setColour(Bt.movement_category.colour),this.appendValueInput("FIELD_DriveTime_Velocity").setCheck("Number").appendField("Move at a speed of (-100 to 100)");var l=this.getInput("FIELD_DriveTime_Velocity").connection;l.connect(e),this.appendValueInput("FIELD_DriveTime_Angular").setCheck("Number").appendField("with angular velocity of (-100 CW to 100 CCW)");var u=this.getInput("FIELD_DriveTime_Angular").connection;u.connect(r),this.appendValueInput("FIELD_DriveTime_TimeMs").setCheck("Number").appendField("for a duration of secs");var h=this.getInput("FIELD_DriveTime_TimeMs").connection;h.connect(o),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("Drives Misty forward (positive speed) or backward (negative speed) with possible turning using angular velocity (0 for straight) for the specified duration (1000 ms = 1 second)")}};let Lj="Turn";Ut.push(Lj);$t.Blocks[Lj]={init:function(){this.setColour(Bt.movement_category.colour),this.appendDummyInput().appendField("Turn").appendField(new $t.FieldDropdown([["Left","L"],["Right","R"]]),"FIELD_Turn_Direction").appendField("for time of").appendField(new $t.FieldNumber(4500),"FIELD_Turn_Duration").appendField("milliseconds"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("Turns Misty in the specified direction (1000ms = 1 second and 4500ms is approximately 90 degrees)")}};let Nj="Turn2";Ut.push(Nj);$t.Blocks[Nj]={init:function(){var n=this.workspace.newBlock("math_number");n.setShadow(!0),n.initSvg(),n.render();var e=n.outputConnection;this.setColour(Bt.movement_category.colour),this.appendDummyInput().appendField("Turn").appendField(new $t.FieldDropdown([["Left","L"],["Right","R"]]),"FIELD_Turn_Direction"),this.appendValueInput("FIELD_Turn_Duration").setCheck("Number").appendField("for time of");var t=this.getInput("FIELD_Turn_Duration").connection;t.connect(e),this.appendDummyInput().appendField("milliseconds"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("Turns Misty in the specified direction (1000ms = 1 second and 4500ms is approximately 90 degrees)")}};let Dj="Speak";Ut.push(Dj);$t.Blocks[Dj]={init:function(){this.setColour(Bt.speech_category.colour),this.appendValueInput("FIELD_Speak_Text").setCheck("String").appendField("Speak: "),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("Speak given input text")}};let Pj="SpeakDefault";Ut.push(Pj);$t.Blocks[Pj]={init:function(){this.setColour(Bt.speech_category.colour),this.appendDummyInput().appendField("Speak: ").appendField(new $t.FieldDropdown([["Hi","Hi"],["Hello","Hello"],["How are you today?","How are you today?"],["Goodbye","Goodbye"]]),"FIELD_SpeakDefault_Text"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("Speak given selected default text")}};let Bj="TurnOnFlashlight";Ut.push(Bj);$t.Blocks[Bj]={init:function(){this.setColour(Bt.light_category.colour),this.appendDummyInput().appendField("Turn on flashlight "),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("Turn on flashlight")}};let Fj="TurnOffFlashlight";Ut.push(Fj);$t.Blocks[Fj]={init:function(){this.setColour(Bt.light_category.colour),this.appendDummyInput().appendField("Turn off flashlight "),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("Turn off flashlight")}};let zj="WaitForSeconds";Ut.push(zj);$t.Blocks[zj]={init:function(){this.appendDummyInput().appendField("wait for"),this.appendDummyInput().setAlign($t.ALIGN_CENTRE).appendField(new $t.FieldNumber(0,-1/0,1/0,.1),"NumSeconds"),this.appendDummyInput().appendField("Seconds"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Bt.movement_category.colour),this.setTooltip("Delay the execution of the next block by some number of seconds")}};let Uj="PlayAudio";Ut.push(Uj);$t.Blocks[Uj]={init:function(){this.setColour(Bt.audio_category.colour),this.appendValueInput("FIELD_PlayAudio_Filename").setCheck("Audio").appendField("Play audio: "),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("")}};let Hj="SetVolume";Ut.push(Hj);$t.Blocks[Hj]={init:function(){this.setColour(Bt.audio_category.colour);var n=this.workspace.newBlock("math_number");n.setShadow(!0),n.initSvg(),n.render();var e=n.outputConnection;this.appendValueInput("FIELD_Volume").setCheck("Number").appendField("Set volume to (0-100): ");var t=this.getInput("FIELD_Volume").connection;t.connect(e),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("Adjusts Misty's volume level for audio playback")}};let Gj="DisplayText";Ut.push(Gj);$t.Blocks[Gj]={init:function(){this.setColour(Bt.face_category.colour),this.appendDummyInput().appendField("Display Text: ").appendField(new $t.FieldTextInput("default"),"FIELD_DisplayText_Text"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("")}};let Wj="ClearText";Ut.push(Wj);$t.Blocks[Wj]={init:function(){this.setColour(Bt.face_category.colour),this.appendDummyInput().appendField("Clear Text"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("")}};let Vj="Start";Ut.push(Vj);$t.Blocks[Vj]={init:function(){this.setStyle("hat_blocks"),this.appendDummyInput().appendField("Program starts here"),this.setColour(Bt.trigger_category.colour),this.setTooltip("This is the starting block"),this.setNextStatement(!0,null),this.setHelpUrl(""),this.setDeletable(!1)}};let jj="FrontLeftBumperPress";Ut.push(jj);$t.Blocks[jj]={init:function(){this.setStyle("hat_blocks"),this.setColour(Bt.trigger_category.colour),this.appendDummyInput().appendField("Front Left Bumper Pressed"),this.setNextStatement(!0,null),this.setTooltip("")}};let Yj="FrontRightBumperPress";Ut.push(Yj);$t.Blocks[Yj]={init:function(){this.setStyle("hat_blocks"),this.setColour(Bt.trigger_category.colour),this.appendDummyInput().appendField("Front Right Bumper Pressed"),this.setNextStatement(!0,null),this.setTooltip("")}};let Xj="RearLeftBumperPress";Ut.push(Xj);$t.Blocks[Xj]={init:function(){this.setStyle("hat_blocks"),this.setColour(Bt.trigger_category.colour),this.appendDummyInput().appendField("Rear Left Bumper Pressed"),this.setNextStatement(!0,null),this.setTooltip("")}};let Kj="RearRightBumperPress";Ut.push(Kj);$t.Blocks[Kj]={init:function(){this.setStyle("hat_blocks"),this.setColour(Bt.trigger_category.colour),this.appendDummyInput().appendField("Right Rear Bumper Pressed"),this.setNextStatement(!0,null),this.setTooltip("")}};let Jj="eyes_acceptance";Ut.push(Jj);$t.Blocks[Jj]={init:function(){this.appendDummyInput().appendField("Expression: acceptance"),this.setOutput(!0,"Face"),this.setColour(Bt.face_category.colour),this.setTooltip("Represents the facial expression 'acceptance'")}};let qj="eyes_admiration";Ut.push(qj);$t.Blocks[qj]={init:function(){this.appendDummyInput().appendField("Expression: admiration"),this.setOutput(!0,"Face"),this.setColour(Bt.face_category.colour),this.setTooltip("Represents the facial expression 'admiration'")}};let Qj="eyes_amazement";Ut.push(Qj);$t.Blocks[Qj]={init:function(){this.appendDummyInput().appendField("Expression: amazement"),this.setOutput(!0,"Face"),this.setColour(Bt.face_category.colour),this.setTooltip("Represents the facial expression 'amazement'")}};let Zj="eyes_anger";Ut.push(Zj);$t.Blocks[Zj]={init:function(){this.appendDummyInput().appendField("Expression: anger"),this.setOutput(!0,"Face"),this.setColour(Bt.face_category.colour),this.setTooltip("Represents the facial expression 'anger'")}};let e7="eyes_annoyed";Ut.push(e7);$t.Blocks[e7]={init:function(){this.appendDummyInput().appendField("Expression: annoyed"),this.setOutput(!0,"Face"),this.setColour(Bt.face_category.colour),this.setTooltip("Represents the facial expression 'annoyed'")}};let t7="eyes_anticipation";Ut.push(t7);$t.Blocks[t7]={init:function(){this.appendDummyInput().appendField("Expression: anticipation"),this.setOutput(!0,"Face"),this.setColour(Bt.face_category.colour),this.setTooltip("Represents the facial expression 'anticipation'")}};let n7="eyes_apprehension";Ut.push(n7);$t.Blocks[n7]={init:function(){this.appendDummyInput().appendField("Expression: apprehension"),this.setOutput(!0,"Face"),this.setColour(Bt.face_category.colour),this.setTooltip("Represents the facial expression 'apprehension'")}};let r7="eyes_boredom";Ut.push(r7);$t.Blocks[r7]={init:function(){this.appendDummyInput().appendField("Expression: boredom"),this.setOutput(!0,"Face"),this.setColour(Bt.face_category.colour),this.setTooltip("Represents the facial expression 'boredom'")}};let i7="eyes_default";Ut.push(i7);$t.Blocks[i7]={init:function(){this.appendDummyInput().appendField("Expression: default"),this.setOutput(!0,"Face"),this.setColour(Bt.face_category.colour),this.setTooltip("Represents the facial expression 'default'")}};let s7="eyes_disgust";Ut.push(s7);$t.Blocks[s7]={init:function(){this.appendDummyInput().appendField("Expression: disgust"),this.setOutput(!0,"Face"),this.setColour(Bt.face_category.colour),this.setTooltip("Represents the facial expression 'disgust'")}};let o7="eyes_distraction";Ut.push(o7);$t.Blocks[o7]={init:function(){this.appendDummyInput().appendField("Expression: distraction"),this.setOutput(!0,"Face"),this.setColour(Bt.face_category.colour),this.setTooltip("Represents the facial expression 'distraction'")}};let a7="eyes_ecstasy_frame_1";Ut.push(a7);$t.Blocks[a7]={init:function(){this.appendDummyInput().appendField("Expression: ecstasy 1"),this.setOutput(!0,"Face"),this.setColour(Bt.face_category.colour),this.setTooltip("Represents the facial expression 'ecstasy 1'")}};let l7="eyes_ecstasy_frame_2";Ut.push(l7);$t.Blocks[l7]={init:function(){this.appendDummyInput().appendField("Expression: ecstasy 2"),this.setOutput(!0,"Face"),this.setColour(Bt.face_category.colour),this.setTooltip("Represents the facial expression 'ecstasy 2'")}};let u7="eyes_fear";Ut.push(u7);$t.Blocks[u7]={init:function(){this.appendDummyInput().appendField("Expression: fear"),this.setOutput(!0,"Face"),this.setColour(Bt.face_category.colour),this.setTooltip("Represents the facial expression 'fear'")}};let c7="eyes_grief";Ut.push(c7);$t.Blocks[c7]={init:function(){this.appendDummyInput().appendField("Expression: grief"),this.setOutput(!0,"Face"),this.setColour(Bt.face_category.colour),this.setTooltip("Represents the facial expression 'grief'")}};let h7="eyes_interest";Ut.push(h7);$t.Blocks[h7]={init:function(){this.appendDummyInput().appendField("Expression: interest"),this.setOutput(!0,"Face"),this.setColour(Bt.face_category.colour),this.setTooltip("Represents the facial expression 'interest'")}};let d7="eyes_joy";Ut.push(d7);$t.Blocks[d7]={init:function(){this.appendDummyInput().appendField("Expression: joy"),this.setOutput(!0,"Face"),this.setColour(Bt.face_category.colour),this.setTooltip("Represents the facial expression 'joy'")}};let f7="eyes_loathing";Ut.push(f7);$t.Blocks[f7]={init:function(){this.appendDummyInput().appendField("Expression: loathing"),this.setOutput(!0,"Face"),this.setColour(Bt.face_category.colour),this.setTooltip("Represents the facial expression 'loathing'")}};let p7="eyes_pensiveness";Ut.push(p7);$t.Blocks[p7]={init:function(){this.appendDummyInput().appendField("Expression: pensiveness"),this.setOutput(!0,"Face"),this.setColour(Bt.face_category.colour),this.setTooltip("Represents the facial expression 'pensiveness'")}};let m7="eyes_rage";Ut.push(m7);$t.Blocks[m7]={init:function(){this.appendDummyInput().appendField("Expression: rage eyes"),this.setOutput(!0,"Face"),this.setColour(Bt.face_category.colour),this.setTooltip("Represents the facial expression 'rage eyes'")}};let g7="eyes_sad";Ut.push(g7);$t.Blocks[g7]={init:function(){this.appendDummyInput().appendField("Expression: sad"),this.setOutput(!0,"Face"),this.setColour(Bt.face_category.colour),this.setTooltip("Represents the facial expression 'sad'")}};let _7="eyes_serenity";Ut.push(_7);$t.Blocks[_7]={init:function(){this.appendDummyInput().appendField("Expression: serenity"),this.setOutput(!0,"Face"),this.setColour(Bt.face_category.colour),this.setTooltip("Represents the facial expression 'serenity'")}};let v7="eyes_surprise";Ut.push(v7);$t.Blocks[v7]={init:function(){this.appendDummyInput().appendField("Expression: surprise"),this.setOutput(!0,"Face"),this.setColour(Bt.face_category.colour),this.setTooltip("Represents the facial expression 'surprise'")}};let y7="eyes_terror";Ut.push(y7);$t.Blocks[y7]={init:function(){this.appendDummyInput().appendField("Expression: terror"),this.setOutput(!0,"Face"),this.setColour(Bt.face_category.colour),this.setTooltip("Represents the facial expression 'terror'")}};let b7="eyes_trust";Ut.push(b7);$t.Blocks[b7]={init:function(){this.appendDummyInput().appendField("Expression: trust"),this.setOutput(!0,"Face"),this.setColour(Bt.face_category.colour),this.setTooltip("Represents the facial expression 'trust'")}};let T7="eyes_vigilance";Ut.push(T7);$t.Blocks[T7]={init:function(){this.appendDummyInput().appendField("Expression: vigilance"),this.setOutput(!0,"Face"),this.setColour(Bt.face_category.colour),this.setTooltip("Represents the facial expression 'vigilance'")}};let S7="e_Sleeping";Ut.push(S7);$t.Blocks[S7]={init:function(){this.appendDummyInput().appendField("Expression: sleeping"),this.setOutput(!0,"Face"),this.setColour(Bt.face_category.colour),this.setTooltip("Represents the facial expression 'sleeping'")}};let w7="e_SleepingZZZ";Ut.push(w7);$t.Blocks[w7]={init:function(){this.appendDummyInput().appendField("Expression: sleeping ZZZ"),this.setOutput(!0,"Face"),this.setColour(Bt.face_category.colour),this.setTooltip("Represents the facial expression 'sleeping ZZZ'")}};let E7="e_Contempt";Ut.push(E7);$t.Blocks[E7]={init:function(){this.appendDummyInput().appendField("Expression: contempt"),this.setOutput(!0,"Face"),this.setColour(Bt.face_category.colour),this.setTooltip("Represents the facial expression 'contempt'")}};let x7="e_ContentLeft";Ut.push(x7);$t.Blocks[x7]={init:function(){this.appendDummyInput().appendField("Expression: content (left)"),this.setOutput(!0,"Face"),this.setColour(Bt.face_category.colour),this.setTooltip("Represents the facial expression 'content (left)'")}};let $7="e_ContentRight";Ut.push($7);$t.Blocks[$7]={init:function(){this.appendDummyInput().appendField("Expression: content (right)"),this.setOutput(!0,"Face"),this.setColour(Bt.face_category.colour),this.setTooltip("Represents the facial expression 'content (right)'")}};let C7="e_Disoriented";Ut.push(C7);$t.Blocks[C7]={init:function(){this.appendDummyInput().appendField("Expression: disoriented"),this.setOutput(!0,"Face"),this.setColour(Bt.face_category.colour),this.setTooltip("Represents the facial expression 'disoriented'")}};let M7="e_EcstacyHilarious";Ut.push(M7);$t.Blocks[M7]={init:function(){this.appendDummyInput().appendField("Expression: ecstacy hilarious"),this.setOutput(!0,"Face"),this.setColour(Bt.face_category.colour),this.setTooltip("Represents the facial expression 'ecstacy hilarious'")}};let A7="e_EcstacyStarryEyed";Ut.push(A7);$t.Blocks[A7]={init:function(){this.appendDummyInput().appendField("Expression: ecstacy starry eyed"),this.setOutput(!0,"Face"),this.setColour(Bt.face_category.colour),this.setTooltip("Represents the facial expression 'ecstacy starry eyed'")}};let I7="e_JoyGoofy";Ut.push(I7);$t.Blocks[I7]={init:function(){this.appendDummyInput().appendField("Expression: joy goofy"),this.setOutput(!0,"Face"),this.setColour(Bt.face_category.colour),this.setTooltip("Represents the facial expression 'joy goofy'")}};let R7="e_JoyGoofy2";Ut.push(R7);$t.Blocks[R7]={init:function(){this.appendDummyInput().appendField("Expression: joy goofy 2"),this.setOutput(!0,"Face"),this.setColour(Bt.face_category.colour),this.setTooltip("Represents the facial expression 'joy goofy 2'")}};let k7="e_JoyGoofy3";Ut.push(k7);$t.Blocks[k7]={init:function(){this.appendDummyInput().appendField("Expression: joy goofy 3"),this.setOutput(!0,"Face"),this.setColour(Bt.face_category.colour),this.setTooltip("Represents the facial expression 'joy goofy 3'")}};let O7="e_Love";Ut.push(O7);$t.Blocks[O7]={init:function(){this.appendDummyInput().appendField("Expression: love"),this.setOutput(!0,"Face"),this.setColour(Bt.face_category.colour),this.setTooltip("Represents the facial expression 'love'")}};let L7="e_Rage";Ut.push(L7);$t.Blocks[L7]={init:function(){this.appendDummyInput().appendField("Expression: rage"),this.setOutput(!0,"Face"),this.setColour(Bt.face_category.colour),this.setTooltip("Represents the facial expression 'rage'")}};let N7="e_Rage2";Ut.push(N7);$t.Blocks[N7]={init:function(){this.appendDummyInput().appendField("Expression: rage 2"),this.setOutput(!0,"Face"),this.setColour(Bt.face_category.colour),this.setTooltip("Represents the facial expression 'rage 2'")}};let D7="e_Rage3";Ut.push(D7);$t.Blocks[D7]={init:function(){this.appendDummyInput().appendField("Expression: rage 3"),this.setOutput(!0,"Face"),this.setColour(Bt.face_category.colour),this.setTooltip("Represents the facial expression 'rage 3'")}};let P7="e_Rage4";Ut.push(P7);$t.Blocks[P7]={init:function(){this.appendDummyInput().appendField("Expression: rage 4"),this.setOutput(!0,"Face"),this.setColour(Bt.face_category.colour),this.setTooltip("Represents the facial expression 'rage 4'")}};let B7="e_RemorseShame";Ut.push(B7);$t.Blocks[B7]={init:function(){this.appendDummyInput().appendField("Expression: remorse shame"),this.setOutput(!0,"Face"),this.setColour(Bt.face_category.colour),this.setTooltip("Represents the facial expression 'remorse shame'")}};$t.Blocks["animation_sleepy.bv"]={init:function(){this.appendDummyInput().appendField("Animation: Sleeping"),this.setOutput(!0,"Animation"),this.setColour(Bt.face_category.colour),this.setTooltip("Run the animation 'sleepy'")}};$t.Blocks["animation_dancing.bv"]={init:function(){this.appendDummyInput().appendField("Animation: Dancing"),this.setOutput(!0,"Animation"),this.setColour(Bt.face_category.colour),this.setTooltip("Run the animation 'dancing'")}};$t.Blocks["animation_spooked.bv"]={init:function(){this.appendDummyInput().appendField("Animation: Spooked"),this.setOutput(!0,"Animation"),this.setColour(Bt.face_category.colour),this.setTooltip("Run the animation 'spooked'")}};let F7="s_Acceptance";Ut.push(F7);$t.Blocks[F7]={init:function(){this.appendDummyInput().appendField("Sound: acceptance"),this.setOutput(!0,"Audio"),this.setColour(Bt.audio_category.colour),this.setTooltip("Represents the audio 'acceptance'")}};let z7="s_Amazement";Ut.push(z7);$t.Blocks[z7]={init:function(){this.appendDummyInput().appendField("Sound: amazement"),this.setOutput(!0,"Audio"),this.setColour(Bt.audio_category.colour),this.setTooltip("Represents the audio 'amazement'")}};let U7="s_Amazement2";Ut.push(U7);$t.Blocks[U7]={init:function(){this.appendDummyInput().appendField("Sound: amazement 2"),this.setOutput(!0,"Audio"),this.setColour(Bt.audio_category.colour),this.setTooltip("Represents the audio 'amazement 2'")}};let H7="s_Anger";Ut.push(H7);$t.Blocks[H7]={init:function(){this.appendDummyInput().appendField("Sound: anger"),this.setOutput(!0,"Audio"),this.setColour(Bt.audio_category.colour),this.setTooltip("Represents the audio 'anger'")}};let G7="s_Anger2";Ut.push(G7);$t.Blocks[G7]={init:function(){this.appendDummyInput().appendField("Sound: anger 2"),this.setOutput(!0,"Audio"),this.setColour(Bt.audio_category.colour),this.setTooltip("Represents the audio 'anger 2'")}};let W7="s_Anger3";Ut.push(W7);$t.Blocks[W7]={init:function(){this.appendDummyInput().appendField("Sound: anger 3"),this.setOutput(!0,"Audio"),this.setColour(Bt.audio_category.colour),this.setTooltip("Represents the audio 'anger 3'")}};let V7="s_Anger4";Ut.push(V7);$t.Blocks[V7]={init:function(){this.appendDummyInput().appendField("Sound: anger 4"),this.setOutput(!0,"Audio"),this.setColour(Bt.audio_category.colour),this.setTooltip("Represents the audio 'anger 4'")}};let j7="s_Annoyance";Ut.push(j7);$t.Blocks[j7]={init:function(){this.appendDummyInput().appendField("Sound: annoyance"),this.setOutput(!0,"Audio"),this.setColour(Bt.audio_category.colour),this.setTooltip("Represents the audio 'annoyance'")}};let Y7="s_Annoyance2";Ut.push(Y7);$t.Blocks[Y7]={init:function(){this.appendDummyInput().appendField("Sound: annoyance 2"),this.setOutput(!0,"Audio"),this.setColour(Bt.audio_category.colour),this.setTooltip("Represents the audio 'annoyance 2'")}};let X7="s_Annoyance3";Ut.push(X7);$t.Blocks[X7]={init:function(){this.appendDummyInput().appendField("Sound: annoyance 3"),this.setOutput(!0,"Audio"),this.setColour(Bt.audio_category.colour),this.setTooltip("Represents the audio 'annoyance 3'")}};let K7="s_Annoyance4";Ut.push(K7);$t.Blocks[K7]={init:function(){this.appendDummyInput().appendField("Sound: annoyance 4"),this.setOutput(!0,"Audio"),this.setColour(Bt.audio_category.colour),this.setTooltip("Represents the audio 'annoyance 4'")}};let J7="s_Awe";Ut.push(J7);$t.Blocks[J7]={init:function(){this.appendDummyInput().appendField("Sound: awe"),this.setOutput(!0,"Audio"),this.setColour(Bt.audio_category.colour),this.setTooltip("Represents the audio 'awe'")}};let q7="s_Awe2";Ut.push(q7);$t.Blocks[q7]={init:function(){this.appendDummyInput().appendField("Sound: awe 2"),this.setOutput(!0,"Audio"),this.setColour(Bt.audio_category.colour),this.setTooltip("Represents the audio 'awe 2'")}};let Q7="s_Awe3";Ut.push(Q7);$t.Blocks[Q7]={init:function(){this.appendDummyInput().appendField("Sound: awe 3"),this.setOutput(!0,"Audio"),this.setColour(Bt.audio_category.colour),this.setTooltip("Represents the audio 'awe 3'")}};let Z7="s_Boredom";Ut.push(Z7);$t.Blocks[Z7]={init:function(){this.appendDummyInput().appendField("Sound: boredom"),this.setOutput(!0,"Audio"),this.setColour(Bt.audio_category.colour),this.setTooltip("Represents the audio 'boredom'")}};let eY="s_Disapproval";Ut.push(eY);$t.Blocks[eY]={init:function(){this.appendDummyInput().appendField("Sound: disapproval"),this.setOutput(!0,"Audio"),this.setColour(Bt.audio_category.colour),this.setTooltip("Represents the audio 'disapproval'")}};let tY="s_Disgust";Ut.push(tY);$t.Blocks[tY]={init:function(){this.appendDummyInput().appendField("Sound: disgust"),this.setOutput(!0,"Audio"),this.setColour(Bt.audio_category.colour),this.setTooltip("Represents the audio 'disgust'")}};let nY="s_Disgust2";Ut.push(nY);$t.Blocks[nY]={init:function(){this.appendDummyInput().appendField("Sound: disgust 2"),this.setOutput(!0,"Audio"),this.setColour(Bt.audio_category.colour),this.setTooltip("Represents the audio 'disgust 2'")}};let rY="s_Disgust3";Ut.push(rY);$t.Blocks[rY]={init:function(){this.appendDummyInput().appendField("Sound: disgust 3"),this.setOutput(!0,"Audio"),this.setColour(Bt.audio_category.colour),this.setTooltip("Represents the audio 'disgust 3'")}};let iY="s_DisorientedConfused";Ut.push(iY);$t.Blocks[iY]={init:function(){this.appendDummyInput().appendField("Sound: disoriented confused"),this.setOutput(!0,"Audio"),this.setColour(Bt.audio_category.colour),this.setTooltip("Represents the audio 'disoriented confused'")}};let sY="s_DisorientedConfused2";Ut.push(sY);$t.Blocks[sY]={init:function(){this.appendDummyInput().appendField("Sound: disoriented confused 2"),this.setOutput(!0,"Audio"),this.setColour(Bt.audio_category.colour),this.setTooltip("Represents the audio 'disoriented confused 2'")}};let oY="s_DisorientedConfused3";Ut.push(oY);$t.Blocks[oY]={init:function(){this.appendDummyInput().appendField("Sound: disoriented confused 3"),this.setOutput(!0,"Audio"),this.setColour(Bt.audio_category.colour),this.setTooltip("Represents the audio 'disoriented confused 3'")}};let aY="s_DisorientedConfused4";Ut.push(aY);$t.Blocks[aY]={init:function(){this.appendDummyInput().appendField("Sound: disoriented confused 4"),this.setOutput(!0,"Audio"),this.setColour(Bt.audio_category.colour),this.setTooltip("Represents the audio 'disoriented confused 4'")}};let lY="s_DisorientedConfused5";Ut.push(lY);$t.Blocks[lY]={init:function(){this.appendDummyInput().appendField("Sound: disoriented confused 5"),this.setOutput(!0,"Audio"),this.setColour(Bt.audio_category.colour),this.setTooltip("Represents the audio 'disoriented confused 5'")}};let uY="s_DisorientedConfused6";Ut.push(uY);$t.Blocks[uY]={init:function(){this.appendDummyInput().appendField("Sound: disoriented confused 6"),this.setOutput(!0,"Audio"),this.setColour(Bt.audio_category.colour),this.setTooltip("Represents the audio 'disoriented confused 6'")}};let cY="s_Distraction";Ut.push(cY);$t.Blocks[cY]={init:function(){this.appendDummyInput().appendField("Sound: distraction"),this.setOutput(!0,"Audio"),this.setColour(Bt.audio_category.colour),this.setTooltip("Represents the audio 'distraction'")}};let hY="s_Ecstacy";Ut.push(hY);$t.Blocks[hY]={init:function(){this.appendDummyInput().appendField("Sound: ecstacy"),this.setOutput(!0,"Audio"),this.setColour(Bt.audio_category.colour),this.setTooltip("Represents the audio 'ecstacy'")}};let dY="s_Ecstacy2";Ut.push(dY);$t.Blocks[dY]={init:function(){this.appendDummyInput().appendField("Sound: ecstacy 2"),this.setOutput(!0,"Audio"),this.setColour(Bt.audio_category.colour),this.setTooltip("Represents the audio 'ecstacy 2'")}};let fY="s_Fear";Ut.push(fY);$t.Blocks[fY]={init:function(){this.appendDummyInput().appendField("Sound: fear"),this.setOutput(!0,"Audio"),this.setColour(Bt.audio_category.colour),this.setTooltip("Represents the audio 'fear'")}};let pY="s_Grief";Ut.push(pY);$t.Blocks[pY]={init:function(){this.appendDummyInput().appendField("Sound: grief"),this.setOutput(!0,"Audio"),this.setColour(Bt.audio_category.colour),this.setTooltip("Represents the audio 'grief'")}};let mY="s_Grief2";Ut.push(mY);$t.Blocks[mY]={init:function(){this.appendDummyInput().appendField("Sound: grief 2"),this.setOutput(!0,"Audio"),this.setColour(Bt.audio_category.colour),this.setTooltip("Represents the audio 'grief 2'")}};let gY="s_Grief3";Ut.push(gY);$t.Blocks[gY]={init:function(){this.appendDummyInput().appendField("Sound: grief 3"),this.setOutput(!0,"Audio"),this.setColour(Bt.audio_category.colour),this.setTooltip("Represents the audio 'grief 3'")}};let _Y="s_Grief4";Ut.push(_Y);$t.Blocks[_Y]={init:function(){this.appendDummyInput().appendField("Sound: grief 4"),this.setOutput(!0,"Audio"),this.setColour(Bt.audio_category.colour),this.setTooltip("Represents the audio 'grief 4'")}};let vY="s_Joy";Ut.push(vY);$t.Blocks[vY]={init:function(){this.appendDummyInput().appendField("Sound: joy"),this.setOutput(!0,"Audio"),this.setColour(Bt.audio_category.colour),this.setTooltip("Represents the audio 'joy'")}};let yY="s_Joy2";Ut.push(yY);$t.Blocks[yY]={init:function(){this.appendDummyInput().appendField("Sound: joy 2"),this.setOutput(!0,"Audio"),this.setColour(Bt.audio_category.colour),this.setTooltip("Represents the audio 'joy 2'")}};let bY="s_Joy3";Ut.push(bY);$t.Blocks[bY]={init:function(){this.appendDummyInput().appendField("Sound: joy 3"),this.setOutput(!0,"Audio"),this.setColour(Bt.audio_category.colour),this.setTooltip("Represents the audio 'joy 3'")}};let TY="s_Joy4";Ut.push(TY);$t.Blocks[TY]={init:function(){this.appendDummyInput().appendField("Sound: joy 4"),this.setOutput(!0,"Audio"),this.setColour(Bt.audio_category.colour),this.setTooltip("Represents the audio 'joy 4'")}};let SY="s_Loathing";Ut.push(SY);$t.Blocks[SY]={init:function(){this.appendDummyInput().appendField("Sound: loathing"),this.setOutput(!0,"Audio"),this.setColour(Bt.audio_category.colour),this.setTooltip("Represents the audio 'loathing'")}};let wY="s_Love";Ut.push(wY);$t.Blocks[wY]={init:function(){this.appendDummyInput().appendField("Sound: love"),this.setOutput(!0,"Audio"),this.setColour(Bt.audio_category.colour),this.setTooltip("Represents the audio 'love'")}};let EY="s_PhraseByeBye";Ut.push(EY);$t.Blocks[EY]={init:function(){this.appendDummyInput().appendField("Sound: Bye Bye"),this.setOutput(!0,"Audio"),this.setColour(Bt.audio_category.colour),this.setTooltip("Represents the audio 'phrase: Bye Bye'")}};let xY="s_PhraseEvilAhHa";Ut.push(xY);$t.Blocks[xY]={init:function(){this.appendDummyInput().appendField("Sound: Evil Ah Ha"),this.setOutput(!0,"Audio"),this.setColour(Bt.audio_category.colour),this.setTooltip("Represents the audio 'phrase: Evil Ah Ha'")}};let $Y="s_PhraseHello";Ut.push($Y);$t.Blocks[$Y]={init:function(){this.appendDummyInput().appendField("Sound: Hello"),this.setOutput(!0,"Audio"),this.setColour(Bt.audio_category.colour),this.setTooltip("Represents the audio 'phrase: Hello'")}};let CY="s_PhraseNoNoNo";Ut.push(CY);$t.Blocks[CY]={init:function(){this.appendDummyInput().appendField("Sound: No No No"),this.setOutput(!0,"Audio"),this.setColour(Bt.audio_category.colour),this.setTooltip("Represents the audio 'phrase: No No No'")}};let MY="s_PhraseOopsy";Ut.push(MY);$t.Blocks[MY]={init:function(){this.appendDummyInput().appendField("Sound: Oopsy"),this.setOutput(!0,"Audio"),this.setColour(Bt.audio_category.colour),this.setTooltip("Represents the audio 'phrase: Oopsy'")}};let AY="s_PhraseOwOwOw";Ut.push(AY);$t.Blocks[AY]={init:function(){this.appendDummyInput().appendField("Sound: Ow Ow Ow"),this.setOutput(!0,"Audio"),this.setColour(Bt.audio_category.colour),this.setTooltip("Represents the audio 'phrase: Ow Ow Ow'")}};let IY="s_PhraseOwwww";Ut.push(IY);$t.Blocks[IY]={init:function(){this.appendDummyInput().appendField("Sound: Owwww"),this.setOutput(!0,"Audio"),this.setColour(Bt.audio_category.colour),this.setTooltip("Represents the audio 'phrase: Owwww'")}};let RY="s_PhraseUhOh";Ut.push(RY);$t.Blocks[RY]={init:function(){this.appendDummyInput().appendField("Sound: Uh Oh"),this.setOutput(!0,"Audio"),this.setColour(Bt.audio_category.colour),this.setTooltip("Represents the audio 'phrase: Uh Oh'")}};let kY="s_Rage";Ut.push(kY);$t.Blocks[kY]={init:function(){this.appendDummyInput().appendField("Sound: rage"),this.setOutput(!0,"Audio"),this.setColour(Bt.audio_category.colour),this.setTooltip("Represents the audio 'rage'")}};let OY="s_Sadness";Ut.push(OY);$t.Blocks[OY]={init:function(){this.appendDummyInput().appendField("Sound: sadness"),this.setOutput(!0,"Audio"),this.setColour(Bt.audio_category.colour),this.setTooltip("Represents the audio 'sadness'")}};let LY="s_Sadness2";Ut.push(LY);$t.Blocks[LY]={init:function(){this.appendDummyInput().appendField("Sound: sadness 2"),this.setOutput(!0,"Audio"),this.setColour(Bt.audio_category.colour),this.setTooltip("Represents the audio 'sadness 2'")}};let NY="s_Sadness3";Ut.push(NY);$t.Blocks[NY]={init:function(){this.appendDummyInput().appendField("Sound: sadness 3"),this.setOutput(!0,"Audio"),this.setColour(Bt.audio_category.colour),this.setTooltip("Represents the audio 'sadness 3'")}};let DY="s_Sadness4";Ut.push(DY);$t.Blocks[DY]={init:function(){this.appendDummyInput().appendField("Sound: sadness 4"),this.setOutput(!0,"Audio"),this.setColour(Bt.audio_category.colour),this.setTooltip("Represents the audio 'sadness 4'")}};let PY="s_Sadness5";Ut.push(PY);$t.Blocks[PY]={init:function(){this.appendDummyInput().appendField("Sound: sadness 5"),this.setOutput(!0,"Audio"),this.setColour(Bt.audio_category.colour),this.setTooltip("Represents the audio 'sadness 5'")}};let BY="s_Sadness6";Ut.push(BY);$t.Blocks[BY]={init:function(){this.appendDummyInput().appendField("Sound: sadness 6"),this.setOutput(!0,"Audio"),this.setColour(Bt.audio_category.colour),this.setTooltip("Represents the audio 'sadness 6'")}};let FY="s_Sadness7";Ut.push(FY);$t.Blocks[FY]={init:function(){this.appendDummyInput().appendField("Sound: sadness 7"),this.setOutput(!0,"Audio"),this.setColour(Bt.audio_category.colour),this.setTooltip("Represents the audio 'sadness 7'")}};let zY="s_Sleepy";Ut.push(zY);$t.Blocks[zY]={init:function(){this.appendDummyInput().appendField("Sound: sleepy"),this.setOutput(!0,"Audio"),this.setColour(Bt.audio_category.colour),this.setTooltip("Represents the audio 'sleepy'")}};let UY="s_Sleepy2";Ut.push(UY);$t.Blocks[UY]={init:function(){this.appendDummyInput().appendField("Sound: sleepy 2"),this.setOutput(!0,"Audio"),this.setColour(Bt.audio_category.colour),this.setTooltip("Represents the audio 'sleepy 2'")}};let HY="s_Sleepy3";Ut.push(HY);$t.Blocks[HY]={init:function(){this.appendDummyInput().appendField("Sound: sleepy 3"),this.setOutput(!0,"Audio"),this.setColour(Bt.audio_category.colour),this.setTooltip("Represents the audio 'sleepy 3'")}};let GY="s_Sleepy4";Ut.push(GY);$t.Blocks[GY]={init:function(){this.appendDummyInput().appendField("Sound: sleepy 4"),this.setOutput(!0,"Audio"),this.setColour(Bt.audio_category.colour),this.setTooltip("Represents the audio 'sleepy 4'")}};let WY="s_SleepySnore";Ut.push(WY);$t.Blocks[WY]={init:function(){this.appendDummyInput().appendField("Sound: sleepy snore"),this.setOutput(!0,"Audio"),this.setColour(Bt.audio_category.colour),this.setTooltip("Represents the audio 'sleepy snore'")}};let VY="s_SystemCameraShutter";Ut.push(VY);$t.Blocks[VY]={init:function(){this.appendDummyInput().appendField("Sound: system camera shutter"),this.setOutput(!0,"Audio"),this.setColour(Bt.audio_category.colour),this.setTooltip("Represents the audio 'system camera shutter'")}};const Lie=$t.common.createBlockDefinitionsFromJsonArray([Oie]),Nie=Ut;/** * @license * Copyright 2023 Google LLC * SPDX-License-Identifier: Apache-2.0 @@ -1181,7 +1181,7 @@ function ${Se.FUNCTION_NAME_PLACEHOLDER_}(haystack, needle, replacement) { textEl.style.color = color; outputDiv.appendChild(textEl); }`)}(${t}, ${r}); -`};ik.Start=function(n){return""};var Nie={BASE_URL:"/gpu-programming/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const VU=n=>{let e;const t=new Set,r=(g,y)=>{const b=typeof g=="function"?g(e):g;if(!Object.is(b,e)){const w=e;e=y??(typeof b!="object"||b===null)?b:Object.assign({},e,b),t.forEach(C=>C(e,w))}},s=()=>e,h={setState:r,getState:s,getInitialState:()=>f,subscribe:g=>(t.add(g),()=>t.delete(g)),destroy:()=>{(Nie?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),t.clear()}},f=e=n(r,s,h);return h},Die=n=>n?VU(n):VU;var VY={exports:{}},jY={},YY={exports:{}},XY={};/** +`};ik.Start=function(n){return""};var Die={BASE_URL:"/gpu-programming/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const VU=n=>{let e;const t=new Set,r=(g,y)=>{const b=typeof g=="function"?g(e):g;if(!Object.is(b,e)){const w=e;e=y??(typeof b!="object"||b===null)?b:Object.assign({},e,b),t.forEach(C=>C(e,w))}},s=()=>e,h={setState:r,getState:s,getInitialState:()=>f,subscribe:g=>(t.add(g),()=>t.delete(g)),destroy:()=>{(Die?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),t.clear()}},f=e=n(r,s,h);return h},Pie=n=>n?VU(n):VU;var jY={exports:{}},YY={},XY={exports:{}},KY={};/** * @license React * use-sync-external-store-shim.production.min.js * @@ -1189,7 +1189,7 @@ function ${Se.FUNCTION_NAME_PLACEHOLDER_}(haystack, needle, replacement) { * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Mw=pe;function Pie(n,e){return n===e&&(n!==0||1/n===1/e)||n!==n&&e!==e}var Bie=typeof Object.is=="function"?Object.is:Pie,Fie=Mw.useState,zie=Mw.useEffect,Uie=Mw.useLayoutEffect,Hie=Mw.useDebugValue;function Gie(n,e){var t=e(),r=Fie({inst:{value:t,getSnapshot:e}}),s=r[0].inst,o=r[1];return Uie(function(){s.value=t,s.getSnapshot=e,dO(s)&&o({inst:s})},[n,t,e]),zie(function(){return dO(s)&&o({inst:s}),n(function(){dO(s)&&o({inst:s})})},[n]),Hie(t),t}function dO(n){var e=n.getSnapshot;n=n.value;try{var t=e();return!Bie(n,t)}catch{return!0}}function Wie(n,e){return e()}var Vie=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Wie:Gie;XY.useSyncExternalStore=Mw.useSyncExternalStore!==void 0?Mw.useSyncExternalStore:Vie;YY.exports=XY;var jie=YY.exports;/** + */var Mw=me;function Bie(n,e){return n===e&&(n!==0||1/n===1/e)||n!==n&&e!==e}var Fie=typeof Object.is=="function"?Object.is:Bie,zie=Mw.useState,Uie=Mw.useEffect,Hie=Mw.useLayoutEffect,Gie=Mw.useDebugValue;function Wie(n,e){var t=e(),r=zie({inst:{value:t,getSnapshot:e}}),s=r[0].inst,o=r[1];return Hie(function(){s.value=t,s.getSnapshot=e,dO(s)&&o({inst:s})},[n,t,e]),Uie(function(){return dO(s)&&o({inst:s}),n(function(){dO(s)&&o({inst:s})})},[n]),Gie(t),t}function dO(n){var e=n.getSnapshot;n=n.value;try{var t=e();return!Fie(n,t)}catch{return!0}}function Vie(n,e){return e()}var jie=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Vie:Wie;KY.useSyncExternalStore=Mw.useSyncExternalStore!==void 0?Mw.useSyncExternalStore:jie;XY.exports=KY;var Yie=XY.exports;/** * @license React * use-sync-external-store-shim/with-selector.production.min.js * @@ -1197,17 +1197,17 @@ function ${Se.FUNCTION_NAME_PLACEHOLDER_}(haystack, needle, replacement) { * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var sk=pe,Yie=jie;function Xie(n,e){return n===e&&(n!==0||1/n===1/e)||n!==n&&e!==e}var Kie=typeof Object.is=="function"?Object.is:Xie,Jie=Yie.useSyncExternalStore,qie=sk.useRef,Qie=sk.useEffect,Zie=sk.useMemo,ese=sk.useDebugValue;jY.useSyncExternalStoreWithSelector=function(n,e,t,r,s){var o=qie(null);if(o.current===null){var l={hasValue:!1,value:null};o.current=l}else l=o.current;o=Zie(function(){function h(w){if(!f){if(f=!0,g=w,w=r(w),s!==void 0&&l.hasValue){var C=l.value;if(s(C,w))return y=C}return y=w}if(C=y,Kie(g,w))return C;var M=r(w);return s!==void 0&&s(C,M)?C:(g=w,y=M)}var f=!1,g,y,b=t===void 0?null:t;return[function(){return h(e())},b===null?void 0:function(){return h(b())}]},[e,t,r,s]);var u=Jie(n,o[0],o[1]);return Qie(function(){l.hasValue=!0,l.value=u},[u]),ese(u),u};VY.exports=jY;var tse=VY.exports;const nse=Xy(tse);var KY={BASE_URL:"/gpu-programming/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{useDebugValue:rse}=yt,{useSyncExternalStoreWithSelector:ise}=nse;let jU=!1;const sse=n=>n;function ose(n,e=sse,t){(KY?"production":void 0)!=="production"&&t&&!jU&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),jU=!0);const r=ise(n.subscribe,n.getState,n.getServerState||n.getInitialState,e,t);return rse(r),r}const YU=n=>{(KY?"production":void 0)!=="production"&&typeof n!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const e=typeof n=="function"?Die(n):n,t=(r,s)=>ose(e,r,s);return Object.assign(t,e),t},ase=n=>n?YU(n):YU;var D3={},ok={};(function(n){const e=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",t=e+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",r="["+e+"]["+t+"]*",s=new RegExp("^"+r+"$"),o=function(u,h){const f=[];let g=h.exec(u);for(;g;){const y=[];y.startIndex=h.lastIndex-g[0].length;const b=g.length;for(let w=0;w"u")};n.isExist=function(u){return typeof u<"u"},n.isEmptyObject=function(u){return Object.keys(u).length===0},n.merge=function(u,h,f){if(h){const g=Object.keys(h),y=g.length;for(let b=0;b"&&n[o]!==" "&&n[o]!==" "&&n[o]!==` -`&&n[o]!=="\r";o++)h+=n[o];if(h=h.trim(),h[h.length-1]==="/"&&(h=h.substring(0,h.length-1),o--),!gse(h)){let y;return h.trim().length===0?y="Invalid space after '<'.":y="Tag '"+h+"' is an invalid name.",Oh("InvalidTag",y,Up(n,o))}const f=hse(n,o);if(f===!1)return Oh("InvalidAttr","Attributes for '"+h+"' have open quote.",Up(n,o));let g=f.value;if(o=f.index,g[g.length-1]==="/"){const y=o-g.length;g=g.substring(0,g.length-1);const b=qU(g,e);if(b===!0)r=!0;else return Oh(b.err.code,b.err.msg,Up(n,y+b.err.line))}else if(u)if(f.tagClosed){if(g.trim().length>0)return Oh("InvalidTag","Closing tag '"+h+"' can't have attributes or invalid starting.",Up(n,l));{const y=t.pop();if(h!==y.tagName){let b=Up(n,y.tagStartPos);return Oh("InvalidTag","Expected closing tag '"+y.tagName+"' (opened in line "+b.line+", col "+b.col+") instead of closing tag '"+h+"'.",Up(n,l))}t.length==0&&(s=!0)}}else return Oh("InvalidTag","Closing tag '"+h+"' doesn't have proper closing.",Up(n,o));else{const y=qU(g,e);if(y!==!0)return Oh(y.err.code,y.err.msg,Up(n,o-g.length+y.err.line));if(s===!0)return Oh("InvalidXml","Multiple possible root nodes found.",Up(n,o));e.unpairedTags.indexOf(h)!==-1||t.push({tagName:h,tagStartPos:l}),r=!0}for(o++;o0)return Oh("InvalidXml","Invalid '"+JSON.stringify(t.map(o=>o.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return Oh("InvalidXml","Start tag expected.",1);return!0};function XU(n){return n===" "||n===" "||n===` -`||n==="\r"}function KU(n,e){const t=e;for(;e5&&r==="xml")return Oh("InvalidXml","XML declaration allowed only at the start of the document.",Up(n,e));if(n[e]=="?"&&n[e+1]==">"){e++;break}else continue}return e}function JU(n,e){if(n.length>e+5&&n[e+1]==="-"&&n[e+2]==="-"){for(e+=3;e"){e+=2;break}}else if(n.length>e+8&&n[e+1]==="D"&&n[e+2]==="O"&&n[e+3]==="C"&&n[e+4]==="T"&&n[e+5]==="Y"&&n[e+6]==="P"&&n[e+7]==="E"){let t=1;for(e+=8;e"&&(t--,t===0))break}else if(n.length>e+9&&n[e+1]==="["&&n[e+2]==="C"&&n[e+3]==="D"&&n[e+4]==="A"&&n[e+5]==="T"&&n[e+6]==="A"&&n[e+7]==="["){for(e+=8;e"){e+=2;break}}return e}const use='"',cse="'";function hse(n,e){let t="",r="",s=!1;for(;e"&&r===""){s=!0;break}t+=n[e]}return r!==""?!1:{value:t,index:e,tagClosed:s}}const dse=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function qU(n,e){const t=P3.getAllMatches(n,dse),r={};for(let s=0;s!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(n,e,t){return n}},_se=function(n){return Object.assign({},JY,n)};B3.buildOptions=_se;B3.defaultOptions=JY;class vse{constructor(e){this.tagname=e,this.child=[],this[":@"]={}}add(e,t){e==="__proto__"&&(e="#__proto__"),this.child.push({[e]:t})}addChild(e){e.tagname==="__proto__"&&(e.tagname="#__proto__"),e[":@"]&&Object.keys(e[":@"]).length>0?this.child.push({[e.tagname]:e.child,":@":e[":@"]}):this.child.push({[e.tagname]:e.child})}}var yse=vse;const bse=ok;function Tse(n,e){const t={};if(n[e+3]==="O"&&n[e+4]==="C"&&n[e+5]==="T"&&n[e+6]==="Y"&&n[e+7]==="P"&&n[e+8]==="E"){e=e+9;let r=1,s=!1,o=!1,l="";for(;e"){if(o?n[e-1]==="-"&&n[e-2]==="-"&&(o=!1,r--):r--,r===0)break}else n[e]==="["?s=!0:l+=n[e];if(r!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:t,i:e}}function Sse(n,e){let t="";for(;e0&&s&&t[2]!==".")return n;if(!e.leadingZeros&&o.length>0&&!s&&t[1]!==".")return n;{const h=Number(t),f=""+h;return f.search(/[eE]/)!==-1||u?e.eNotation?h:n:t.indexOf(".")!==-1?f==="0"&&l===""||f===l||s&&f==="-"+l?h:n:o?l===f||s+l===f?h:n:t===f||t===s+f?h:n}}else return n}}function Lse(n){return n&&n.indexOf(".")!==-1&&(n=n.replace(/0+$/,""),n==="."?n="0":n[0]==="."?n="0"+n:n[n.length-1]==="."&&(n=n.substr(0,n.length-1))),n}var Nse=Ose;const qY=ok,VE=yse,Dse=Ase,Pse=Nse;let Bse=class{constructor(e){this.options=e,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(t,r)=>String.fromCharCode(Number.parseInt(r,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(t,r)=>String.fromCharCode(Number.parseInt(r,16))}},this.addExternalEntities=Fse,this.parseXml=Wse,this.parseTextData=zse,this.resolveNameSpace=Use,this.buildAttributesMap=Gse,this.isItStopNode=Xse,this.replaceEntitiesValue=jse,this.readStopNodeData=Jse,this.saveTextToParentTag=Yse,this.addChild=Vse}};function Fse(n){const e=Object.keys(n);for(let t=0;t0)){l||(n=this.replaceEntitiesValue(n));const u=this.options.tagValueProcessor(e,n,t,s,o);return u==null?n:typeof u!=typeof n||u!==n?u:this.options.trimValues?$D(n,this.options.parseTagValue,this.options.numberParseOptions):n.trim()===n?$D(n,this.options.parseTagValue,this.options.numberParseOptions):n}}function Use(n){if(this.options.removeNSPrefix){const e=n.split(":"),t=n.charAt(0)==="/"?"/":"";if(e[0]==="xmlns")return"";e.length===2&&(n=t+e[1])}return n}const Hse=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function Gse(n,e,t){if(!this.options.ignoreAttributes&&typeof n=="string"){const r=qY.getAllMatches(n,Hse),s=r.length,o={};for(let l=0;l",o,"Closing Tag is not closed.");let h=n.substring(o+2,u).trim();if(this.options.removeNSPrefix){const y=h.indexOf(":");y!==-1&&(h=h.substr(y+1))}this.options.transformTagName&&(h=this.options.transformTagName(h)),t&&(r=this.saveTextToParentTag(r,t,s));const f=s.substring(s.lastIndexOf(".")+1);if(h&&this.options.unpairedTags.indexOf(h)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: `);let g=0;f&&this.options.unpairedTags.indexOf(f)!==-1?(g=s.lastIndexOf(".",s.lastIndexOf(".")-1),this.tagsNodeStack.pop()):g=s.lastIndexOf("."),s=s.substring(0,g),t=this.tagsNodeStack.pop(),r="",o=u}else if(n[o+1]==="?"){let u=xD(n,o,!1,"?>");if(!u)throw new Error("Pi Tag is not closed.");if(r=this.saveTextToParentTag(r,t,s),!(this.options.ignoreDeclaration&&u.tagName==="?xml"||this.options.ignorePiTags)){const h=new VE(u.tagName);h.add(this.options.textNodeName,""),u.tagName!==u.tagExp&&u.attrExpPresent&&(h[":@"]=this.buildAttributesMap(u.tagExp,s,u.tagName)),this.addChild(t,h,s)}o=u.closeIndex+1}else if(n.substr(o+1,3)==="!--"){const u=y1(n,"-->",o+4,"Comment is not closed.");if(this.options.commentPropName){const h=n.substring(o+4,u-2);r=this.saveTextToParentTag(r,t,s),t.add(this.options.commentPropName,[{[this.options.textNodeName]:h}])}o=u}else if(n.substr(o+1,2)==="!D"){const u=Dse(n,o);this.docTypeEntities=u.entities,o=u.i}else if(n.substr(o+1,2)==="!["){const u=y1(n,"]]>",o,"CDATA is not closed.")-2,h=n.substring(o+9,u);r=this.saveTextToParentTag(r,t,s);let f=this.parseTextData(h,t.tagname,s,!0,!1,!0,!0);f==null&&(f=""),this.options.cdataPropName?t.add(this.options.cdataPropName,[{[this.options.textNodeName]:h}]):t.add(this.options.textNodeName,f),o=u+2}else{let u=xD(n,o,this.options.removeNSPrefix),h=u.tagName;const f=u.rawTagName;let g=u.tagExp,y=u.attrExpPresent,b=u.closeIndex;this.options.transformTagName&&(h=this.options.transformTagName(h)),t&&r&&t.tagname!=="!xml"&&(r=this.saveTextToParentTag(r,t,s,!1));const w=t;if(w&&this.options.unpairedTags.indexOf(w.tagname)!==-1&&(t=this.tagsNodeStack.pop(),s=s.substring(0,s.lastIndexOf("."))),h!==e.tagname&&(s+=s?"."+h:h),this.isItStopNode(this.options.stopNodes,s,h)){let C="";if(g.length>0&&g.lastIndexOf("/")===g.length-1)o=u.closeIndex;else if(this.options.unpairedTags.indexOf(h)!==-1)o=u.closeIndex;else{const A=this.readStopNodeData(n,f,b+1);if(!A)throw new Error(`Unexpected end of ${f}`);o=A.i,C=A.tagContent}const M=new VE(h);h!==g&&y&&(M[":@"]=this.buildAttributesMap(g,s,h)),C&&(C=this.parseTextData(C,h,s,!0,y,!0,!0)),s=s.substr(0,s.lastIndexOf(".")),M.add(this.options.textNodeName,C),this.addChild(t,M,s)}else{if(g.length>0&&g.lastIndexOf("/")===g.length-1){h[h.length-1]==="/"?(h=h.substr(0,h.length-1),s=s.substr(0,s.length-1),g=h):g=g.substr(0,g.length-1),this.options.transformTagName&&(h=this.options.transformTagName(h));const C=new VE(h);h!==g&&y&&(C[":@"]=this.buildAttributesMap(g,s,h)),this.addChild(t,C,s),s=s.substr(0,s.lastIndexOf("."))}else{const C=new VE(h);this.tagsNodeStack.push(t),h!==g&&y&&(C[":@"]=this.buildAttributesMap(g,s,h)),this.addChild(t,C,s),t=C}r="",o=b}}else r+=n[o];return e.child};function Vse(n,e,t){const r=this.options.updateTag(e.tagname,t,e[":@"]);r===!1||(typeof r=="string"&&(e.tagname=r),n.addChild(e))}const jse=function(n){if(this.options.processEntities){for(let e in this.docTypeEntities){const t=this.docTypeEntities[e];n=n.replace(t.regx,t.val)}for(let e in this.lastEntities){const t=this.lastEntities[e];n=n.replace(t.regex,t.val)}if(this.options.htmlEntities)for(let e in this.htmlEntities){const t=this.htmlEntities[e];n=n.replace(t.regex,t.val)}n=n.replace(this.ampEntity.regex,this.ampEntity.val)}return n};function Yse(n,e,t,r){return n&&(r===void 0&&(r=Object.keys(e.child).length===0),n=this.parseTextData(n,e.tagname,t,!1,e[":@"]?Object.keys(e[":@"]).length!==0:!1,r),n!==void 0&&n!==""&&e.add(this.options.textNodeName,n),n=""),n}function Xse(n,e,t){const r="*."+t;for(const s in n){const o=n[s];if(r===o||e===o)return!0}return!1}function Kse(n,e,t=">"){let r,s="";for(let o=e;o",t,`${e} is not closed`);if(n.substring(t+2,o).trim()===e&&(s--,s===0))return{tagContent:n.substring(r,t),i:o};t=o}else if(n[t+1]==="?")t=y1(n,"?>",t+1,"StopNode is not closed.");else if(n.substr(t+1,3)==="!--")t=y1(n,"-->",t+3,"StopNode is not closed.");else if(n.substr(t+1,2)==="![")t=y1(n,"]]>",t,"StopNode is not closed.")-2;else{const o=xD(n,t,">");o&&((o&&o.tagName)===e&&o.tagExp[o.tagExp.length-1]!=="/"&&s++,t=o.closeIndex)}}function $D(n,e,t){if(e&&typeof n=="string"){const r=n.trim();return r==="true"?!0:r==="false"?!1:Pse(n,t)}else return qY.isExist(n)?n:""}var qse=Bse,QY={};function Qse(n,e){return ZY(n,e)}function ZY(n,e,t){let r;const s={};for(let o=0;o0&&(s[e.textNodeName]=r):r!==void 0&&(s[e.textNodeName]=r),s}function Zse(n){const e=Object.keys(n);for(let t=0;t0&&(t=loe),eX(n,e,"",t)}function eX(n,e,t,r){let s="",o=!1;for(let l=0;l`,o=!1;continue}else if(h===e.commentPropName){s+=r+``,o=!0;continue}else if(h[0]==="?"){const C=QU(u[":@"],e),M=h==="?xml"?"":r;let A=u[h][0][e.textNodeName];A=A.length!==0?" "+A:"",s+=M+`<${h}${A}${C}?>`,o=!0;continue}let g=r;g!==""&&(g+=e.indentBy);const y=QU(u[":@"],e),b=r+`<${h}${y}`,w=eX(u[h],e,f,g);e.unpairedTags.indexOf(h)!==-1?e.suppressUnpairedNode?s+=b+">":s+=b+"/>":(!w||w.length===0)&&e.suppressEmptyNode?s+=b+"/>":w&&w.endsWith(">")?s+=b+`>${w}${r}`:(s+=b+">",w&&r!==""&&(w.includes("/>")||w.includes("`),o=!0}return s}function coe(n){const e=Object.keys(n);for(let t=0;t0&&e.processEntities)for(let t=0;t","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("'","g"),val:"'"},{regex:new RegExp('"',"g"),val:"""}],processEntities:!0,stopNodes:[],oneListGroup:!1};function Qy(n){this.options=Object.assign({},poe,n),this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=_oe),this.processTextOrObjNode=moe,this.options.format?(this.indentate=goe,this.tagEndChar=`> + */var sk=me,Xie=Yie;function Kie(n,e){return n===e&&(n!==0||1/n===1/e)||n!==n&&e!==e}var Jie=typeof Object.is=="function"?Object.is:Kie,qie=Xie.useSyncExternalStore,Qie=sk.useRef,Zie=sk.useEffect,ese=sk.useMemo,tse=sk.useDebugValue;YY.useSyncExternalStoreWithSelector=function(n,e,t,r,s){var o=Qie(null);if(o.current===null){var l={hasValue:!1,value:null};o.current=l}else l=o.current;o=ese(function(){function h(w){if(!f){if(f=!0,g=w,w=r(w),s!==void 0&&l.hasValue){var C=l.value;if(s(C,w))return y=C}return y=w}if(C=y,Jie(g,w))return C;var M=r(w);return s!==void 0&&s(C,M)?C:(g=w,y=M)}var f=!1,g,y,b=t===void 0?null:t;return[function(){return h(e())},b===null?void 0:function(){return h(b())}]},[e,t,r,s]);var u=qie(n,o[0],o[1]);return Zie(function(){l.hasValue=!0,l.value=u},[u]),tse(u),u};jY.exports=YY;var nse=jY.exports;const rse=Xy(nse);var JY={BASE_URL:"/gpu-programming/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{useDebugValue:ise}=yt,{useSyncExternalStoreWithSelector:sse}=rse;let jU=!1;const ose=n=>n;function ase(n,e=ose,t){(JY?"production":void 0)!=="production"&&t&&!jU&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),jU=!0);const r=sse(n.subscribe,n.getState,n.getServerState||n.getInitialState,e,t);return ise(r),r}const YU=n=>{(JY?"production":void 0)!=="production"&&typeof n!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const e=typeof n=="function"?Pie(n):n,t=(r,s)=>ase(e,r,s);return Object.assign(t,e),t},lse=n=>n?YU(n):YU;var D3={},ok={};(function(n){const e=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",t=e+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",r="["+e+"]["+t+"]*",s=new RegExp("^"+r+"$"),o=function(u,h){const f=[];let g=h.exec(u);for(;g;){const y=[];y.startIndex=h.lastIndex-g[0].length;const b=g.length;for(let w=0;w"u")};n.isExist=function(u){return typeof u<"u"},n.isEmptyObject=function(u){return Object.keys(u).length===0},n.merge=function(u,h,f){if(h){const g=Object.keys(h),y=g.length;for(let b=0;b"&&n[o]!==" "&&n[o]!==" "&&n[o]!==` +`&&n[o]!=="\r";o++)h+=n[o];if(h=h.trim(),h[h.length-1]==="/"&&(h=h.substring(0,h.length-1),o--),!_se(h)){let y;return h.trim().length===0?y="Invalid space after '<'.":y="Tag '"+h+"' is an invalid name.",Oh("InvalidTag",y,Up(n,o))}const f=dse(n,o);if(f===!1)return Oh("InvalidAttr","Attributes for '"+h+"' have open quote.",Up(n,o));let g=f.value;if(o=f.index,g[g.length-1]==="/"){const y=o-g.length;g=g.substring(0,g.length-1);const b=qU(g,e);if(b===!0)r=!0;else return Oh(b.err.code,b.err.msg,Up(n,y+b.err.line))}else if(u)if(f.tagClosed){if(g.trim().length>0)return Oh("InvalidTag","Closing tag '"+h+"' can't have attributes or invalid starting.",Up(n,l));{const y=t.pop();if(h!==y.tagName){let b=Up(n,y.tagStartPos);return Oh("InvalidTag","Expected closing tag '"+y.tagName+"' (opened in line "+b.line+", col "+b.col+") instead of closing tag '"+h+"'.",Up(n,l))}t.length==0&&(s=!0)}}else return Oh("InvalidTag","Closing tag '"+h+"' doesn't have proper closing.",Up(n,o));else{const y=qU(g,e);if(y!==!0)return Oh(y.err.code,y.err.msg,Up(n,o-g.length+y.err.line));if(s===!0)return Oh("InvalidXml","Multiple possible root nodes found.",Up(n,o));e.unpairedTags.indexOf(h)!==-1||t.push({tagName:h,tagStartPos:l}),r=!0}for(o++;o0)return Oh("InvalidXml","Invalid '"+JSON.stringify(t.map(o=>o.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return Oh("InvalidXml","Start tag expected.",1);return!0};function XU(n){return n===" "||n===" "||n===` +`||n==="\r"}function KU(n,e){const t=e;for(;e5&&r==="xml")return Oh("InvalidXml","XML declaration allowed only at the start of the document.",Up(n,e));if(n[e]=="?"&&n[e+1]==">"){e++;break}else continue}return e}function JU(n,e){if(n.length>e+5&&n[e+1]==="-"&&n[e+2]==="-"){for(e+=3;e"){e+=2;break}}else if(n.length>e+8&&n[e+1]==="D"&&n[e+2]==="O"&&n[e+3]==="C"&&n[e+4]==="T"&&n[e+5]==="Y"&&n[e+6]==="P"&&n[e+7]==="E"){let t=1;for(e+=8;e"&&(t--,t===0))break}else if(n.length>e+9&&n[e+1]==="["&&n[e+2]==="C"&&n[e+3]==="D"&&n[e+4]==="A"&&n[e+5]==="T"&&n[e+6]==="A"&&n[e+7]==="["){for(e+=8;e"){e+=2;break}}return e}const cse='"',hse="'";function dse(n,e){let t="",r="",s=!1;for(;e"&&r===""){s=!0;break}t+=n[e]}return r!==""?!1:{value:t,index:e,tagClosed:s}}const fse=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function qU(n,e){const t=P3.getAllMatches(n,fse),r={};for(let s=0;s!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(n,e,t){return n}},vse=function(n){return Object.assign({},qY,n)};B3.buildOptions=vse;B3.defaultOptions=qY;class yse{constructor(e){this.tagname=e,this.child=[],this[":@"]={}}add(e,t){e==="__proto__"&&(e="#__proto__"),this.child.push({[e]:t})}addChild(e){e.tagname==="__proto__"&&(e.tagname="#__proto__"),e[":@"]&&Object.keys(e[":@"]).length>0?this.child.push({[e.tagname]:e.child,":@":e[":@"]}):this.child.push({[e.tagname]:e.child})}}var bse=yse;const Tse=ok;function Sse(n,e){const t={};if(n[e+3]==="O"&&n[e+4]==="C"&&n[e+5]==="T"&&n[e+6]==="Y"&&n[e+7]==="P"&&n[e+8]==="E"){e=e+9;let r=1,s=!1,o=!1,l="";for(;e"){if(o?n[e-1]==="-"&&n[e-2]==="-"&&(o=!1,r--):r--,r===0)break}else n[e]==="["?s=!0:l+=n[e];if(r!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:t,i:e}}function wse(n,e){let t="";for(;e0&&s&&t[2]!==".")return n;if(!e.leadingZeros&&o.length>0&&!s&&t[1]!==".")return n;{const h=Number(t),f=""+h;return f.search(/[eE]/)!==-1||u?e.eNotation?h:n:t.indexOf(".")!==-1?f==="0"&&l===""||f===l||s&&f==="-"+l?h:n:o?l===f||s+l===f?h:n:t===f||t===s+f?h:n}}else return n}}function Nse(n){return n&&n.indexOf(".")!==-1&&(n=n.replace(/0+$/,""),n==="."?n="0":n[0]==="."?n="0"+n:n[n.length-1]==="."&&(n=n.substr(0,n.length-1))),n}var Dse=Lse;const QY=ok,VE=bse,Pse=Ise,Bse=Dse;let Fse=class{constructor(e){this.options=e,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(t,r)=>String.fromCharCode(Number.parseInt(r,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(t,r)=>String.fromCharCode(Number.parseInt(r,16))}},this.addExternalEntities=zse,this.parseXml=Vse,this.parseTextData=Use,this.resolveNameSpace=Hse,this.buildAttributesMap=Wse,this.isItStopNode=Kse,this.replaceEntitiesValue=Yse,this.readStopNodeData=qse,this.saveTextToParentTag=Xse,this.addChild=jse}};function zse(n){const e=Object.keys(n);for(let t=0;t0)){l||(n=this.replaceEntitiesValue(n));const u=this.options.tagValueProcessor(e,n,t,s,o);return u==null?n:typeof u!=typeof n||u!==n?u:this.options.trimValues?$D(n,this.options.parseTagValue,this.options.numberParseOptions):n.trim()===n?$D(n,this.options.parseTagValue,this.options.numberParseOptions):n}}function Hse(n){if(this.options.removeNSPrefix){const e=n.split(":"),t=n.charAt(0)==="/"?"/":"";if(e[0]==="xmlns")return"";e.length===2&&(n=t+e[1])}return n}const Gse=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function Wse(n,e,t){if(!this.options.ignoreAttributes&&typeof n=="string"){const r=QY.getAllMatches(n,Gse),s=r.length,o={};for(let l=0;l",o,"Closing Tag is not closed.");let h=n.substring(o+2,u).trim();if(this.options.removeNSPrefix){const y=h.indexOf(":");y!==-1&&(h=h.substr(y+1))}this.options.transformTagName&&(h=this.options.transformTagName(h)),t&&(r=this.saveTextToParentTag(r,t,s));const f=s.substring(s.lastIndexOf(".")+1);if(h&&this.options.unpairedTags.indexOf(h)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: `);let g=0;f&&this.options.unpairedTags.indexOf(f)!==-1?(g=s.lastIndexOf(".",s.lastIndexOf(".")-1),this.tagsNodeStack.pop()):g=s.lastIndexOf("."),s=s.substring(0,g),t=this.tagsNodeStack.pop(),r="",o=u}else if(n[o+1]==="?"){let u=xD(n,o,!1,"?>");if(!u)throw new Error("Pi Tag is not closed.");if(r=this.saveTextToParentTag(r,t,s),!(this.options.ignoreDeclaration&&u.tagName==="?xml"||this.options.ignorePiTags)){const h=new VE(u.tagName);h.add(this.options.textNodeName,""),u.tagName!==u.tagExp&&u.attrExpPresent&&(h[":@"]=this.buildAttributesMap(u.tagExp,s,u.tagName)),this.addChild(t,h,s)}o=u.closeIndex+1}else if(n.substr(o+1,3)==="!--"){const u=b1(n,"-->",o+4,"Comment is not closed.");if(this.options.commentPropName){const h=n.substring(o+4,u-2);r=this.saveTextToParentTag(r,t,s),t.add(this.options.commentPropName,[{[this.options.textNodeName]:h}])}o=u}else if(n.substr(o+1,2)==="!D"){const u=Pse(n,o);this.docTypeEntities=u.entities,o=u.i}else if(n.substr(o+1,2)==="!["){const u=b1(n,"]]>",o,"CDATA is not closed.")-2,h=n.substring(o+9,u);r=this.saveTextToParentTag(r,t,s);let f=this.parseTextData(h,t.tagname,s,!0,!1,!0,!0);f==null&&(f=""),this.options.cdataPropName?t.add(this.options.cdataPropName,[{[this.options.textNodeName]:h}]):t.add(this.options.textNodeName,f),o=u+2}else{let u=xD(n,o,this.options.removeNSPrefix),h=u.tagName;const f=u.rawTagName;let g=u.tagExp,y=u.attrExpPresent,b=u.closeIndex;this.options.transformTagName&&(h=this.options.transformTagName(h)),t&&r&&t.tagname!=="!xml"&&(r=this.saveTextToParentTag(r,t,s,!1));const w=t;if(w&&this.options.unpairedTags.indexOf(w.tagname)!==-1&&(t=this.tagsNodeStack.pop(),s=s.substring(0,s.lastIndexOf("."))),h!==e.tagname&&(s+=s?"."+h:h),this.isItStopNode(this.options.stopNodes,s,h)){let C="";if(g.length>0&&g.lastIndexOf("/")===g.length-1)o=u.closeIndex;else if(this.options.unpairedTags.indexOf(h)!==-1)o=u.closeIndex;else{const A=this.readStopNodeData(n,f,b+1);if(!A)throw new Error(`Unexpected end of ${f}`);o=A.i,C=A.tagContent}const M=new VE(h);h!==g&&y&&(M[":@"]=this.buildAttributesMap(g,s,h)),C&&(C=this.parseTextData(C,h,s,!0,y,!0,!0)),s=s.substr(0,s.lastIndexOf(".")),M.add(this.options.textNodeName,C),this.addChild(t,M,s)}else{if(g.length>0&&g.lastIndexOf("/")===g.length-1){h[h.length-1]==="/"?(h=h.substr(0,h.length-1),s=s.substr(0,s.length-1),g=h):g=g.substr(0,g.length-1),this.options.transformTagName&&(h=this.options.transformTagName(h));const C=new VE(h);h!==g&&y&&(C[":@"]=this.buildAttributesMap(g,s,h)),this.addChild(t,C,s),s=s.substr(0,s.lastIndexOf("."))}else{const C=new VE(h);this.tagsNodeStack.push(t),h!==g&&y&&(C[":@"]=this.buildAttributesMap(g,s,h)),this.addChild(t,C,s),t=C}r="",o=b}}else r+=n[o];return e.child};function jse(n,e,t){const r=this.options.updateTag(e.tagname,t,e[":@"]);r===!1||(typeof r=="string"&&(e.tagname=r),n.addChild(e))}const Yse=function(n){if(this.options.processEntities){for(let e in this.docTypeEntities){const t=this.docTypeEntities[e];n=n.replace(t.regx,t.val)}for(let e in this.lastEntities){const t=this.lastEntities[e];n=n.replace(t.regex,t.val)}if(this.options.htmlEntities)for(let e in this.htmlEntities){const t=this.htmlEntities[e];n=n.replace(t.regex,t.val)}n=n.replace(this.ampEntity.regex,this.ampEntity.val)}return n};function Xse(n,e,t,r){return n&&(r===void 0&&(r=Object.keys(e.child).length===0),n=this.parseTextData(n,e.tagname,t,!1,e[":@"]?Object.keys(e[":@"]).length!==0:!1,r),n!==void 0&&n!==""&&e.add(this.options.textNodeName,n),n=""),n}function Kse(n,e,t){const r="*."+t;for(const s in n){const o=n[s];if(r===o||e===o)return!0}return!1}function Jse(n,e,t=">"){let r,s="";for(let o=e;o",t,`${e} is not closed`);if(n.substring(t+2,o).trim()===e&&(s--,s===0))return{tagContent:n.substring(r,t),i:o};t=o}else if(n[t+1]==="?")t=b1(n,"?>",t+1,"StopNode is not closed.");else if(n.substr(t+1,3)==="!--")t=b1(n,"-->",t+3,"StopNode is not closed.");else if(n.substr(t+1,2)==="![")t=b1(n,"]]>",t,"StopNode is not closed.")-2;else{const o=xD(n,t,">");o&&((o&&o.tagName)===e&&o.tagExp[o.tagExp.length-1]!=="/"&&s++,t=o.closeIndex)}}function $D(n,e,t){if(e&&typeof n=="string"){const r=n.trim();return r==="true"?!0:r==="false"?!1:Bse(n,t)}else return QY.isExist(n)?n:""}var Qse=Fse,ZY={};function Zse(n,e){return eX(n,e)}function eX(n,e,t){let r;const s={};for(let o=0;o0&&(s[e.textNodeName]=r):r!==void 0&&(s[e.textNodeName]=r),s}function eoe(n){const e=Object.keys(n);for(let t=0;t0&&(t=uoe),tX(n,e,"",t)}function tX(n,e,t,r){let s="",o=!1;for(let l=0;l`,o=!1;continue}else if(h===e.commentPropName){s+=r+``,o=!0;continue}else if(h[0]==="?"){const C=QU(u[":@"],e),M=h==="?xml"?"":r;let A=u[h][0][e.textNodeName];A=A.length!==0?" "+A:"",s+=M+`<${h}${A}${C}?>`,o=!0;continue}let g=r;g!==""&&(g+=e.indentBy);const y=QU(u[":@"],e),b=r+`<${h}${y}`,w=tX(u[h],e,f,g);e.unpairedTags.indexOf(h)!==-1?e.suppressUnpairedNode?s+=b+">":s+=b+"/>":(!w||w.length===0)&&e.suppressEmptyNode?s+=b+"/>":w&&w.endsWith(">")?s+=b+`>${w}${r}`:(s+=b+">",w&&r!==""&&(w.includes("/>")||w.includes("`),o=!0}return s}function hoe(n){const e=Object.keys(n);for(let t=0;t0&&e.processEntities)for(let t=0;t","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("'","g"),val:"'"},{regex:new RegExp('"',"g"),val:"""}],processEntities:!0,stopNodes:[],oneListGroup:!1};function Qy(n){this.options=Object.assign({},moe,n),this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=voe),this.processTextOrObjNode=goe,this.options.format?(this.indentate=_oe,this.tagEndChar=`> `,this.newLine=` -`):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}Qy.prototype.build=function(n){return this.options.preserveOrder?foe(n,this.options):(Array.isArray(n)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(n={[this.options.arrayNodeName]:n}),this.j2x(n,0).val)};Qy.prototype.j2x=function(n,e){let t="",r="";for(let s in n)if(Object.prototype.hasOwnProperty.call(n,s))if(typeof n[s]>"u")this.isAttribute(s)&&(r+="");else if(n[s]===null)this.isAttribute(s)?r+="":s[0]==="?"?r+=this.indentate(e)+"<"+s+"?"+this.tagEndChar:r+=this.indentate(e)+"<"+s+"/"+this.tagEndChar;else if(n[s]instanceof Date)r+=this.buildTextValNode(n[s],s,"",e);else if(typeof n[s]!="object"){const o=this.isAttribute(s);if(o)t+=this.buildAttrPairStr(o,""+n[s]);else if(s===this.options.textNodeName){let l=this.options.tagValueProcessor(s,""+n[s]);r+=this.replaceEntitiesValue(l)}else r+=this.buildTextValNode(n[s],s,"",e)}else if(Array.isArray(n[s])){const o=n[s].length;let l="";for(let u=0;u"u"||(h===null?s[0]==="?"?r+=this.indentate(e)+"<"+s+"?"+this.tagEndChar:r+=this.indentate(e)+"<"+s+"/"+this.tagEndChar:typeof h=="object"?this.options.oneListGroup?l+=this.j2x(h,e+1).val:l+=this.processTextOrObjNode(h,s,e):l+=this.buildTextValNode(h,s,"",e))}this.options.oneListGroup&&(l=this.buildObjectNode(l,s,"",e)),r+=l}else if(this.options.attributesGroupName&&s===this.options.attributesGroupName){const o=Object.keys(n[s]),l=o.length;for(let u=0;u"+n+s:this.options.commentPropName!==!1&&e===this.options.commentPropName&&o.length===0?this.indentate(r)+``+this.newLine:this.indentate(r)+"<"+e+t+o+this.tagEndChar+n+this.indentate(r)+s}};Qy.prototype.closeTag=function(n){let e="";return this.options.unpairedTags.indexOf(n)!==-1?this.options.suppressUnpairedNode||(e="/"):this.options.suppressEmptyNode?e="/":e=`>`+this.newLine;if(this.options.commentPropName!==!1&&e===this.options.commentPropName)return this.indentate(r)+``+this.newLine;if(e[0]==="?")return this.indentate(r)+"<"+e+t+"?"+this.tagEndChar;{let s=this.options.tagValueProcessor(e,n);return s=this.replaceEntitiesValue(s),s===""?this.indentate(r)+"<"+e+t+this.closeTag(e)+this.tagEndChar:this.indentate(r)+"<"+e+t+">"+s+"0&&this.options.processEntities)for(let e=0;e",this.newLine="")}Qy.prototype.build=function(n){return this.options.preserveOrder?poe(n,this.options):(Array.isArray(n)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(n={[this.options.arrayNodeName]:n}),this.j2x(n,0).val)};Qy.prototype.j2x=function(n,e){let t="",r="";for(let s in n)if(Object.prototype.hasOwnProperty.call(n,s))if(typeof n[s]>"u")this.isAttribute(s)&&(r+="");else if(n[s]===null)this.isAttribute(s)?r+="":s[0]==="?"?r+=this.indentate(e)+"<"+s+"?"+this.tagEndChar:r+=this.indentate(e)+"<"+s+"/"+this.tagEndChar;else if(n[s]instanceof Date)r+=this.buildTextValNode(n[s],s,"",e);else if(typeof n[s]!="object"){const o=this.isAttribute(s);if(o)t+=this.buildAttrPairStr(o,""+n[s]);else if(s===this.options.textNodeName){let l=this.options.tagValueProcessor(s,""+n[s]);r+=this.replaceEntitiesValue(l)}else r+=this.buildTextValNode(n[s],s,"",e)}else if(Array.isArray(n[s])){const o=n[s].length;let l="";for(let u=0;u"u"||(h===null?s[0]==="?"?r+=this.indentate(e)+"<"+s+"?"+this.tagEndChar:r+=this.indentate(e)+"<"+s+"/"+this.tagEndChar:typeof h=="object"?this.options.oneListGroup?l+=this.j2x(h,e+1).val:l+=this.processTextOrObjNode(h,s,e):l+=this.buildTextValNode(h,s,"",e))}this.options.oneListGroup&&(l=this.buildObjectNode(l,s,"",e)),r+=l}else if(this.options.attributesGroupName&&s===this.options.attributesGroupName){const o=Object.keys(n[s]),l=o.length;for(let u=0;u"+n+s:this.options.commentPropName!==!1&&e===this.options.commentPropName&&o.length===0?this.indentate(r)+``+this.newLine:this.indentate(r)+"<"+e+t+o+this.tagEndChar+n+this.indentate(r)+s}};Qy.prototype.closeTag=function(n){let e="";return this.options.unpairedTags.indexOf(n)!==-1?this.options.suppressUnpairedNode||(e="/"):this.options.suppressEmptyNode?e="/":e=`>`+this.newLine;if(this.options.commentPropName!==!1&&e===this.options.commentPropName)return this.indentate(r)+``+this.newLine;if(e[0]==="?")return this.indentate(r)+"<"+e+t+"?"+this.tagEndChar;{let s=this.options.tagValueProcessor(e,n);return s=this.replaceEntitiesValue(s),s===""?this.indentate(r)+"<"+e+t+this.closeTag(e)+this.tagEndChar:this.indentate(r)+"<"+e+t+">"+s+"0&&this.options.processEntities)for(let e=0;e>8&255]+xf[n>>16&255]+xf[n>>24&255]+"-"+xf[e&255]+xf[e>>8&255]+"-"+xf[e>>16&15|64]+xf[e>>24&255]+"-"+xf[t&63|128]+xf[t>>8&255]+"-"+xf[t>>16&255]+xf[t>>24&255]+xf[r&255]+xf[r>>8&255]+xf[r>>16&255]+xf[r>>24&255]).toLowerCase()}function Lf(n,e,t){return Math.max(e,Math.min(t,n))}function V3(n,e){return(n%e+e)%e}function Poe(n,e,t,r,s){return r+(n-e)*(s-r)/(t-e)}function Boe(n,e,t){return n!==e?(t-n)/(e-n):0}function Kx(n,e,t){return(1-t)*n+t*e}function Foe(n,e,t,r){return Kx(n,e,1-Math.exp(-t*r))}function zoe(n,e=1){return e-Math.abs(V3(n,e*2)-e)}function Uoe(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*(3-2*n))}function Hoe(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*n*(n*(n*6-15)+10))}function Goe(n,e){return n+Math.floor(Math.random()*(e-n+1))}function Woe(n,e){return n+Math.random()*(e-n)}function Voe(n){return n*(.5-Math.random())}function joe(n){n!==void 0&&(f5=n);let e=f5+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function Yoe(n){return n*Xx}function Xoe(n){return n*$$}function Koe(n){return(n&n-1)===0&&n!==0}function Joe(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function qoe(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function Qoe(n,e,t,r,s){const o=Math.cos,l=Math.sin,u=o(t/2),h=l(t/2),f=o((e+r)/2),g=l((e+r)/2),y=o((e-r)/2),b=l((e-r)/2),w=o((r-e)/2),C=l((r-e)/2);switch(s){case"XYX":n.set(u*g,h*y,h*b,u*f);break;case"YZY":n.set(h*b,u*g,h*y,u*f);break;case"ZXZ":n.set(h*y,h*b,u*g,u*f);break;case"XZX":n.set(u*g,h*C,h*w,u*f);break;case"YXY":n.set(h*w,u*g,h*C,u*f);break;case"ZYZ":n.set(h*C,h*w,u*g,u*f);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+s)}}function e0(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return n/4294967295;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int32Array:return Math.max(n/2147483647,-1);case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function Ma(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return Math.round(n*4294967295);case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int32Array:return Math.round(n*2147483647);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}const Zoe={DEG2RAD:Xx,RAD2DEG:$$,generateUUID:a0,clamp:Lf,euclideanModulo:V3,mapLinear:Poe,inverseLerp:Boe,lerp:Kx,damp:Foe,pingpong:zoe,smoothstep:Uoe,smootherstep:Hoe,randInt:Goe,randFloat:Woe,randFloatSpread:Voe,seededRandom:joe,degToRad:Yoe,radToDeg:Xoe,isPowerOfTwo:Koe,ceilPowerOfTwo:Joe,floorPowerOfTwo:qoe,setQuaternionFromProperEuler:Qoe,normalize:Ma,denormalize:e0};class cc{constructor(e=0,t=0){cc.prototype.isVector2=!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){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,r=this.y,s=e.elements;return this.x=s[0]*t+s[3]*r+s[6],this.y=s[1]*t+s[4]*r+s[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 r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(t,r)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const r=this.dot(e)/t;return Math.acos(Lf(r,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,r=this.y-e.y;return t*t+r*r}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,r){return this.x=e.x+(t.x-e.x)*r,this.y=e.y+(t.y-e.y)*r,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const r=Math.cos(t),s=Math.sin(t),o=this.x-e.x,l=this.y-e.y;return this.x=o*r-l*s+e.x,this.y=o*s+l*r+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class $v{constructor(e,t,r,s,o,l,u,h,f){$v.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,r,s,o,l,u,h,f)}set(e,t,r,s,o,l,u,h,f){const g=this.elements;return g[0]=e,g[1]=s,g[2]=u,g[3]=t,g[4]=o,g[5]=h,g[6]=r,g[7]=l,g[8]=f,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,r=e.elements;return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],this}extractBasis(e,t,r){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),r.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 r=e.elements,s=t.elements,o=this.elements,l=r[0],u=r[3],h=r[6],f=r[1],g=r[4],y=r[7],b=r[2],w=r[5],C=r[8],M=s[0],A=s[3],k=s[6],L=s[1],P=s[4],D=s[7],z=s[2],U=s[5],V=s[8];return o[0]=l*M+u*L+h*z,o[3]=l*A+u*P+h*U,o[6]=l*k+u*D+h*V,o[1]=f*M+g*L+y*z,o[4]=f*A+g*P+y*U,o[7]=f*k+g*D+y*V,o[2]=b*M+w*L+C*z,o[5]=b*A+w*P+C*U,o[8]=b*k+w*D+C*V,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],r=e[1],s=e[2],o=e[3],l=e[4],u=e[5],h=e[6],f=e[7],g=e[8];return t*l*g-t*u*f-r*o*g+r*u*h+s*o*f-s*l*h}invert(){const e=this.elements,t=e[0],r=e[1],s=e[2],o=e[3],l=e[4],u=e[5],h=e[6],f=e[7],g=e[8],y=g*l-u*f,b=u*h-g*o,w=f*o-l*h,C=t*y+r*b+s*w;if(C===0)return this.set(0,0,0,0,0,0,0,0,0);const M=1/C;return e[0]=y*M,e[1]=(s*f-g*r)*M,e[2]=(u*r-s*l)*M,e[3]=b*M,e[4]=(g*t-s*h)*M,e[5]=(s*o-u*t)*M,e[6]=w*M,e[7]=(r*h-f*t)*M,e[8]=(l*t-r*o)*M,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,r,s,o,l,u){const h=Math.cos(o),f=Math.sin(o);return this.set(r*h,r*f,-r*(h*l+f*u)+l+e,-s*f,s*h,-s*(-f*l+h*u)+u+t,0,0,1),this}scale(e,t){return this.premultiply(mO.makeScale(e,t)),this}rotate(e){return this.premultiply(mO.makeRotation(-e)),this}translate(e,t){return this.premultiply(mO.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),r=Math.sin(e);return this.set(t,-r,0,r,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,r=e.elements;for(let s=0;s<9;s++)if(t[s]!==r[s])return!1;return!0}fromArray(e,t=0){for(let r=0;r<9;r++)this.elements[r]=e[r+t];return this}toArray(e=[],t=0){const r=this.elements;return e[t]=r[0],e[t+1]=r[1],e[t+2]=r[2],e[t+3]=r[3],e[t+4]=r[4],e[t+5]=r[5],e[t+6]=r[6],e[t+7]=r[7],e[t+8]=r[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const mO=new $v;function eae(n){for(let e=n.length-1;e>=0;--e)if(n[e]>=65535)return!0;return!1}function kD(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}const p5={};function lX(n){n in p5||(p5[n]=!0,console.warn(n))}const m5=new $v().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),g5=new $v().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),cM={[W3]:{transfer:AD,primaries:c5,toReference:n=>n,fromReference:n=>n},[my]:{transfer:u5,primaries:c5,toReference:n=>n.convertSRGBToLinear(),fromReference:n=>n.convertLinearToSRGB()},[aX]:{transfer:AD,primaries:h5,toReference:n=>n.applyMatrix3(g5),fromReference:n=>n.applyMatrix3(m5)},[Noe]:{transfer:u5,primaries:h5,toReference:n=>n.convertSRGBToLinear().applyMatrix3(g5),fromReference:n=>n.applyMatrix3(m5).convertLinearToSRGB()}},tae=new Set([W3,aX]),Hg={enabled:!0,_workingColorSpace:W3,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(n){if(!tae.has(n))throw new Error(`Unsupported working color space, "${n}".`);this._workingColorSpace=n},convert:function(n,e,t){if(this.enabled===!1||e===t||!e||!t)return n;const r=cM[e].toReference,s=cM[t].fromReference;return s(r(n))},fromWorkingColorSpace:function(n,e){return this.convert(n,this._workingColorSpace,e)},toWorkingColorSpace:function(n,e){return this.convert(n,e,this._workingColorSpace)},getPrimaries:function(n){return cM[n].primaries},getTransfer:function(n){return n===oX?AD:cM[n].transfer}};function dw(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function gO(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let jT;class nae{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{jT===void 0&&(jT=kD("canvas")),jT.width=e.width,jT.height=e.height;const r=jT.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),t=jT}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(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=kD("canvas");t.width=e.width,t.height=e.height;const r=t.getContext("2d");r.drawImage(e,0,0,e.width,e.height);const s=r.getImageData(0,0,e.width,e.height),o=s.data;for(let l=0;l0&&(r.userData=this.userData),t||(e.textures[this.uuid]=r),r}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==rX)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case w$:e.x=e.x-Math.floor(e.x);break;case Mx:e.x=e.x<0?0:1;break;case CD:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case w$:e.y=e.y-Math.floor(e.y);break;case Mx:e.y=e.y<0?0:1;break;case CD:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}}Lm.DEFAULT_IMAGE=null;Lm.DEFAULT_MAPPING=rX;Lm.DEFAULT_ANISOTROPY=1;class _g{constructor(e=0,t=0,r=0,s=1){_g.prototype.isVector4=!0,this.x=e,this.y=t,this.z=r,this.w=s}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,r,s){return this.x=e,this.y=t,this.z=r,this.w=s,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=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,r=this.y,s=this.z,o=this.w,l=e.elements;return this.x=l[0]*t+l[4]*r+l[8]*s+l[12]*o,this.y=l[1]*t+l[5]*r+l[9]*s+l[13]*o,this.z=l[2]*t+l[6]*r+l[10]*s+l[14]*o,this.w=l[3]*t+l[7]*r+l[11]*s+l[15]*o,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,r,s,o;const h=e.elements,f=h[0],g=h[4],y=h[8],b=h[1],w=h[5],C=h[9],M=h[2],A=h[6],k=h[10];if(Math.abs(g-b)<.01&&Math.abs(y-M)<.01&&Math.abs(C-A)<.01){if(Math.abs(g+b)<.1&&Math.abs(y+M)<.1&&Math.abs(C+A)<.1&&Math.abs(f+w+k-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const P=(f+1)/2,D=(w+1)/2,z=(k+1)/2,U=(g+b)/4,V=(y+M)/4,H=(C+A)/4;return P>D&&P>z?P<.01?(r=0,s=.707106781,o=.707106781):(r=Math.sqrt(P),s=U/r,o=V/r):D>z?D<.01?(r=.707106781,s=0,o=.707106781):(s=Math.sqrt(D),r=U/s,o=H/s):z<.01?(r=.707106781,s=.707106781,o=0):(o=Math.sqrt(z),r=V/o,s=H/o),this.set(r,s,o,t),this}let L=Math.sqrt((A-C)*(A-C)+(y-M)*(y-M)+(b-g)*(b-g));return Math.abs(L)<.001&&(L=1),this.x=(A-C)/L,this.y=(y-M)/L,this.z=(b-g)/L,this.w=Math.acos((f+w+k-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 r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(t,r)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,r){return this.x=e.x+(t.x-e.x)*r,this.y=e.y+(t.y-e.y)*r,this.z=e.z+(t.z-e.z)*r,this.w=e.w+(t.w-e.w)*r,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class Pu{constructor(e=0,t=0,r=0,s=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=r,this._w=s}static slerpFlat(e,t,r,s,o,l,u){let h=r[s+0],f=r[s+1],g=r[s+2],y=r[s+3];const b=o[l+0],w=o[l+1],C=o[l+2],M=o[l+3];if(u===0){e[t+0]=h,e[t+1]=f,e[t+2]=g,e[t+3]=y;return}if(u===1){e[t+0]=b,e[t+1]=w,e[t+2]=C,e[t+3]=M;return}if(y!==M||h!==b||f!==w||g!==C){let A=1-u;const k=h*b+f*w+g*C+y*M,L=k>=0?1:-1,P=1-k*k;if(P>Number.EPSILON){const z=Math.sqrt(P),U=Math.atan2(z,k*L);A=Math.sin(A*U)/z,u=Math.sin(u*U)/z}const D=u*L;if(h=h*A+b*D,f=f*A+w*D,g=g*A+C*D,y=y*A+M*D,A===1-u){const z=1/Math.sqrt(h*h+f*f+g*g+y*y);h*=z,f*=z,g*=z,y*=z}}e[t]=h,e[t+1]=f,e[t+2]=g,e[t+3]=y}static multiplyQuaternionsFlat(e,t,r,s,o,l){const u=r[s],h=r[s+1],f=r[s+2],g=r[s+3],y=o[l],b=o[l+1],w=o[l+2],C=o[l+3];return e[t]=u*C+g*y+h*w-f*b,e[t+1]=h*C+g*b+f*y-u*w,e[t+2]=f*C+g*w+u*b-h*y,e[t+3]=g*C-u*y-h*b-f*w,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,r,s){return this._x=e,this._y=t,this._z=r,this._w=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const r=e._x,s=e._y,o=e._z,l=e._order,u=Math.cos,h=Math.sin,f=u(r/2),g=u(s/2),y=u(o/2),b=h(r/2),w=h(s/2),C=h(o/2);switch(l){case"XYZ":this._x=b*g*y+f*w*C,this._y=f*w*y-b*g*C,this._z=f*g*C+b*w*y,this._w=f*g*y-b*w*C;break;case"YXZ":this._x=b*g*y+f*w*C,this._y=f*w*y-b*g*C,this._z=f*g*C-b*w*y,this._w=f*g*y+b*w*C;break;case"ZXY":this._x=b*g*y-f*w*C,this._y=f*w*y+b*g*C,this._z=f*g*C+b*w*y,this._w=f*g*y-b*w*C;break;case"ZYX":this._x=b*g*y-f*w*C,this._y=f*w*y+b*g*C,this._z=f*g*C-b*w*y,this._w=f*g*y+b*w*C;break;case"YZX":this._x=b*g*y+f*w*C,this._y=f*w*y+b*g*C,this._z=f*g*C-b*w*y,this._w=f*g*y-b*w*C;break;case"XZY":this._x=b*g*y-f*w*C,this._y=f*w*y-b*g*C,this._z=f*g*C+b*w*y,this._w=f*g*y+b*w*C;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+l)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const r=t/2,s=Math.sin(r);return this._x=e.x*s,this._y=e.y*s,this._z=e.z*s,this._w=Math.cos(r),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,r=t[0],s=t[4],o=t[8],l=t[1],u=t[5],h=t[9],f=t[2],g=t[6],y=t[10],b=r+u+y;if(b>0){const w=.5/Math.sqrt(b+1);this._w=.25/w,this._x=(g-h)*w,this._y=(o-f)*w,this._z=(l-s)*w}else if(r>u&&r>y){const w=2*Math.sqrt(1+r-u-y);this._w=(g-h)/w,this._x=.25*w,this._y=(s+l)/w,this._z=(o+f)/w}else if(u>y){const w=2*Math.sqrt(1+u-r-y);this._w=(o-f)/w,this._x=(s+l)/w,this._y=.25*w,this._z=(h+g)/w}else{const w=2*Math.sqrt(1+y-r-u);this._w=(l-s)/w,this._x=(o+f)/w,this._y=(h+g)/w,this._z=.25*w}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let r=e.dot(t)+1;return rMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=r):(this._x=0,this._y=-e.z,this._z=e.y,this._w=r)):(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=r),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Lf(this.dot(e),-1,1)))}rotateTowards(e,t){const r=this.angleTo(e);if(r===0)return this;const s=Math.min(1,t/r);return this.slerp(e,s),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const r=e._x,s=e._y,o=e._z,l=e._w,u=t._x,h=t._y,f=t._z,g=t._w;return this._x=r*g+l*u+s*f-o*h,this._y=s*g+l*h+o*u-r*f,this._z=o*g+l*f+r*h-s*u,this._w=l*g-r*u-s*h-o*f,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const r=this._x,s=this._y,o=this._z,l=this._w;let u=l*e._w+r*e._x+s*e._y+o*e._z;if(u<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,u=-u):this.copy(e),u>=1)return this._w=l,this._x=r,this._y=s,this._z=o,this;const h=1-u*u;if(h<=Number.EPSILON){const w=1-t;return this._w=w*l+t*this._w,this._x=w*r+t*this._x,this._y=w*s+t*this._y,this._z=w*o+t*this._z,this.normalize(),this}const f=Math.sqrt(h),g=Math.atan2(f,u),y=Math.sin((1-t)*g)/f,b=Math.sin(t*g)/f;return this._w=l*y+this._w*b,this._x=r*y+this._x*b,this._y=s*y+this._y*b,this._z=o*y+this._z*b,this._onChangeCallback(),this}slerpQuaternions(e,t,r){return this.copy(e).slerp(t,r)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),r=Math.random(),s=Math.sqrt(1-r),o=Math.sqrt(r);return this.set(s*Math.sin(e),s*Math.cos(e),o*Math.sin(t),o*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class Bt{constructor(e=0,t=0,r=0){Bt.prototype.isVector3=!0,this.x=e,this.y=t,this.z=r}set(e,t,r){return r===void 0&&(r=this.z),this.x=e,this.y=t,this.z=r,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){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(_5.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(_5.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,r=this.y,s=this.z,o=e.elements;return this.x=o[0]*t+o[3]*r+o[6]*s,this.y=o[1]*t+o[4]*r+o[7]*s,this.z=o[2]*t+o[5]*r+o[8]*s,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,r=this.y,s=this.z,o=e.elements,l=1/(o[3]*t+o[7]*r+o[11]*s+o[15]);return this.x=(o[0]*t+o[4]*r+o[8]*s+o[12])*l,this.y=(o[1]*t+o[5]*r+o[9]*s+o[13])*l,this.z=(o[2]*t+o[6]*r+o[10]*s+o[14])*l,this}applyQuaternion(e){const t=this.x,r=this.y,s=this.z,o=e.x,l=e.y,u=e.z,h=e.w,f=2*(l*s-u*r),g=2*(u*t-o*s),y=2*(o*r-l*t);return this.x=t+h*f+l*y-u*g,this.y=r+h*g+u*f-o*y,this.z=s+h*y+o*g-l*f,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,r=this.y,s=this.z,o=e.elements;return this.x=o[0]*t+o[4]*r+o[8]*s,this.y=o[1]*t+o[5]*r+o[9]*s,this.z=o[2]*t+o[6]*r+o[10]*s,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 r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(t,r)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,r){return this.x=e.x+(t.x-e.x)*r,this.y=e.y+(t.y-e.y)*r,this.z=e.z+(t.z-e.z)*r,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const r=e.x,s=e.y,o=e.z,l=t.x,u=t.y,h=t.z;return this.x=s*h-o*u,this.y=o*l-r*h,this.z=r*u-s*l,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const r=e.dot(this)/t;return this.copy(e).multiplyScalar(r)}projectOnPlane(e){return vO.copy(this).projectOnVector(e),this.sub(vO)}reflect(e){return this.sub(vO.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const r=this.dot(e)/t;return Math.acos(Lf(r,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,r=this.y-e.y,s=this.z-e.z;return t*t+r*r+s*s}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,r){const s=Math.sin(t)*e;return this.x=s*Math.sin(r),this.y=Math.cos(t)*e,this.z=s*Math.cos(r),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,r){return this.x=e*Math.sin(t),this.y=r,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(),r=this.setFromMatrixColumn(e,1).length(),s=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=r,this.z=s,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,t=Math.random()*2-1,r=Math.sqrt(1-t*t);return this.x=r*Math.cos(e),this.y=t,this.z=r*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const vO=new Bt,_5=new Pu;class Cv{constructor(e=new Bt(1/0,1/0,1/0),t=new Bt(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,r=e.length;tthis.max.x||e.ythis.max.y||e.zthis.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.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,Gg),Gg.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,r;return e.normal.x>0?(t=e.normal.x*this.min.x,r=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,r=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,r+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,r+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,r+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,r+=e.normal.z*this.min.z),t<=-e.constant&&r>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(jE),dM.subVectors(this.max,jE),YT.subVectors(e.a,jE),XT.subVectors(e.b,jE),KT.subVectors(e.c,jE),Kv.subVectors(XT,YT),Jv.subVectors(KT,XT),Bb.subVectors(YT,KT);let t=[0,-Kv.z,Kv.y,0,-Jv.z,Jv.y,0,-Bb.z,Bb.y,Kv.z,0,-Kv.x,Jv.z,0,-Jv.x,Bb.z,0,-Bb.x,-Kv.y,Kv.x,0,-Jv.y,Jv.x,0,-Bb.y,Bb.x,0];return!yO(t,YT,XT,KT,dM)||(t=[1,0,0,0,1,0,0,0,1],!yO(t,YT,XT,KT,dM))?!1:(fM.crossVectors(Kv,Jv),t=[fM.x,fM.y,fM.z],yO(t,YT,XT,KT,dM))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Gg).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Gg).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(V_[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),V_[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),V_[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),V_[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),V_[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),V_[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),V_[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),V_[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(V_),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const V_=[new Bt,new Bt,new Bt,new Bt,new Bt,new Bt,new Bt,new Bt],Gg=new Bt,hM=new Cv,YT=new Bt,XT=new Bt,KT=new Bt,Kv=new Bt,Jv=new Bt,Bb=new Bt,jE=new Bt,dM=new Bt,fM=new Bt,Fb=new Bt;function yO(n,e,t,r,s){for(let o=0,l=n.length-3;o<=l;o+=3){Fb.fromArray(n,o);const u=s.x*Math.abs(Fb.x)+s.y*Math.abs(Fb.y)+s.z*Math.abs(Fb.z),h=e.dot(Fb),f=t.dot(Fb),g=r.dot(Fb);if(Math.max(-Math.max(h,f,g),Math.min(h,f,g))>u)return!1}return!0}const oae=new Cv,YE=new Bt,bO=new Bt;class v_{constructor(e=new Bt,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const r=this.center;t!==void 0?r.copy(t):oae.setFromPoints(e).getCenter(r);let s=0;for(let o=0,l=e.length;othis.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){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;YE.subVectors(e,this.center);const t=YE.lengthSq();if(t>this.radius*this.radius){const r=Math.sqrt(t),s=(r-this.radius)*.5;this.center.addScaledVector(YE,s/r),this.radius+=s}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(bO.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(YE.copy(e.center).add(bO)),this.expandByPoint(YE.copy(e.center).sub(bO))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const j_=new Bt,TO=new Bt,pM=new Bt,qv=new Bt,SO=new Bt,mM=new Bt,wO=new Bt;class lk{constructor(e=new Bt,t=new Bt(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,j_)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const r=t.dot(this.direction);return r<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,r)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=j_.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(j_.copy(this.origin).addScaledVector(this.direction,t),j_.distanceToSquared(e))}distanceSqToSegment(e,t,r,s){TO.copy(e).add(t).multiplyScalar(.5),pM.copy(t).sub(e).normalize(),qv.copy(this.origin).sub(TO);const o=e.distanceTo(t)*.5,l=-this.direction.dot(pM),u=qv.dot(this.direction),h=-qv.dot(pM),f=qv.lengthSq(),g=Math.abs(1-l*l);let y,b,w,C;if(g>0)if(y=l*h-u,b=l*u-h,C=o*g,y>=0)if(b>=-C)if(b<=C){const M=1/g;y*=M,b*=M,w=y*(y+l*b+2*u)+b*(l*y+b+2*h)+f}else b=o,y=Math.max(0,-(l*b+u)),w=-y*y+b*(b+2*h)+f;else b=-o,y=Math.max(0,-(l*b+u)),w=-y*y+b*(b+2*h)+f;else b<=-C?(y=Math.max(0,-(-l*o+u)),b=y>0?-o:Math.min(Math.max(-o,-h),o),w=-y*y+b*(b+2*h)+f):b<=C?(y=0,b=Math.min(Math.max(-o,-h),o),w=b*(b+2*h)+f):(y=Math.max(0,-(l*o+u)),b=y>0?o:Math.min(Math.max(-o,-h),o),w=-y*y+b*(b+2*h)+f);else b=l>0?-o:o,y=Math.max(0,-(l*b+u)),w=-y*y+b*(b+2*h)+f;return r&&r.copy(this.origin).addScaledVector(this.direction,y),s&&s.copy(TO).addScaledVector(pM,b),w}intersectSphere(e,t){j_.subVectors(e.center,this.origin);const r=j_.dot(this.direction),s=j_.dot(j_)-r*r,o=e.radius*e.radius;if(s>o)return null;const l=Math.sqrt(o-s),u=r-l,h=r+l;return h<0?null:u<0?this.at(h,t):this.at(u,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const r=-(this.origin.dot(e.normal)+e.constant)/t;return r>=0?r:null}intersectPlane(e,t){const r=this.distanceToPlane(e);return r===null?null:this.at(r,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let r,s,o,l,u,h;const f=1/this.direction.x,g=1/this.direction.y,y=1/this.direction.z,b=this.origin;return f>=0?(r=(e.min.x-b.x)*f,s=(e.max.x-b.x)*f):(r=(e.max.x-b.x)*f,s=(e.min.x-b.x)*f),g>=0?(o=(e.min.y-b.y)*g,l=(e.max.y-b.y)*g):(o=(e.max.y-b.y)*g,l=(e.min.y-b.y)*g),r>l||o>s||((o>r||isNaN(r))&&(r=o),(l=0?(u=(e.min.z-b.z)*y,h=(e.max.z-b.z)*y):(u=(e.max.z-b.z)*y,h=(e.min.z-b.z)*y),r>h||u>s)||((u>r||r!==r)&&(r=u),(h=0?r:s,t)}intersectsBox(e){return this.intersectBox(e,j_)!==null}intersectTriangle(e,t,r,s,o){SO.subVectors(t,e),mM.subVectors(r,e),wO.crossVectors(SO,mM);let l=this.direction.dot(wO),u;if(l>0){if(s)return null;u=1}else if(l<0)u=-1,l=-l;else return null;qv.subVectors(this.origin,e);const h=u*this.direction.dot(mM.crossVectors(qv,mM));if(h<0)return null;const f=u*this.direction.dot(SO.cross(qv));if(f<0||h+f>l)return null;const g=-u*qv.dot(wO);return g<0?null:this.at(g/l,o)}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 Ys{constructor(e,t,r,s,o,l,u,h,f,g,y,b,w,C,M,A){Ys.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,r,s,o,l,u,h,f,g,y,b,w,C,M,A)}set(e,t,r,s,o,l,u,h,f,g,y,b,w,C,M,A){const k=this.elements;return k[0]=e,k[4]=t,k[8]=r,k[12]=s,k[1]=o,k[5]=l,k[9]=u,k[13]=h,k[2]=f,k[6]=g,k[10]=y,k[14]=b,k[3]=w,k[7]=C,k[11]=M,k[15]=A,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 Ys().fromArray(this.elements)}copy(e){const t=this.elements,r=e.elements;return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],t[9]=r[9],t[10]=r[10],t[11]=r[11],t[12]=r[12],t[13]=r[13],t[14]=r[14],t[15]=r[15],this}copyPosition(e){const t=this.elements,r=e.elements;return t[12]=r[12],t[13]=r[13],t[14]=r[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,r){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),r.setFromMatrixColumn(this,2),this}makeBasis(e,t,r){return this.set(e.x,t.x,r.x,0,e.y,t.y,r.y,0,e.z,t.z,r.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,r=e.elements,s=1/JT.setFromMatrixColumn(e,0).length(),o=1/JT.setFromMatrixColumn(e,1).length(),l=1/JT.setFromMatrixColumn(e,2).length();return t[0]=r[0]*s,t[1]=r[1]*s,t[2]=r[2]*s,t[3]=0,t[4]=r[4]*o,t[5]=r[5]*o,t[6]=r[6]*o,t[7]=0,t[8]=r[8]*l,t[9]=r[9]*l,t[10]=r[10]*l,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,r=e.x,s=e.y,o=e.z,l=Math.cos(r),u=Math.sin(r),h=Math.cos(s),f=Math.sin(s),g=Math.cos(o),y=Math.sin(o);if(e.order==="XYZ"){const b=l*g,w=l*y,C=u*g,M=u*y;t[0]=h*g,t[4]=-h*y,t[8]=f,t[1]=w+C*f,t[5]=b-M*f,t[9]=-u*h,t[2]=M-b*f,t[6]=C+w*f,t[10]=l*h}else if(e.order==="YXZ"){const b=h*g,w=h*y,C=f*g,M=f*y;t[0]=b+M*u,t[4]=C*u-w,t[8]=l*f,t[1]=l*y,t[5]=l*g,t[9]=-u,t[2]=w*u-C,t[6]=M+b*u,t[10]=l*h}else if(e.order==="ZXY"){const b=h*g,w=h*y,C=f*g,M=f*y;t[0]=b-M*u,t[4]=-l*y,t[8]=C+w*u,t[1]=w+C*u,t[5]=l*g,t[9]=M-b*u,t[2]=-l*f,t[6]=u,t[10]=l*h}else if(e.order==="ZYX"){const b=l*g,w=l*y,C=u*g,M=u*y;t[0]=h*g,t[4]=C*f-w,t[8]=b*f+M,t[1]=h*y,t[5]=M*f+b,t[9]=w*f-C,t[2]=-f,t[6]=u*h,t[10]=l*h}else if(e.order==="YZX"){const b=l*h,w=l*f,C=u*h,M=u*f;t[0]=h*g,t[4]=M-b*y,t[8]=C*y+w,t[1]=y,t[5]=l*g,t[9]=-u*g,t[2]=-f*g,t[6]=w*y+C,t[10]=b-M*y}else if(e.order==="XZY"){const b=l*h,w=l*f,C=u*h,M=u*f;t[0]=h*g,t[4]=-y,t[8]=f*g,t[1]=b*y+M,t[5]=l*g,t[9]=w*y-C,t[2]=C*y-w,t[6]=u*g,t[10]=M*y+b}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(aae,e,lae)}lookAt(e,t,r){const s=this.elements;return Em.subVectors(e,t),Em.lengthSq()===0&&(Em.z=1),Em.normalize(),Qv.crossVectors(r,Em),Qv.lengthSq()===0&&(Math.abs(r.z)===1?Em.x+=1e-4:Em.z+=1e-4,Em.normalize(),Qv.crossVectors(r,Em)),Qv.normalize(),gM.crossVectors(Em,Qv),s[0]=Qv.x,s[4]=gM.x,s[8]=Em.x,s[1]=Qv.y,s[5]=gM.y,s[9]=Em.y,s[2]=Qv.z,s[6]=gM.z,s[10]=Em.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const r=e.elements,s=t.elements,o=this.elements,l=r[0],u=r[4],h=r[8],f=r[12],g=r[1],y=r[5],b=r[9],w=r[13],C=r[2],M=r[6],A=r[10],k=r[14],L=r[3],P=r[7],D=r[11],z=r[15],U=s[0],V=s[4],H=s[8],oe=s[12],le=s[1],Z=s[5],q=s[9],he=s[13],ae=s[2],ue=s[6],ge=s[10],we=s[14],J=s[3],re=s[7],ie=s[11],fe=s[15];return o[0]=l*U+u*le+h*ae+f*J,o[4]=l*V+u*Z+h*ue+f*re,o[8]=l*H+u*q+h*ge+f*ie,o[12]=l*oe+u*he+h*we+f*fe,o[1]=g*U+y*le+b*ae+w*J,o[5]=g*V+y*Z+b*ue+w*re,o[9]=g*H+y*q+b*ge+w*ie,o[13]=g*oe+y*he+b*we+w*fe,o[2]=C*U+M*le+A*ae+k*J,o[6]=C*V+M*Z+A*ue+k*re,o[10]=C*H+M*q+A*ge+k*ie,o[14]=C*oe+M*he+A*we+k*fe,o[3]=L*U+P*le+D*ae+z*J,o[7]=L*V+P*Z+D*ue+z*re,o[11]=L*H+P*q+D*ge+z*ie,o[15]=L*oe+P*he+D*we+z*fe,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],r=e[4],s=e[8],o=e[12],l=e[1],u=e[5],h=e[9],f=e[13],g=e[2],y=e[6],b=e[10],w=e[14],C=e[3],M=e[7],A=e[11],k=e[15];return C*(+o*h*y-s*f*y-o*u*b+r*f*b+s*u*w-r*h*w)+M*(+t*h*w-t*f*b+o*l*b-s*l*w+s*f*g-o*h*g)+A*(+t*f*y-t*u*w-o*l*y+r*l*w+o*u*g-r*f*g)+k*(-s*u*g-t*h*y+t*u*b+s*l*y-r*l*b+r*h*g)}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,r){const s=this.elements;return e.isVector3?(s[12]=e.x,s[13]=e.y,s[14]=e.z):(s[12]=e,s[13]=t,s[14]=r),this}invert(){const e=this.elements,t=e[0],r=e[1],s=e[2],o=e[3],l=e[4],u=e[5],h=e[6],f=e[7],g=e[8],y=e[9],b=e[10],w=e[11],C=e[12],M=e[13],A=e[14],k=e[15],L=y*A*f-M*b*f+M*h*w-u*A*w-y*h*k+u*b*k,P=C*b*f-g*A*f-C*h*w+l*A*w+g*h*k-l*b*k,D=g*M*f-C*y*f+C*u*w-l*M*w-g*u*k+l*y*k,z=C*y*h-g*M*h-C*u*b+l*M*b+g*u*A-l*y*A,U=t*L+r*P+s*D+o*z;if(U===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const V=1/U;return e[0]=L*V,e[1]=(M*b*o-y*A*o-M*s*w+r*A*w+y*s*k-r*b*k)*V,e[2]=(u*A*o-M*h*o+M*s*f-r*A*f-u*s*k+r*h*k)*V,e[3]=(y*h*o-u*b*o-y*s*f+r*b*f+u*s*w-r*h*w)*V,e[4]=P*V,e[5]=(g*A*o-C*b*o+C*s*w-t*A*w-g*s*k+t*b*k)*V,e[6]=(C*h*o-l*A*o-C*s*f+t*A*f+l*s*k-t*h*k)*V,e[7]=(l*b*o-g*h*o+g*s*f-t*b*f-l*s*w+t*h*w)*V,e[8]=D*V,e[9]=(C*y*o-g*M*o-C*r*w+t*M*w+g*r*k-t*y*k)*V,e[10]=(l*M*o-C*u*o+C*r*f-t*M*f-l*r*k+t*u*k)*V,e[11]=(g*u*o-l*y*o-g*r*f+t*y*f+l*r*w-t*u*w)*V,e[12]=z*V,e[13]=(g*M*s-C*y*s+C*r*b-t*M*b-g*r*A+t*y*A)*V,e[14]=(C*u*s-l*M*s-C*r*h+t*M*h+l*r*A-t*u*A)*V,e[15]=(l*y*s-g*u*s+g*r*h-t*y*h-l*r*b+t*u*b)*V,this}scale(e){const t=this.elements,r=e.x,s=e.y,o=e.z;return t[0]*=r,t[4]*=s,t[8]*=o,t[1]*=r,t[5]*=s,t[9]*=o,t[2]*=r,t[6]*=s,t[10]*=o,t[3]*=r,t[7]*=s,t[11]*=o,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],r=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],s=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,r,s))}makeTranslation(e,t,r){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,r,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),r=Math.sin(e);return this.set(1,0,0,0,0,t,-r,0,0,r,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),r=Math.sin(e);return this.set(t,0,r,0,0,1,0,0,-r,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),r=Math.sin(e);return this.set(t,-r,0,0,r,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const r=Math.cos(t),s=Math.sin(t),o=1-r,l=e.x,u=e.y,h=e.z,f=o*l,g=o*u;return this.set(f*l+r,f*u-s*h,f*h+s*u,0,f*u+s*h,g*u+r,g*h-s*l,0,f*h-s*u,g*h+s*l,o*h*h+r,0,0,0,0,1),this}makeScale(e,t,r){return this.set(e,0,0,0,0,t,0,0,0,0,r,0,0,0,0,1),this}makeShear(e,t,r,s,o,l){return this.set(1,r,o,0,e,1,l,0,t,s,1,0,0,0,0,1),this}compose(e,t,r){const s=this.elements,o=t._x,l=t._y,u=t._z,h=t._w,f=o+o,g=l+l,y=u+u,b=o*f,w=o*g,C=o*y,M=l*g,A=l*y,k=u*y,L=h*f,P=h*g,D=h*y,z=r.x,U=r.y,V=r.z;return s[0]=(1-(M+k))*z,s[1]=(w+D)*z,s[2]=(C-P)*z,s[3]=0,s[4]=(w-D)*U,s[5]=(1-(b+k))*U,s[6]=(A+L)*U,s[7]=0,s[8]=(C+P)*V,s[9]=(A-L)*V,s[10]=(1-(b+M))*V,s[11]=0,s[12]=e.x,s[13]=e.y,s[14]=e.z,s[15]=1,this}decompose(e,t,r){const s=this.elements;let o=JT.set(s[0],s[1],s[2]).length();const l=JT.set(s[4],s[5],s[6]).length(),u=JT.set(s[8],s[9],s[10]).length();this.determinant()<0&&(o=-o),e.x=s[12],e.y=s[13],e.z=s[14],Wg.copy(this);const f=1/o,g=1/l,y=1/u;return Wg.elements[0]*=f,Wg.elements[1]*=f,Wg.elements[2]*=f,Wg.elements[4]*=g,Wg.elements[5]*=g,Wg.elements[6]*=g,Wg.elements[8]*=y,Wg.elements[9]*=y,Wg.elements[10]*=y,t.setFromRotationMatrix(Wg),r.x=o,r.y=l,r.z=u,this}makePerspective(e,t,r,s,o,l,u=b1){const h=this.elements,f=2*o/(t-e),g=2*o/(r-s),y=(t+e)/(t-e),b=(r+s)/(r-s);let w,C;if(u===b1)w=-(l+o)/(l-o),C=-2*l*o/(l-o);else if(u===RD)w=-l/(l-o),C=-l*o/(l-o);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+u);return h[0]=f,h[4]=0,h[8]=y,h[12]=0,h[1]=0,h[5]=g,h[9]=b,h[13]=0,h[2]=0,h[6]=0,h[10]=w,h[14]=C,h[3]=0,h[7]=0,h[11]=-1,h[15]=0,this}makeOrthographic(e,t,r,s,o,l,u=b1){const h=this.elements,f=1/(t-e),g=1/(r-s),y=1/(l-o),b=(t+e)*f,w=(r+s)*g;let C,M;if(u===b1)C=(l+o)*y,M=-2*y;else if(u===RD)C=o*y,M=-1*y;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+u);return h[0]=2*f,h[4]=0,h[8]=0,h[12]=-b,h[1]=0,h[5]=2*g,h[9]=0,h[13]=-w,h[2]=0,h[6]=0,h[10]=M,h[14]=-C,h[3]=0,h[7]=0,h[11]=0,h[15]=1,this}equals(e){const t=this.elements,r=e.elements;for(let s=0;s<16;s++)if(t[s]!==r[s])return!1;return!0}fromArray(e,t=0){for(let r=0;r<16;r++)this.elements[r]=e[r+t];return this}toArray(e=[],t=0){const r=this.elements;return e[t]=r[0],e[t+1]=r[1],e[t+2]=r[2],e[t+3]=r[3],e[t+4]=r[4],e[t+5]=r[5],e[t+6]=r[6],e[t+7]=r[7],e[t+8]=r[8],e[t+9]=r[9],e[t+10]=r[10],e[t+11]=r[11],e[t+12]=r[12],e[t+13]=r[13],e[t+14]=r[14],e[t+15]=r[15],e}}const JT=new Bt,Wg=new Ys,aae=new Bt(0,0,0),lae=new Bt(1,1,1),Qv=new Bt,gM=new Bt,Em=new Bt,v5=new Ys,y5=new Pu;class sT{constructor(e=0,t=0,r=0,s=sT.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=r,this._order=s}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,r,s=this._order){return this._x=e,this._y=t,this._z=r,this._order=s,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,r=!0){const s=e.elements,o=s[0],l=s[4],u=s[8],h=s[1],f=s[5],g=s[9],y=s[2],b=s[6],w=s[10];switch(t){case"XYZ":this._y=Math.asin(Lf(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(-g,w),this._z=Math.atan2(-l,o)):(this._x=Math.atan2(b,f),this._z=0);break;case"YXZ":this._x=Math.asin(-Lf(g,-1,1)),Math.abs(g)<.9999999?(this._y=Math.atan2(u,w),this._z=Math.atan2(h,f)):(this._y=Math.atan2(-y,o),this._z=0);break;case"ZXY":this._x=Math.asin(Lf(b,-1,1)),Math.abs(b)<.9999999?(this._y=Math.atan2(-y,w),this._z=Math.atan2(-l,f)):(this._y=0,this._z=Math.atan2(h,o));break;case"ZYX":this._y=Math.asin(-Lf(y,-1,1)),Math.abs(y)<.9999999?(this._x=Math.atan2(b,w),this._z=Math.atan2(h,o)):(this._x=0,this._z=Math.atan2(-l,f));break;case"YZX":this._z=Math.asin(Lf(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(-g,f),this._y=Math.atan2(-y,o)):(this._x=0,this._y=Math.atan2(u,w));break;case"XZY":this._z=Math.asin(-Lf(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(b,f),this._y=Math.atan2(u,o)):(this._x=Math.atan2(-g,w),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,r===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,r){return v5.makeRotationFromQuaternion(e),this.setFromRotationMatrix(v5,t,r)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return y5.setFromEuler(this),this.setFromQuaternion(y5,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}sT.DEFAULT_ORDER="XYZ";class iI{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let t=0;t1){for(let r=0;r0&&(s.userData=this.userData),s.layers=this.layers.mask,s.matrix=this.matrix.toArray(),s.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(s.matrixAutoUpdate=!1),this.isInstancedMesh&&(s.type="InstancedMesh",s.count=this.count,s.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(s.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(s.type="BatchedMesh",s.perObjectFrustumCulled=this.perObjectFrustumCulled,s.sortObjects=this.sortObjects,s.drawRanges=this._drawRanges,s.reservedRanges=this._reservedRanges,s.visibility=this._visibility,s.active=this._active,s.bounds=this._bounds.map(u=>({boxInitialized:u.boxInitialized,boxMin:u.box.min.toArray(),boxMax:u.box.max.toArray(),sphereInitialized:u.sphereInitialized,sphereRadius:u.sphere.radius,sphereCenter:u.sphere.center.toArray()})),s.maxGeometryCount=this._maxGeometryCount,s.maxVertexCount=this._maxVertexCount,s.maxIndexCount=this._maxIndexCount,s.geometryInitialized=this._geometryInitialized,s.geometryCount=this._geometryCount,s.matricesTexture=this._matricesTexture.toJSON(e),this.boundingSphere!==null&&(s.boundingSphere={center:s.boundingSphere.center.toArray(),radius:s.boundingSphere.radius}),this.boundingBox!==null&&(s.boundingBox={min:s.boundingBox.min.toArray(),max:s.boundingBox.max.toArray()}));function o(u,h){return u[h.uuid]===void 0&&(u[h.uuid]=h.toJSON(e)),h.uuid}if(this.isScene)this.background&&(this.background.isColor?s.background=this.background.toJSON():this.background.isTexture&&(s.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(s.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){s.geometry=o(e.geometries,this.geometry);const u=this.geometry.parameters;if(u!==void 0&&u.shapes!==void 0){const h=u.shapes;if(Array.isArray(h))for(let f=0,g=h.length;f0){s.children=[];for(let u=0;u0){s.animations=[];for(let u=0;u0&&(r.geometries=u),h.length>0&&(r.materials=h),f.length>0&&(r.textures=f),g.length>0&&(r.images=g),y.length>0&&(r.shapes=y),b.length>0&&(r.skeletons=b),w.length>0&&(r.animations=w),C.length>0&&(r.nodes=C)}return r.object=s,r;function l(u){const h=[];for(const f in u){const g=u[f];delete g.metadata,h.push(g)}return h}}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.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let r=0;r0?s.multiplyScalar(1/Math.sqrt(o)):s.set(0,0,0)}static getBarycoord(e,t,r,s,o){Vg.subVectors(s,t),X_.subVectors(r,t),$O.subVectors(e,t);const l=Vg.dot(Vg),u=Vg.dot(X_),h=Vg.dot($O),f=X_.dot(X_),g=X_.dot($O),y=l*f-u*u;if(y===0)return o.set(0,0,0),null;const b=1/y,w=(f*h-u*g)*b,C=(l*g-u*h)*b;return o.set(1-w-C,C,w)}static containsPoint(e,t,r,s){return this.getBarycoord(e,t,r,s,K_)===null?!1:K_.x>=0&&K_.y>=0&&K_.x+K_.y<=1}static getInterpolation(e,t,r,s,o,l,u,h){return this.getBarycoord(e,t,r,s,K_)===null?(h.x=0,h.y=0,"z"in h&&(h.z=0),"w"in h&&(h.w=0),null):(h.setScalar(0),h.addScaledVector(o,K_.x),h.addScaledVector(l,K_.y),h.addScaledVector(u,K_.z),h)}static isFrontFacing(e,t,r,s){return Vg.subVectors(r,t),X_.subVectors(e,t),Vg.cross(X_).dot(s)<0}set(e,t,r){return this.a.copy(e),this.b.copy(t),this.c.copy(r),this}setFromPointsAndIndices(e,t,r,s){return this.a.copy(e[t]),this.b.copy(e[r]),this.c.copy(e[s]),this}setFromAttributeAndIndices(e,t,r,s){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,r),this.c.fromBufferAttribute(e,s),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 Vg.subVectors(this.c,this.b),X_.subVectors(this.a,this.b),Vg.cross(X_).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return t_.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return t_.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,r,s,o){return t_.getInterpolation(e,this.a,this.b,this.c,t,r,s,o)}containsPoint(e){return t_.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return t_.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const r=this.a,s=this.b,o=this.c;let l,u;QT.subVectors(s,r),ZT.subVectors(o,r),CO.subVectors(e,r);const h=QT.dot(CO),f=ZT.dot(CO);if(h<=0&&f<=0)return t.copy(r);MO.subVectors(e,s);const g=QT.dot(MO),y=ZT.dot(MO);if(g>=0&&y<=g)return t.copy(s);const b=h*y-g*f;if(b<=0&&h>=0&&g<=0)return l=h/(h-g),t.copy(r).addScaledVector(QT,l);AO.subVectors(e,o);const w=QT.dot(AO),C=ZT.dot(AO);if(C>=0&&w<=C)return t.copy(o);const M=w*f-h*C;if(M<=0&&f>=0&&C<=0)return u=f/(f-C),t.copy(r).addScaledVector(ZT,u);const A=g*C-w*y;if(A<=0&&y-g>=0&&w-C>=0)return E5.subVectors(o,s),u=(y-g)/(y-g+(w-C)),t.copy(s).addScaledVector(E5,u);const k=1/(A+M+b);return l=M*k,u=b*k,t.copy(r).addScaledVector(QT,l).addScaledVector(ZT,u)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const uX={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},Zv={h:0,s:0,l:0},vM={h:0,s:0,l:0};function IO(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*6*(2/3-t):n}class Ph{constructor(e,t,r){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,r)}set(e,t,r){if(t===void 0&&r===void 0){const s=e;s&&s.isColor?this.copy(s):typeof s=="number"?this.setHex(s):typeof s=="string"&&this.setStyle(s)}else this.setRGB(e,t,r);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=my){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Hg.toWorkingColorSpace(this,t),this}setRGB(e,t,r,s=Hg.workingColorSpace){return this.r=e,this.g=t,this.b=r,Hg.toWorkingColorSpace(this,s),this}setHSL(e,t,r,s=Hg.workingColorSpace){if(e=V3(e,1),t=Lf(t,0,1),r=Lf(r,0,1),t===0)this.r=this.g=this.b=r;else{const o=r<=.5?r*(1+t):r+t-r*t,l=2*r-o;this.r=IO(l,o,e+1/3),this.g=IO(l,o,e),this.b=IO(l,o,e-1/3)}return Hg.toWorkingColorSpace(this,s),this}setStyle(e,t=my){function r(o){o!==void 0&&parseFloat(o)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let s;if(s=/^(\w+)\(([^\)]*)\)/.exec(e)){let o;const l=s[1],u=s[2];switch(l){case"rgb":case"rgba":if(o=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(u))return r(o[4]),this.setRGB(Math.min(255,parseInt(o[1],10))/255,Math.min(255,parseInt(o[2],10))/255,Math.min(255,parseInt(o[3],10))/255,t);if(o=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(u))return r(o[4]),this.setRGB(Math.min(100,parseInt(o[1],10))/100,Math.min(100,parseInt(o[2],10))/100,Math.min(100,parseInt(o[3],10))/100,t);break;case"hsl":case"hsla":if(o=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(u))return r(o[4]),this.setHSL(parseFloat(o[1])/360,parseFloat(o[2])/100,parseFloat(o[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(s=/^\#([A-Fa-f\d]+)$/.exec(e)){const o=s[1],l=o.length;if(l===3)return this.setRGB(parseInt(o.charAt(0),16)/15,parseInt(o.charAt(1),16)/15,parseInt(o.charAt(2),16)/15,t);if(l===6)return this.setHex(parseInt(o,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=my){const r=uX[e.toLowerCase()];return r!==void 0?this.setHex(r,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=dw(e.r),this.g=dw(e.g),this.b=dw(e.b),this}copyLinearToSRGB(e){return this.r=gO(e.r),this.g=gO(e.g),this.b=gO(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=my){return Hg.fromWorkingColorSpace($f.copy(this),e),Math.round(Lf($f.r*255,0,255))*65536+Math.round(Lf($f.g*255,0,255))*256+Math.round(Lf($f.b*255,0,255))}getHexString(e=my){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=Hg.workingColorSpace){Hg.fromWorkingColorSpace($f.copy(this),t);const r=$f.r,s=$f.g,o=$f.b,l=Math.max(r,s,o),u=Math.min(r,s,o);let h,f;const g=(u+l)/2;if(u===l)h=0,f=0;else{const y=l-u;switch(f=g<=.5?y/(l+u):y/(2-l-u),l){case r:h=(s-o)/y+(s0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const r=e[t];if(r===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const s=this[t];if(s===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}s&&s.isColor?s.set(r):s&&s.isVector3&&r&&r.isVector3?s.copy(r):this[t]=r}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const r={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.color&&this.color.isColor&&(r.color=this.color.getHex()),this.roughness!==void 0&&(r.roughness=this.roughness),this.metalness!==void 0&&(r.metalness=this.metalness),this.sheen!==void 0&&(r.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(r.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(r.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(r.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(r.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(r.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(r.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(r.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(r.shininess=this.shininess),this.clearcoat!==void 0&&(r.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(r.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(r.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(r.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(r.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,r.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.iridescence!==void 0&&(r.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(r.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(r.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(r.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(r.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(r.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(r.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(r.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(r.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(r.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(r.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(r.lightMap=this.lightMap.toJSON(e).uuid,r.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(r.aoMap=this.aoMap.toJSON(e).uuid,r.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(r.bumpMap=this.bumpMap.toJSON(e).uuid,r.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(r.normalMap=this.normalMap.toJSON(e).uuid,r.normalMapType=this.normalMapType,r.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(r.displacementMap=this.displacementMap.toJSON(e).uuid,r.displacementScale=this.displacementScale,r.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(r.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(r.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(r.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(r.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(r.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(r.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(r.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(r.combine=this.combine)),this.envMapRotation!==void 0&&(r.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(r.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(r.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(r.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(r.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(r.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(r.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(r.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(r.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(r.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(r.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(r.size=this.size),this.shadowSide!==null&&(r.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(r.sizeAttenuation=this.sizeAttenuation),this.blending!==ZU&&(r.blending=this.blending),this.side!==nR&&(r.side=this.side),this.vertexColors===!0&&(r.vertexColors=!0),this.opacity<1&&(r.opacity=this.opacity),this.transparent===!0&&(r.transparent=!0),this.blendSrc!==t5&&(r.blendSrc=this.blendSrc),this.blendDst!==n5&&(r.blendDst=this.blendDst),this.blendEquation!==e5&&(r.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(r.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(r.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(r.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(r.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(r.blendAlpha=this.blendAlpha),this.depthFunc!==r5&&(r.depthFunc=this.depthFunc),this.depthTest===!1&&(r.depthTest=this.depthTest),this.depthWrite===!1&&(r.depthWrite=this.depthWrite),this.colorWrite===!1&&(r.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(r.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==d5&&(r.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(r.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(r.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==VT&&(r.stencilFail=this.stencilFail),this.stencilZFail!==VT&&(r.stencilZFail=this.stencilZFail),this.stencilZPass!==VT&&(r.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(r.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(r.rotation=this.rotation),this.polygonOffset===!0&&(r.polygonOffset=!0),this.polygonOffsetFactor!==0&&(r.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(r.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(r.linewidth=this.linewidth),this.dashSize!==void 0&&(r.dashSize=this.dashSize),this.gapSize!==void 0&&(r.gapSize=this.gapSize),this.scale!==void 0&&(r.scale=this.scale),this.dithering===!0&&(r.dithering=!0),this.alphaTest>0&&(r.alphaTest=this.alphaTest),this.alphaHash===!0&&(r.alphaHash=!0),this.alphaToCoverage===!0&&(r.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(r.premultipliedAlpha=!0),this.forceSinglePass===!0&&(r.forceSinglePass=!0),this.wireframe===!0&&(r.wireframe=!0),this.wireframeLinewidth>1&&(r.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(r.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(r.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(r.flatShading=!0),this.visible===!1&&(r.visible=!1),this.toneMapped===!1&&(r.toneMapped=!1),this.fog===!1&&(r.fog=!1),Object.keys(this.userData).length>0&&(r.userData=this.userData);function s(o){const l=[];for(const u in o){const h=o[u];delete h.metadata,l.push(h)}return l}if(t){const o=s(e.textures),l=s(e.images);o.length>0&&(r.textures=o),l.length>0&&(r.images=l)}return r}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let r=null;if(t!==null){const s=t.length;r=new Array(s);for(let o=0;o!==s;++o)r[o]=t[o].clone()}return this.clippingPlanes=r,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}class qS extends Dy{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Ph(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new sT,this.combine=Eoe,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const Ih=new Bt,yM=new cc;class Nm{constructor(e,t,r=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=r,this.usage=ID,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=H3,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return lX("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,r){e*=this.itemSize,r*=t.itemSize;for(let s=0,o=this.itemSize;s0&&(e.userData=this.userData),this.parameters!==void 0){const h=this.parameters;for(const f in h)h[f]!==void 0&&(e[f]=h[f]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const r=this.attributes;for(const h in r){const f=r[h];e.data.attributes[h]=f.toJSON(e.data)}const s={};let o=!1;for(const h in this.morphAttributes){const f=this.morphAttributes[h],g=[];for(let y=0,b=f.length;y0&&(s[h]=g,o=!0)}o&&(e.data.morphAttributes=s,e.data.morphTargetsRelative=this.morphTargetsRelative);const l=this.groups;l.length>0&&(e.data.groups=JSON.parse(JSON.stringify(l)));const u=this.boundingSphere;return u!==null&&(e.data.boundingSphere={center:u.center.toArray(),radius:u.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 r=e.index;r!==null&&this.setIndex(r.clone(t));const s=e.attributes;for(const f in s){const g=s[f];this.setAttribute(f,g.clone(t))}const o=e.morphAttributes;for(const f in o){const g=[],y=o[f];for(let b=0,w=y.length;b0){const s=t[r[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,l=s.length;o(e.far-e.near)**2))&&(x5.copy(o).invert(),zb.copy(e.ray).applyMatrix4(x5),!(r.boundingBox!==null&&zb.intersectsBox(r.boundingBox)===!1)&&this._computeIntersections(e,t,zb)))}_computeIntersections(e,t,r){let s;const o=this.geometry,l=this.material,u=o.index,h=o.attributes.position,f=o.attributes.uv,g=o.attributes.uv1,y=o.attributes.normal,b=o.groups,w=o.drawRange;if(u!==null)if(Array.isArray(l))for(let C=0,M=b.length;Ct.far?null:{distance:f,point:$M.clone(),object:n}}function CM(n,e,t,r,s,o,l,u,h,f){n.getVertexPosition(u,tS),n.getVertexPosition(h,nS),n.getVertexPosition(f,rS);const g=vae(n,e,t,r,tS,nS,rS,xM);if(g){s&&(SM.fromBufferAttribute(s,u),wM.fromBufferAttribute(s,h),EM.fromBufferAttribute(s,f),g.uv=t_.getInterpolation(xM,tS,nS,rS,SM,wM,EM,new cc)),o&&(SM.fromBufferAttribute(o,u),wM.fromBufferAttribute(o,h),EM.fromBufferAttribute(o,f),g.uv1=t_.getInterpolation(xM,tS,nS,rS,SM,wM,EM,new cc)),l&&(C5.fromBufferAttribute(l,u),M5.fromBufferAttribute(l,h),A5.fromBufferAttribute(l,f),g.normal=t_.getInterpolation(xM,tS,nS,rS,C5,M5,A5,new Bt),g.normal.dot(r.direction)>0&&g.normal.multiplyScalar(-1));const y={a:u,b:h,c:f,normal:new Bt,materialIndex:0};t_.getNormal(tS,nS,rS,y.normal),g.face=y}return g}class cX extends dh{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Ys,this.projectionMatrix=new Ys,this.projectionMatrixInverse=new Ys,this.coordinateSystem=b1}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.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)}}const ey=new Bt,I5=new cc,R5=new cc;class Y3 extends cX{constructor(e=50,t=1,r=.1,s=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=r,this.far=s,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=$$*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(Xx*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return $$*2*Math.atan(Math.tan(Xx*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,r){ey.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(ey.x,ey.y).multiplyScalar(-e/ey.z),ey.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),r.set(ey.x,ey.y).multiplyScalar(-e/ey.z)}getViewSize(e,t){return this.getViewBounds(e,I5,R5),t.subVectors(R5,I5)}setViewOffset(e,t,r,s,o,l){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=r,this.view.offsetY=s,this.view.width=o,this.view.height=l,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(Xx*.5*this.fov)/this.zoom,r=2*t,s=this.aspect*r,o=-.5*s;const l=this.view;if(this.view!==null&&this.view.enabled){const h=l.fullWidth,f=l.fullHeight;o+=l.offsetX*s/h,t-=l.offsetY*r/f,s*=l.width/h,r*=l.height/f}const u=this.filmOffset;u!==0&&(o+=e*u/this.getFilmWidth()),this.projectionMatrix.makePerspective(o,o+s,t,t-r,e,this.far,this.coordinateSystem),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,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}const OO=new Bt,yae=new Bt,bae=new $v;class iS{constructor(e=new Bt(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,r,s){return this.normal.set(e,t,r),this.constant=s,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,r){const s=OO.subVectors(r,t).cross(yae.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(s,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(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){const r=e.delta(OO),s=this.normal.dot(r);if(s===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const o=-(e.start.dot(this.normal)+this.constant)/s;return o<0||o>1?null:t.copy(e.start).addScaledVector(r,o)}intersectsLine(e){const t=this.distanceToPoint(e.start),r=this.distanceToPoint(e.end);return t<0&&r>0||r<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 r=t||bae.getNormalMatrix(e),s=this.coplanarPoint(OO).applyMatrix4(e),o=this.normal.applyMatrix3(r).normalize();return this.constant=-s.dot(o),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const Ub=new v_,MM=new Bt;class Tae{constructor(e=new iS,t=new iS,r=new iS,s=new iS,o=new iS,l=new iS){this.planes=[e,t,r,s,o,l]}set(e,t,r,s,o,l){const u=this.planes;return u[0].copy(e),u[1].copy(t),u[2].copy(r),u[3].copy(s),u[4].copy(o),u[5].copy(l),this}copy(e){const t=this.planes;for(let r=0;r<6;r++)t[r].copy(e.planes[r]);return this}setFromProjectionMatrix(e,t=b1){const r=this.planes,s=e.elements,o=s[0],l=s[1],u=s[2],h=s[3],f=s[4],g=s[5],y=s[6],b=s[7],w=s[8],C=s[9],M=s[10],A=s[11],k=s[12],L=s[13],P=s[14],D=s[15];if(r[0].setComponents(h-o,b-f,A-w,D-k).normalize(),r[1].setComponents(h+o,b+f,A+w,D+k).normalize(),r[2].setComponents(h+l,b+g,A+C,D+L).normalize(),r[3].setComponents(h-l,b-g,A-C,D-L).normalize(),r[4].setComponents(h-u,b-y,A-M,D-P).normalize(),t===b1)r[5].setComponents(h+u,b+y,A+M,D+P).normalize();else if(t===RD)r[5].setComponents(u,y,M,P).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),Ub.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),Ub.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Ub)}intersectsSprite(e){return Ub.center.set(0,0,0),Ub.radius=.7071067811865476,Ub.applyMatrix4(e.matrixWorld),this.intersectsSphere(Ub)}intersectsSphere(e){const t=this.planes,r=e.center,s=-e.radius;for(let o=0;o<6;o++)if(t[o].distanceToPoint(r)0?e.max.x:e.min.x,MM.y=s.normal.y>0?e.max.y:e.min.y,MM.z=s.normal.z>0?e.max.z:e.min.z,s.distanceToPoint(MM)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let r=0;r<6;r++)if(t[r].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}class hX extends cX{constructor(e=-1,t=1,r=1,s=-1,o=.1,l=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=r,this.bottom=s,this.near=o,this.far=l,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,r,s,o,l){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=r,this.view.offsetY=s,this.view.width=o,this.view.height=l,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),r=(this.right+this.left)/2,s=(this.top+this.bottom)/2;let o=r-e,l=r+e,u=s+t,h=s-t;if(this.view!==null&&this.view.enabled){const f=(this.right-this.left)/this.view.fullWidth/this.zoom,g=(this.top-this.bottom)/this.view.fullHeight/this.zoom;o+=f*this.view.offsetX,l=o+f*this.view.width,u-=g*this.view.offsetY,h=u-g*this.view.height}this.projectionMatrix.makeOrthographic(o,l,u,h,this.near,this.far,this.coordinateSystem),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,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}class Sae extends Lm{constructor(e,t,r,s,o,l,u,h,f,g){if(g=g!==void 0?g:fO,g!==fO&&g!==s5)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");r===void 0&&g===fO&&(r=Aoe),r===void 0&&g===s5&&(r=Ioe),super(null,s,o,l,u,h,g,r,f),this.isDepthTexture=!0,this.image={width:e,height:t},this.magFilter=u!==void 0?u:E$,this.minFilter=h!==void 0?h:E$,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}}const wae=new Sae(1,1);wae.compareFunction=Doe;class LO extends dh{constructor(){super(),this.isGroup=!0,this.type="Group"}}class Eae{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=ID,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=a0()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return lX("THREE.InterleavedBuffer: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,r){e*=this.stride,r*=t.stride;for(let s=0,o=this.stride;sh)continue;b.applyMatrix4(this.matrixWorld);const H=e.ray.origin.distanceTo(b);He.far||t.push({distance:H,point:y.clone().applyMatrix4(this.matrixWorld),index:P,face:null,faceIndex:null,object:this})}}else{const k=Math.max(0,l.start),L=Math.min(A.count,l.start+l.count);for(let P=k,D=L-1;Ph)continue;b.applyMatrix4(this.matrixWorld);const U=e.ray.origin.distanceTo(b);Ue.far||t.push({distance:U,point:y.clone().applyMatrix4(this.matrixWorld),index:P,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const t=this.geometry.morphAttributes,r=Object.keys(t);if(r.length>0){const s=t[r[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,l=s.length;o0){const s=t[r[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,l=s.length;os.far)return;o.push({distance:f,distanceToRay:Math.sqrt(u),point:h,index:e,face:null,object:l})}}class q3 extends Dy{constructor(e){super(),this.isMeshStandardMaterial=!0,this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new Ph(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 Ph(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Loe,this.normalScale=new cc(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new sT,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class eb extends q3{constructor(e){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new cc(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return Lf(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(t){this.ior=(1+.4*t)/(1-.4*t)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new Ph(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new Ph(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new Ph(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(e)}get anisotropy(){return this._anisotropy}set anisotropy(e){this._anisotropy>0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}function LM(n,e,t){return!n||!t&&n.constructor===e?n:typeof e.BYTES_PER_ELEMENT=="number"?new e(n):Array.prototype.slice.call(n)}function Oae(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function Lae(n){function e(s,o){return n[s]-n[o]}const t=n.length,r=new Array(t);for(let s=0;s!==t;++s)r[s]=s;return r.sort(e),r}function X5(n,e,t){const r=n.length,s=new n.constructor(r);for(let o=0,l=0;l!==r;++o){const u=t[o]*e;for(let h=0;h!==e;++h)s[l++]=n[u+h]}return s}function gX(n,e,t,r){let s=1,o=n[0];for(;o!==void 0&&o[r]===void 0;)o=n[s++];if(o===void 0)return;let l=o[r];if(l!==void 0)if(Array.isArray(l))do l=o[r],l!==void 0&&(e.push(o.time),t.push.apply(t,l)),o=n[s++];while(o!==void 0);else if(l.toArray!==void 0)do l=o[r],l!==void 0&&(e.push(o.time),l.toArray(t,t.length)),o=n[s++];while(o!==void 0);else do l=o[r],l!==void 0&&(e.push(o.time),t.push(l)),o=n[s++];while(o!==void 0)}class yC{constructor(e,t,r,s){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=s!==void 0?s:new t.constructor(r),this.sampleValues=t,this.valueSize=r,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let r=this._cachedIndex,s=t[r],o=t[r-1];e:{t:{let l;n:{r:if(!(e=o)){const u=t[1];e=o)break t}l=r,r=0;break n}break e}for(;r>>1;et;)--l;if(++l,o!==0||l!==s){o>=l&&(l=Math.max(l,1),o=l-1);const u=this.getValueSize();this.times=r.slice(o,l),this.values=this.values.slice(o*u,l*u)}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 r=this.times,s=this.values,o=r.length;o===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let l=null;for(let u=0;u!==o;u++){const h=r[u];if(typeof h=="number"&&isNaN(h)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,u,h),e=!1;break}if(l!==null&&l>h){console.error("THREE.KeyframeTrack: Out of order keys.",this,u,h,l),e=!1;break}l=h}if(s!==void 0&&Oae(s))for(let u=0,h=s.length;u!==h;++u){const f=s[u];if(isNaN(f)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,u,f),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),r=this.getValueSize(),s=this.getInterpolation()===pO,o=e.length-1;let l=1;for(let u=1;u0){e[l]=e[o];for(let u=o*r,h=l*r,f=0;f!==r;++f)t[h+f]=t[u+f];++l}return l!==e.length?(this.times=e.slice(0,l),this.values=t.slice(0,l*r)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),r=this.constructor,s=new r(this.name,e,t);return s.createInterpolant=this.createInterpolant,s}}y_.prototype.TimeBufferType=Float32Array;y_.prototype.ValueBufferType=Float32Array;y_.prototype.DefaultInterpolation=Aw;class iE extends y_{}iE.prototype.ValueTypeName="bool";iE.prototype.ValueBufferType=Array;iE.prototype.DefaultInterpolation=x$;iE.prototype.InterpolantFactoryMethodLinear=void 0;iE.prototype.InterpolantFactoryMethodSmooth=void 0;class _X extends y_{}_X.prototype.ValueTypeName="color";class C$ extends y_{}C$.prototype.ValueTypeName="number";class Bae extends yC{constructor(e,t,r,s){super(e,t,r,s)}interpolate_(e,t,r,s){const o=this.resultBuffer,l=this.sampleValues,u=this.valueSize,h=(r-t)/(s-t);let f=e*u;for(let g=f+u;f!==g;f+=4)Pu.slerpFlat(o,0,l,f-u,l,f,h);return o}}class K1 extends y_{InterpolantFactoryMethodLinear(e){return new Bae(this.times,this.values,this.getValueSize(),e)}}K1.prototype.ValueTypeName="quaternion";K1.prototype.DefaultInterpolation=Aw;K1.prototype.InterpolantFactoryMethodSmooth=void 0;class sE extends y_{}sE.prototype.ValueTypeName="string";sE.prototype.ValueBufferType=Array;sE.prototype.DefaultInterpolation=x$;sE.prototype.InterpolantFactoryMethodLinear=void 0;sE.prototype.InterpolantFactoryMethodSmooth=void 0;class M$ extends y_{}M$.prototype.ValueTypeName="vector";class Fae{constructor(e,t=-1,r,s=koe){this.name=e,this.tracks=r,this.duration=t,this.blendMode=s,this.uuid=a0(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],r=e.tracks,s=1/(e.fps||1);for(let l=0,u=r.length;l!==u;++l)t.push(Uae(r[l]).scale(s));const o=new this(e.name,e.duration,t,e.blendMode);return o.uuid=e.uuid,o}static toJSON(e){const t=[],r=e.tracks,s={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let o=0,l=r.length;o!==l;++o)t.push(y_.toJSON(r[o]));return s}static CreateFromMorphTargetSequence(e,t,r,s){const o=t.length,l=[];for(let u=0;u1){const y=g[1];let b=s[y];b||(s[y]=b=[]),b.push(f)}}const l=[];for(const u in s)l.push(this.CreateFromMorphTargetSequence(u,s[u],t,r));return l}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const r=function(y,b,w,C,M){if(w.length!==0){const A=[],k=[];gX(w,A,k,C),A.length!==0&&M.push(new y(b,A,k))}},s=[],o=e.name||"default",l=e.fps||30,u=e.blendMode;let h=e.length||-1;const f=e.hierarchy||[];for(let y=0;y{t&&t(o),this.manager.itemEnd(e)},0),o;if(J_[e]!==void 0){J_[e].push({onLoad:t,onProgress:r,onError:s});return}J_[e]=[],J_[e].push({onLoad:t,onProgress:r,onError:s});const l=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),u=this.mimeType,h=this.responseType;fetch(l).then(f=>{if(f.status===200||f.status===0){if(f.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||f.body===void 0||f.body.getReader===void 0)return f;const g=J_[e],y=f.body.getReader(),b=f.headers.get("Content-Length")||f.headers.get("X-File-Size"),w=b?parseInt(b):0,C=w!==0;let M=0;const A=new ReadableStream({start(k){L();function L(){y.read().then(({done:P,value:D})=>{if(P)k.close();else{M+=D.byteLength;const z=new ProgressEvent("progress",{lengthComputable:C,loaded:M,total:w});for(let U=0,V=g.length;U{switch(h){case"arraybuffer":return f.arrayBuffer();case"blob":return f.blob();case"document":return f.text().then(g=>new DOMParser().parseFromString(g,u));case"json":return f.json();default:if(u===void 0)return f.text();{const y=/charset="?([^;"\s]*)"?/i.exec(u),b=y&&y[1]?y[1].toLowerCase():void 0,w=new TextDecoder(b);return f.arrayBuffer().then(C=>w.decode(C))}}}).then(f=>{wy.add(e,f);const g=J_[e];delete J_[e];for(let y=0,b=g.length;y{const g=J_[e];if(g===void 0)throw this.manager.itemError(e),f;delete J_[e];for(let y=0,b=g.length;y{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class Vae extends oT{constructor(e){super(e)}load(e,t,r,s){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const o=this,l=wy.get(e);if(l!==void 0)return o.manager.itemStart(e),setTimeout(function(){t&&t(l),o.manager.itemEnd(e)},0),l;const u=kD("img");function h(){g(),wy.add(e,this),t&&t(this),o.manager.itemEnd(e)}function f(y){g(),s&&s(y),o.manager.itemError(e),o.manager.itemEnd(e)}function g(){u.removeEventListener("load",h,!1),u.removeEventListener("error",f,!1)}return u.addEventListener("load",h,!1),u.addEventListener("error",f,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(u.crossOrigin=this.crossOrigin),o.manager.itemStart(e),u.src=e,u}}class jae extends oT{constructor(e){super(e)}load(e,t,r,s){const o=new Lm,l=new Vae(this.manager);return l.setCrossOrigin(this.crossOrigin),l.setPath(this.path),l.load(e,function(u){o.image=u,o.needsUpdate=!0,t!==void 0&&t(o)},r,s),o}}class Q3 extends dh{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new Ph(e),this.intensity=t}dispose(){}copy(e,t){return super.copy(e,t),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,this.groundColor!==void 0&&(t.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(t.object.distance=this.distance),this.angle!==void 0&&(t.object.angle=this.angle),this.decay!==void 0&&(t.object.decay=this.decay),this.penumbra!==void 0&&(t.object.penumbra=this.penumbra),this.shadow!==void 0&&(t.object.shadow=this.shadow.toJSON()),t}}const BO=new Ys,K5=new Bt,J5=new Bt;class Z3{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new cc(512,512),this.map=null,this.mapPass=null,this.matrix=new Ys,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Tae,this._frameExtents=new cc(1,1),this._viewportCount=1,this._viewports=[new _g(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,r=this.matrix;K5.setFromMatrixPosition(e.matrixWorld),t.position.copy(K5),J5.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(J5),t.updateMatrixWorld(),BO.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(BO),r.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),r.multiply(BO)}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 this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class Yae extends Z3{constructor(){super(new Y3(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(e){const t=this.camera,r=$$*2*e.angle*this.focus,s=this.mapSize.width/this.mapSize.height,o=e.distance||t.far;(r!==t.fov||s!==t.aspect||o!==t.far)&&(t.fov=r,t.aspect=s,t.far=o,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class Xae extends Q3{constructor(e,t,r=0,s=Math.PI/3,o=0,l=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(dh.DEFAULT_UP),this.updateMatrix(),this.target=new dh,this.distance=r,this.angle=s,this.penumbra=o,this.decay=l,this.map=null,this.shadow=new Yae}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}const q5=new Ys,QE=new Bt,FO=new Bt;class Kae extends Z3{constructor(){super(new Y3(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new cc(4,2),this._viewportCount=6,this._viewports=[new _g(2,1,1,1),new _g(0,1,1,1),new _g(3,1,1,1),new _g(1,1,1,1),new _g(3,0,1,1),new _g(1,0,1,1)],this._cubeDirections=[new Bt(1,0,0),new Bt(-1,0,0),new Bt(0,0,1),new Bt(0,0,-1),new Bt(0,1,0),new Bt(0,-1,0)],this._cubeUps=[new Bt(0,1,0),new Bt(0,1,0),new Bt(0,1,0),new Bt(0,1,0),new Bt(0,0,1),new Bt(0,0,-1)]}updateMatrices(e,t=0){const r=this.camera,s=this.matrix,o=e.distance||r.far;o!==r.far&&(r.far=o,r.updateProjectionMatrix()),QE.setFromMatrixPosition(e.matrixWorld),r.position.copy(QE),FO.copy(r.position),FO.add(this._cubeDirections[t]),r.up.copy(this._cubeUps[t]),r.lookAt(FO),r.updateMatrixWorld(),s.makeTranslation(-QE.x,-QE.y,-QE.z),q5.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),this._frustum.setFromProjectionMatrix(q5)}}class Jae extends Q3{constructor(e,t,r=0,s=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=r,this.decay=s,this.shadow=new Kae}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}class qae extends Z3{constructor(){super(new hX(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class Qae extends Q3{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(dh.DEFAULT_UP),this.updateMatrix(),this.target=new dh,this.shadow=new qae}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class k1{static decodeText(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let r=0,s=e.length;r"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,r,s){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const o=this,l=wy.get(e);if(l!==void 0){if(o.manager.itemStart(e),l.then){l.then(f=>{t&&t(f),o.manager.itemEnd(e)}).catch(f=>{s&&s(f)});return}return setTimeout(function(){t&&t(l),o.manager.itemEnd(e)},0),l}const u={};u.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",u.headers=this.requestHeader;const h=fetch(e,u).then(function(f){return f.blob()}).then(function(f){return createImageBitmap(f,Object.assign(o.options,{colorSpaceConversion:"none"}))}).then(function(f){return wy.add(e,f),t&&t(f),o.manager.itemEnd(e),f}).catch(function(f){s&&s(f),wy.remove(e),o.manager.itemError(e),o.manager.itemEnd(e)});wy.add(e,h),o.manager.itemStart(e)}}const eF="\\[\\]\\.:\\/",ele=new RegExp("["+eF+"]","g"),tF="[^"+eF+"]",tle="[^"+eF.replace("\\.","")+"]",nle=/((?:WC+[\/:])*)/.source.replace("WC",tF),rle=/(WCOD+)?/.source.replace("WCOD",tle),ile=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",tF),sle=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",tF),ole=new RegExp("^"+nle+rle+ile+sle+"$"),ale=["material","materials","bones","map"];class lle{constructor(e,t,r){const s=r||Aa.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,s)}getValue(e,t){this.bind();const r=this._targetGroup.nCachedObjects_,s=this._bindings[r];s!==void 0&&s.getValue(e,t)}setValue(e,t){const r=this._bindings;for(let s=this._targetGroup.nCachedObjects_,o=r.length;s!==o;++s)r[s].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,r=e.length;t!==r;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,r=e.length;t!==r;++t)e[t].unbind()}}class Aa{constructor(e,t,r){this.path=t,this.parsedPath=r||Aa.parseTrackName(t),this.node=Aa.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,r){return e&&e.isAnimationObjectGroup?new Aa.Composite(e,t,r):new Aa(e,t,r)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(ele,"")}static parseTrackName(e){const t=ole.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const r={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},s=r.nodeName&&r.nodeName.lastIndexOf(".");if(s!==void 0&&s!==-1){const o=r.nodeName.substring(s+1);ale.indexOf(o)!==-1&&(r.nodeName=r.nodeName.substring(0,s),r.objectName=o)}if(r.propertyName===null||r.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return r}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const r=e.skeleton.getBoneByName(t);if(r!==void 0)return r}if(e.children){const r=function(o){for(let l=0;l{const s=r>n[n.length-1]?r%n[n.length-1]:r;let o=0;for(let l=0;l{let[t,r,s]=[...n],[o,l,u,h]=[...dle[e.toLowerCase()]],f=o+1,g=Q5[f+l-1]+1,y=Q5[f-l]+1;if(h!==0){let V=[t,s];t=V[1],s=V[0]}l!==0&&(r=-1*r),t=t/2,r=r/2,s=s/2;let b=Math.cos(t),w=Math.sin(t),C=Math.cos(r),M=Math.sin(r),A=Math.cos(s),k=Math.sin(s),L=b*A,P=b*k,D=w*A,z=w*k,U=[null,null,null,null];return u!==0?(U[0]=C*(L-z),U[f]=C*(P+D),U[g]=M*(L+z),U[y]=M*(P-D)):(U[0]=C*L+M*z,U[f]=C*D-M*P,U[g]=C*z+M*L,U[y]=C*P-M*D),l!==0&&(U[g]*=-1),U},fle=n=>({x:n.x*zO,y:n.y*zO,z:n.z*zO}),oI=n=>{let e=fle(new sT().setFromQuaternion(new Pu(n.x,n.y,n.z,n.w)));return{x:e.x,y:e.y,z:e.z}},ty=(n,e,t)=>{let r=Math.cos(n*.5),s=Math.cos(e*.5),o=Math.cos(t*.5),l=Math.sin(n*.5),u=Math.sin(e*.5),h=Math.sin(t*.5),f=new Pu;return f.w=o*r*s+h*l*u,f.x=o*l*s-h*r*u,f.y=o*r*u+h*l*s,f.z=h*r*s-o*l*u,f},ple=n=>n._w===.707&&n._z===.707?ad/2:n._w===.707&&n._z===-.707?-ad/2:n._w===-.707&&n._z===.707?3*ad/4:n._w===-.707&&n._z===-.707?-3*ad/4:n._z===1?ad:n._z===-1?-ad:oI(n).z;function aS(n){var e=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;n=n.replace(e,function(r,s,o,l){return s+s+o+o+l+l});var t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(n);return console.log(t),t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null}function mle(n,e){const t={ignoreAttributes:!1,attributeNamePrefix:"@_"},o=new nX.XMLParser(t).parse(n).robot.joint,l={};return(Array.isArray(o)?o:[o]).forEach(h=>{h["@_name"];const f=h.origin,g=h.parent["@_link"],y=h.child["@_link"],b=f["@_xyz"].split(" ").map(Number),w=f["@_rpy"].split(" ").map(Number),C=TX(w,"sxyz");l[y]={frame:g,position:{x:b[0],y:b[1],z:b[2]},rotation:{w:C[0],x:C[1],y:C[2],z:C[3]},scale:{x:1,y:1,z:1}}}),l.base_link={frame:"world",position:{x:0,y:0,z:0},rotation:{w:1,x:0,y:0,z:0},scale:{x:1,y:1,z:1}},console.log(l),l}function gle(n){const e={ignoreAttributes:!1,attributeNamePrefix:"@_",parseAttributeValue:!0},r=new nX.XMLParser(e).parse(n),s=r.robot.link,o=r.robot.material,l={},u={};return o&&(Array.isArray(o)?o:[o]).forEach(g=>{const y=g["@_name"],b=g.color["@_rgba"].split(" ").map(Number);u[y]={r:b[0],g:b[1],b:b[2],a:b[3]}}),(Array.isArray(s)?s:[s]).forEach(f=>{var C,M;const g=f["@_name"],y=f.visual;let b=null,w=null;if((C=y==null?void 0:y.geometry)!=null&&C.mesh&&(b=y.geometry.mesh["@_filename"],w=(M=y.geometry.mesh["@_scale"])==null?void 0:M.split(" ").map(Number)),g&&y&&b){if(y.material.color){let P=y.material.color["@_rgba"].split(" ").map(Number);P[0],P[1],P[2],P[3]}else y.material["@_name"]&&u[y.material["@_name"]]&&u[y.material["@_name"]];const A=y.origin["@_xyz"].split(" ").map(Number),k=y.origin["@_rpy"].split(" ").map(Number),L=TX(k,"sxyz");l[g]={shape:b,name:g,frame:g,position:{x:A[0],y:A[1],z:A[2]},rotation:{w:L[0],x:L[1],y:L[2],z:L[3]},color:{r:.7*255,g:.7*255,b:.7*255,a:1},scale:w?{x:w[0],y:w[1],z:w[2]}:{x:1,y:1,z:1},highlight:"false"}}}),l}class _le{constructor(){this._previousTime=0,this._currentTime=0,this._delta=0,this._elapsed=0,this._timescale=1,this._useFixedDelta=!1,this._fixedDelta=16.67,this._usePageVisibilityAPI=typeof document<"u"&&document.hidden!==void 0,this._usePageVisibilityAPI===!0&&(this._pageVisibilityHandler=vle.bind(this),document.addEventListener("visibilitychange",this._pageVisibilityHandler,!1))}reset_elapsed(){return this._elapsed=0,this}disableFixedDelta(){return this._useFixedDelta=!1,this}dispose(){return this._usePageVisibilityAPI===!0&&document.removeEventListener("visibilitychange",this._pageVisibilityHandler),this}enableFixedDelta(){return this._useFixedDelta=!0,this}getDelta(){return this._delta/1e3}getElapsed(){return this._elapsed/1e3}getFixedDelta(){return this._fixedDelta/1e3}getTimescale(){return this._timescale}reset(){return this._currentTime=this._now(),this}setFixedDelta(e){return this._fixedDelta=e*1e3,this}setTimescale(e){return this._timescale=e,this}update(){return this._useFixedDelta===!0?this._delta=this._fixedDelta:(this._previousTime=this._currentTime,this._currentTime=this._now(),this._delta=this._currentTime-this._previousTime),this._delta*=this._timescale,this._elapsed+=this._delta,this}_now(){return(typeof performance>"u"?Date:performance).now()}}function vle(){document.hidden===!1&&this.reset()}const GO={camera_link:{frame:"HEAD_1",position:{x:null,y:0,z:0},rotation:{w:1,x:0,y:0,z:0},scale:{x:1,y:1,z:1}},imu_sensor_link:{frame:"base_link",position:{x:0,y:0,z:0},rotation:{w:1,x:0,y:0,z:0},scale:{x:1,y:1,z:1}},MIDDLE_LEFT_WHEEL_1:{frame:"base_link",position:{x:-.006691,y:.060225,z:.028646},rotation:{w:1,x:0,y:0,z:0},scale:{x:1,y:1,z:1}},REAR_LEFT_WHEEL_1:{frame:"base_link",position:{x:-.075191,y:.060225,z:.028646},rotation:{w:1,x:0,y:0,z:0},scale:{x:1,y:1,z:1}},REAR_RIGHT_WHEEL_1:{frame:"base_link",position:{x:-.075191,y:-.060225,z:.028646},rotation:{w:1,x:0,y:0,z:0},scale:{x:1,y:1,z:1}},MIDDLE_RIGHT_WHEEL_1:{frame:"base_link",position:{x:-.006691,y:-.060225,z:.028646},rotation:{w:1,x:0,y:0,z:0},scale:{x:1,y:1,z:1}},BODY_BASE_CONNECTOR_1:{frame:"base_link",position:{x:-.263414,y:-.061691,z:.210284},rotation:{w:1,x:0,y:0,z:0},scale:{x:1,y:1,z:1}},BASE_RIGHT_COVER_1:{frame:"base_link",position:{x:.062309,y:-.045,z:.074646},rotation:{w:1,x:0,y:0,z:0},scale:{x:1,y:1,z:1}},BASE_LEFT_COVER_1:{frame:"base_link",position:{x:.062309,y:.045,z:.074646},rotation:{w:1,x:0,y:0,z:0},scale:{x:1,y:1,z:1}},BASE_FRONT_GRILL_1:{frame:"base_link",position:{x:.039109,y:.043,z:.078796},rotation:{w:1,x:0,y:0,z:0},scale:{x:1,y:1,z:1}},Torso_1:{frame:"BODY_BASE_CONNECTOR_1",position:{x:.214514,y:.061691,z:-.095653},rotation:{w:1,x:0,y:0,z:0},scale:{x:1,y:1,z:1}},NECK_GLOBE_BASE_1:{frame:"Torso_1",position:{x:.014661,y:.0228,z:.084122},rotation:{w:1,x:0,y:0,z:0},scale:{x:1,y:1,z:1}},HEAD_VENT_RIGHT_1:{frame:"HEAD_1",position:{x:.08973-.019009,y:-.057013+.025,z:.04831+.238601-.05},rotation:{w:1,x:0,y:0,z:0},scale:{x:1,y:1,z:1}},HEAD_1:{frame:"NECK_GLOBE_BASE_1",position:{x:.034239,y:-.02,z:.05},rotation:{w:1,x:0,y:0,z:0},scale:{x:1,y:1,z:1}},EYE_LENS_1:{frame:"HEAD_1",position:{x:.016845-.019009,y:.061941+.025,z:.034753+.238601-.05},rotation:{w:1,x:0,y:0,z:0},scale:{x:1,y:1,z:1}},FACE_1:{frame:"EYE_LENS_1",position:{x:.076086,y:.007237,z:-.003703},rotation:{w:1,x:0,y:0,z:0},scale:{x:1,y:1,z:1}},VISOR_GLASS_1:{frame:"HEAD_1",position:{x:.111798-.019009,y:-.024175+.025,z:-.124256+.238601-.05},rotation:{w:1,x:0,y:0,z:0},scale:{x:1,y:1,z:1}},HEAD_VENT_LEFT_1:{frame:"HEAD_1",position:{x:-.042326-.019009,y:.038377+.025,z:-.162881+.238601-.05},rotation:{w:1,x:0,y:0,z:0},scale:{x:1,y:1,z:1}},LEFT_ARM_1:{frame:"LEFT_ARM_CONNECTOR_1",position:{x:-.013297,y:.005336,z:-.001514},rotation:{w:1,x:0,y:0,z:0},scale:{x:1,y:1,z:1}},RIGHT_ARM_1:{frame:"RIGHT_ARM_CONNECTOR_1",position:{x:-.014964,y:-.001971,z:-287e-6},rotation:{w:1,x:0,y:0,z:0},scale:{x:1,y:1,z:1}},Battery_1:{frame:"base_link",position:{x:-.321414,y:.065009,z:.175134},rotation:{w:1,x:0,y:0,z:0},scale:{x:1,y:1,z:1}},RIGHT_ARM_CONNECTOR_1:{frame:"Torso_1",position:{x:.044751,y:-.066216,z:.057987},rotation:{w:.924,x:0,y:.383,z:0},scale:{x:1,y:1,z:1}},LEFT_ARM_CONNECTOR_1:{frame:"Torso_1",position:{x:.044751,y:.066216,z:.057987},rotation:{w:.924,x:0,y:.383,z:0},scale:{x:1,y:1,z:1}},FRONT_LEFT_WHEEL_1:{frame:"base_link",position:{x:.060309,y:.060225,z:.036146},rotation:{w:1,x:0,y:0,z:0},scale:{x:1,y:1,z:1}},FRONT_RIGHT_WHEEL_1:{frame:"base_link",position:{x:.060309,y:-.060225,z:.036146},rotation:{w:1,x:0,y:0,z:0},scale:{x:1,y:1,z:1}},BALANCE_WHEEL:{frame:"base_link",position:{x:-.075191,y:0,z:.028646},rotation:{w:1,x:0,y:0,z:0},scale:{x:1,y:1,z:1}},base_link:{frame:"world",position:{x:0,y:0,z:0},rotation:{w:.707,x:0,y:0,z:-.707},scale:{x:1,y:1,z:1}}},WO={base_link:{shape:"package://misty_description/meshes/base_link.stl",name:"base_link",frame:"base_link",position:{x:0,y:0,z:0},rotation:{w:1,x:0,y:0,z:0},color:{r:178.5,g:178.5,b:178.5,a:1},scale:{x:.001,y:.001,z:.001},highlight:"false"},MIDDLE_LEFT_WHEEL_1:{shape:"package://misty_description/meshes/MIDDLE_LEFT_WHEEL_1.stl",name:"MIDDLE_LEFT_WHEEL_1",frame:"MIDDLE_LEFT_WHEEL_1",position:{x:.006691,y:-.060225,z:-.027646},rotation:{w:1,x:0,y:0,z:0},color:{r:178.5,g:178.5,b:178.5,a:1},scale:{x:.001,y:.001,z:.001},highlight:"false"},REAR_LEFT_WHEEL_1:{shape:"package://misty_description/meshes/REAR_LEFT_WHEEL_1.stl",name:"REAR_LEFT_WHEEL_1",frame:"REAR_LEFT_WHEEL_1",position:{x:.075191,y:-.060225,z:-.027646},rotation:{w:1,x:0,y:0,z:0},color:{r:178.5,g:178.5,b:178.5,a:1},scale:{x:.001,y:.001,z:.001},highlight:"false"},REAR_RIGHT_WHEEL_1:{shape:"package://misty_description/meshes/REAR_RIGHT_WHEEL_1.stl",name:"REAR_RIGHT_WHEEL_1",frame:"REAR_RIGHT_WHEEL_1",position:{x:.075191,y:.060225,z:-.027646},rotation:{w:1,x:0,y:0,z:0},color:{r:178.5,g:178.5,b:178.5,a:1},scale:{x:.001,y:.001,z:.001},highlight:"false"},MIDDLE_RIGHT_WHEEL_1:{shape:"package://misty_description/meshes/MIDDLE_RIGHT_WHEEL_1.stl",name:"MIDDLE_RIGHT_WHEEL_1",frame:"MIDDLE_RIGHT_WHEEL_1",position:{x:.006691,y:.060225,z:-.027646},rotation:{w:1,x:0,y:0,z:0},color:{r:178.5,g:178.5,b:178.5,a:1},scale:{x:.001,y:.001,z:.001},highlight:"false"},BODY_BASE_CONNECTOR_1:{shape:"package://misty_description/meshes/BODY_BASE_CONNECTOR_1.stl",name:"BODY_BASE_CONNECTOR_1",frame:"BODY_BASE_CONNECTOR_1",position:{x:.263414,y:.061691,z:-.210284},rotation:{w:1,x:0,y:0,z:0},color:{r:178.5,g:178.5,b:178.5,a:1},scale:{x:.001,y:.001,z:.001},highlight:"false"},BASE_RIGHT_COVER_1:{shape:"package://misty_description/meshes/BASE_RIGHT_COVER_1.stl",name:"BASE_RIGHT_COVER_1",frame:"BASE_RIGHT_COVER_1",position:{x:-.062309,y:.045,z:-.074646},rotation:{w:1,x:0,y:0,z:0},color:{r:178.5,g:178.5,b:178.5,a:1},scale:{x:.001,y:.001,z:.001},highlight:"false"},BASE_LEFT_COVER_1:{shape:"package://misty_description/meshes/BASE_LEFT_COVER_1.stl",name:"BASE_LEFT_COVER_1",frame:"BASE_LEFT_COVER_1",position:{x:-.062309,y:-.045,z:-.074646},rotation:{w:1,x:0,y:0,z:0},color:{r:178.5,g:178.5,b:178.5,a:1},scale:{x:.001,y:.001,z:.001},highlight:"false"},BASE_FRONT_GRILL_1:{shape:"package://misty_description/meshes/BASE_FRONT_GRILL_1.stl",name:"BASE_FRONT_GRILL_1",frame:"BASE_FRONT_GRILL_1",position:{x:-.039109,y:-.043,z:-.078796},rotation:{w:1,x:0,y:0,z:0},color:{r:178.5,g:178.5,b:178.5,a:1},scale:{x:.001,y:.001,z:.001},highlight:"false"},Torso_1:{shape:"package://misty_description/meshes/Torso_1.stl",name:"Torso_1",frame:"Torso_1",position:{x:.0489,y:0,z:-.114631},rotation:{w:1,x:0,y:0,z:0},color:{r:178.5,g:178.5,b:178.5,a:1},scale:{x:.001,y:.001,z:.001},highlight:"false"},NECK_GLOBE_BASE_1:{shape:"package://misty_description/meshes/NECK_GLOBE_BASE_1.stl",name:"NECK_GLOBE_BASE_1",frame:"NECK_GLOBE_BASE_1",position:{x:.034239,y:-.0228,z:-.198753},rotation:{w:1,x:0,y:0,z:0},color:{r:178.5,g:178.5,b:178.5,a:1},scale:{x:.001,y:.001,z:.001},highlight:"false"},HEAD_VENT_RIGHT_1:{shape:"package://misty_description/meshes/HEAD_VENT_RIGHT_1.stl",name:"HEAD_VENT_RIGHT_1",frame:"HEAD_VENT_RIGHT_1",position:{x:-.070814,y:.032838,z:-.485664},rotation:{w:1,x:0,y:0,z:0},color:{r:178.5,g:178.5,b:178.5,a:1},scale:{x:.001,y:.001,z:.001},highlight:"false"},HEAD_1:{shape:"package://misty_description/meshes/HEAD_1.stl",name:"HEAD_1",frame:"HEAD_1",position:{x:0,y:0,z:-.25},rotation:{w:1,x:0,y:0,z:0},color:{r:178.5,g:178.5,b:178.5,a:1},scale:{x:.001,y:.001,z:.001},highlight:"false"},EYE_LENS_1:{shape:"package://misty_description/meshes/EYE_LENS_1.stl",name:"EYE_LENS_1",frame:"EYE_LENS_1",position:{x:.002071,y:-.086116,z:-.472107},rotation:{w:1,x:0,y:0,z:0},color:{r:0,g:0,b:0,a:.5},scale:{x:.001,y:.001,z:.001},highlight:"false"},FACE_1:{shape:"package://misty_description/meshes/FACE_1.stl",name:"FACE_1",frame:"FACE_1",position:{x:-.074015,y:-.093353,z:-.468404-.02},rotation:{w:1,x:0,y:0,z:0},color:{r:178.5,g:178.5,b:178.5,a:1},scale:{x:.00105,y:.00105,z:.00105},highlight:"false"},eyes_acceptance:{shape:"eyes_acceptance",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},eyes_admiration:{shape:"eyes_admiration",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},eyes_amazement:{shape:"eyes_amazement",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},eyes_anger:{shape:"eyes_anger",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},eyes_annoyed:{shape:"eyes_annoyed",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},eyes_anticipation:{shape:"eyes_anticipation",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},eyes_apprehension:{shape:"eyes_apprehension",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},eyes_apprehension_1:{shape:"eyes_apprehension_1",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},eyes_boredom:{shape:"eyes_boredom",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},eyes_default:{shape:"eyes_default",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!1},eyes_disgust:{shape:"eyes_disgust",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},eyes_distraction:{shape:"eyes_distraction",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},eyes_ecstasy_frame_1:{shape:"eyes_ecstasy_frame_1",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},eyes_ecstasy_frame_2:{shape:"eyes_ecstasy_frame_2",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},eyes_fear:{shape:"eyes_fear",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},eyes_grief:{shape:"eyes_grief",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},eyes_interest:{shape:"eyes_interest",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},eyes_joy:{shape:"eyes_joy",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},eyes_loathing:{shape:"eyes_loathing",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},eyes_pensiveness:{shape:"eyes_pensiveness",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},eyes_rage:{shape:"eyes_rage",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},eyes_sad:{shape:"eyes_sad",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},eyes_serenity:{shape:"eyes_serenity",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},eyes_surprise:{shape:"eyes_surprise",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},eyes_terror:{shape:"eyes_terror",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},eyes_trust:{shape:"eyes_trust",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},eyes_vigilance:{shape:"eyes_vigilance",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},e_Sleeping:{shape:"e_Sleeping",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},e_SleepingZZZ:{shape:"e_SleepingZZZ",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},e_Contempt:{shape:"e_Contempt",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},e_ContentLeft:{shape:"e_ContentLeft",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},e_ContentRight:{shape:"e_ContentRight",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},e_Disoriented:{shape:"e_Disoriented",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},e_EcstacyHilarious:{shape:"e_EcstacyHilarious",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},e_EcstacyStarryEyed:{shape:"e_EcstacyStarryEyed",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},e_JoyGoofy:{shape:"e_JoyGoofy",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},e_JoyGoofy2:{shape:"e_JoyGoofy2",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},e_JoyGoofy3:{shape:"e_JoyGoofy3",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},e_Love:{shape:"e_Love",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},e_Rage:{shape:"e_Rage",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},e_Rage2:{shape:"e_Rage2",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},e_Rage3:{shape:"e_Rage3",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},e_Rage4:{shape:"e_Rage4",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},e_RemorseShame:{shape:"e_RemorseShame",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},VISOR_GLASS_1:{shape:"package://misty_description/meshes/VISOR_GLASS_1.stl",name:"VISOR_GLASS_1",frame:"VISOR_GLASS_1",position:{x:-.092882,y:0,z:-.313098},rotation:{w:1,x:0,y:0,z:0},color:{r:22,g:22,b:22,a:1},scale:{x:.001,y:.001,z:.001},highlight:"false"},HEAD_VENT_LEFT_1:{shape:"package://misty_description/meshes/HEAD_VENT_LEFT_1.stl",name:"HEAD_VENT_LEFT_1",frame:"HEAD_VENT_LEFT_1",position:{x:.061242,y:-.062552,z:-.274473},rotation:{w:1,x:0,y:0,z:0},color:{r:178.5,g:178.5,b:178.5,a:1},scale:{x:.001,y:.001,z:.001},highlight:"false"},LEFT_ARM_1:{shape:"package://misty_description/meshes/LEFT_ARM_1.stl",name:"LEFT_ARM_1",frame:"LEFT_ARM_1",position:{x:.017446,y:-.071552,z:-.171104},rotation:{w:1,x:0,y:0,z:0},color:{r:178.5,g:178.5,b:178.5,a:1},scale:{x:.001,y:.001,z:.001},highlight:"false"},RIGHT_ARM_1:{shape:"package://misty_description/meshes/RIGHT_ARM_1.stl",name:"RIGHT_ARM_1",frame:"RIGHT_ARM_1",position:{x:.019113,y:.068187,z:-.172331},rotation:{w:1,x:0,y:0,z:0},color:{r:178.5,g:178.5,b:178.5,a:1},scale:{x:.001,y:.001,z:.001},highlight:"false"},Battery_1:{shape:"package://misty_description/meshes/Battery_1.stl",name:"Battery_1",frame:"Battery_1",position:{x:.321414,y:-.065009,z:-.175134},rotation:{w:1,x:0,y:0,z:0},color:{r:178.5,g:178.5,b:178.5,a:1},scale:{x:.001,y:.001,z:.001},highlight:"false"},RIGHT_ARM_CONNECTOR_1:{shape:"package://misty_description/meshes/RIGHT_ARM_CONNECTOR_1.stl",name:"RIGHT_ARM_CONNECTOR_1",frame:"RIGHT_ARM_CONNECTOR_1",position:{x:.004149,y:.066216,z:-.172618},rotation:{w:1,x:0,y:0,z:0},color:{r:178.5,g:178.5,b:178.5,a:1},scale:{x:.001,y:.001,z:.001},highlight:"false"},LEFT_ARM_CONNECTOR_1:{shape:"package://misty_description/meshes/LEFT_ARM_CONNECTOR_1.stl",name:"LEFT_ARM_CONNECTOR_1",frame:"LEFT_ARM_CONNECTOR_1",position:{x:.004149,y:-.066216,z:-.172618},rotation:{w:1,x:0,y:0,z:0},color:{r:178.5,g:178.5,b:178.5,a:1},scale:{x:.001,y:.001,z:.001},highlight:"false"},FRONT_LEFT_WHEEL_1:{shape:"package://misty_description/meshes/FRONT_LEFT_WHEEL_1.stl",name:"FRONT_LEFT_WHEEL_1",frame:"FRONT_LEFT_WHEEL_1",position:{x:-.060309,y:-.060225,z:-.035146},rotation:{w:1,x:0,y:0,z:0},color:{r:178.5,g:178.5,b:178.5,a:1},scale:{x:.001,y:.001,z:.001},highlight:"false"},FRONT_RIGHT_WHEEL_1:{shape:"package://misty_description/meshes/FRONT_RIGHT_WHEEL_1.stl",name:"FRONT_RIGHT_WHEEL_1",frame:"FRONT_RIGHT_WHEEL_1",position:{x:-.060309,y:.060225,z:-.035146},rotation:{w:1,x:0,y:0,z:0},color:{r:178.5,g:178.5,b:178.5,a:1},scale:{x:.001,y:.001,z:.001},highlight:"false"},Reset_Button:{shape:"cube",frame:"gizmo",name:"Reset_Button",position:{x:0,y:0,z:0},rotation:{w:1,x:0,y:0,z:0},color:{r:255,g:0,b:0,a:1},scale:{x:1,y:1,z:1}}},yle=`You are an assistive agent that translates descriptions of robot behavior into JSON that describes goals for programming. These goals are individual steps for a user to achieve in order to program the robot to perform the corresponding behavior. A user will use these goals to help them figure out how to build a robot program using a custom interface for programming robots. + */const F3="162",nR=0,woe=1,Eoe=2,ZU=1,e5=100,t5=204,n5=205,r5=3,xoe=0,i5="attached",$oe="detached",iX=300,w$=1e3,Mx=1001,CD=1002,E$=1003,Coe=1004,Moe=1005,z3=1006,Aoe=1007,U3=1008,sX=1009,Ioe=1014,H3=1015,Roe=1020,G3=1023,fO=1026,s5=1027,koe=1028,x$=2300,Aw=2301,pO=2302,o5=2400,a5=2401,l5=2402,Ooe=2500,Loe=0,oX=1,MD=2,Noe=0,aX="",my="srgb",W3="srgb-linear",Doe="display-p3",lX="display-p3-linear",AD="linear",u5="srgb",c5="rec709",h5="p3",jT=7680,d5=519,Poe=515,ID=35044,T1=2e3,RD=2001;class ak{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const r=this._listeners;r[e]===void 0&&(r[e]=[]),r[e].indexOf(t)===-1&&r[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;const r=this._listeners;return r[e]!==void 0&&r[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;const s=this._listeners[e];if(s!==void 0){const o=s.indexOf(t);o!==-1&&s.splice(o,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const r=this._listeners[e.type];if(r!==void 0){e.target=this;const s=r.slice(0);for(let o=0,l=s.length;o>8&255]+xf[n>>16&255]+xf[n>>24&255]+"-"+xf[e&255]+xf[e>>8&255]+"-"+xf[e>>16&15|64]+xf[e>>24&255]+"-"+xf[t&63|128]+xf[t>>8&255]+"-"+xf[t>>16&255]+xf[t>>24&255]+xf[r&255]+xf[r>>8&255]+xf[r>>16&255]+xf[r>>24&255]).toLowerCase()}function Lf(n,e,t){return Math.max(e,Math.min(t,n))}function V3(n,e){return(n%e+e)%e}function Boe(n,e,t,r,s){return r+(n-e)*(s-r)/(t-e)}function Foe(n,e,t){return n!==e?(t-n)/(e-n):0}function Kx(n,e,t){return(1-t)*n+t*e}function zoe(n,e,t,r){return Kx(n,e,1-Math.exp(-t*r))}function Uoe(n,e=1){return e-Math.abs(V3(n,e*2)-e)}function Hoe(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*(3-2*n))}function Goe(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*n*(n*(n*6-15)+10))}function Woe(n,e){return n+Math.floor(Math.random()*(e-n+1))}function Voe(n,e){return n+Math.random()*(e-n)}function joe(n){return n*(.5-Math.random())}function Yoe(n){n!==void 0&&(f5=n);let e=f5+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function Xoe(n){return n*Xx}function Koe(n){return n*$$}function Joe(n){return(n&n-1)===0&&n!==0}function qoe(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function Qoe(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function Zoe(n,e,t,r,s){const o=Math.cos,l=Math.sin,u=o(t/2),h=l(t/2),f=o((e+r)/2),g=l((e+r)/2),y=o((e-r)/2),b=l((e-r)/2),w=o((r-e)/2),C=l((r-e)/2);switch(s){case"XYX":n.set(u*g,h*y,h*b,u*f);break;case"YZY":n.set(h*b,u*g,h*y,u*f);break;case"ZXZ":n.set(h*y,h*b,u*g,u*f);break;case"XZX":n.set(u*g,h*C,h*w,u*f);break;case"YXY":n.set(h*w,u*g,h*C,u*f);break;case"ZYZ":n.set(h*C,h*w,u*g,u*f);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+s)}}function e0(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return n/4294967295;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int32Array:return Math.max(n/2147483647,-1);case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function Ma(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return Math.round(n*4294967295);case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int32Array:return Math.round(n*2147483647);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}const eae={DEG2RAD:Xx,RAD2DEG:$$,generateUUID:a0,clamp:Lf,euclideanModulo:V3,mapLinear:Boe,inverseLerp:Foe,lerp:Kx,damp:zoe,pingpong:Uoe,smoothstep:Hoe,smootherstep:Goe,randInt:Woe,randFloat:Voe,randFloatSpread:joe,seededRandom:Yoe,degToRad:Xoe,radToDeg:Koe,isPowerOfTwo:Joe,ceilPowerOfTwo:qoe,floorPowerOfTwo:Qoe,setQuaternionFromProperEuler:Zoe,normalize:Ma,denormalize:e0};class cc{constructor(e=0,t=0){cc.prototype.isVector2=!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){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,r=this.y,s=e.elements;return this.x=s[0]*t+s[3]*r+s[6],this.y=s[1]*t+s[4]*r+s[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 r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(t,r)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const r=this.dot(e)/t;return Math.acos(Lf(r,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,r=this.y-e.y;return t*t+r*r}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,r){return this.x=e.x+(t.x-e.x)*r,this.y=e.y+(t.y-e.y)*r,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const r=Math.cos(t),s=Math.sin(t),o=this.x-e.x,l=this.y-e.y;return this.x=o*r-l*s+e.x,this.y=o*s+l*r+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class $v{constructor(e,t,r,s,o,l,u,h,f){$v.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,r,s,o,l,u,h,f)}set(e,t,r,s,o,l,u,h,f){const g=this.elements;return g[0]=e,g[1]=s,g[2]=u,g[3]=t,g[4]=o,g[5]=h,g[6]=r,g[7]=l,g[8]=f,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,r=e.elements;return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],this}extractBasis(e,t,r){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),r.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 r=e.elements,s=t.elements,o=this.elements,l=r[0],u=r[3],h=r[6],f=r[1],g=r[4],y=r[7],b=r[2],w=r[5],C=r[8],M=s[0],A=s[3],k=s[6],L=s[1],P=s[4],D=s[7],z=s[2],U=s[5],V=s[8];return o[0]=l*M+u*L+h*z,o[3]=l*A+u*P+h*U,o[6]=l*k+u*D+h*V,o[1]=f*M+g*L+y*z,o[4]=f*A+g*P+y*U,o[7]=f*k+g*D+y*V,o[2]=b*M+w*L+C*z,o[5]=b*A+w*P+C*U,o[8]=b*k+w*D+C*V,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],r=e[1],s=e[2],o=e[3],l=e[4],u=e[5],h=e[6],f=e[7],g=e[8];return t*l*g-t*u*f-r*o*g+r*u*h+s*o*f-s*l*h}invert(){const e=this.elements,t=e[0],r=e[1],s=e[2],o=e[3],l=e[4],u=e[5],h=e[6],f=e[7],g=e[8],y=g*l-u*f,b=u*h-g*o,w=f*o-l*h,C=t*y+r*b+s*w;if(C===0)return this.set(0,0,0,0,0,0,0,0,0);const M=1/C;return e[0]=y*M,e[1]=(s*f-g*r)*M,e[2]=(u*r-s*l)*M,e[3]=b*M,e[4]=(g*t-s*h)*M,e[5]=(s*o-u*t)*M,e[6]=w*M,e[7]=(r*h-f*t)*M,e[8]=(l*t-r*o)*M,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,r,s,o,l,u){const h=Math.cos(o),f=Math.sin(o);return this.set(r*h,r*f,-r*(h*l+f*u)+l+e,-s*f,s*h,-s*(-f*l+h*u)+u+t,0,0,1),this}scale(e,t){return this.premultiply(mO.makeScale(e,t)),this}rotate(e){return this.premultiply(mO.makeRotation(-e)),this}translate(e,t){return this.premultiply(mO.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),r=Math.sin(e);return this.set(t,-r,0,r,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,r=e.elements;for(let s=0;s<9;s++)if(t[s]!==r[s])return!1;return!0}fromArray(e,t=0){for(let r=0;r<9;r++)this.elements[r]=e[r+t];return this}toArray(e=[],t=0){const r=this.elements;return e[t]=r[0],e[t+1]=r[1],e[t+2]=r[2],e[t+3]=r[3],e[t+4]=r[4],e[t+5]=r[5],e[t+6]=r[6],e[t+7]=r[7],e[t+8]=r[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const mO=new $v;function tae(n){for(let e=n.length-1;e>=0;--e)if(n[e]>=65535)return!0;return!1}function kD(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}const p5={};function uX(n){n in p5||(p5[n]=!0,console.warn(n))}const m5=new $v().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),g5=new $v().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),cM={[W3]:{transfer:AD,primaries:c5,toReference:n=>n,fromReference:n=>n},[my]:{transfer:u5,primaries:c5,toReference:n=>n.convertSRGBToLinear(),fromReference:n=>n.convertLinearToSRGB()},[lX]:{transfer:AD,primaries:h5,toReference:n=>n.applyMatrix3(g5),fromReference:n=>n.applyMatrix3(m5)},[Doe]:{transfer:u5,primaries:h5,toReference:n=>n.convertSRGBToLinear().applyMatrix3(g5),fromReference:n=>n.applyMatrix3(m5).convertLinearToSRGB()}},nae=new Set([W3,lX]),Hg={enabled:!0,_workingColorSpace:W3,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(n){if(!nae.has(n))throw new Error(`Unsupported working color space, "${n}".`);this._workingColorSpace=n},convert:function(n,e,t){if(this.enabled===!1||e===t||!e||!t)return n;const r=cM[e].toReference,s=cM[t].fromReference;return s(r(n))},fromWorkingColorSpace:function(n,e){return this.convert(n,this._workingColorSpace,e)},toWorkingColorSpace:function(n,e){return this.convert(n,e,this._workingColorSpace)},getPrimaries:function(n){return cM[n].primaries},getTransfer:function(n){return n===aX?AD:cM[n].transfer}};function dw(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function gO(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let YT;class rae{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{YT===void 0&&(YT=kD("canvas")),YT.width=e.width,YT.height=e.height;const r=YT.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),t=YT}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(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=kD("canvas");t.width=e.width,t.height=e.height;const r=t.getContext("2d");r.drawImage(e,0,0,e.width,e.height);const s=r.getImageData(0,0,e.width,e.height),o=s.data;for(let l=0;l0&&(r.userData=this.userData),t||(e.textures[this.uuid]=r),r}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==iX)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case w$:e.x=e.x-Math.floor(e.x);break;case Mx:e.x=e.x<0?0:1;break;case CD:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case w$:e.y=e.y-Math.floor(e.y);break;case Mx:e.y=e.y<0?0:1;break;case CD:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}}Lm.DEFAULT_IMAGE=null;Lm.DEFAULT_MAPPING=iX;Lm.DEFAULT_ANISOTROPY=1;class _g{constructor(e=0,t=0,r=0,s=1){_g.prototype.isVector4=!0,this.x=e,this.y=t,this.z=r,this.w=s}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,r,s){return this.x=e,this.y=t,this.z=r,this.w=s,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=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,r=this.y,s=this.z,o=this.w,l=e.elements;return this.x=l[0]*t+l[4]*r+l[8]*s+l[12]*o,this.y=l[1]*t+l[5]*r+l[9]*s+l[13]*o,this.z=l[2]*t+l[6]*r+l[10]*s+l[14]*o,this.w=l[3]*t+l[7]*r+l[11]*s+l[15]*o,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,r,s,o;const h=e.elements,f=h[0],g=h[4],y=h[8],b=h[1],w=h[5],C=h[9],M=h[2],A=h[6],k=h[10];if(Math.abs(g-b)<.01&&Math.abs(y-M)<.01&&Math.abs(C-A)<.01){if(Math.abs(g+b)<.1&&Math.abs(y+M)<.1&&Math.abs(C+A)<.1&&Math.abs(f+w+k-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const P=(f+1)/2,D=(w+1)/2,z=(k+1)/2,U=(g+b)/4,V=(y+M)/4,H=(C+A)/4;return P>D&&P>z?P<.01?(r=0,s=.707106781,o=.707106781):(r=Math.sqrt(P),s=U/r,o=V/r):D>z?D<.01?(r=.707106781,s=0,o=.707106781):(s=Math.sqrt(D),r=U/s,o=H/s):z<.01?(r=.707106781,s=.707106781,o=0):(o=Math.sqrt(z),r=V/o,s=H/o),this.set(r,s,o,t),this}let L=Math.sqrt((A-C)*(A-C)+(y-M)*(y-M)+(b-g)*(b-g));return Math.abs(L)<.001&&(L=1),this.x=(A-C)/L,this.y=(y-M)/L,this.z=(b-g)/L,this.w=Math.acos((f+w+k-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 r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(t,r)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,r){return this.x=e.x+(t.x-e.x)*r,this.y=e.y+(t.y-e.y)*r,this.z=e.z+(t.z-e.z)*r,this.w=e.w+(t.w-e.w)*r,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class Pu{constructor(e=0,t=0,r=0,s=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=r,this._w=s}static slerpFlat(e,t,r,s,o,l,u){let h=r[s+0],f=r[s+1],g=r[s+2],y=r[s+3];const b=o[l+0],w=o[l+1],C=o[l+2],M=o[l+3];if(u===0){e[t+0]=h,e[t+1]=f,e[t+2]=g,e[t+3]=y;return}if(u===1){e[t+0]=b,e[t+1]=w,e[t+2]=C,e[t+3]=M;return}if(y!==M||h!==b||f!==w||g!==C){let A=1-u;const k=h*b+f*w+g*C+y*M,L=k>=0?1:-1,P=1-k*k;if(P>Number.EPSILON){const z=Math.sqrt(P),U=Math.atan2(z,k*L);A=Math.sin(A*U)/z,u=Math.sin(u*U)/z}const D=u*L;if(h=h*A+b*D,f=f*A+w*D,g=g*A+C*D,y=y*A+M*D,A===1-u){const z=1/Math.sqrt(h*h+f*f+g*g+y*y);h*=z,f*=z,g*=z,y*=z}}e[t]=h,e[t+1]=f,e[t+2]=g,e[t+3]=y}static multiplyQuaternionsFlat(e,t,r,s,o,l){const u=r[s],h=r[s+1],f=r[s+2],g=r[s+3],y=o[l],b=o[l+1],w=o[l+2],C=o[l+3];return e[t]=u*C+g*y+h*w-f*b,e[t+1]=h*C+g*b+f*y-u*w,e[t+2]=f*C+g*w+u*b-h*y,e[t+3]=g*C-u*y-h*b-f*w,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,r,s){return this._x=e,this._y=t,this._z=r,this._w=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const r=e._x,s=e._y,o=e._z,l=e._order,u=Math.cos,h=Math.sin,f=u(r/2),g=u(s/2),y=u(o/2),b=h(r/2),w=h(s/2),C=h(o/2);switch(l){case"XYZ":this._x=b*g*y+f*w*C,this._y=f*w*y-b*g*C,this._z=f*g*C+b*w*y,this._w=f*g*y-b*w*C;break;case"YXZ":this._x=b*g*y+f*w*C,this._y=f*w*y-b*g*C,this._z=f*g*C-b*w*y,this._w=f*g*y+b*w*C;break;case"ZXY":this._x=b*g*y-f*w*C,this._y=f*w*y+b*g*C,this._z=f*g*C+b*w*y,this._w=f*g*y-b*w*C;break;case"ZYX":this._x=b*g*y-f*w*C,this._y=f*w*y+b*g*C,this._z=f*g*C-b*w*y,this._w=f*g*y+b*w*C;break;case"YZX":this._x=b*g*y+f*w*C,this._y=f*w*y+b*g*C,this._z=f*g*C-b*w*y,this._w=f*g*y-b*w*C;break;case"XZY":this._x=b*g*y-f*w*C,this._y=f*w*y-b*g*C,this._z=f*g*C+b*w*y,this._w=f*g*y+b*w*C;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+l)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const r=t/2,s=Math.sin(r);return this._x=e.x*s,this._y=e.y*s,this._z=e.z*s,this._w=Math.cos(r),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,r=t[0],s=t[4],o=t[8],l=t[1],u=t[5],h=t[9],f=t[2],g=t[6],y=t[10],b=r+u+y;if(b>0){const w=.5/Math.sqrt(b+1);this._w=.25/w,this._x=(g-h)*w,this._y=(o-f)*w,this._z=(l-s)*w}else if(r>u&&r>y){const w=2*Math.sqrt(1+r-u-y);this._w=(g-h)/w,this._x=.25*w,this._y=(s+l)/w,this._z=(o+f)/w}else if(u>y){const w=2*Math.sqrt(1+u-r-y);this._w=(o-f)/w,this._x=(s+l)/w,this._y=.25*w,this._z=(h+g)/w}else{const w=2*Math.sqrt(1+y-r-u);this._w=(l-s)/w,this._x=(o+f)/w,this._y=(h+g)/w,this._z=.25*w}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let r=e.dot(t)+1;return rMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=r):(this._x=0,this._y=-e.z,this._z=e.y,this._w=r)):(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=r),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Lf(this.dot(e),-1,1)))}rotateTowards(e,t){const r=this.angleTo(e);if(r===0)return this;const s=Math.min(1,t/r);return this.slerp(e,s),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const r=e._x,s=e._y,o=e._z,l=e._w,u=t._x,h=t._y,f=t._z,g=t._w;return this._x=r*g+l*u+s*f-o*h,this._y=s*g+l*h+o*u-r*f,this._z=o*g+l*f+r*h-s*u,this._w=l*g-r*u-s*h-o*f,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const r=this._x,s=this._y,o=this._z,l=this._w;let u=l*e._w+r*e._x+s*e._y+o*e._z;if(u<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,u=-u):this.copy(e),u>=1)return this._w=l,this._x=r,this._y=s,this._z=o,this;const h=1-u*u;if(h<=Number.EPSILON){const w=1-t;return this._w=w*l+t*this._w,this._x=w*r+t*this._x,this._y=w*s+t*this._y,this._z=w*o+t*this._z,this.normalize(),this}const f=Math.sqrt(h),g=Math.atan2(f,u),y=Math.sin((1-t)*g)/f,b=Math.sin(t*g)/f;return this._w=l*y+this._w*b,this._x=r*y+this._x*b,this._y=s*y+this._y*b,this._z=o*y+this._z*b,this._onChangeCallback(),this}slerpQuaternions(e,t,r){return this.copy(e).slerp(t,r)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),r=Math.random(),s=Math.sqrt(1-r),o=Math.sqrt(r);return this.set(s*Math.sin(e),s*Math.cos(e),o*Math.sin(t),o*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class Pt{constructor(e=0,t=0,r=0){Pt.prototype.isVector3=!0,this.x=e,this.y=t,this.z=r}set(e,t,r){return r===void 0&&(r=this.z),this.x=e,this.y=t,this.z=r,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){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(_5.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(_5.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,r=this.y,s=this.z,o=e.elements;return this.x=o[0]*t+o[3]*r+o[6]*s,this.y=o[1]*t+o[4]*r+o[7]*s,this.z=o[2]*t+o[5]*r+o[8]*s,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,r=this.y,s=this.z,o=e.elements,l=1/(o[3]*t+o[7]*r+o[11]*s+o[15]);return this.x=(o[0]*t+o[4]*r+o[8]*s+o[12])*l,this.y=(o[1]*t+o[5]*r+o[9]*s+o[13])*l,this.z=(o[2]*t+o[6]*r+o[10]*s+o[14])*l,this}applyQuaternion(e){const t=this.x,r=this.y,s=this.z,o=e.x,l=e.y,u=e.z,h=e.w,f=2*(l*s-u*r),g=2*(u*t-o*s),y=2*(o*r-l*t);return this.x=t+h*f+l*y-u*g,this.y=r+h*g+u*f-o*y,this.z=s+h*y+o*g-l*f,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,r=this.y,s=this.z,o=e.elements;return this.x=o[0]*t+o[4]*r+o[8]*s,this.y=o[1]*t+o[5]*r+o[9]*s,this.z=o[2]*t+o[6]*r+o[10]*s,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 r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(t,r)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,r){return this.x=e.x+(t.x-e.x)*r,this.y=e.y+(t.y-e.y)*r,this.z=e.z+(t.z-e.z)*r,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const r=e.x,s=e.y,o=e.z,l=t.x,u=t.y,h=t.z;return this.x=s*h-o*u,this.y=o*l-r*h,this.z=r*u-s*l,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const r=e.dot(this)/t;return this.copy(e).multiplyScalar(r)}projectOnPlane(e){return vO.copy(this).projectOnVector(e),this.sub(vO)}reflect(e){return this.sub(vO.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const r=this.dot(e)/t;return Math.acos(Lf(r,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,r=this.y-e.y,s=this.z-e.z;return t*t+r*r+s*s}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,r){const s=Math.sin(t)*e;return this.x=s*Math.sin(r),this.y=Math.cos(t)*e,this.z=s*Math.cos(r),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,r){return this.x=e*Math.sin(t),this.y=r,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(),r=this.setFromMatrixColumn(e,1).length(),s=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=r,this.z=s,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,t=Math.random()*2-1,r=Math.sqrt(1-t*t);return this.x=r*Math.cos(e),this.y=t,this.z=r*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const vO=new Pt,_5=new Pu;class Cv{constructor(e=new Pt(1/0,1/0,1/0),t=new Pt(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,r=e.length;tthis.max.x||e.ythis.max.y||e.zthis.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.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,Gg),Gg.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,r;return e.normal.x>0?(t=e.normal.x*this.min.x,r=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,r=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,r+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,r+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,r+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,r+=e.normal.z*this.min.z),t<=-e.constant&&r>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(jE),dM.subVectors(this.max,jE),XT.subVectors(e.a,jE),KT.subVectors(e.b,jE),JT.subVectors(e.c,jE),Kv.subVectors(KT,XT),Jv.subVectors(JT,KT),Bb.subVectors(XT,JT);let t=[0,-Kv.z,Kv.y,0,-Jv.z,Jv.y,0,-Bb.z,Bb.y,Kv.z,0,-Kv.x,Jv.z,0,-Jv.x,Bb.z,0,-Bb.x,-Kv.y,Kv.x,0,-Jv.y,Jv.x,0,-Bb.y,Bb.x,0];return!yO(t,XT,KT,JT,dM)||(t=[1,0,0,0,1,0,0,0,1],!yO(t,XT,KT,JT,dM))?!1:(fM.crossVectors(Kv,Jv),t=[fM.x,fM.y,fM.z],yO(t,XT,KT,JT,dM))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Gg).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Gg).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(V_[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),V_[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),V_[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),V_[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),V_[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),V_[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),V_[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),V_[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(V_),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const V_=[new Pt,new Pt,new Pt,new Pt,new Pt,new Pt,new Pt,new Pt],Gg=new Pt,hM=new Cv,XT=new Pt,KT=new Pt,JT=new Pt,Kv=new Pt,Jv=new Pt,Bb=new Pt,jE=new Pt,dM=new Pt,fM=new Pt,Fb=new Pt;function yO(n,e,t,r,s){for(let o=0,l=n.length-3;o<=l;o+=3){Fb.fromArray(n,o);const u=s.x*Math.abs(Fb.x)+s.y*Math.abs(Fb.y)+s.z*Math.abs(Fb.z),h=e.dot(Fb),f=t.dot(Fb),g=r.dot(Fb);if(Math.max(-Math.max(h,f,g),Math.min(h,f,g))>u)return!1}return!0}const aae=new Cv,YE=new Pt,bO=new Pt;class v_{constructor(e=new Pt,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const r=this.center;t!==void 0?r.copy(t):aae.setFromPoints(e).getCenter(r);let s=0;for(let o=0,l=e.length;othis.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){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;YE.subVectors(e,this.center);const t=YE.lengthSq();if(t>this.radius*this.radius){const r=Math.sqrt(t),s=(r-this.radius)*.5;this.center.addScaledVector(YE,s/r),this.radius+=s}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(bO.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(YE.copy(e.center).add(bO)),this.expandByPoint(YE.copy(e.center).sub(bO))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const j_=new Pt,TO=new Pt,pM=new Pt,qv=new Pt,SO=new Pt,mM=new Pt,wO=new Pt;class lk{constructor(e=new Pt,t=new Pt(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,j_)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const r=t.dot(this.direction);return r<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,r)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=j_.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(j_.copy(this.origin).addScaledVector(this.direction,t),j_.distanceToSquared(e))}distanceSqToSegment(e,t,r,s){TO.copy(e).add(t).multiplyScalar(.5),pM.copy(t).sub(e).normalize(),qv.copy(this.origin).sub(TO);const o=e.distanceTo(t)*.5,l=-this.direction.dot(pM),u=qv.dot(this.direction),h=-qv.dot(pM),f=qv.lengthSq(),g=Math.abs(1-l*l);let y,b,w,C;if(g>0)if(y=l*h-u,b=l*u-h,C=o*g,y>=0)if(b>=-C)if(b<=C){const M=1/g;y*=M,b*=M,w=y*(y+l*b+2*u)+b*(l*y+b+2*h)+f}else b=o,y=Math.max(0,-(l*b+u)),w=-y*y+b*(b+2*h)+f;else b=-o,y=Math.max(0,-(l*b+u)),w=-y*y+b*(b+2*h)+f;else b<=-C?(y=Math.max(0,-(-l*o+u)),b=y>0?-o:Math.min(Math.max(-o,-h),o),w=-y*y+b*(b+2*h)+f):b<=C?(y=0,b=Math.min(Math.max(-o,-h),o),w=b*(b+2*h)+f):(y=Math.max(0,-(l*o+u)),b=y>0?o:Math.min(Math.max(-o,-h),o),w=-y*y+b*(b+2*h)+f);else b=l>0?-o:o,y=Math.max(0,-(l*b+u)),w=-y*y+b*(b+2*h)+f;return r&&r.copy(this.origin).addScaledVector(this.direction,y),s&&s.copy(TO).addScaledVector(pM,b),w}intersectSphere(e,t){j_.subVectors(e.center,this.origin);const r=j_.dot(this.direction),s=j_.dot(j_)-r*r,o=e.radius*e.radius;if(s>o)return null;const l=Math.sqrt(o-s),u=r-l,h=r+l;return h<0?null:u<0?this.at(h,t):this.at(u,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const r=-(this.origin.dot(e.normal)+e.constant)/t;return r>=0?r:null}intersectPlane(e,t){const r=this.distanceToPlane(e);return r===null?null:this.at(r,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let r,s,o,l,u,h;const f=1/this.direction.x,g=1/this.direction.y,y=1/this.direction.z,b=this.origin;return f>=0?(r=(e.min.x-b.x)*f,s=(e.max.x-b.x)*f):(r=(e.max.x-b.x)*f,s=(e.min.x-b.x)*f),g>=0?(o=(e.min.y-b.y)*g,l=(e.max.y-b.y)*g):(o=(e.max.y-b.y)*g,l=(e.min.y-b.y)*g),r>l||o>s||((o>r||isNaN(r))&&(r=o),(l=0?(u=(e.min.z-b.z)*y,h=(e.max.z-b.z)*y):(u=(e.max.z-b.z)*y,h=(e.min.z-b.z)*y),r>h||u>s)||((u>r||r!==r)&&(r=u),(h=0?r:s,t)}intersectsBox(e){return this.intersectBox(e,j_)!==null}intersectTriangle(e,t,r,s,o){SO.subVectors(t,e),mM.subVectors(r,e),wO.crossVectors(SO,mM);let l=this.direction.dot(wO),u;if(l>0){if(s)return null;u=1}else if(l<0)u=-1,l=-l;else return null;qv.subVectors(this.origin,e);const h=u*this.direction.dot(mM.crossVectors(qv,mM));if(h<0)return null;const f=u*this.direction.dot(SO.cross(qv));if(f<0||h+f>l)return null;const g=-u*qv.dot(wO);return g<0?null:this.at(g/l,o)}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 Ys{constructor(e,t,r,s,o,l,u,h,f,g,y,b,w,C,M,A){Ys.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,r,s,o,l,u,h,f,g,y,b,w,C,M,A)}set(e,t,r,s,o,l,u,h,f,g,y,b,w,C,M,A){const k=this.elements;return k[0]=e,k[4]=t,k[8]=r,k[12]=s,k[1]=o,k[5]=l,k[9]=u,k[13]=h,k[2]=f,k[6]=g,k[10]=y,k[14]=b,k[3]=w,k[7]=C,k[11]=M,k[15]=A,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 Ys().fromArray(this.elements)}copy(e){const t=this.elements,r=e.elements;return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],t[9]=r[9],t[10]=r[10],t[11]=r[11],t[12]=r[12],t[13]=r[13],t[14]=r[14],t[15]=r[15],this}copyPosition(e){const t=this.elements,r=e.elements;return t[12]=r[12],t[13]=r[13],t[14]=r[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,r){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),r.setFromMatrixColumn(this,2),this}makeBasis(e,t,r){return this.set(e.x,t.x,r.x,0,e.y,t.y,r.y,0,e.z,t.z,r.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,r=e.elements,s=1/qT.setFromMatrixColumn(e,0).length(),o=1/qT.setFromMatrixColumn(e,1).length(),l=1/qT.setFromMatrixColumn(e,2).length();return t[0]=r[0]*s,t[1]=r[1]*s,t[2]=r[2]*s,t[3]=0,t[4]=r[4]*o,t[5]=r[5]*o,t[6]=r[6]*o,t[7]=0,t[8]=r[8]*l,t[9]=r[9]*l,t[10]=r[10]*l,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,r=e.x,s=e.y,o=e.z,l=Math.cos(r),u=Math.sin(r),h=Math.cos(s),f=Math.sin(s),g=Math.cos(o),y=Math.sin(o);if(e.order==="XYZ"){const b=l*g,w=l*y,C=u*g,M=u*y;t[0]=h*g,t[4]=-h*y,t[8]=f,t[1]=w+C*f,t[5]=b-M*f,t[9]=-u*h,t[2]=M-b*f,t[6]=C+w*f,t[10]=l*h}else if(e.order==="YXZ"){const b=h*g,w=h*y,C=f*g,M=f*y;t[0]=b+M*u,t[4]=C*u-w,t[8]=l*f,t[1]=l*y,t[5]=l*g,t[9]=-u,t[2]=w*u-C,t[6]=M+b*u,t[10]=l*h}else if(e.order==="ZXY"){const b=h*g,w=h*y,C=f*g,M=f*y;t[0]=b-M*u,t[4]=-l*y,t[8]=C+w*u,t[1]=w+C*u,t[5]=l*g,t[9]=M-b*u,t[2]=-l*f,t[6]=u,t[10]=l*h}else if(e.order==="ZYX"){const b=l*g,w=l*y,C=u*g,M=u*y;t[0]=h*g,t[4]=C*f-w,t[8]=b*f+M,t[1]=h*y,t[5]=M*f+b,t[9]=w*f-C,t[2]=-f,t[6]=u*h,t[10]=l*h}else if(e.order==="YZX"){const b=l*h,w=l*f,C=u*h,M=u*f;t[0]=h*g,t[4]=M-b*y,t[8]=C*y+w,t[1]=y,t[5]=l*g,t[9]=-u*g,t[2]=-f*g,t[6]=w*y+C,t[10]=b-M*y}else if(e.order==="XZY"){const b=l*h,w=l*f,C=u*h,M=u*f;t[0]=h*g,t[4]=-y,t[8]=f*g,t[1]=b*y+M,t[5]=l*g,t[9]=w*y-C,t[2]=C*y-w,t[6]=u*g,t[10]=M*y+b}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(lae,e,uae)}lookAt(e,t,r){const s=this.elements;return Em.subVectors(e,t),Em.lengthSq()===0&&(Em.z=1),Em.normalize(),Qv.crossVectors(r,Em),Qv.lengthSq()===0&&(Math.abs(r.z)===1?Em.x+=1e-4:Em.z+=1e-4,Em.normalize(),Qv.crossVectors(r,Em)),Qv.normalize(),gM.crossVectors(Em,Qv),s[0]=Qv.x,s[4]=gM.x,s[8]=Em.x,s[1]=Qv.y,s[5]=gM.y,s[9]=Em.y,s[2]=Qv.z,s[6]=gM.z,s[10]=Em.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const r=e.elements,s=t.elements,o=this.elements,l=r[0],u=r[4],h=r[8],f=r[12],g=r[1],y=r[5],b=r[9],w=r[13],C=r[2],M=r[6],A=r[10],k=r[14],L=r[3],P=r[7],D=r[11],z=r[15],U=s[0],V=s[4],H=s[8],oe=s[12],le=s[1],Z=s[5],q=s[9],he=s[13],ae=s[2],ue=s[6],ge=s[10],we=s[14],J=s[3],re=s[7],se=s[11],fe=s[15];return o[0]=l*U+u*le+h*ae+f*J,o[4]=l*V+u*Z+h*ue+f*re,o[8]=l*H+u*q+h*ge+f*se,o[12]=l*oe+u*he+h*we+f*fe,o[1]=g*U+y*le+b*ae+w*J,o[5]=g*V+y*Z+b*ue+w*re,o[9]=g*H+y*q+b*ge+w*se,o[13]=g*oe+y*he+b*we+w*fe,o[2]=C*U+M*le+A*ae+k*J,o[6]=C*V+M*Z+A*ue+k*re,o[10]=C*H+M*q+A*ge+k*se,o[14]=C*oe+M*he+A*we+k*fe,o[3]=L*U+P*le+D*ae+z*J,o[7]=L*V+P*Z+D*ue+z*re,o[11]=L*H+P*q+D*ge+z*se,o[15]=L*oe+P*he+D*we+z*fe,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],r=e[4],s=e[8],o=e[12],l=e[1],u=e[5],h=e[9],f=e[13],g=e[2],y=e[6],b=e[10],w=e[14],C=e[3],M=e[7],A=e[11],k=e[15];return C*(+o*h*y-s*f*y-o*u*b+r*f*b+s*u*w-r*h*w)+M*(+t*h*w-t*f*b+o*l*b-s*l*w+s*f*g-o*h*g)+A*(+t*f*y-t*u*w-o*l*y+r*l*w+o*u*g-r*f*g)+k*(-s*u*g-t*h*y+t*u*b+s*l*y-r*l*b+r*h*g)}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,r){const s=this.elements;return e.isVector3?(s[12]=e.x,s[13]=e.y,s[14]=e.z):(s[12]=e,s[13]=t,s[14]=r),this}invert(){const e=this.elements,t=e[0],r=e[1],s=e[2],o=e[3],l=e[4],u=e[5],h=e[6],f=e[7],g=e[8],y=e[9],b=e[10],w=e[11],C=e[12],M=e[13],A=e[14],k=e[15],L=y*A*f-M*b*f+M*h*w-u*A*w-y*h*k+u*b*k,P=C*b*f-g*A*f-C*h*w+l*A*w+g*h*k-l*b*k,D=g*M*f-C*y*f+C*u*w-l*M*w-g*u*k+l*y*k,z=C*y*h-g*M*h-C*u*b+l*M*b+g*u*A-l*y*A,U=t*L+r*P+s*D+o*z;if(U===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const V=1/U;return e[0]=L*V,e[1]=(M*b*o-y*A*o-M*s*w+r*A*w+y*s*k-r*b*k)*V,e[2]=(u*A*o-M*h*o+M*s*f-r*A*f-u*s*k+r*h*k)*V,e[3]=(y*h*o-u*b*o-y*s*f+r*b*f+u*s*w-r*h*w)*V,e[4]=P*V,e[5]=(g*A*o-C*b*o+C*s*w-t*A*w-g*s*k+t*b*k)*V,e[6]=(C*h*o-l*A*o-C*s*f+t*A*f+l*s*k-t*h*k)*V,e[7]=(l*b*o-g*h*o+g*s*f-t*b*f-l*s*w+t*h*w)*V,e[8]=D*V,e[9]=(C*y*o-g*M*o-C*r*w+t*M*w+g*r*k-t*y*k)*V,e[10]=(l*M*o-C*u*o+C*r*f-t*M*f-l*r*k+t*u*k)*V,e[11]=(g*u*o-l*y*o-g*r*f+t*y*f+l*r*w-t*u*w)*V,e[12]=z*V,e[13]=(g*M*s-C*y*s+C*r*b-t*M*b-g*r*A+t*y*A)*V,e[14]=(C*u*s-l*M*s-C*r*h+t*M*h+l*r*A-t*u*A)*V,e[15]=(l*y*s-g*u*s+g*r*h-t*y*h-l*r*b+t*u*b)*V,this}scale(e){const t=this.elements,r=e.x,s=e.y,o=e.z;return t[0]*=r,t[4]*=s,t[8]*=o,t[1]*=r,t[5]*=s,t[9]*=o,t[2]*=r,t[6]*=s,t[10]*=o,t[3]*=r,t[7]*=s,t[11]*=o,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],r=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],s=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,r,s))}makeTranslation(e,t,r){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,r,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),r=Math.sin(e);return this.set(1,0,0,0,0,t,-r,0,0,r,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),r=Math.sin(e);return this.set(t,0,r,0,0,1,0,0,-r,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),r=Math.sin(e);return this.set(t,-r,0,0,r,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const r=Math.cos(t),s=Math.sin(t),o=1-r,l=e.x,u=e.y,h=e.z,f=o*l,g=o*u;return this.set(f*l+r,f*u-s*h,f*h+s*u,0,f*u+s*h,g*u+r,g*h-s*l,0,f*h-s*u,g*h+s*l,o*h*h+r,0,0,0,0,1),this}makeScale(e,t,r){return this.set(e,0,0,0,0,t,0,0,0,0,r,0,0,0,0,1),this}makeShear(e,t,r,s,o,l){return this.set(1,r,o,0,e,1,l,0,t,s,1,0,0,0,0,1),this}compose(e,t,r){const s=this.elements,o=t._x,l=t._y,u=t._z,h=t._w,f=o+o,g=l+l,y=u+u,b=o*f,w=o*g,C=o*y,M=l*g,A=l*y,k=u*y,L=h*f,P=h*g,D=h*y,z=r.x,U=r.y,V=r.z;return s[0]=(1-(M+k))*z,s[1]=(w+D)*z,s[2]=(C-P)*z,s[3]=0,s[4]=(w-D)*U,s[5]=(1-(b+k))*U,s[6]=(A+L)*U,s[7]=0,s[8]=(C+P)*V,s[9]=(A-L)*V,s[10]=(1-(b+M))*V,s[11]=0,s[12]=e.x,s[13]=e.y,s[14]=e.z,s[15]=1,this}decompose(e,t,r){const s=this.elements;let o=qT.set(s[0],s[1],s[2]).length();const l=qT.set(s[4],s[5],s[6]).length(),u=qT.set(s[8],s[9],s[10]).length();this.determinant()<0&&(o=-o),e.x=s[12],e.y=s[13],e.z=s[14],Wg.copy(this);const f=1/o,g=1/l,y=1/u;return Wg.elements[0]*=f,Wg.elements[1]*=f,Wg.elements[2]*=f,Wg.elements[4]*=g,Wg.elements[5]*=g,Wg.elements[6]*=g,Wg.elements[8]*=y,Wg.elements[9]*=y,Wg.elements[10]*=y,t.setFromRotationMatrix(Wg),r.x=o,r.y=l,r.z=u,this}makePerspective(e,t,r,s,o,l,u=T1){const h=this.elements,f=2*o/(t-e),g=2*o/(r-s),y=(t+e)/(t-e),b=(r+s)/(r-s);let w,C;if(u===T1)w=-(l+o)/(l-o),C=-2*l*o/(l-o);else if(u===RD)w=-l/(l-o),C=-l*o/(l-o);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+u);return h[0]=f,h[4]=0,h[8]=y,h[12]=0,h[1]=0,h[5]=g,h[9]=b,h[13]=0,h[2]=0,h[6]=0,h[10]=w,h[14]=C,h[3]=0,h[7]=0,h[11]=-1,h[15]=0,this}makeOrthographic(e,t,r,s,o,l,u=T1){const h=this.elements,f=1/(t-e),g=1/(r-s),y=1/(l-o),b=(t+e)*f,w=(r+s)*g;let C,M;if(u===T1)C=(l+o)*y,M=-2*y;else if(u===RD)C=o*y,M=-1*y;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+u);return h[0]=2*f,h[4]=0,h[8]=0,h[12]=-b,h[1]=0,h[5]=2*g,h[9]=0,h[13]=-w,h[2]=0,h[6]=0,h[10]=M,h[14]=-C,h[3]=0,h[7]=0,h[11]=0,h[15]=1,this}equals(e){const t=this.elements,r=e.elements;for(let s=0;s<16;s++)if(t[s]!==r[s])return!1;return!0}fromArray(e,t=0){for(let r=0;r<16;r++)this.elements[r]=e[r+t];return this}toArray(e=[],t=0){const r=this.elements;return e[t]=r[0],e[t+1]=r[1],e[t+2]=r[2],e[t+3]=r[3],e[t+4]=r[4],e[t+5]=r[5],e[t+6]=r[6],e[t+7]=r[7],e[t+8]=r[8],e[t+9]=r[9],e[t+10]=r[10],e[t+11]=r[11],e[t+12]=r[12],e[t+13]=r[13],e[t+14]=r[14],e[t+15]=r[15],e}}const qT=new Pt,Wg=new Ys,lae=new Pt(0,0,0),uae=new Pt(1,1,1),Qv=new Pt,gM=new Pt,Em=new Pt,v5=new Ys,y5=new Pu;class oT{constructor(e=0,t=0,r=0,s=oT.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=r,this._order=s}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,r,s=this._order){return this._x=e,this._y=t,this._z=r,this._order=s,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,r=!0){const s=e.elements,o=s[0],l=s[4],u=s[8],h=s[1],f=s[5],g=s[9],y=s[2],b=s[6],w=s[10];switch(t){case"XYZ":this._y=Math.asin(Lf(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(-g,w),this._z=Math.atan2(-l,o)):(this._x=Math.atan2(b,f),this._z=0);break;case"YXZ":this._x=Math.asin(-Lf(g,-1,1)),Math.abs(g)<.9999999?(this._y=Math.atan2(u,w),this._z=Math.atan2(h,f)):(this._y=Math.atan2(-y,o),this._z=0);break;case"ZXY":this._x=Math.asin(Lf(b,-1,1)),Math.abs(b)<.9999999?(this._y=Math.atan2(-y,w),this._z=Math.atan2(-l,f)):(this._y=0,this._z=Math.atan2(h,o));break;case"ZYX":this._y=Math.asin(-Lf(y,-1,1)),Math.abs(y)<.9999999?(this._x=Math.atan2(b,w),this._z=Math.atan2(h,o)):(this._x=0,this._z=Math.atan2(-l,f));break;case"YZX":this._z=Math.asin(Lf(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(-g,f),this._y=Math.atan2(-y,o)):(this._x=0,this._y=Math.atan2(u,w));break;case"XZY":this._z=Math.asin(-Lf(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(b,f),this._y=Math.atan2(u,o)):(this._x=Math.atan2(-g,w),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,r===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,r){return v5.makeRotationFromQuaternion(e),this.setFromRotationMatrix(v5,t,r)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return y5.setFromEuler(this),this.setFromQuaternion(y5,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}oT.DEFAULT_ORDER="XYZ";class iI{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let t=0;t1){for(let r=0;r0&&(s.userData=this.userData),s.layers=this.layers.mask,s.matrix=this.matrix.toArray(),s.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(s.matrixAutoUpdate=!1),this.isInstancedMesh&&(s.type="InstancedMesh",s.count=this.count,s.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(s.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(s.type="BatchedMesh",s.perObjectFrustumCulled=this.perObjectFrustumCulled,s.sortObjects=this.sortObjects,s.drawRanges=this._drawRanges,s.reservedRanges=this._reservedRanges,s.visibility=this._visibility,s.active=this._active,s.bounds=this._bounds.map(u=>({boxInitialized:u.boxInitialized,boxMin:u.box.min.toArray(),boxMax:u.box.max.toArray(),sphereInitialized:u.sphereInitialized,sphereRadius:u.sphere.radius,sphereCenter:u.sphere.center.toArray()})),s.maxGeometryCount=this._maxGeometryCount,s.maxVertexCount=this._maxVertexCount,s.maxIndexCount=this._maxIndexCount,s.geometryInitialized=this._geometryInitialized,s.geometryCount=this._geometryCount,s.matricesTexture=this._matricesTexture.toJSON(e),this.boundingSphere!==null&&(s.boundingSphere={center:s.boundingSphere.center.toArray(),radius:s.boundingSphere.radius}),this.boundingBox!==null&&(s.boundingBox={min:s.boundingBox.min.toArray(),max:s.boundingBox.max.toArray()}));function o(u,h){return u[h.uuid]===void 0&&(u[h.uuid]=h.toJSON(e)),h.uuid}if(this.isScene)this.background&&(this.background.isColor?s.background=this.background.toJSON():this.background.isTexture&&(s.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(s.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){s.geometry=o(e.geometries,this.geometry);const u=this.geometry.parameters;if(u!==void 0&&u.shapes!==void 0){const h=u.shapes;if(Array.isArray(h))for(let f=0,g=h.length;f0){s.children=[];for(let u=0;u0){s.animations=[];for(let u=0;u0&&(r.geometries=u),h.length>0&&(r.materials=h),f.length>0&&(r.textures=f),g.length>0&&(r.images=g),y.length>0&&(r.shapes=y),b.length>0&&(r.skeletons=b),w.length>0&&(r.animations=w),C.length>0&&(r.nodes=C)}return r.object=s,r;function l(u){const h=[];for(const f in u){const g=u[f];delete g.metadata,h.push(g)}return h}}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.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let r=0;r0?s.multiplyScalar(1/Math.sqrt(o)):s.set(0,0,0)}static getBarycoord(e,t,r,s,o){Vg.subVectors(s,t),X_.subVectors(r,t),$O.subVectors(e,t);const l=Vg.dot(Vg),u=Vg.dot(X_),h=Vg.dot($O),f=X_.dot(X_),g=X_.dot($O),y=l*f-u*u;if(y===0)return o.set(0,0,0),null;const b=1/y,w=(f*h-u*g)*b,C=(l*g-u*h)*b;return o.set(1-w-C,C,w)}static containsPoint(e,t,r,s){return this.getBarycoord(e,t,r,s,K_)===null?!1:K_.x>=0&&K_.y>=0&&K_.x+K_.y<=1}static getInterpolation(e,t,r,s,o,l,u,h){return this.getBarycoord(e,t,r,s,K_)===null?(h.x=0,h.y=0,"z"in h&&(h.z=0),"w"in h&&(h.w=0),null):(h.setScalar(0),h.addScaledVector(o,K_.x),h.addScaledVector(l,K_.y),h.addScaledVector(u,K_.z),h)}static isFrontFacing(e,t,r,s){return Vg.subVectors(r,t),X_.subVectors(e,t),Vg.cross(X_).dot(s)<0}set(e,t,r){return this.a.copy(e),this.b.copy(t),this.c.copy(r),this}setFromPointsAndIndices(e,t,r,s){return this.a.copy(e[t]),this.b.copy(e[r]),this.c.copy(e[s]),this}setFromAttributeAndIndices(e,t,r,s){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,r),this.c.fromBufferAttribute(e,s),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 Vg.subVectors(this.c,this.b),X_.subVectors(this.a,this.b),Vg.cross(X_).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return t_.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return t_.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,r,s,o){return t_.getInterpolation(e,this.a,this.b,this.c,t,r,s,o)}containsPoint(e){return t_.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return t_.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const r=this.a,s=this.b,o=this.c;let l,u;ZT.subVectors(s,r),eS.subVectors(o,r),CO.subVectors(e,r);const h=ZT.dot(CO),f=eS.dot(CO);if(h<=0&&f<=0)return t.copy(r);MO.subVectors(e,s);const g=ZT.dot(MO),y=eS.dot(MO);if(g>=0&&y<=g)return t.copy(s);const b=h*y-g*f;if(b<=0&&h>=0&&g<=0)return l=h/(h-g),t.copy(r).addScaledVector(ZT,l);AO.subVectors(e,o);const w=ZT.dot(AO),C=eS.dot(AO);if(C>=0&&w<=C)return t.copy(o);const M=w*f-h*C;if(M<=0&&f>=0&&C<=0)return u=f/(f-C),t.copy(r).addScaledVector(eS,u);const A=g*C-w*y;if(A<=0&&y-g>=0&&w-C>=0)return E5.subVectors(o,s),u=(y-g)/(y-g+(w-C)),t.copy(s).addScaledVector(E5,u);const k=1/(A+M+b);return l=M*k,u=b*k,t.copy(r).addScaledVector(ZT,l).addScaledVector(eS,u)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const cX={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},Zv={h:0,s:0,l:0},vM={h:0,s:0,l:0};function IO(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*6*(2/3-t):n}class Ph{constructor(e,t,r){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,r)}set(e,t,r){if(t===void 0&&r===void 0){const s=e;s&&s.isColor?this.copy(s):typeof s=="number"?this.setHex(s):typeof s=="string"&&this.setStyle(s)}else this.setRGB(e,t,r);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=my){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Hg.toWorkingColorSpace(this,t),this}setRGB(e,t,r,s=Hg.workingColorSpace){return this.r=e,this.g=t,this.b=r,Hg.toWorkingColorSpace(this,s),this}setHSL(e,t,r,s=Hg.workingColorSpace){if(e=V3(e,1),t=Lf(t,0,1),r=Lf(r,0,1),t===0)this.r=this.g=this.b=r;else{const o=r<=.5?r*(1+t):r+t-r*t,l=2*r-o;this.r=IO(l,o,e+1/3),this.g=IO(l,o,e),this.b=IO(l,o,e-1/3)}return Hg.toWorkingColorSpace(this,s),this}setStyle(e,t=my){function r(o){o!==void 0&&parseFloat(o)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let s;if(s=/^(\w+)\(([^\)]*)\)/.exec(e)){let o;const l=s[1],u=s[2];switch(l){case"rgb":case"rgba":if(o=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(u))return r(o[4]),this.setRGB(Math.min(255,parseInt(o[1],10))/255,Math.min(255,parseInt(o[2],10))/255,Math.min(255,parseInt(o[3],10))/255,t);if(o=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(u))return r(o[4]),this.setRGB(Math.min(100,parseInt(o[1],10))/100,Math.min(100,parseInt(o[2],10))/100,Math.min(100,parseInt(o[3],10))/100,t);break;case"hsl":case"hsla":if(o=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(u))return r(o[4]),this.setHSL(parseFloat(o[1])/360,parseFloat(o[2])/100,parseFloat(o[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(s=/^\#([A-Fa-f\d]+)$/.exec(e)){const o=s[1],l=o.length;if(l===3)return this.setRGB(parseInt(o.charAt(0),16)/15,parseInt(o.charAt(1),16)/15,parseInt(o.charAt(2),16)/15,t);if(l===6)return this.setHex(parseInt(o,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=my){const r=cX[e.toLowerCase()];return r!==void 0?this.setHex(r,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=dw(e.r),this.g=dw(e.g),this.b=dw(e.b),this}copyLinearToSRGB(e){return this.r=gO(e.r),this.g=gO(e.g),this.b=gO(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=my){return Hg.fromWorkingColorSpace($f.copy(this),e),Math.round(Lf($f.r*255,0,255))*65536+Math.round(Lf($f.g*255,0,255))*256+Math.round(Lf($f.b*255,0,255))}getHexString(e=my){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=Hg.workingColorSpace){Hg.fromWorkingColorSpace($f.copy(this),t);const r=$f.r,s=$f.g,o=$f.b,l=Math.max(r,s,o),u=Math.min(r,s,o);let h,f;const g=(u+l)/2;if(u===l)h=0,f=0;else{const y=l-u;switch(f=g<=.5?y/(l+u):y/(2-l-u),l){case r:h=(s-o)/y+(s0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const r=e[t];if(r===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const s=this[t];if(s===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}s&&s.isColor?s.set(r):s&&s.isVector3&&r&&r.isVector3?s.copy(r):this[t]=r}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const r={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.color&&this.color.isColor&&(r.color=this.color.getHex()),this.roughness!==void 0&&(r.roughness=this.roughness),this.metalness!==void 0&&(r.metalness=this.metalness),this.sheen!==void 0&&(r.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(r.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(r.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(r.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(r.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(r.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(r.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(r.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(r.shininess=this.shininess),this.clearcoat!==void 0&&(r.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(r.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(r.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(r.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(r.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,r.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.iridescence!==void 0&&(r.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(r.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(r.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(r.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(r.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(r.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(r.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(r.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(r.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(r.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(r.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(r.lightMap=this.lightMap.toJSON(e).uuid,r.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(r.aoMap=this.aoMap.toJSON(e).uuid,r.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(r.bumpMap=this.bumpMap.toJSON(e).uuid,r.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(r.normalMap=this.normalMap.toJSON(e).uuid,r.normalMapType=this.normalMapType,r.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(r.displacementMap=this.displacementMap.toJSON(e).uuid,r.displacementScale=this.displacementScale,r.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(r.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(r.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(r.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(r.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(r.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(r.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(r.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(r.combine=this.combine)),this.envMapRotation!==void 0&&(r.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(r.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(r.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(r.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(r.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(r.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(r.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(r.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(r.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(r.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(r.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(r.size=this.size),this.shadowSide!==null&&(r.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(r.sizeAttenuation=this.sizeAttenuation),this.blending!==ZU&&(r.blending=this.blending),this.side!==nR&&(r.side=this.side),this.vertexColors===!0&&(r.vertexColors=!0),this.opacity<1&&(r.opacity=this.opacity),this.transparent===!0&&(r.transparent=!0),this.blendSrc!==t5&&(r.blendSrc=this.blendSrc),this.blendDst!==n5&&(r.blendDst=this.blendDst),this.blendEquation!==e5&&(r.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(r.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(r.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(r.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(r.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(r.blendAlpha=this.blendAlpha),this.depthFunc!==r5&&(r.depthFunc=this.depthFunc),this.depthTest===!1&&(r.depthTest=this.depthTest),this.depthWrite===!1&&(r.depthWrite=this.depthWrite),this.colorWrite===!1&&(r.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(r.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==d5&&(r.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(r.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(r.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==jT&&(r.stencilFail=this.stencilFail),this.stencilZFail!==jT&&(r.stencilZFail=this.stencilZFail),this.stencilZPass!==jT&&(r.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(r.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(r.rotation=this.rotation),this.polygonOffset===!0&&(r.polygonOffset=!0),this.polygonOffsetFactor!==0&&(r.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(r.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(r.linewidth=this.linewidth),this.dashSize!==void 0&&(r.dashSize=this.dashSize),this.gapSize!==void 0&&(r.gapSize=this.gapSize),this.scale!==void 0&&(r.scale=this.scale),this.dithering===!0&&(r.dithering=!0),this.alphaTest>0&&(r.alphaTest=this.alphaTest),this.alphaHash===!0&&(r.alphaHash=!0),this.alphaToCoverage===!0&&(r.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(r.premultipliedAlpha=!0),this.forceSinglePass===!0&&(r.forceSinglePass=!0),this.wireframe===!0&&(r.wireframe=!0),this.wireframeLinewidth>1&&(r.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(r.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(r.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(r.flatShading=!0),this.visible===!1&&(r.visible=!1),this.toneMapped===!1&&(r.toneMapped=!1),this.fog===!1&&(r.fog=!1),Object.keys(this.userData).length>0&&(r.userData=this.userData);function s(o){const l=[];for(const u in o){const h=o[u];delete h.metadata,l.push(h)}return l}if(t){const o=s(e.textures),l=s(e.images);o.length>0&&(r.textures=o),l.length>0&&(r.images=l)}return r}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let r=null;if(t!==null){const s=t.length;r=new Array(s);for(let o=0;o!==s;++o)r[o]=t[o].clone()}return this.clippingPlanes=r,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}class qS extends Dy{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Ph(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new oT,this.combine=xoe,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const Ih=new Pt,yM=new cc;class Nm{constructor(e,t,r=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=r,this.usage=ID,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=H3,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return uX("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,r){e*=this.itemSize,r*=t.itemSize;for(let s=0,o=this.itemSize;s0&&(e.userData=this.userData),this.parameters!==void 0){const h=this.parameters;for(const f in h)h[f]!==void 0&&(e[f]=h[f]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const r=this.attributes;for(const h in r){const f=r[h];e.data.attributes[h]=f.toJSON(e.data)}const s={};let o=!1;for(const h in this.morphAttributes){const f=this.morphAttributes[h],g=[];for(let y=0,b=f.length;y0&&(s[h]=g,o=!0)}o&&(e.data.morphAttributes=s,e.data.morphTargetsRelative=this.morphTargetsRelative);const l=this.groups;l.length>0&&(e.data.groups=JSON.parse(JSON.stringify(l)));const u=this.boundingSphere;return u!==null&&(e.data.boundingSphere={center:u.center.toArray(),radius:u.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 r=e.index;r!==null&&this.setIndex(r.clone(t));const s=e.attributes;for(const f in s){const g=s[f];this.setAttribute(f,g.clone(t))}const o=e.morphAttributes;for(const f in o){const g=[],y=o[f];for(let b=0,w=y.length;b0){const s=t[r[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,l=s.length;o(e.far-e.near)**2))&&(x5.copy(o).invert(),zb.copy(e.ray).applyMatrix4(x5),!(r.boundingBox!==null&&zb.intersectsBox(r.boundingBox)===!1)&&this._computeIntersections(e,t,zb)))}_computeIntersections(e,t,r){let s;const o=this.geometry,l=this.material,u=o.index,h=o.attributes.position,f=o.attributes.uv,g=o.attributes.uv1,y=o.attributes.normal,b=o.groups,w=o.drawRange;if(u!==null)if(Array.isArray(l))for(let C=0,M=b.length;Ct.far?null:{distance:f,point:$M.clone(),object:n}}function CM(n,e,t,r,s,o,l,u,h,f){n.getVertexPosition(u,nS),n.getVertexPosition(h,rS),n.getVertexPosition(f,iS);const g=yae(n,e,t,r,nS,rS,iS,xM);if(g){s&&(SM.fromBufferAttribute(s,u),wM.fromBufferAttribute(s,h),EM.fromBufferAttribute(s,f),g.uv=t_.getInterpolation(xM,nS,rS,iS,SM,wM,EM,new cc)),o&&(SM.fromBufferAttribute(o,u),wM.fromBufferAttribute(o,h),EM.fromBufferAttribute(o,f),g.uv1=t_.getInterpolation(xM,nS,rS,iS,SM,wM,EM,new cc)),l&&(C5.fromBufferAttribute(l,u),M5.fromBufferAttribute(l,h),A5.fromBufferAttribute(l,f),g.normal=t_.getInterpolation(xM,nS,rS,iS,C5,M5,A5,new Pt),g.normal.dot(r.direction)>0&&g.normal.multiplyScalar(-1));const y={a:u,b:h,c:f,normal:new Pt,materialIndex:0};t_.getNormal(nS,rS,iS,y.normal),g.face=y}return g}class hX extends dh{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Ys,this.projectionMatrix=new Ys,this.projectionMatrixInverse=new Ys,this.coordinateSystem=T1}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.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)}}const ey=new Pt,I5=new cc,R5=new cc;class Y3 extends hX{constructor(e=50,t=1,r=.1,s=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=r,this.far=s,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=$$*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(Xx*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return $$*2*Math.atan(Math.tan(Xx*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,r){ey.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(ey.x,ey.y).multiplyScalar(-e/ey.z),ey.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),r.set(ey.x,ey.y).multiplyScalar(-e/ey.z)}getViewSize(e,t){return this.getViewBounds(e,I5,R5),t.subVectors(R5,I5)}setViewOffset(e,t,r,s,o,l){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=r,this.view.offsetY=s,this.view.width=o,this.view.height=l,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(Xx*.5*this.fov)/this.zoom,r=2*t,s=this.aspect*r,o=-.5*s;const l=this.view;if(this.view!==null&&this.view.enabled){const h=l.fullWidth,f=l.fullHeight;o+=l.offsetX*s/h,t-=l.offsetY*r/f,s*=l.width/h,r*=l.height/f}const u=this.filmOffset;u!==0&&(o+=e*u/this.getFilmWidth()),this.projectionMatrix.makePerspective(o,o+s,t,t-r,e,this.far,this.coordinateSystem),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,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}const OO=new Pt,bae=new Pt,Tae=new $v;class sS{constructor(e=new Pt(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,r,s){return this.normal.set(e,t,r),this.constant=s,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,r){const s=OO.subVectors(r,t).cross(bae.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(s,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(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){const r=e.delta(OO),s=this.normal.dot(r);if(s===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const o=-(e.start.dot(this.normal)+this.constant)/s;return o<0||o>1?null:t.copy(e.start).addScaledVector(r,o)}intersectsLine(e){const t=this.distanceToPoint(e.start),r=this.distanceToPoint(e.end);return t<0&&r>0||r<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 r=t||Tae.getNormalMatrix(e),s=this.coplanarPoint(OO).applyMatrix4(e),o=this.normal.applyMatrix3(r).normalize();return this.constant=-s.dot(o),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const Ub=new v_,MM=new Pt;class Sae{constructor(e=new sS,t=new sS,r=new sS,s=new sS,o=new sS,l=new sS){this.planes=[e,t,r,s,o,l]}set(e,t,r,s,o,l){const u=this.planes;return u[0].copy(e),u[1].copy(t),u[2].copy(r),u[3].copy(s),u[4].copy(o),u[5].copy(l),this}copy(e){const t=this.planes;for(let r=0;r<6;r++)t[r].copy(e.planes[r]);return this}setFromProjectionMatrix(e,t=T1){const r=this.planes,s=e.elements,o=s[0],l=s[1],u=s[2],h=s[3],f=s[4],g=s[5],y=s[6],b=s[7],w=s[8],C=s[9],M=s[10],A=s[11],k=s[12],L=s[13],P=s[14],D=s[15];if(r[0].setComponents(h-o,b-f,A-w,D-k).normalize(),r[1].setComponents(h+o,b+f,A+w,D+k).normalize(),r[2].setComponents(h+l,b+g,A+C,D+L).normalize(),r[3].setComponents(h-l,b-g,A-C,D-L).normalize(),r[4].setComponents(h-u,b-y,A-M,D-P).normalize(),t===T1)r[5].setComponents(h+u,b+y,A+M,D+P).normalize();else if(t===RD)r[5].setComponents(u,y,M,P).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),Ub.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),Ub.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Ub)}intersectsSprite(e){return Ub.center.set(0,0,0),Ub.radius=.7071067811865476,Ub.applyMatrix4(e.matrixWorld),this.intersectsSphere(Ub)}intersectsSphere(e){const t=this.planes,r=e.center,s=-e.radius;for(let o=0;o<6;o++)if(t[o].distanceToPoint(r)0?e.max.x:e.min.x,MM.y=s.normal.y>0?e.max.y:e.min.y,MM.z=s.normal.z>0?e.max.z:e.min.z,s.distanceToPoint(MM)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let r=0;r<6;r++)if(t[r].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}class dX extends hX{constructor(e=-1,t=1,r=1,s=-1,o=.1,l=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=r,this.bottom=s,this.near=o,this.far=l,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,r,s,o,l){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=r,this.view.offsetY=s,this.view.width=o,this.view.height=l,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),r=(this.right+this.left)/2,s=(this.top+this.bottom)/2;let o=r-e,l=r+e,u=s+t,h=s-t;if(this.view!==null&&this.view.enabled){const f=(this.right-this.left)/this.view.fullWidth/this.zoom,g=(this.top-this.bottom)/this.view.fullHeight/this.zoom;o+=f*this.view.offsetX,l=o+f*this.view.width,u-=g*this.view.offsetY,h=u-g*this.view.height}this.projectionMatrix.makeOrthographic(o,l,u,h,this.near,this.far,this.coordinateSystem),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,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}class wae extends Lm{constructor(e,t,r,s,o,l,u,h,f,g){if(g=g!==void 0?g:fO,g!==fO&&g!==s5)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");r===void 0&&g===fO&&(r=Ioe),r===void 0&&g===s5&&(r=Roe),super(null,s,o,l,u,h,g,r,f),this.isDepthTexture=!0,this.image={width:e,height:t},this.magFilter=u!==void 0?u:E$,this.minFilter=h!==void 0?h:E$,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}}const Eae=new wae(1,1);Eae.compareFunction=Poe;class LO extends dh{constructor(){super(),this.isGroup=!0,this.type="Group"}}class xae{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=ID,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=a0()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return uX("THREE.InterleavedBuffer: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,r){e*=this.stride,r*=t.stride;for(let s=0,o=this.stride;sh)continue;b.applyMatrix4(this.matrixWorld);const H=e.ray.origin.distanceTo(b);He.far||t.push({distance:H,point:y.clone().applyMatrix4(this.matrixWorld),index:P,face:null,faceIndex:null,object:this})}}else{const k=Math.max(0,l.start),L=Math.min(A.count,l.start+l.count);for(let P=k,D=L-1;Ph)continue;b.applyMatrix4(this.matrixWorld);const U=e.ray.origin.distanceTo(b);Ue.far||t.push({distance:U,point:y.clone().applyMatrix4(this.matrixWorld),index:P,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const t=this.geometry.morphAttributes,r=Object.keys(t);if(r.length>0){const s=t[r[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,l=s.length;o0){const s=t[r[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,l=s.length;os.far)return;o.push({distance:f,distanceToRay:Math.sqrt(u),point:h,index:e,face:null,object:l})}}class q3 extends Dy{constructor(e){super(),this.isMeshStandardMaterial=!0,this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new Ph(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 Ph(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Noe,this.normalScale=new cc(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new oT,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class eb extends q3{constructor(e){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new cc(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return Lf(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(t){this.ior=(1+.4*t)/(1-.4*t)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new Ph(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new Ph(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new Ph(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(e)}get anisotropy(){return this._anisotropy}set anisotropy(e){this._anisotropy>0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}function LM(n,e,t){return!n||!t&&n.constructor===e?n:typeof e.BYTES_PER_ELEMENT=="number"?new e(n):Array.prototype.slice.call(n)}function Lae(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function Nae(n){function e(s,o){return n[s]-n[o]}const t=n.length,r=new Array(t);for(let s=0;s!==t;++s)r[s]=s;return r.sort(e),r}function X5(n,e,t){const r=n.length,s=new n.constructor(r);for(let o=0,l=0;l!==r;++o){const u=t[o]*e;for(let h=0;h!==e;++h)s[l++]=n[u+h]}return s}function _X(n,e,t,r){let s=1,o=n[0];for(;o!==void 0&&o[r]===void 0;)o=n[s++];if(o===void 0)return;let l=o[r];if(l!==void 0)if(Array.isArray(l))do l=o[r],l!==void 0&&(e.push(o.time),t.push.apply(t,l)),o=n[s++];while(o!==void 0);else if(l.toArray!==void 0)do l=o[r],l!==void 0&&(e.push(o.time),l.toArray(t,t.length)),o=n[s++];while(o!==void 0);else do l=o[r],l!==void 0&&(e.push(o.time),t.push(l)),o=n[s++];while(o!==void 0)}class yC{constructor(e,t,r,s){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=s!==void 0?s:new t.constructor(r),this.sampleValues=t,this.valueSize=r,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let r=this._cachedIndex,s=t[r],o=t[r-1];e:{t:{let l;n:{r:if(!(e=o)){const u=t[1];e=o)break t}l=r,r=0;break n}break e}for(;r>>1;et;)--l;if(++l,o!==0||l!==s){o>=l&&(l=Math.max(l,1),o=l-1);const u=this.getValueSize();this.times=r.slice(o,l),this.values=this.values.slice(o*u,l*u)}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 r=this.times,s=this.values,o=r.length;o===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let l=null;for(let u=0;u!==o;u++){const h=r[u];if(typeof h=="number"&&isNaN(h)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,u,h),e=!1;break}if(l!==null&&l>h){console.error("THREE.KeyframeTrack: Out of order keys.",this,u,h,l),e=!1;break}l=h}if(s!==void 0&&Lae(s))for(let u=0,h=s.length;u!==h;++u){const f=s[u];if(isNaN(f)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,u,f),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),r=this.getValueSize(),s=this.getInterpolation()===pO,o=e.length-1;let l=1;for(let u=1;u0){e[l]=e[o];for(let u=o*r,h=l*r,f=0;f!==r;++f)t[h+f]=t[u+f];++l}return l!==e.length?(this.times=e.slice(0,l),this.values=t.slice(0,l*r)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),r=this.constructor,s=new r(this.name,e,t);return s.createInterpolant=this.createInterpolant,s}}y_.prototype.TimeBufferType=Float32Array;y_.prototype.ValueBufferType=Float32Array;y_.prototype.DefaultInterpolation=Aw;class iE extends y_{}iE.prototype.ValueTypeName="bool";iE.prototype.ValueBufferType=Array;iE.prototype.DefaultInterpolation=x$;iE.prototype.InterpolantFactoryMethodLinear=void 0;iE.prototype.InterpolantFactoryMethodSmooth=void 0;class vX extends y_{}vX.prototype.ValueTypeName="color";class C$ extends y_{}C$.prototype.ValueTypeName="number";class Fae extends yC{constructor(e,t,r,s){super(e,t,r,s)}interpolate_(e,t,r,s){const o=this.resultBuffer,l=this.sampleValues,u=this.valueSize,h=(r-t)/(s-t);let f=e*u;for(let g=f+u;f!==g;f+=4)Pu.slerpFlat(o,0,l,f-u,l,f,h);return o}}class J1 extends y_{InterpolantFactoryMethodLinear(e){return new Fae(this.times,this.values,this.getValueSize(),e)}}J1.prototype.ValueTypeName="quaternion";J1.prototype.DefaultInterpolation=Aw;J1.prototype.InterpolantFactoryMethodSmooth=void 0;class sE extends y_{}sE.prototype.ValueTypeName="string";sE.prototype.ValueBufferType=Array;sE.prototype.DefaultInterpolation=x$;sE.prototype.InterpolantFactoryMethodLinear=void 0;sE.prototype.InterpolantFactoryMethodSmooth=void 0;class M$ extends y_{}M$.prototype.ValueTypeName="vector";class zae{constructor(e,t=-1,r,s=Ooe){this.name=e,this.tracks=r,this.duration=t,this.blendMode=s,this.uuid=a0(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],r=e.tracks,s=1/(e.fps||1);for(let l=0,u=r.length;l!==u;++l)t.push(Hae(r[l]).scale(s));const o=new this(e.name,e.duration,t,e.blendMode);return o.uuid=e.uuid,o}static toJSON(e){const t=[],r=e.tracks,s={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let o=0,l=r.length;o!==l;++o)t.push(y_.toJSON(r[o]));return s}static CreateFromMorphTargetSequence(e,t,r,s){const o=t.length,l=[];for(let u=0;u1){const y=g[1];let b=s[y];b||(s[y]=b=[]),b.push(f)}}const l=[];for(const u in s)l.push(this.CreateFromMorphTargetSequence(u,s[u],t,r));return l}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const r=function(y,b,w,C,M){if(w.length!==0){const A=[],k=[];_X(w,A,k,C),A.length!==0&&M.push(new y(b,A,k))}},s=[],o=e.name||"default",l=e.fps||30,u=e.blendMode;let h=e.length||-1;const f=e.hierarchy||[];for(let y=0;y{t&&t(o),this.manager.itemEnd(e)},0),o;if(J_[e]!==void 0){J_[e].push({onLoad:t,onProgress:r,onError:s});return}J_[e]=[],J_[e].push({onLoad:t,onProgress:r,onError:s});const l=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),u=this.mimeType,h=this.responseType;fetch(l).then(f=>{if(f.status===200||f.status===0){if(f.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||f.body===void 0||f.body.getReader===void 0)return f;const g=J_[e],y=f.body.getReader(),b=f.headers.get("Content-Length")||f.headers.get("X-File-Size"),w=b?parseInt(b):0,C=w!==0;let M=0;const A=new ReadableStream({start(k){L();function L(){y.read().then(({done:P,value:D})=>{if(P)k.close();else{M+=D.byteLength;const z=new ProgressEvent("progress",{lengthComputable:C,loaded:M,total:w});for(let U=0,V=g.length;U{switch(h){case"arraybuffer":return f.arrayBuffer();case"blob":return f.blob();case"document":return f.text().then(g=>new DOMParser().parseFromString(g,u));case"json":return f.json();default:if(u===void 0)return f.text();{const y=/charset="?([^;"\s]*)"?/i.exec(u),b=y&&y[1]?y[1].toLowerCase():void 0,w=new TextDecoder(b);return f.arrayBuffer().then(C=>w.decode(C))}}}).then(f=>{wy.add(e,f);const g=J_[e];delete J_[e];for(let y=0,b=g.length;y{const g=J_[e];if(g===void 0)throw this.manager.itemError(e),f;delete J_[e];for(let y=0,b=g.length;y{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class jae extends aT{constructor(e){super(e)}load(e,t,r,s){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const o=this,l=wy.get(e);if(l!==void 0)return o.manager.itemStart(e),setTimeout(function(){t&&t(l),o.manager.itemEnd(e)},0),l;const u=kD("img");function h(){g(),wy.add(e,this),t&&t(this),o.manager.itemEnd(e)}function f(y){g(),s&&s(y),o.manager.itemError(e),o.manager.itemEnd(e)}function g(){u.removeEventListener("load",h,!1),u.removeEventListener("error",f,!1)}return u.addEventListener("load",h,!1),u.addEventListener("error",f,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(u.crossOrigin=this.crossOrigin),o.manager.itemStart(e),u.src=e,u}}class Yae extends aT{constructor(e){super(e)}load(e,t,r,s){const o=new Lm,l=new jae(this.manager);return l.setCrossOrigin(this.crossOrigin),l.setPath(this.path),l.load(e,function(u){o.image=u,o.needsUpdate=!0,t!==void 0&&t(o)},r,s),o}}class Q3 extends dh{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new Ph(e),this.intensity=t}dispose(){}copy(e,t){return super.copy(e,t),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,this.groundColor!==void 0&&(t.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(t.object.distance=this.distance),this.angle!==void 0&&(t.object.angle=this.angle),this.decay!==void 0&&(t.object.decay=this.decay),this.penumbra!==void 0&&(t.object.penumbra=this.penumbra),this.shadow!==void 0&&(t.object.shadow=this.shadow.toJSON()),t}}const BO=new Ys,K5=new Pt,J5=new Pt;class Z3{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new cc(512,512),this.map=null,this.mapPass=null,this.matrix=new Ys,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Sae,this._frameExtents=new cc(1,1),this._viewportCount=1,this._viewports=[new _g(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,r=this.matrix;K5.setFromMatrixPosition(e.matrixWorld),t.position.copy(K5),J5.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(J5),t.updateMatrixWorld(),BO.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(BO),r.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),r.multiply(BO)}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 this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class Xae extends Z3{constructor(){super(new Y3(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(e){const t=this.camera,r=$$*2*e.angle*this.focus,s=this.mapSize.width/this.mapSize.height,o=e.distance||t.far;(r!==t.fov||s!==t.aspect||o!==t.far)&&(t.fov=r,t.aspect=s,t.far=o,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class Kae extends Q3{constructor(e,t,r=0,s=Math.PI/3,o=0,l=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(dh.DEFAULT_UP),this.updateMatrix(),this.target=new dh,this.distance=r,this.angle=s,this.penumbra=o,this.decay=l,this.map=null,this.shadow=new Xae}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}const q5=new Ys,QE=new Pt,FO=new Pt;class Jae extends Z3{constructor(){super(new Y3(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new cc(4,2),this._viewportCount=6,this._viewports=[new _g(2,1,1,1),new _g(0,1,1,1),new _g(3,1,1,1),new _g(1,1,1,1),new _g(3,0,1,1),new _g(1,0,1,1)],this._cubeDirections=[new Pt(1,0,0),new Pt(-1,0,0),new Pt(0,0,1),new Pt(0,0,-1),new Pt(0,1,0),new Pt(0,-1,0)],this._cubeUps=[new Pt(0,1,0),new Pt(0,1,0),new Pt(0,1,0),new Pt(0,1,0),new Pt(0,0,1),new Pt(0,0,-1)]}updateMatrices(e,t=0){const r=this.camera,s=this.matrix,o=e.distance||r.far;o!==r.far&&(r.far=o,r.updateProjectionMatrix()),QE.setFromMatrixPosition(e.matrixWorld),r.position.copy(QE),FO.copy(r.position),FO.add(this._cubeDirections[t]),r.up.copy(this._cubeUps[t]),r.lookAt(FO),r.updateMatrixWorld(),s.makeTranslation(-QE.x,-QE.y,-QE.z),q5.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),this._frustum.setFromProjectionMatrix(q5)}}class qae extends Q3{constructor(e,t,r=0,s=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=r,this.decay=s,this.shadow=new Jae}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}class Qae extends Z3{constructor(){super(new dX(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class Zae extends Q3{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(dh.DEFAULT_UP),this.updateMatrix(),this.target=new dh,this.shadow=new Qae}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class O1{static decodeText(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let r=0,s=e.length;r"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,r,s){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const o=this,l=wy.get(e);if(l!==void 0){if(o.manager.itemStart(e),l.then){l.then(f=>{t&&t(f),o.manager.itemEnd(e)}).catch(f=>{s&&s(f)});return}return setTimeout(function(){t&&t(l),o.manager.itemEnd(e)},0),l}const u={};u.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",u.headers=this.requestHeader;const h=fetch(e,u).then(function(f){return f.blob()}).then(function(f){return createImageBitmap(f,Object.assign(o.options,{colorSpaceConversion:"none"}))}).then(function(f){return wy.add(e,f),t&&t(f),o.manager.itemEnd(e),f}).catch(function(f){s&&s(f),wy.remove(e),o.manager.itemError(e),o.manager.itemEnd(e)});wy.add(e,h),o.manager.itemStart(e)}}const eF="\\[\\]\\.:\\/",tle=new RegExp("["+eF+"]","g"),tF="[^"+eF+"]",nle="[^"+eF.replace("\\.","")+"]",rle=/((?:WC+[\/:])*)/.source.replace("WC",tF),ile=/(WCOD+)?/.source.replace("WCOD",nle),sle=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",tF),ole=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",tF),ale=new RegExp("^"+rle+ile+sle+ole+"$"),lle=["material","materials","bones","map"];class ule{constructor(e,t,r){const s=r||Aa.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,s)}getValue(e,t){this.bind();const r=this._targetGroup.nCachedObjects_,s=this._bindings[r];s!==void 0&&s.getValue(e,t)}setValue(e,t){const r=this._bindings;for(let s=this._targetGroup.nCachedObjects_,o=r.length;s!==o;++s)r[s].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,r=e.length;t!==r;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,r=e.length;t!==r;++t)e[t].unbind()}}class Aa{constructor(e,t,r){this.path=t,this.parsedPath=r||Aa.parseTrackName(t),this.node=Aa.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,r){return e&&e.isAnimationObjectGroup?new Aa.Composite(e,t,r):new Aa(e,t,r)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(tle,"")}static parseTrackName(e){const t=ale.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const r={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},s=r.nodeName&&r.nodeName.lastIndexOf(".");if(s!==void 0&&s!==-1){const o=r.nodeName.substring(s+1);lle.indexOf(o)!==-1&&(r.nodeName=r.nodeName.substring(0,s),r.objectName=o)}if(r.propertyName===null||r.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return r}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const r=e.skeleton.getBoneByName(t);if(r!==void 0)return r}if(e.children){const r=function(o){for(let l=0;l{const s=r>n[n.length-1]?r%n[n.length-1]:r;let o=0;for(let l=0;l{let[t,r,s]=[...n],[o,l,u,h]=[...fle[e.toLowerCase()]],f=o+1,g=Q5[f+l-1]+1,y=Q5[f-l]+1;if(h!==0){let V=[t,s];t=V[1],s=V[0]}l!==0&&(r=-1*r),t=t/2,r=r/2,s=s/2;let b=Math.cos(t),w=Math.sin(t),C=Math.cos(r),M=Math.sin(r),A=Math.cos(s),k=Math.sin(s),L=b*A,P=b*k,D=w*A,z=w*k,U=[null,null,null,null];return u!==0?(U[0]=C*(L-z),U[f]=C*(P+D),U[g]=M*(L+z),U[y]=M*(P-D)):(U[0]=C*L+M*z,U[f]=C*D-M*P,U[g]=C*z+M*L,U[y]=C*P-M*D),l!==0&&(U[g]*=-1),U},ple=n=>({x:n.x*zO,y:n.y*zO,z:n.z*zO}),oI=n=>{let e=ple(new oT().setFromQuaternion(new Pu(n.x,n.y,n.z,n.w)));return{x:e.x,y:e.y,z:e.z}},ty=(n,e,t)=>{let r=Math.cos(n*.5),s=Math.cos(e*.5),o=Math.cos(t*.5),l=Math.sin(n*.5),u=Math.sin(e*.5),h=Math.sin(t*.5),f=new Pu;return f.w=o*r*s+h*l*u,f.x=o*l*s-h*r*u,f.y=o*r*u+h*l*s,f.z=h*r*s-o*l*u,f},Z5=n=>n._w===.707&&n._z===.707?ad/2:n._w===.707&&n._z===-.707?-ad/2:n._w===-.707&&n._z===.707?3*ad/4:n._w===-.707&&n._z===-.707?-3*ad/4:n._z===1?ad:n._z===-1?-ad:oI(n).z;function aS(n){var e=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;n=n.replace(e,function(r,s,o,l){return s+s+o+o+l+l});var t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(n);return console.log(t),t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null}function mle(n,e){const t={ignoreAttributes:!1,attributeNamePrefix:"@_"},o=new rX.XMLParser(t).parse(n).robot.joint,l={};return(Array.isArray(o)?o:[o]).forEach(h=>{h["@_name"];const f=h.origin,g=h.parent["@_link"],y=h.child["@_link"],b=f["@_xyz"].split(" ").map(Number),w=f["@_rpy"].split(" ").map(Number),C=SX(w,"sxyz");l[y]={frame:g,position:{x:b[0],y:b[1],z:b[2]},rotation:{w:C[0],x:C[1],y:C[2],z:C[3]},scale:{x:1,y:1,z:1}}}),l.base_link={frame:"world",position:{x:0,y:0,z:0},rotation:{w:1,x:0,y:0,z:0},scale:{x:1,y:1,z:1}},console.log(l),l}function gle(n){const e={ignoreAttributes:!1,attributeNamePrefix:"@_",parseAttributeValue:!0},r=new rX.XMLParser(e).parse(n),s=r.robot.link,o=r.robot.material,l={},u={};return o&&(Array.isArray(o)?o:[o]).forEach(g=>{const y=g["@_name"],b=g.color["@_rgba"].split(" ").map(Number);u[y]={r:b[0],g:b[1],b:b[2],a:b[3]}}),(Array.isArray(s)?s:[s]).forEach(f=>{var C,M;const g=f["@_name"],y=f.visual;let b=null,w=null;if((C=y==null?void 0:y.geometry)!=null&&C.mesh&&(b=y.geometry.mesh["@_filename"],w=(M=y.geometry.mesh["@_scale"])==null?void 0:M.split(" ").map(Number)),g&&y&&b){if(y.material.color){let P=y.material.color["@_rgba"].split(" ").map(Number);P[0],P[1],P[2],P[3]}else y.material["@_name"]&&u[y.material["@_name"]]&&u[y.material["@_name"]];const A=y.origin["@_xyz"].split(" ").map(Number),k=y.origin["@_rpy"].split(" ").map(Number),L=SX(k,"sxyz");l[g]={shape:b,name:g,frame:g,position:{x:A[0],y:A[1],z:A[2]},rotation:{w:L[0],x:L[1],y:L[2],z:L[3]},color:{r:.7*255,g:.7*255,b:.7*255,a:1},scale:w?{x:w[0],y:w[1],z:w[2]}:{x:1,y:1,z:1},highlight:"false"}}}),l}class _le{constructor(){this._previousTime=0,this._currentTime=0,this._delta=0,this._elapsed=0,this._timescale=1,this._useFixedDelta=!1,this._fixedDelta=16.67,this._usePageVisibilityAPI=typeof document<"u"&&document.hidden!==void 0,this._usePageVisibilityAPI===!0&&(this._pageVisibilityHandler=vle.bind(this),document.addEventListener("visibilitychange",this._pageVisibilityHandler,!1))}reset_elapsed(){return this._elapsed=0,this}disableFixedDelta(){return this._useFixedDelta=!1,this}dispose(){return this._usePageVisibilityAPI===!0&&document.removeEventListener("visibilitychange",this._pageVisibilityHandler),this}enableFixedDelta(){return this._useFixedDelta=!0,this}getDelta(){return this._delta/1e3}getElapsed(){return this._elapsed/1e3}getFixedDelta(){return this._fixedDelta/1e3}getTimescale(){return this._timescale}reset(){return this._currentTime=this._now(),this}setFixedDelta(e){return this._fixedDelta=e*1e3,this}setTimescale(e){return this._timescale=e,this}update(){return this._useFixedDelta===!0?this._delta=this._fixedDelta:(this._previousTime=this._currentTime,this._currentTime=this._now(),this._delta=this._currentTime-this._previousTime),this._delta*=this._timescale,this._elapsed+=this._delta,this}_now(){return(typeof performance>"u"?Date:performance).now()}}function vle(){document.hidden===!1&&this.reset()}const GO={camera_link:{frame:"HEAD_1",position:{x:null,y:0,z:0},rotation:{w:1,x:0,y:0,z:0},scale:{x:1,y:1,z:1}},imu_sensor_link:{frame:"base_link",position:{x:0,y:0,z:0},rotation:{w:1,x:0,y:0,z:0},scale:{x:1,y:1,z:1}},MIDDLE_LEFT_WHEEL_1:{frame:"base_link",position:{x:-.006691,y:.060225,z:.028646},rotation:{w:1,x:0,y:0,z:0},scale:{x:1,y:1,z:1}},REAR_LEFT_WHEEL_1:{frame:"base_link",position:{x:-.075191,y:.060225,z:.028646},rotation:{w:1,x:0,y:0,z:0},scale:{x:1,y:1,z:1}},REAR_RIGHT_WHEEL_1:{frame:"base_link",position:{x:-.075191,y:-.060225,z:.028646},rotation:{w:1,x:0,y:0,z:0},scale:{x:1,y:1,z:1}},MIDDLE_RIGHT_WHEEL_1:{frame:"base_link",position:{x:-.006691,y:-.060225,z:.028646},rotation:{w:1,x:0,y:0,z:0},scale:{x:1,y:1,z:1}},BODY_BASE_CONNECTOR_1:{frame:"base_link",position:{x:-.263414,y:-.061691,z:.210284},rotation:{w:1,x:0,y:0,z:0},scale:{x:1,y:1,z:1}},BASE_RIGHT_COVER_1:{frame:"base_link",position:{x:.062309,y:-.045,z:.074646},rotation:{w:1,x:0,y:0,z:0},scale:{x:1,y:1,z:1}},BASE_LEFT_COVER_1:{frame:"base_link",position:{x:.062309,y:.045,z:.074646},rotation:{w:1,x:0,y:0,z:0},scale:{x:1,y:1,z:1}},BASE_FRONT_GRILL_1:{frame:"base_link",position:{x:.039109,y:.043,z:.078796},rotation:{w:1,x:0,y:0,z:0},scale:{x:1,y:1,z:1}},Torso_1:{frame:"BODY_BASE_CONNECTOR_1",position:{x:.214514,y:.061691,z:-.095653},rotation:{w:1,x:0,y:0,z:0},scale:{x:1,y:1,z:1}},NECK_GLOBE_BASE_1:{frame:"Torso_1",position:{x:.014661,y:.0228,z:.084122},rotation:{w:1,x:0,y:0,z:0},scale:{x:1,y:1,z:1}},HEAD_VENT_RIGHT_1:{frame:"HEAD_1",position:{x:.08973-.019009,y:-.057013+.025,z:.04831+.238601-.05},rotation:{w:1,x:0,y:0,z:0},scale:{x:1,y:1,z:1}},HEAD_1:{frame:"NECK_GLOBE_BASE_1",position:{x:.034239,y:-.02,z:.05},rotation:{w:1,x:0,y:0,z:0},scale:{x:1,y:1,z:1}},EYE_LENS_1:{frame:"HEAD_1",position:{x:.016845-.019009,y:.061941+.025,z:.034753+.238601-.05},rotation:{w:1,x:0,y:0,z:0},scale:{x:1,y:1,z:1}},FACE_1:{frame:"EYE_LENS_1",position:{x:.076086,y:.007237,z:-.003703},rotation:{w:1,x:0,y:0,z:0},scale:{x:1,y:1,z:1}},VISOR_GLASS_1:{frame:"HEAD_1",position:{x:.111798-.019009,y:-.024175+.025,z:-.124256+.238601-.05},rotation:{w:1,x:0,y:0,z:0},scale:{x:1,y:1,z:1}},HEAD_VENT_LEFT_1:{frame:"HEAD_1",position:{x:-.042326-.019009,y:.038377+.025,z:-.162881+.238601-.05},rotation:{w:1,x:0,y:0,z:0},scale:{x:1,y:1,z:1}},LEFT_ARM_1:{frame:"LEFT_ARM_CONNECTOR_1",position:{x:-.013297,y:.005336,z:-.001514},rotation:{w:1,x:0,y:0,z:0},scale:{x:1,y:1,z:1}},RIGHT_ARM_1:{frame:"RIGHT_ARM_CONNECTOR_1",position:{x:-.014964,y:-.001971,z:-287e-6},rotation:{w:1,x:0,y:0,z:0},scale:{x:1,y:1,z:1}},Battery_1:{frame:"base_link",position:{x:-.321414,y:.065009,z:.175134},rotation:{w:1,x:0,y:0,z:0},scale:{x:1,y:1,z:1}},RIGHT_ARM_CONNECTOR_1:{frame:"Torso_1",position:{x:.044751,y:-.066216,z:.057987},rotation:{w:.924,x:0,y:.383,z:0},scale:{x:1,y:1,z:1}},LEFT_ARM_CONNECTOR_1:{frame:"Torso_1",position:{x:.044751,y:.066216,z:.057987},rotation:{w:.924,x:0,y:.383,z:0},scale:{x:1,y:1,z:1}},FRONT_LEFT_WHEEL_1:{frame:"base_link",position:{x:.060309,y:.060225,z:.036146},rotation:{w:1,x:0,y:0,z:0},scale:{x:1,y:1,z:1}},FRONT_RIGHT_WHEEL_1:{frame:"base_link",position:{x:.060309,y:-.060225,z:.036146},rotation:{w:1,x:0,y:0,z:0},scale:{x:1,y:1,z:1}},BALANCE_WHEEL:{frame:"base_link",position:{x:-.075191,y:0,z:.028646},rotation:{w:1,x:0,y:0,z:0},scale:{x:1,y:1,z:1}},base_link:{frame:"world",position:{x:0,y:0,z:0},rotation:{w:.707,x:0,y:0,z:-.707},scale:{x:1,y:1,z:1}}},WO={base_link:{shape:"package://misty_description/meshes/base_link.stl",name:"base_link",frame:"base_link",position:{x:0,y:0,z:0},rotation:{w:1,x:0,y:0,z:0},color:{r:178.5,g:178.5,b:178.5,a:1},scale:{x:.001,y:.001,z:.001},highlight:"false"},MIDDLE_LEFT_WHEEL_1:{shape:"package://misty_description/meshes/MIDDLE_LEFT_WHEEL_1.stl",name:"MIDDLE_LEFT_WHEEL_1",frame:"MIDDLE_LEFT_WHEEL_1",position:{x:.006691,y:-.060225,z:-.027646},rotation:{w:1,x:0,y:0,z:0},color:{r:178.5,g:178.5,b:178.5,a:1},scale:{x:.001,y:.001,z:.001},highlight:"false"},REAR_LEFT_WHEEL_1:{shape:"package://misty_description/meshes/REAR_LEFT_WHEEL_1.stl",name:"REAR_LEFT_WHEEL_1",frame:"REAR_LEFT_WHEEL_1",position:{x:.075191,y:-.060225,z:-.027646},rotation:{w:1,x:0,y:0,z:0},color:{r:178.5,g:178.5,b:178.5,a:1},scale:{x:.001,y:.001,z:.001},highlight:"false"},REAR_RIGHT_WHEEL_1:{shape:"package://misty_description/meshes/REAR_RIGHT_WHEEL_1.stl",name:"REAR_RIGHT_WHEEL_1",frame:"REAR_RIGHT_WHEEL_1",position:{x:.075191,y:.060225,z:-.027646},rotation:{w:1,x:0,y:0,z:0},color:{r:178.5,g:178.5,b:178.5,a:1},scale:{x:.001,y:.001,z:.001},highlight:"false"},MIDDLE_RIGHT_WHEEL_1:{shape:"package://misty_description/meshes/MIDDLE_RIGHT_WHEEL_1.stl",name:"MIDDLE_RIGHT_WHEEL_1",frame:"MIDDLE_RIGHT_WHEEL_1",position:{x:.006691,y:.060225,z:-.027646},rotation:{w:1,x:0,y:0,z:0},color:{r:178.5,g:178.5,b:178.5,a:1},scale:{x:.001,y:.001,z:.001},highlight:"false"},BODY_BASE_CONNECTOR_1:{shape:"package://misty_description/meshes/BODY_BASE_CONNECTOR_1.stl",name:"BODY_BASE_CONNECTOR_1",frame:"BODY_BASE_CONNECTOR_1",position:{x:.263414,y:.061691,z:-.210284},rotation:{w:1,x:0,y:0,z:0},color:{r:178.5,g:178.5,b:178.5,a:1},scale:{x:.001,y:.001,z:.001},highlight:"false"},BASE_RIGHT_COVER_1:{shape:"package://misty_description/meshes/BASE_RIGHT_COVER_1.stl",name:"BASE_RIGHT_COVER_1",frame:"BASE_RIGHT_COVER_1",position:{x:-.062309,y:.045,z:-.074646},rotation:{w:1,x:0,y:0,z:0},color:{r:178.5,g:178.5,b:178.5,a:1},scale:{x:.001,y:.001,z:.001},highlight:"false"},BASE_LEFT_COVER_1:{shape:"package://misty_description/meshes/BASE_LEFT_COVER_1.stl",name:"BASE_LEFT_COVER_1",frame:"BASE_LEFT_COVER_1",position:{x:-.062309,y:-.045,z:-.074646},rotation:{w:1,x:0,y:0,z:0},color:{r:178.5,g:178.5,b:178.5,a:1},scale:{x:.001,y:.001,z:.001},highlight:"false"},BASE_FRONT_GRILL_1:{shape:"package://misty_description/meshes/BASE_FRONT_GRILL_1.stl",name:"BASE_FRONT_GRILL_1",frame:"BASE_FRONT_GRILL_1",position:{x:-.039109,y:-.043,z:-.078796},rotation:{w:1,x:0,y:0,z:0},color:{r:178.5,g:178.5,b:178.5,a:1},scale:{x:.001,y:.001,z:.001},highlight:"false"},Torso_1:{shape:"package://misty_description/meshes/Torso_1.stl",name:"Torso_1",frame:"Torso_1",position:{x:.0489,y:0,z:-.114631},rotation:{w:1,x:0,y:0,z:0},color:{r:178.5,g:178.5,b:178.5,a:1},scale:{x:.001,y:.001,z:.001},highlight:"false"},NECK_GLOBE_BASE_1:{shape:"package://misty_description/meshes/NECK_GLOBE_BASE_1.stl",name:"NECK_GLOBE_BASE_1",frame:"NECK_GLOBE_BASE_1",position:{x:.034239,y:-.0228,z:-.198753},rotation:{w:1,x:0,y:0,z:0},color:{r:178.5,g:178.5,b:178.5,a:1},scale:{x:.001,y:.001,z:.001},highlight:"false"},HEAD_VENT_RIGHT_1:{shape:"package://misty_description/meshes/HEAD_VENT_RIGHT_1.stl",name:"HEAD_VENT_RIGHT_1",frame:"HEAD_VENT_RIGHT_1",position:{x:-.070814,y:.032838,z:-.485664},rotation:{w:1,x:0,y:0,z:0},color:{r:178.5,g:178.5,b:178.5,a:1},scale:{x:.001,y:.001,z:.001},highlight:"false"},HEAD_1:{shape:"package://misty_description/meshes/HEAD_1.stl",name:"HEAD_1",frame:"HEAD_1",position:{x:0,y:0,z:-.25},rotation:{w:1,x:0,y:0,z:0},color:{r:178.5,g:178.5,b:178.5,a:1},scale:{x:.001,y:.001,z:.001},highlight:"false"},EYE_LENS_1:{shape:"package://misty_description/meshes/EYE_LENS_1.stl",name:"EYE_LENS_1",frame:"EYE_LENS_1",position:{x:.002071,y:-.086116,z:-.472107},rotation:{w:1,x:0,y:0,z:0},color:{r:0,g:0,b:0,a:.5},scale:{x:.001,y:.001,z:.001},highlight:"false"},FACE_1:{shape:"package://misty_description/meshes/FACE_1.stl",name:"FACE_1",frame:"FACE_1",position:{x:-.074015,y:-.093353,z:-.468404-.02},rotation:{w:1,x:0,y:0,z:0},color:{r:178.5,g:178.5,b:178.5,a:1},scale:{x:.00105,y:.00105,z:.00105},highlight:"false"},eyes_acceptance:{shape:"eyes_acceptance",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},eyes_admiration:{shape:"eyes_admiration",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},eyes_amazement:{shape:"eyes_amazement",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},eyes_anger:{shape:"eyes_anger",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},eyes_annoyed:{shape:"eyes_annoyed",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},eyes_anticipation:{shape:"eyes_anticipation",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},eyes_apprehension:{shape:"eyes_apprehension",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},eyes_apprehension_1:{shape:"eyes_apprehension_1",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},eyes_boredom:{shape:"eyes_boredom",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},eyes_default:{shape:"eyes_default",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!1},eyes_disgust:{shape:"eyes_disgust",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},eyes_distraction:{shape:"eyes_distraction",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},eyes_ecstasy_frame_1:{shape:"eyes_ecstasy_frame_1",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},eyes_ecstasy_frame_2:{shape:"eyes_ecstasy_frame_2",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},eyes_fear:{shape:"eyes_fear",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},eyes_grief:{shape:"eyes_grief",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},eyes_interest:{shape:"eyes_interest",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},eyes_joy:{shape:"eyes_joy",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},eyes_loathing:{shape:"eyes_loathing",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},eyes_pensiveness:{shape:"eyes_pensiveness",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},eyes_rage:{shape:"eyes_rage",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},eyes_sad:{shape:"eyes_sad",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},eyes_serenity:{shape:"eyes_serenity",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},eyes_surprise:{shape:"eyes_surprise",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},eyes_terror:{shape:"eyes_terror",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},eyes_trust:{shape:"eyes_trust",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},eyes_vigilance:{shape:"eyes_vigilance",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},e_Sleeping:{shape:"e_Sleeping",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},e_SleepingZZZ:{shape:"e_SleepingZZZ",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},e_Contempt:{shape:"e_Contempt",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},e_ContentLeft:{shape:"e_ContentLeft",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},e_ContentRight:{shape:"e_ContentRight",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},e_Disoriented:{shape:"e_Disoriented",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},e_EcstacyHilarious:{shape:"e_EcstacyHilarious",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},e_EcstacyStarryEyed:{shape:"e_EcstacyStarryEyed",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},e_JoyGoofy:{shape:"e_JoyGoofy",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},e_JoyGoofy2:{shape:"e_JoyGoofy2",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},e_JoyGoofy3:{shape:"e_JoyGoofy3",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},e_Love:{shape:"e_Love",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},e_Rage:{shape:"e_Rage",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},e_Rage2:{shape:"e_Rage2",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},e_Rage3:{shape:"e_Rage3",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},e_Rage4:{shape:"e_Rage4",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},e_RemorseShame:{shape:"e_RemorseShame",name:"blink",frame:"FACE_1",position:{x:-.01,y:-.095,z:-.19},rotation:{w:.5,x:.5,y:-.5,z:-.5},scale:{x:.045,y:.0253125,z:1},hidden:!0},VISOR_GLASS_1:{shape:"package://misty_description/meshes/VISOR_GLASS_1.stl",name:"VISOR_GLASS_1",frame:"VISOR_GLASS_1",position:{x:-.092882,y:0,z:-.313098},rotation:{w:1,x:0,y:0,z:0},color:{r:22,g:22,b:22,a:1},scale:{x:.001,y:.001,z:.001},highlight:"false"},HEAD_VENT_LEFT_1:{shape:"package://misty_description/meshes/HEAD_VENT_LEFT_1.stl",name:"HEAD_VENT_LEFT_1",frame:"HEAD_VENT_LEFT_1",position:{x:.061242,y:-.062552,z:-.274473},rotation:{w:1,x:0,y:0,z:0},color:{r:178.5,g:178.5,b:178.5,a:1},scale:{x:.001,y:.001,z:.001},highlight:"false"},LEFT_ARM_1:{shape:"package://misty_description/meshes/LEFT_ARM_1.stl",name:"LEFT_ARM_1",frame:"LEFT_ARM_1",position:{x:.017446,y:-.071552,z:-.171104},rotation:{w:1,x:0,y:0,z:0},color:{r:178.5,g:178.5,b:178.5,a:1},scale:{x:.001,y:.001,z:.001},highlight:"false"},RIGHT_ARM_1:{shape:"package://misty_description/meshes/RIGHT_ARM_1.stl",name:"RIGHT_ARM_1",frame:"RIGHT_ARM_1",position:{x:.019113,y:.068187,z:-.172331},rotation:{w:1,x:0,y:0,z:0},color:{r:178.5,g:178.5,b:178.5,a:1},scale:{x:.001,y:.001,z:.001},highlight:"false"},Battery_1:{shape:"package://misty_description/meshes/Battery_1.stl",name:"Battery_1",frame:"Battery_1",position:{x:.321414,y:-.065009,z:-.175134},rotation:{w:1,x:0,y:0,z:0},color:{r:178.5,g:178.5,b:178.5,a:1},scale:{x:.001,y:.001,z:.001},highlight:"false"},RIGHT_ARM_CONNECTOR_1:{shape:"package://misty_description/meshes/RIGHT_ARM_CONNECTOR_1.stl",name:"RIGHT_ARM_CONNECTOR_1",frame:"RIGHT_ARM_CONNECTOR_1",position:{x:.004149,y:.066216,z:-.172618},rotation:{w:1,x:0,y:0,z:0},color:{r:178.5,g:178.5,b:178.5,a:1},scale:{x:.001,y:.001,z:.001},highlight:"false"},LEFT_ARM_CONNECTOR_1:{shape:"package://misty_description/meshes/LEFT_ARM_CONNECTOR_1.stl",name:"LEFT_ARM_CONNECTOR_1",frame:"LEFT_ARM_CONNECTOR_1",position:{x:.004149,y:-.066216,z:-.172618},rotation:{w:1,x:0,y:0,z:0},color:{r:178.5,g:178.5,b:178.5,a:1},scale:{x:.001,y:.001,z:.001},highlight:"false"},FRONT_LEFT_WHEEL_1:{shape:"package://misty_description/meshes/FRONT_LEFT_WHEEL_1.stl",name:"FRONT_LEFT_WHEEL_1",frame:"FRONT_LEFT_WHEEL_1",position:{x:-.060309,y:-.060225,z:-.035146},rotation:{w:1,x:0,y:0,z:0},color:{r:178.5,g:178.5,b:178.5,a:1},scale:{x:.001,y:.001,z:.001},highlight:"false"},FRONT_RIGHT_WHEEL_1:{shape:"package://misty_description/meshes/FRONT_RIGHT_WHEEL_1.stl",name:"FRONT_RIGHT_WHEEL_1",frame:"FRONT_RIGHT_WHEEL_1",position:{x:-.060309,y:.060225,z:-.035146},rotation:{w:1,x:0,y:0,z:0},color:{r:178.5,g:178.5,b:178.5,a:1},scale:{x:.001,y:.001,z:.001},highlight:"false"},Reset_Button:{shape:"cube",frame:"gizmo",name:"Reset_Button",position:{x:0,y:0,z:0},rotation:{w:1,x:0,y:0,z:0},color:{r:255,g:0,b:0,a:1},scale:{x:1,y:1,z:1}}},yle=`You are an assistive agent that translates descriptions of robot behavior into JSON that describes goals for programming. These goals are individual steps for a user to achieve in order to program the robot to perform the corresponding behavior. A user will use these goals to help them figure out how to build a robot program using a custom interface for programming robots. For example, a user might say: "The robot should say "Watch me", play a sound, and then do a dance." One possible result is the following set of JSON goals: "{ @@ -1583,34 +1583,34 @@ ONLY respond with the JSON and be sure that the output JSON is valid according t * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */iR.exports;(function(n,e){(function(){var t,r="4.17.21",s=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",l="Expected a function",u="Invalid `variable` option passed into `_.template`",h="__lodash_hash_undefined__",f=500,g="__lodash_placeholder__",y=1,b=2,w=4,C=1,M=2,A=1,k=2,L=4,P=8,D=16,z=32,U=64,V=128,H=256,oe=512,le=30,Z="...",q=800,he=16,ae=1,ue=2,ge=3,we=1/0,J=9007199254740991,re=17976931348623157e292,ie=NaN,fe=4294967295,Te=fe-1,Fe=fe>>>1,Ie=[["ary",V],["bind",A],["bindKey",k],["curry",P],["curryRight",D],["flip",oe],["partial",z],["partialRight",U],["rearg",H]],Je="[object Arguments]",Re="[object Array]",Qe="[object AsyncFunction]",nt="[object Boolean]",ft="[object Date]",lt="[object DOMException]",ze="[object Error]",Ce="[object Function]",He="[object GeneratorFunction]",rt="[object Map]",it="[object Number]",Nt="[object Null]",kt="[object Object]",vt="[object Promise]",Mt="[object Proxy]",At="[object RegExp]",mt="[object Set]",xe="[object String]",se="[object Symbol]",$e="[object Undefined]",ht="[object WeakMap]",St="[object WeakSet]",It="[object ArrayBuffer]",pt="[object DataView]",Ke="[object Float32Array]",Le="[object Float64Array]",Q="[object Int8Array]",te="[object Int16Array]",me="[object Int32Array]",ke="[object Uint8Array]",Xe="[object Uint8ClampedArray]",Wt="[object Uint16Array]",Ge="[object Uint32Array]",tn=/\b__p \+= '';/g,_t=/\b(__p \+=) '' \+/g,Jt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Kt=/&(?:amp|lt|gt|quot|#39);/g,On=/[&<>"']/g,ii=RegExp(Kt.source),Pr=RegExp(On.source),Ei=/<%-([\s\S]+?)%>/g,xr=/<%([\s\S]+?)%>/g,mr=/<%=([\s\S]+?)%>/g,ne=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Se=/^\w*$/,We=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ot=/[\\^$.*+?()[\]{}|]/g,zt=RegExp(ot.source),sn=/^\s+/,Nn=/\s/,Pe=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,gt=/\{\n\/\* \[wrapped with (.+)\] \*/,Ct=/,? & /,bt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Vt=/[()=,{}\[\]\/\s]/,Wn=/\\(\\)?/g,rr=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,_r=/\w*$/,$r=/^[-+]0x[0-9a-f]+$/i,si=/^0b[01]+$/i,Br=/^\[object .+?Constructor\]$/,Yr=/^0o[0-7]+$/i,Ss=/^(?:0|[1-9]\d*)$/,Oa=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Eo=/($^)/,Yl=/['\n\r\u2028\u2029\\]/g,nn="\\ud800-\\udfff",Rr="\\u0300-\\u036f",el="\\ufe20-\\ufe2f",La="\\u20d0-\\u20ff",Fs=Rr+el+La,zs="\\u2700-\\u27bf",Di="a-z\\xdf-\\xf6\\xf8-\\xff",kr="\\xac\\xb1\\xd7\\xf7",An="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Ir="\\u2000-\\u206f",Gr=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",yr="A-Z\\xc0-\\xd6\\xd8-\\xde",Pi="\\ufe0e\\ufe0f",ws=kr+An+Ir+Gr,fi="['’]",gs="["+nn+"]",tl="["+ws+"]",Na="["+Fs+"]",fc="\\d+",pc="["+zs+"]",Xs="["+Di+"]",Jo="[^"+nn+ws+fc+zs+Di+yr+"]",Xl="\\ud83c[\\udffb-\\udfff]",gu="(?:"+Na+"|"+Xl+")",mh="[^"+nn+"]",qo="(?:\\ud83c[\\udde6-\\uddff]){2}",vr="[\\ud800-\\udbff][\\udc00-\\udfff]",xi="["+yr+"]",Dc="\\u200d",gh="(?:"+Xs+"|"+Jo+")",Pc="(?:"+xi+"|"+Jo+")",El="(?:"+fi+"(?:d|ll|m|re|s|t|ve))?",_u="(?:"+fi+"(?:D|LL|M|RE|S|T|VE))?",xl=gu+"?",$l="["+Pi+"]?",br="(?:"+Dc+"(?:"+[mh,qo,vr].join("|")+")"+$l+xl+")*",Tr="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Kl="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",nl=$l+xl+br,rl="(?:"+[pc,qo,vr].join("|")+")"+nl,vu="(?:"+[mh+Na+"?",Na,qo,vr,gs].join("|")+")",Qi=RegExp(fi,"g"),_s=RegExp(Na,"g"),il=RegExp(Xl+"(?="+Xl+")|"+vu+nl,"g"),Cd=RegExp([xi+"?"+Xs+"+"+El+"(?="+[tl,xi,"$"].join("|")+")",Pc+"+"+_u+"(?="+[tl,xi+gh,"$"].join("|")+")",xi+"?"+gh+"+"+El,xi+"+"+_u,Kl,Tr,fc,rl].join("|"),"g"),io=RegExp("["+Dc+nn+Fs+Pi+"]"),zu=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ca=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],yu=-1,or={};or[Ke]=or[Le]=or[Q]=or[te]=or[me]=or[ke]=or[Xe]=or[Wt]=or[Ge]=!0,or[Je]=or[Re]=or[It]=or[nt]=or[pt]=or[ft]=or[ze]=or[Ce]=or[rt]=or[it]=or[kt]=or[At]=or[mt]=or[xe]=or[ht]=!1;var Gn={};Gn[Je]=Gn[Re]=Gn[It]=Gn[pt]=Gn[nt]=Gn[ft]=Gn[Ke]=Gn[Le]=Gn[Q]=Gn[te]=Gn[me]=Gn[rt]=Gn[it]=Gn[kt]=Gn[At]=Gn[mt]=Gn[xe]=Gn[se]=Gn[ke]=Gn[Xe]=Gn[Wt]=Gn[Ge]=!0,Gn[ze]=Gn[Ce]=Gn[ht]=!1;var Es={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},so={"&":"&","<":"<",">":">",'"':""","'":"'"},Uu={"&":"&","<":"<",">":">",""":'"',"'":"'"},bu={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},_h=parseFloat,Da=parseInt,ha=typeof Vl=="object"&&Vl&&Vl.Object===Object&&Vl,Hu=typeof self=="object"&&self&&self.Object===Object&&self,wr=ha||Hu||Function("return this")(),Rs=e&&!e.nodeType&&e,bi=Rs&&!0&&n&&!n.nodeType&&n,$i=bi&&bi.exports===Rs,da=$i&&ha.process,Zr=function(){try{var ye=bi&&bi.require&&bi.require("util").types;return ye||da&&da.binding&&da.binding("util")}catch{}}(),Tu=Zr&&Zr.isArrayBuffer,xo=Zr&&Zr.isDate,Su=Zr&&Zr.isMap,sl=Zr&&Zr.isRegExp,Bi=Zr&&Zr.isSet,Ci=Zr&&Zr.isTypedArray;function Vn(ye,je,Be){switch(Be.length){case 0:return ye.call(je);case 1:return ye.call(je,Be[0]);case 2:return ye.call(je,Be[0],Be[1]);case 3:return ye.call(je,Be[0],Be[1],Be[2])}return ye.apply(je,Be)}function Mi(ye,je,Be,Ot){for(var rn=-1,In=ye==null?0:ye.length;++rn-1}function vh(ye,je,Be){for(var Ot=-1,rn=ye==null?0:ye.length;++Ot-1;);return Be}function fa(ye,je){for(var Be=ye.length;Be--&&ks(je,ye[Be],0)>-1;);return Be}function Eu(ye,je){for(var Be=ye.length,Ot=0;Be--;)ye[Be]===je&&++Ot;return Ot}var cf=Er(Es),hf=Er(so);function pd(ye){return"\\"+bu[ye]}function Wu(ye,je){return ye==null?t:ye[je]}function ol(ye){return io.test(ye)}function Fc(ye){return zu.test(ye)}function zh(ye){for(var je,Be=[];!(je=ye.next()).done;)Be.push(je.value);return Be}function Vu(ye){var je=-1,Be=Array(ye.size);return ye.forEach(function(Ot,rn){Be[++je]=[rn,Ot]}),Be}function Zl(ye,je){return function(Be){return ye(je(Be))}}function Us(ye,je){for(var Be=-1,Ot=ye.length,rn=0,In=[];++Be-1}function Yh(c,m){var E=this.__data__,N=ys(E,c);return N<0?(++this.size,E.push([c,m])):E[N][1]=m,this}os.prototype.clear=Yc,os.prototype.delete=na,os.prototype.get=Od,os.prototype.has=Ld,os.prototype.set=Yh;function Gs(c){var m=-1,E=c==null?0:c.length;for(this.clear();++m=m?c:m)),c}function ki(c,m,E,N,G,K){var ce,_e=m&y,Ee=m&b,et=m&w;if(E&&(ce=G?E(c,N,G,K):E(c)),ce!==t)return ce;if(!ri(c))return c;var tt=kn(c);if(tt){if(ce=Jm(c),!_e)return ni(c,ce)}else{var ct=hs(c),Rt=ct==Ce||ct==He;if(ah(c))return eh(c,_e);if(ct==kt||ct==Je||Rt&&!G){if(ce=Ee||Rt?{}:xc(c),!_e)return Ee?yd(c,fl(ce,c)):qh(c,as(ce,c))}else{if(!Gn[ct])return G?c:{};ce=Zs(c,ct,_e)}}K||(K=new gi);var Xt=K.get(c);if(Xt)return Xt;K.set(c,ce),A_(c)?c.forEach(function(dn){ce.add(ki(dn,m,E,dn,c,K))}):td(c)&&c.forEach(function(dn,Yn){ce.set(Yn,ki(dn,m,E,Yn,c,K))});var pn=et?Ee?Mr:cr:Ee?rs:wi,Ln=tt?t:pn(c);return Xr(Ln||c,function(dn,Yn){Ln&&(Yn=dn,dn=c[Yn]),$o(ce,Yn,ki(dn,m,E,Yn,c,K))}),ce}function Nd(c){var m=wi(c);return function(E){return Xc(E,c,m)}}function Xc(c,m,E){var N=E.length;if(c==null)return!N;for(c=vn(c);N--;){var G=E[N],K=m[G],ce=c[G];if(ce===t&&!(G in c)||!K(ce))return!1}return!0}function Kh(c,m,E){if(typeof c!="function")throw new Ti(l);return gf(function(){c.apply(t,E)},m)}function Uo(c,m,E,N){var G=-1,K=Pa,ce=!0,_e=c.length,Ee=[],et=m.length;if(!_e)return Ee;E&&(m=hr(m,Wr(E))),N?(K=vh,ce=!1):m.length>=s&&(K=Sr,ce=!1,m=new Fo(m));e:for(;++G<_e;){var tt=c[G],ct=E==null?tt:E(tt);if(tt=N||tt!==0?tt:0,ce&&ct===ct){for(var Rt=et;Rt--;)if(m[Rt]===ct)continue e;Ee.push(tt)}else K(m,ct,N)||Ee.push(tt)}return Ee}var Co=Qh(ls),df=Qh(Va,!0);function Cu(c,m){var E=!0;return Co(c,function(N,G,K){return E=!!m(N,G,K),E}),E}function Ol(c,m,E){for(var N=-1,G=c.length;++NG?0:G+E),N=N===t||N>G?G:Mn(N),N<0&&(N+=G),N=E>N?0:I0(N);E0&&E(_e)?m>1?Kr(_e,m-1,E,N,G):Qo(G,_e):N||(G[G.length]=_e)}return G}var ou=Ec(),Ju=Ec(!0);function ls(c,m){return c&&ou(c,m,wi)}function Va(c,m){return c&&Ju(c,m,wi)}function $s(c,m){return Vi(m,function(E){return Mc(c[E])})}function Cs(c,m){m=ia(m,c);for(var E=0,N=m.length;c!=null&&Em}function bc(c,m){return c!=null&&qn.call(c,m)}function ff(c,m){return c!=null&&m in vn(c)}function Eh(c,m,E){return c>=Ii(m,E)&&c=120&&tt.length>=120)?new Fo(ce&&tt):t}tt=c[0];var ct=-1,Rt=_e[0];e:for(;++ct-1;)_e!==c&&ju.call(_e,Ee,1),ju.call(c,Ee,1);return c}function bs(c,m){for(var E=c?m.length:0,N=E-1;E--;){var G=m[E];if(E==N||G!==K){var K=G;Ka(G)?ju.call(c,G,1):Qc(c,G)}}return c}function Os(c,m){return c+nu(Il()*(m-c+1))}function Ya(c,m,E,N){for(var G=-1,K=ei(Yu((m-c)/(E||1)),0),ce=Be(K);K--;)ce[N?K:++G]=c,c+=E;return ce}function Vs(c,m){var E="";if(!c||m<1||m>J)return E;do m%2&&(E+=c),m=nu(m/2),m&&(c+=c);while(m);return E}function fn(c,m){return Bd(nm(c,m,ko),c+"")}function Jc(c){return hl(Tf(c))}function wn(c,m){var E=Tf(c);return dr(E,Wa(m,0,E.length))}function vi(c,m,E,N){if(!ri(c))return c;m=ia(m,c);for(var G=-1,K=m.length,ce=K-1,_e=c;_e!=null&&++GG?0:G+m),E=E>G?G:E,E<0&&(E+=G),G=m>E?0:E-m>>>0,m>>>=0;for(var K=Be(G);++N>>1,ce=c[K];ce!==null&&!aa(ce)&&(E?ce<=m:ce=s){var et=m?null:Dr(c);if(et)return eu(et);ce=!1,G=Sr,Ee=new Fo}else Ee=m?[]:_e;e:for(;++N=N?c:Ft(c,m,E)}var Iu=Vh||function(c){return wr.clearTimeout(c)};function eh(c,m){if(m)return c.slice();var E=c.length,N=Gh?Gh(E):new c.constructor(E);return c.copy(N),N}function wc(c){var m=new c.constructor(c.byteLength);return new Hc(m).set(new Hc(c)),m}function Go(c,m){var E=m?wc(c.buffer):c.buffer;return new c.constructor(E,c.byteOffset,c.byteLength)}function _o(c){var m=new c.constructor(c.source,_r.exec(c));return m.lastIndex=c.lastIndex,m}function rc(c){return Zi?vn(Zi.call(c)):{}}function Dl(c,m){var E=m?wc(c.buffer):c.buffer;return new c.constructor(E,c.byteOffset,c.length)}function vo(c,m){if(c!==m){var E=c!==t,N=c===null,G=c===c,K=aa(c),ce=m!==t,_e=m===null,Ee=m===m,et=aa(m);if(!_e&&!et&&!K&&c>m||K&&ce&&Ee&&!_e&&!et||N&&ce&&Ee||!E&&Ee||!G)return 1;if(!N&&!K&&!et&&c=_e)return Ee;var et=E[N];return Ee*(et=="desc"?-1:1)}}return c.index-m.index}function Xa(c,m,E,N){for(var G=-1,K=c.length,ce=E.length,_e=-1,Ee=m.length,et=ei(K-ce,0),tt=Be(Ee+et),ct=!N;++_e1?E[G-1]:t,ce=G>2?E[2]:t;for(K=c.length>3&&typeof K=="function"?(G--,K):t,ce&&Ur(E[0],E[1],ce)&&(K=G<3?t:K,G=1),m=vn(m);++N-1?G[K?m[ce]:ce]:t}}function B(c){return zn(function(m){var E=m.length,N=E,G=Cr.prototype.thru;for(c&&m.reverse();N--;){var K=m[N];if(typeof K!="function")throw new Ti(l);if(G&&!ce&&pf(K)=="wrapper")var ce=new Cr([],!0)}for(N=ce?N:E;++N1&&er.reverse(),tt&&Ee_e))return!1;var et=K.get(c),tt=K.get(m);if(et&&tt)return et==m&&tt==c;var ct=-1,Rt=!0,Xt=E&M?new Fo:t;for(K.set(c,m),K.set(m,c);++ct<_e;){var pn=c[ct],Ln=m[ct];if(N)var dn=ce?N(Ln,pn,ct,m,c,K):N(pn,Ln,ct,c,m,K);if(dn!==t){if(dn)continue;Rt=!1;break}if(Xt){if(!Bc(m,function(Yn,er){if(!Sr(Xt,er)&&(pn===Yn||G(pn,Yn,E,N,K)))return Xt.push(er)})){Rt=!1;break}}else if(!(pn===Ln||G(pn,Ln,E,N,K))){Rt=!1;break}}return K.delete(c),K.delete(m),Rt}function En(c,m,E,N,G,K,ce){switch(E){case pt:if(c.byteLength!=m.byteLength||c.byteOffset!=m.byteOffset)return!1;c=c.buffer,m=m.buffer;case It:return!(c.byteLength!=m.byteLength||!K(new Hc(c),new Hc(m)));case nt:case ft:case it:return Ca(+c,+m);case ze:return c.name==m.name&&c.message==m.message;case At:case xe:return c==m+"";case rt:var _e=Vu;case mt:var Ee=N&C;if(_e||(_e=eu),c.size!=m.size&&!Ee)return!1;var et=ce.get(c);if(et)return et==m;N|=M,ce.set(c,m);var tt=on(_e(c),_e(m),N,G,K,ce);return ce.delete(c),tt;case se:if(Zi)return Zi.call(c)==Zi.call(m)}return!1}function Rn(c,m,E,N,G,K){var ce=E&C,_e=cr(c),Ee=_e.length,et=cr(m),tt=et.length;if(Ee!=tt&&!ce)return!1;for(var ct=Ee;ct--;){var Rt=_e[ct];if(!(ce?Rt in m:qn.call(m,Rt)))return!1}var Xt=K.get(c),pn=K.get(m);if(Xt&&pn)return Xt==m&&pn==c;var Ln=!0;K.set(c,m),K.set(m,c);for(var dn=ce;++ct1?"& ":"")+m[N],m=m.join(E>2?", ":" "),c.replace(Pe,`{ + */iR.exports;(function(n,e){(function(){var t,r="4.17.21",s=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",l="Expected a function",u="Invalid `variable` option passed into `_.template`",h="__lodash_hash_undefined__",f=500,g="__lodash_placeholder__",y=1,b=2,w=4,C=1,M=2,A=1,k=2,L=4,P=8,D=16,z=32,U=64,V=128,H=256,oe=512,le=30,Z="...",q=800,he=16,ae=1,ue=2,ge=3,we=1/0,J=9007199254740991,re=17976931348623157e292,se=NaN,fe=4294967295,Te=fe-1,Fe=fe>>>1,Ie=[["ary",V],["bind",A],["bindKey",k],["curry",P],["curryRight",D],["flip",oe],["partial",z],["partialRight",U],["rearg",H]],qe="[object Arguments]",Re="[object Array]",Ze="[object AsyncFunction]",rt="[object Boolean]",ft="[object Date]",ut="[object DOMException]",ze="[object Error]",$e="[object Function]",He="[object GeneratorFunction]",it="[object Map]",st="[object Number]",Nt="[object Null]",kt="[object Object]",vt="[object Promise]",Ct="[object Proxy]",At="[object RegExp]",gt="[object Set]",xe="[object String]",ie="[object Symbol]",Pe="[object Undefined]",Ye="[object WeakMap]",St="[object WeakSet]",It="[object ArrayBuffer]",mt="[object DataView]",Ke="[object Float32Array]",Oe="[object Float64Array]",Q="[object Int8Array]",te="[object Int16Array]",pe="[object Int32Array]",Ae="[object Uint8Array]",Je="[object Uint8ClampedArray]",jt="[object Uint16Array]",Ge="[object Uint32Array]",qt=/\b__p \+= '';/g,pt=/\b(__p \+=) '' \+/g,Jt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Xt=/&(?:amp|lt|gt|quot|#39);/g,xn=/[&<>"']/g,ii=RegExp(Xt.source),Pr=RegExp(xn.source),Ei=/<%-([\s\S]+?)%>/g,xr=/<%([\s\S]+?)%>/g,mr=/<%=([\s\S]+?)%>/g,ne=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Se=/^\w*$/,We=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,at=/[\\^$.*+?()[\]{}|]/g,zt=RegExp(at.source),sn=/^\s+/,Nn=/\s/,De=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,_t=/\{\n\/\* \[wrapped with (.+)\] \*/,Mt=/,? & /,bt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Wt=/[()=,{}\[\]\/\s]/,Wn=/\\(\\)?/g,rr=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,_r=/\w*$/,$r=/^[-+]0x[0-9a-f]+$/i,si=/^0b[01]+$/i,Br=/^\[object .+?Constructor\]$/,Yr=/^0o[0-7]+$/i,Ss=/^(?:0|[1-9]\d*)$/,Oa=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Eo=/($^)/,Yl=/['\n\r\u2028\u2029\\]/g,nn="\\ud800-\\udfff",Rr="\\u0300-\\u036f",el="\\ufe20-\\ufe2f",La="\\u20d0-\\u20ff",Fs=Rr+el+La,zs="\\u2700-\\u27bf",Di="a-z\\xdf-\\xf6\\xf8-\\xff",kr="\\xac\\xb1\\xd7\\xf7",In="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Ir="\\u2000-\\u206f",Gr=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",yr="A-Z\\xc0-\\xd6\\xd8-\\xde",Pi="\\ufe0e\\ufe0f",ws=kr+In+Ir+Gr,fi="['’]",gs="["+nn+"]",tl="["+ws+"]",Na="["+Fs+"]",fc="\\d+",pc="["+zs+"]",Xs="["+Di+"]",Jo="[^"+nn+ws+fc+zs+Di+yr+"]",Xl="\\ud83c[\\udffb-\\udfff]",gu="(?:"+Na+"|"+Xl+")",mh="[^"+nn+"]",qo="(?:\\ud83c[\\udde6-\\uddff]){2}",vr="[\\ud800-\\udbff][\\udc00-\\udfff]",xi="["+yr+"]",Dc="\\u200d",gh="(?:"+Xs+"|"+Jo+")",Pc="(?:"+xi+"|"+Jo+")",El="(?:"+fi+"(?:d|ll|m|re|s|t|ve))?",_u="(?:"+fi+"(?:D|LL|M|RE|S|T|VE))?",xl=gu+"?",$l="["+Pi+"]?",br="(?:"+Dc+"(?:"+[mh,qo,vr].join("|")+")"+$l+xl+")*",Tr="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Kl="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",nl=$l+xl+br,rl="(?:"+[pc,qo,vr].join("|")+")"+nl,vu="(?:"+[mh+Na+"?",Na,qo,vr,gs].join("|")+")",Qi=RegExp(fi,"g"),_s=RegExp(Na,"g"),il=RegExp(Xl+"(?="+Xl+")|"+vu+nl,"g"),Cd=RegExp([xi+"?"+Xs+"+"+El+"(?="+[tl,xi,"$"].join("|")+")",Pc+"+"+_u+"(?="+[tl,xi+gh,"$"].join("|")+")",xi+"?"+gh+"+"+El,xi+"+"+_u,Kl,Tr,fc,rl].join("|"),"g"),io=RegExp("["+Dc+nn+Fs+Pi+"]"),zu=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ca=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],yu=-1,or={};or[Ke]=or[Oe]=or[Q]=or[te]=or[pe]=or[Ae]=or[Je]=or[jt]=or[Ge]=!0,or[qe]=or[Re]=or[It]=or[rt]=or[mt]=or[ft]=or[ze]=or[$e]=or[it]=or[st]=or[kt]=or[At]=or[gt]=or[xe]=or[Ye]=!1;var Gn={};Gn[qe]=Gn[Re]=Gn[It]=Gn[mt]=Gn[rt]=Gn[ft]=Gn[Ke]=Gn[Oe]=Gn[Q]=Gn[te]=Gn[pe]=Gn[it]=Gn[st]=Gn[kt]=Gn[At]=Gn[gt]=Gn[xe]=Gn[ie]=Gn[Ae]=Gn[Je]=Gn[jt]=Gn[Ge]=!0,Gn[ze]=Gn[$e]=Gn[Ye]=!1;var Es={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},so={"&":"&","<":"<",">":">",'"':""","'":"'"},Uu={"&":"&","<":"<",">":">",""":'"',"'":"'"},bu={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},_h=parseFloat,Da=parseInt,ha=typeof Vl=="object"&&Vl&&Vl.Object===Object&&Vl,Hu=typeof self=="object"&&self&&self.Object===Object&&self,wr=ha||Hu||Function("return this")(),Rs=e&&!e.nodeType&&e,bi=Rs&&!0&&n&&!n.nodeType&&n,$i=bi&&bi.exports===Rs,da=$i&&ha.process,Zr=function(){try{var ye=bi&&bi.require&&bi.require("util").types;return ye||da&&da.binding&&da.binding("util")}catch{}}(),Tu=Zr&&Zr.isArrayBuffer,xo=Zr&&Zr.isDate,Su=Zr&&Zr.isMap,sl=Zr&&Zr.isRegExp,Bi=Zr&&Zr.isSet,Ci=Zr&&Zr.isTypedArray;function Vn(ye,je,Be){switch(Be.length){case 0:return ye.call(je);case 1:return ye.call(je,Be[0]);case 2:return ye.call(je,Be[0],Be[1]);case 3:return ye.call(je,Be[0],Be[1],Be[2])}return ye.apply(je,Be)}function Mi(ye,je,Be,Ot){for(var rn=-1,Rn=ye==null?0:ye.length;++rn-1}function vh(ye,je,Be){for(var Ot=-1,rn=ye==null?0:ye.length;++Ot-1;);return Be}function fa(ye,je){for(var Be=ye.length;Be--&&ks(je,ye[Be],0)>-1;);return Be}function Eu(ye,je){for(var Be=ye.length,Ot=0;Be--;)ye[Be]===je&&++Ot;return Ot}var cf=Er(Es),hf=Er(so);function pd(ye){return"\\"+bu[ye]}function Wu(ye,je){return ye==null?t:ye[je]}function ol(ye){return io.test(ye)}function Fc(ye){return zu.test(ye)}function zh(ye){for(var je,Be=[];!(je=ye.next()).done;)Be.push(je.value);return Be}function Vu(ye){var je=-1,Be=Array(ye.size);return ye.forEach(function(Ot,rn){Be[++je]=[rn,Ot]}),Be}function Zl(ye,je){return function(Be){return ye(je(Be))}}function Us(ye,je){for(var Be=-1,Ot=ye.length,rn=0,Rn=[];++Be-1}function Yh(c,m){var E=this.__data__,N=ys(E,c);return N<0?(++this.size,E.push([c,m])):E[N][1]=m,this}os.prototype.clear=Yc,os.prototype.delete=na,os.prototype.get=Od,os.prototype.has=Ld,os.prototype.set=Yh;function Gs(c){var m=-1,E=c==null?0:c.length;for(this.clear();++m=m?c:m)),c}function ki(c,m,E,N,G,K){var ce,_e=m&y,Ee=m&b,tt=m&w;if(E&&(ce=G?E(c,N,G,K):E(c)),ce!==t)return ce;if(!ri(c))return c;var nt=On(c);if(nt){if(ce=Jm(c),!_e)return ni(c,ce)}else{var ht=hs(c),Rt=ht==$e||ht==He;if(ah(c))return eh(c,_e);if(ht==kt||ht==qe||Rt&&!G){if(ce=Ee||Rt?{}:xc(c),!_e)return Ee?yd(c,fl(ce,c)):qh(c,as(ce,c))}else{if(!Gn[ht])return G?c:{};ce=Zs(c,ht,_e)}}K||(K=new gi);var Kt=K.get(c);if(Kt)return Kt;K.set(c,ce),A_(c)?c.forEach(function(dn){ce.add(ki(dn,m,E,dn,c,K))}):td(c)&&c.forEach(function(dn,Yn){ce.set(Yn,ki(dn,m,E,Yn,c,K))});var pn=tt?Ee?Mr:cr:Ee?rs:wi,Ln=nt?t:pn(c);return Xr(Ln||c,function(dn,Yn){Ln&&(Yn=dn,dn=c[Yn]),$o(ce,Yn,ki(dn,m,E,Yn,c,K))}),ce}function Nd(c){var m=wi(c);return function(E){return Xc(E,c,m)}}function Xc(c,m,E){var N=E.length;if(c==null)return!N;for(c=vn(c);N--;){var G=E[N],K=m[G],ce=c[G];if(ce===t&&!(G in c)||!K(ce))return!1}return!0}function Kh(c,m,E){if(typeof c!="function")throw new Ti(l);return gf(function(){c.apply(t,E)},m)}function Uo(c,m,E,N){var G=-1,K=Pa,ce=!0,_e=c.length,Ee=[],tt=m.length;if(!_e)return Ee;E&&(m=hr(m,Wr(E))),N?(K=vh,ce=!1):m.length>=s&&(K=Sr,ce=!1,m=new Fo(m));e:for(;++G<_e;){var nt=c[G],ht=E==null?nt:E(nt);if(nt=N||nt!==0?nt:0,ce&&ht===ht){for(var Rt=tt;Rt--;)if(m[Rt]===ht)continue e;Ee.push(nt)}else K(m,ht,N)||Ee.push(nt)}return Ee}var Co=Qh(ls),df=Qh(Va,!0);function Cu(c,m){var E=!0;return Co(c,function(N,G,K){return E=!!m(N,G,K),E}),E}function Ol(c,m,E){for(var N=-1,G=c.length;++NG?0:G+E),N=N===t||N>G?G:An(N),N<0&&(N+=G),N=E>N?0:I0(N);E0&&E(_e)?m>1?Kr(_e,m-1,E,N,G):Qo(G,_e):N||(G[G.length]=_e)}return G}var ou=Ec(),Ju=Ec(!0);function ls(c,m){return c&&ou(c,m,wi)}function Va(c,m){return c&&Ju(c,m,wi)}function $s(c,m){return Vi(m,function(E){return Mc(c[E])})}function Cs(c,m){m=ia(m,c);for(var E=0,N=m.length;c!=null&&Em}function bc(c,m){return c!=null&&qn.call(c,m)}function ff(c,m){return c!=null&&m in vn(c)}function Eh(c,m,E){return c>=Ii(m,E)&&c=120&&nt.length>=120)?new Fo(ce&&nt):t}nt=c[0];var ht=-1,Rt=_e[0];e:for(;++ht-1;)_e!==c&&ju.call(_e,Ee,1),ju.call(c,Ee,1);return c}function bs(c,m){for(var E=c?m.length:0,N=E-1;E--;){var G=m[E];if(E==N||G!==K){var K=G;Ka(G)?ju.call(c,G,1):Qc(c,G)}}return c}function Os(c,m){return c+nu(Il()*(m-c+1))}function Ya(c,m,E,N){for(var G=-1,K=ei(Yu((m-c)/(E||1)),0),ce=Be(K);K--;)ce[N?K:++G]=c,c+=E;return ce}function Vs(c,m){var E="";if(!c||m<1||m>J)return E;do m%2&&(E+=c),m=nu(m/2),m&&(c+=c);while(m);return E}function fn(c,m){return Bd(nm(c,m,ko),c+"")}function Jc(c){return hl(Tf(c))}function wn(c,m){var E=Tf(c);return dr(E,Wa(m,0,E.length))}function vi(c,m,E,N){if(!ri(c))return c;m=ia(m,c);for(var G=-1,K=m.length,ce=K-1,_e=c;_e!=null&&++GG?0:G+m),E=E>G?G:E,E<0&&(E+=G),G=m>E?0:E-m>>>0,m>>>=0;for(var K=Be(G);++N>>1,ce=c[K];ce!==null&&!aa(ce)&&(E?ce<=m:ce=s){var tt=m?null:Dr(c);if(tt)return eu(tt);ce=!1,G=Sr,Ee=new Fo}else Ee=m?[]:_e;e:for(;++N=N?c:Ft(c,m,E)}var Iu=Vh||function(c){return wr.clearTimeout(c)};function eh(c,m){if(m)return c.slice();var E=c.length,N=Gh?Gh(E):new c.constructor(E);return c.copy(N),N}function wc(c){var m=new c.constructor(c.byteLength);return new Hc(m).set(new Hc(c)),m}function Go(c,m){var E=m?wc(c.buffer):c.buffer;return new c.constructor(E,c.byteOffset,c.byteLength)}function _o(c){var m=new c.constructor(c.source,_r.exec(c));return m.lastIndex=c.lastIndex,m}function rc(c){return Zi?vn(Zi.call(c)):{}}function Dl(c,m){var E=m?wc(c.buffer):c.buffer;return new c.constructor(E,c.byteOffset,c.length)}function vo(c,m){if(c!==m){var E=c!==t,N=c===null,G=c===c,K=aa(c),ce=m!==t,_e=m===null,Ee=m===m,tt=aa(m);if(!_e&&!tt&&!K&&c>m||K&&ce&&Ee&&!_e&&!tt||N&&ce&&Ee||!E&&Ee||!G)return 1;if(!N&&!K&&!tt&&c=_e)return Ee;var tt=E[N];return Ee*(tt=="desc"?-1:1)}}return c.index-m.index}function Xa(c,m,E,N){for(var G=-1,K=c.length,ce=E.length,_e=-1,Ee=m.length,tt=ei(K-ce,0),nt=Be(Ee+tt),ht=!N;++_e1?E[G-1]:t,ce=G>2?E[2]:t;for(K=c.length>3&&typeof K=="function"?(G--,K):t,ce&&Ur(E[0],E[1],ce)&&(K=G<3?t:K,G=1),m=vn(m);++N-1?G[K?m[ce]:ce]:t}}function B(c){return zn(function(m){var E=m.length,N=E,G=Cr.prototype.thru;for(c&&m.reverse();N--;){var K=m[N];if(typeof K!="function")throw new Ti(l);if(G&&!ce&&pf(K)=="wrapper")var ce=new Cr([],!0)}for(N=ce?N:E;++N1&&er.reverse(),nt&&Ee_e))return!1;var tt=K.get(c),nt=K.get(m);if(tt&&nt)return tt==m&&nt==c;var ht=-1,Rt=!0,Kt=E&M?new Fo:t;for(K.set(c,m),K.set(m,c);++ht<_e;){var pn=c[ht],Ln=m[ht];if(N)var dn=ce?N(Ln,pn,ht,m,c,K):N(pn,Ln,ht,c,m,K);if(dn!==t){if(dn)continue;Rt=!1;break}if(Kt){if(!Bc(m,function(Yn,er){if(!Sr(Kt,er)&&(pn===Yn||G(pn,Yn,E,N,K)))return Kt.push(er)})){Rt=!1;break}}else if(!(pn===Ln||G(pn,Ln,E,N,K))){Rt=!1;break}}return K.delete(c),K.delete(m),Rt}function En(c,m,E,N,G,K,ce){switch(E){case mt:if(c.byteLength!=m.byteLength||c.byteOffset!=m.byteOffset)return!1;c=c.buffer,m=m.buffer;case It:return!(c.byteLength!=m.byteLength||!K(new Hc(c),new Hc(m)));case rt:case ft:case st:return Ca(+c,+m);case ze:return c.name==m.name&&c.message==m.message;case At:case xe:return c==m+"";case it:var _e=Vu;case gt:var Ee=N&C;if(_e||(_e=eu),c.size!=m.size&&!Ee)return!1;var tt=ce.get(c);if(tt)return tt==m;N|=M,ce.set(c,m);var nt=on(_e(c),_e(m),N,G,K,ce);return ce.delete(c),nt;case ie:if(Zi)return Zi.call(c)==Zi.call(m)}return!1}function kn(c,m,E,N,G,K){var ce=E&C,_e=cr(c),Ee=_e.length,tt=cr(m),nt=tt.length;if(Ee!=nt&&!ce)return!1;for(var ht=Ee;ht--;){var Rt=_e[ht];if(!(ce?Rt in m:qn.call(m,Rt)))return!1}var Kt=K.get(c),pn=K.get(m);if(Kt&&pn)return Kt==m&&pn==c;var Ln=!0;K.set(c,m),K.set(m,c);for(var dn=ce;++ht1?"& ":"")+m[N],m=m.join(E>2?", ":" "),c.replace(De,`{ /* [wrapped with `+m+`] */ -`)}function Dd(c){return kn(c)||Yd(c)||!!(md&&c&&c[md])}function Ka(c,m){var E=typeof c;return m=m??J,!!m&&(E=="number"||E!="symbol"&&Ss.test(c))&&c>-1&&c%1==0&&c0){if(++m>=q)return arguments[0]}else m=0;return c.apply(t,arguments)}}function dr(c,m){var E=-1,N=c.length,G=N-1;for(m=m===t?N:m;++E1?c[m-1]:t;return E=typeof E=="function"?(c.pop(),E):t,Rp(c,E)});function Ou(c){var m=X(c);return m.__chain__=!0,m}function Og(c,m){return m(c),c}function jf(c,m){return m(c)}var ed=zn(function(c){var m=c.length,E=m?c[0]:0,N=this.__wrapped__,G=function(K){return Xh(K,c)};return m>1||this.__actions__.length||!(N instanceof mn)||!Ka(E)?this.thru(G):(N=N.slice(E,+E+(m?1:0)),N.__actions__.push({func:jf,args:[G],thisArg:t}),new Cr(N,this.__chain__).thru(function(K){return m&&!K.length&&K.push(t),K}))});function hm(){return Ou(this)}function Yf(){return new Cr(this.value(),this.__chain__)}function Xf(){this.__values__===t&&(this.__values__=Bv(this.value()));var c=this.__index__>=this.__values__.length,m=c?t:this.__values__[this.__index__++];return{done:c,value:m}}function kp(){return this}function bd(c){for(var m,E=this;E instanceof ga;){var N=Fd(E);N.__index__=0,N.__values__=t,m?G.__wrapped__=N:m=N;var G=N;E=E.__wrapped__}return G.__wrapped__=c,m}function yf(){var c=this.__wrapped__;if(c instanceof mn){var m=c;return this.__actions__.length&&(m=new mn(this)),m=m.reverse(),m.__actions__.push({func:jf,args:[$a],thisArg:t}),new Cr(m,this.__chain__)}return this.thru($a)}function eg(){return Zc(this.__wrapped__,this.__actions__)}var kv=Ta(function(c,m,E){qn.call(c,E)?++c[E]:zo(c,E,1)});function Lg(c,m,E){var N=kn(c)?wu:Cu;return E&&Ur(c,m,E)&&(m=t),N(c,ln(m,3))}function Vd(c,m){var E=kn(c)?Vi:yc;return E(c,ln(m,3))}var Li=I(zd),dm=I(Ud);function tg(c,m){return Kr(Si(c,m),1)}function Ng(c,m){return Kr(Si(c,m),we)}function Ov(c,m,E){return E=E===t?1:Mn(E),Kr(Si(c,m),E)}function ng(c,m){var E=kn(c)?Xr:Co;return E(c,ln(m,3))}function Op(c,m){var E=kn(c)?dd:df;return E(c,ln(m,3))}var rg=Ta(function(c,m,E){qn.call(c,E)?c[E].push(m):zo(c,E,[m])});function Kf(c,m,E,N){c=Hi(c)?c:Tf(c),E=E&&!N?Mn(E):0;var G=c.length;return E<0&&(E=ei(G+E,0)),vm(c)?E<=G&&c.indexOf(m,E)>-1:!!G&&ks(c,m,E)>-1}var Jf=fn(function(c,m,E){var N=-1,G=typeof m=="function",K=Hi(c)?Be(c.length):[];return Co(c,function(ce){K[++N]=G?Vn(m,ce,E):Pn(ce,m,E)}),K}),fm=Ta(function(c,m,E){zo(c,E,m)});function Si(c,m){var E=kn(c)?hr:Mu;return E(c,ln(m,3))}function qf(c,m,E,N){return c==null?[]:(kn(m)||(m=m==null?[]:[m]),E=N?t:E,kn(E)||(E=E==null?[]:[E]),Zu(c,m,E))}var pm=Ta(function(c,m,E){c[E?0:1].push(m)},function(){return[[],[]]});function mm(c,m,E){var N=kn(c)?fd:oo,G=arguments.length<3;return N(c,ln(m,4),E,G,Co)}function Lp(c,m,E){var N=kn(c)?lf:oo,G=arguments.length<3;return N(c,ln(m,4),E,G,df)}function Dg(c,m){var E=kn(c)?Vi:yc;return E(c,Et(ln(m,3)))}function v(c){var m=kn(c)?hl:Jc;return m(c)}function T(c,m,E){(E?Ur(c,m,E):m===t)?m=1:m=Mn(m);var N=kn(c)?vc:wn;return N(c,m)}function R(c){var m=kn(c)?wp:Nl;return m(c)}function F(c){if(c==null)return 0;if(Hi(c))return vm(c)?is(c):c.length;var m=hs(c);return m==rt||m==mt?c.size:ho(c).length}function Y(c,m,E){var N=kn(c)?Bc:pl;return E&&Ur(c,m,E)&&(m=t),N(c,ln(m,3))}var ee=fn(function(c,m){if(c==null)return[];var E=m.length;return E>1&&Ur(c,m[0],m[1])?m=[]:E>2&&Ur(m[0],m[1],m[2])&&(m=[m[0]]),Zu(c,Kr(m,1),[])}),be=zi||function(){return wr.Date.now()};function Ye(c,m){if(typeof m!="function")throw new Ti(l);return c=Mn(c),function(){if(--c<1)return m.apply(this,arguments)}}function at(c,m,E){return m=E?t:m,m=c&&m==null?c.length:m,Me(c,V,t,t,t,t,m)}function Lt(c,m){var E;if(typeof m!="function")throw new Ti(l);return c=Mn(c),function(){return--c>0&&(E=m.apply(this,arguments)),c<=1&&(m=t),E}}var Zt=fn(function(c,m,E){var N=A;if(E.length){var G=Us(E,Mh(Zt));N|=z}return Me(c,N,m,E,G)}),hn=fn(function(c,m,E){var N=A|k;if(E.length){var G=Us(E,Mh(hn));N|=z}return Me(m,N,c,E,G)});function an(c,m,E){m=E?t:m;var N=Me(c,P,t,t,t,t,t,m);return N.placeholder=an.placeholder,N}function Dn(c,m,E){m=E?t:m;var N=Me(c,D,t,t,t,t,t,m);return N.placeholder=Dn.placeholder,N}function Zn(c,m,E){var N,G,K,ce,_e,Ee,et=0,tt=!1,ct=!1,Rt=!0;if(typeof c!="function")throw new Ti(l);m=Ki(m)||0,ri(E)&&(tt=!!E.leading,ct="maxWait"in E,K=ct?ei(Ki(E.maxWait)||0,m):K,Rt="trailing"in E?!!E.trailing:Rt);function Xt(yi){var Hl=N,Ic=G;return N=G=t,et=yi,ce=c.apply(Ic,Hl),ce}function pn(yi){return et=yi,_e=gf(Yn,m),tt?Xt(yi):ce}function Ln(yi){var Hl=yi-Ee,Ic=yi-et,Yv=m-Hl;return ct?Ii(Yv,K-Ic):Yv}function dn(yi){var Hl=yi-Ee,Ic=yi-et;return Ee===t||Hl>=m||Hl<0||ct&&Ic>=K}function Yn(){var yi=be();if(dn(yi))return er(yi);_e=gf(Yn,Ln(yi))}function er(yi){return _e=t,Rt&&N?Xt(yi):(N=G=t,ce)}function la(){_e!==t&&Iu(_e),et=0,N=Ee=G=_e=t}function to(){return _e===t?ce:er(be())}function Ds(){var yi=be(),Hl=dn(yi);if(N=arguments,G=this,Ee=yi,Hl){if(_e===t)return pn(Ee);if(ct)return Iu(_e),_e=gf(Yn,m),Xt(Ee)}return _e===t&&(_e=gf(Yn,m)),ce}return Ds.cancel=la,Ds.flush=to,Ds}var ir=fn(function(c,m){return Kh(c,1,m)}),Io=fn(function(c,m,E){return Kh(c,Ki(m)||0,E)});function xt(c){return Me(c,oe)}function dt(c,m){if(typeof c!="function"||m!=null&&typeof m!="function")throw new Ti(l);var E=function(){var N=arguments,G=m?m.apply(this,N):N[0],K=E.cache;if(K.has(G))return K.get(G);var ce=c.apply(this,N);return E.cache=K.set(G,ce)||K,ce};return E.cache=new(dt.Cache||Gs),E}dt.Cache=Gs;function Et(c){if(typeof c!="function")throw new Ti(l);return function(){var m=arguments;switch(m.length){case 0:return!c.call(this);case 1:return!c.call(this,m[0]);case 2:return!c.call(this,m[0],m[1]);case 3:return!c.call(this,m[0],m[1],m[2])}return!c.apply(this,m)}}function Sn(c){return Lt(2,c)}var lr=Ch(function(c,m){m=m.length==1&&kn(m[0])?hr(m[0],Wr(ln())):hr(Kr(m,1),Wr(ln()));var E=m.length;return fn(function(N){for(var G=-1,K=Ii(N.length,E);++G=m}),Yd=tr(function(){return arguments}())?tr:function(c){return di(c)&&qn.call(c,"callee")&&!gc.call(c,"callee")},kn=Be.isArray,Lv=Tu?Wr(Tu):Nr;function Hi(c){return c!=null&&Ah(c.length)&&!Mc(c)}function Jr(c){return di(c)&&Hi(c)}function ab(c){return c===!0||c===!1||di(c)&&_i(c)==nt}var ah=Id||wm,gT=xo?Wr(xo):ti;function bf(c){return di(c)&&c.nodeType===1&&!Hr(c)}function M_(c){if(c==null)return!0;if(Hi(c)&&(kn(c)||typeof c=="string"||typeof c.splice=="function"||ah(c)||Jd(c)||Yd(c)))return!c.length;var m=hs(c);if(m==rt||m==mt)return!c.size;if($c(c))return!ho(c).length;for(var E in c)if(qn.call(c,E))return!1;return!0}function Gi(c,m){return qr(c,m)}function Ro(c,m,E){E=typeof E=="function"?E:t;var N=E?E(c,m):t;return N===t?qr(c,m,t,E):!!N}function C0(c){if(!di(c))return!1;var m=_i(c);return m==ze||m==lt||typeof c.message=="string"&&typeof c.name=="string"&&!Hr(c)}function Nv(c){return typeof c=="number"&&Al(c)}function Mc(c){if(!ri(c))return!1;var m=_i(c);return m==Ce||m==He||m==Qe||m==Mt}function M0(c){return typeof c=="number"&&c==Mn(c)}function Ah(c){return typeof c=="number"&&c>-1&&c%1==0&&c<=J}function ri(c){var m=typeof c;return c!=null&&(m=="object"||m=="function")}function di(c){return c!=null&&typeof c=="object"}var td=Su?Wr(Su):us;function As(c,m){return c===m||ts(c,m,em(m))}function _m(c,m,E){return E=typeof E=="function"?E:t,ts(c,m,em(m),E)}function Dv(c){return Xd(c)&&c!=+c}function Pv(c){if(S_(c))throw new rn(o);return au(c)}function A0(c){return c===null}function SE(c){return c==null}function Xd(c){return typeof c=="number"||di(c)&&_i(c)==it}function Hr(c){if(!di(c)||_i(c)!=kt)return!1;var m=Ha(c);if(m===null)return!0;var E=qn.call(m,"constructor")&&m.constructor;return typeof E=="function"&&E instanceof E&&$u.call(E)==Ua}var Kd=sl?Wr(sl):qu;function qa(c){return M0(c)&&c>=-J&&c<=J}var A_=Bi?Wr(Bi):Tc;function vm(c){return typeof c=="string"||!kn(c)&&di(c)&&_i(c)==xe}function aa(c){return typeof c=="symbol"||di(c)&&_i(c)==se}var Jd=Ci?Wr(Ci):Qu;function _T(c){return c===t}function vT(c){return di(c)&&hs(c)==ht}function nd(c){return di(c)&&_i(c)==St}var lb=bn(ba),Zf=bn(function(c,m){return c<=m});function Bv(c){if(!c)return[];if(Hi(c))return vm(c)?Fr(c):ni(c);if(ea&&c[ea])return zh(c[ea]());var m=hs(c),E=m==rt?Vu:m==mt?eu:Tf;return E(c)}function Ac(c){if(!c)return c===0?c:0;if(c=Ki(c),c===we||c===-we){var m=c<0?-1:1;return m*re}return c===c?c:0}function Mn(c){var m=Ac(c),E=m%1;return m===m?E?m-E:m:0}function I0(c){return c?Wa(Mn(c),0,fe):0}function Ki(c){if(typeof c=="number")return c;if(aa(c))return ie;if(ri(c)){var m=typeof c.valueOf=="function"?c.valueOf():c;c=ri(m)?m+"":m}if(typeof c!="string")return c===0?c:+c;c=Fh(c);var E=si.test(c);return E||Yr.test(c)?Da(c.slice(2),E?2:8):$r.test(c)?ie:+c}function ub(c){return cs(c,rs(c))}function ut(c){return c?Wa(Mn(c),-J,J):c===0?c:0}function sr(c){return c==null?"":oi(c)}var I_=Sa(function(c,m){if($c(m)||Hi(m)){cs(m,wi(m),c);return}for(var E in m)qn.call(m,E)&&$o(c,E,m[E])}),R_=Sa(function(c,m){cs(m,rs(m),c)}),rd=Sa(function(c,m,E,N){cs(m,rs(m),c,N)}),ig=Sa(function(c,m,E,N){cs(m,wi(m),c,N)}),Fv=zn(Xh);function R0(c,m){var E=xs(c);return m==null?E:as(E,m)}var cb=fn(function(c,m){c=vn(c);var E=-1,N=m.length,G=N>2?m[2]:t;for(G&&Ur(m[0],m[1],G)&&(N=1);++E1),K}),cs(c,Mr(c),E),N&&(E=ki(E,y|b|w,Ht));for(var G=m.length;G--;)Qc(E,m[G]);return E});function k0(c,m){return N_(c,Et(ln(m)))}var en=zn(function(c,m){return c==null?{}:ec(c,m)});function N_(c,m){if(c==null)return{};var E=hr(Mr(c),function(N){return[N]});return m=ln(m),xh(c,E,function(N,G){return m(N,G[0])})}function wE(c,m,E){m=ia(m,c);var N=-1,G=m.length;for(G||(G=1,c=t);++Nm){var N=c;c=m,m=N}if(E||c%1||m%1){var G=Il();return Ii(c+G*(m-c+_h("1e-"+((G+"").length-1))),m)}return Os(c,m)}var mb=d(function(c,m,E){return m=m.toLowerCase(),c+(E?Sm(m):m)});function Sm(c){return P0(sr(c).toLowerCase())}function Uv(c){return c=sr(c),c&&c.replace(Oa,cf).replace(_s,"")}function gb(c,m,E){c=sr(c),m=oi(m);var N=c.length;E=E===t?N:Wa(Mn(E),0,N);var G=E;return E-=m.length,E>=0&&c.slice(E,G)==m}function _b(c){return c=sr(c),c&&Pr.test(c)?c.replace(On,hf):c}function vb(c){return c=sr(c),c&&zt.test(c)?c.replace(ot,"\\$&"):c}var B_=d(function(c,m,E){return c+(E?"-":"")+m.toLowerCase()}),CE=d(function(c,m,E){return c+(E?" ":"")+m.toLowerCase()}),CT=x("toLowerCase");function ME(c,m,E){c=sr(c),m=Mn(m);var N=m?is(c):0;if(!m||N>=m)return c;var G=(m-N)/2;return wt(nu(G),E)+c+wt(Yu(G),E)}function AE(c,m,E){c=sr(c),m=Mn(m);var N=m?is(c):0;return m&&N>>0,E?(c=sr(c),c&&(typeof m=="string"||m!=null&&!Kd(m))&&(m=oi(m),!m&&ol(c))?go(Fr(c),0,E):c.split(m,E)):[]}var F_=d(function(c,m,E){return c+(E?" ":"")+P0(m)});function AT(c,m,E){return c=sr(c),E=E==null?0:Wa(Mn(E),0,c.length),m=oi(m),c.slice(E,E+m.length)==m}function Sb(c,m,E){var N=X.templateSettings;E&&Ur(c,m,E)&&(m=t),c=sr(c),m=rd({},m,N,Ne);var G=rd({},m.imports,N.imports,Ne),K=wi(G),ce=Ai(G,K),_e,Ee,et=0,tt=m.interpolate||Eo,ct="__p += '",Rt=zr((m.escape||Eo).source+"|"+tt.source+"|"+(tt===mr?rr:Eo).source+"|"+(m.evaluate||Eo).source+"|$","g"),Xt="//# sourceURL="+(qn.call(m,"sourceURL")?(m.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++yu+"]")+` -`;c.replace(Rt,function(dn,Yn,er,la,to,Ds){return er||(er=la),ct+=c.slice(et,Ds).replace(Yl,pd),Yn&&(_e=!0,ct+=`' + +`)}function Dd(c){return On(c)||Yd(c)||!!(md&&c&&c[md])}function Ka(c,m){var E=typeof c;return m=m??J,!!m&&(E=="number"||E!="symbol"&&Ss.test(c))&&c>-1&&c%1==0&&c0){if(++m>=q)return arguments[0]}else m=0;return c.apply(t,arguments)}}function dr(c,m){var E=-1,N=c.length,G=N-1;for(m=m===t?N:m;++E1?c[m-1]:t;return E=typeof E=="function"?(c.pop(),E):t,Rp(c,E)});function Ou(c){var m=X(c);return m.__chain__=!0,m}function Og(c,m){return m(c),c}function jf(c,m){return m(c)}var ed=zn(function(c){var m=c.length,E=m?c[0]:0,N=this.__wrapped__,G=function(K){return Xh(K,c)};return m>1||this.__actions__.length||!(N instanceof mn)||!Ka(E)?this.thru(G):(N=N.slice(E,+E+(m?1:0)),N.__actions__.push({func:jf,args:[G],thisArg:t}),new Cr(N,this.__chain__).thru(function(K){return m&&!K.length&&K.push(t),K}))});function hm(){return Ou(this)}function Yf(){return new Cr(this.value(),this.__chain__)}function Xf(){this.__values__===t&&(this.__values__=Bv(this.value()));var c=this.__index__>=this.__values__.length,m=c?t:this.__values__[this.__index__++];return{done:c,value:m}}function kp(){return this}function bd(c){for(var m,E=this;E instanceof ga;){var N=Fd(E);N.__index__=0,N.__values__=t,m?G.__wrapped__=N:m=N;var G=N;E=E.__wrapped__}return G.__wrapped__=c,m}function yf(){var c=this.__wrapped__;if(c instanceof mn){var m=c;return this.__actions__.length&&(m=new mn(this)),m=m.reverse(),m.__actions__.push({func:jf,args:[$a],thisArg:t}),new Cr(m,this.__chain__)}return this.thru($a)}function eg(){return Zc(this.__wrapped__,this.__actions__)}var kv=Ta(function(c,m,E){qn.call(c,E)?++c[E]:zo(c,E,1)});function Lg(c,m,E){var N=On(c)?wu:Cu;return E&&Ur(c,m,E)&&(m=t),N(c,ln(m,3))}function Vd(c,m){var E=On(c)?Vi:yc;return E(c,ln(m,3))}var Li=I(zd),dm=I(Ud);function tg(c,m){return Kr(Si(c,m),1)}function Ng(c,m){return Kr(Si(c,m),we)}function Ov(c,m,E){return E=E===t?1:An(E),Kr(Si(c,m),E)}function ng(c,m){var E=On(c)?Xr:Co;return E(c,ln(m,3))}function Op(c,m){var E=On(c)?dd:df;return E(c,ln(m,3))}var rg=Ta(function(c,m,E){qn.call(c,E)?c[E].push(m):zo(c,E,[m])});function Kf(c,m,E,N){c=Hi(c)?c:Tf(c),E=E&&!N?An(E):0;var G=c.length;return E<0&&(E=ei(G+E,0)),vm(c)?E<=G&&c.indexOf(m,E)>-1:!!G&&ks(c,m,E)>-1}var Jf=fn(function(c,m,E){var N=-1,G=typeof m=="function",K=Hi(c)?Be(c.length):[];return Co(c,function(ce){K[++N]=G?Vn(m,ce,E):Pn(ce,m,E)}),K}),fm=Ta(function(c,m,E){zo(c,E,m)});function Si(c,m){var E=On(c)?hr:Mu;return E(c,ln(m,3))}function qf(c,m,E,N){return c==null?[]:(On(m)||(m=m==null?[]:[m]),E=N?t:E,On(E)||(E=E==null?[]:[E]),Zu(c,m,E))}var pm=Ta(function(c,m,E){c[E?0:1].push(m)},function(){return[[],[]]});function mm(c,m,E){var N=On(c)?fd:oo,G=arguments.length<3;return N(c,ln(m,4),E,G,Co)}function Lp(c,m,E){var N=On(c)?lf:oo,G=arguments.length<3;return N(c,ln(m,4),E,G,df)}function Dg(c,m){var E=On(c)?Vi:yc;return E(c,Et(ln(m,3)))}function v(c){var m=On(c)?hl:Jc;return m(c)}function T(c,m,E){(E?Ur(c,m,E):m===t)?m=1:m=An(m);var N=On(c)?vc:wn;return N(c,m)}function R(c){var m=On(c)?wp:Nl;return m(c)}function F(c){if(c==null)return 0;if(Hi(c))return vm(c)?is(c):c.length;var m=hs(c);return m==it||m==gt?c.size:ho(c).length}function Y(c,m,E){var N=On(c)?Bc:pl;return E&&Ur(c,m,E)&&(m=t),N(c,ln(m,3))}var ee=fn(function(c,m){if(c==null)return[];var E=m.length;return E>1&&Ur(c,m[0],m[1])?m=[]:E>2&&Ur(m[0],m[1],m[2])&&(m=[m[0]]),Zu(c,Kr(m,1),[])}),be=zi||function(){return wr.Date.now()};function Xe(c,m){if(typeof m!="function")throw new Ti(l);return c=An(c),function(){if(--c<1)return m.apply(this,arguments)}}function lt(c,m,E){return m=E?t:m,m=c&&m==null?c.length:m,Ce(c,V,t,t,t,t,m)}function Lt(c,m){var E;if(typeof m!="function")throw new Ti(l);return c=An(c),function(){return--c>0&&(E=m.apply(this,arguments)),c<=1&&(m=t),E}}var en=fn(function(c,m,E){var N=A;if(E.length){var G=Us(E,Mh(en));N|=z}return Ce(c,N,m,E,G)}),hn=fn(function(c,m,E){var N=A|k;if(E.length){var G=Us(E,Mh(hn));N|=z}return Ce(m,N,c,E,G)});function an(c,m,E){m=E?t:m;var N=Ce(c,P,t,t,t,t,t,m);return N.placeholder=an.placeholder,N}function Dn(c,m,E){m=E?t:m;var N=Ce(c,D,t,t,t,t,t,m);return N.placeholder=Dn.placeholder,N}function Zn(c,m,E){var N,G,K,ce,_e,Ee,tt=0,nt=!1,ht=!1,Rt=!0;if(typeof c!="function")throw new Ti(l);m=Ki(m)||0,ri(E)&&(nt=!!E.leading,ht="maxWait"in E,K=ht?ei(Ki(E.maxWait)||0,m):K,Rt="trailing"in E?!!E.trailing:Rt);function Kt(yi){var Hl=N,Ic=G;return N=G=t,tt=yi,ce=c.apply(Ic,Hl),ce}function pn(yi){return tt=yi,_e=gf(Yn,m),nt?Kt(yi):ce}function Ln(yi){var Hl=yi-Ee,Ic=yi-tt,Yv=m-Hl;return ht?Ii(Yv,K-Ic):Yv}function dn(yi){var Hl=yi-Ee,Ic=yi-tt;return Ee===t||Hl>=m||Hl<0||ht&&Ic>=K}function Yn(){var yi=be();if(dn(yi))return er(yi);_e=gf(Yn,Ln(yi))}function er(yi){return _e=t,Rt&&N?Kt(yi):(N=G=t,ce)}function la(){_e!==t&&Iu(_e),tt=0,N=Ee=G=_e=t}function to(){return _e===t?ce:er(be())}function Ds(){var yi=be(),Hl=dn(yi);if(N=arguments,G=this,Ee=yi,Hl){if(_e===t)return pn(Ee);if(ht)return Iu(_e),_e=gf(Yn,m),Kt(Ee)}return _e===t&&(_e=gf(Yn,m)),ce}return Ds.cancel=la,Ds.flush=to,Ds}var ir=fn(function(c,m){return Kh(c,1,m)}),Io=fn(function(c,m,E){return Kh(c,Ki(m)||0,E)});function xt(c){return Ce(c,oe)}function dt(c,m){if(typeof c!="function"||m!=null&&typeof m!="function")throw new Ti(l);var E=function(){var N=arguments,G=m?m.apply(this,N):N[0],K=E.cache;if(K.has(G))return K.get(G);var ce=c.apply(this,N);return E.cache=K.set(G,ce)||K,ce};return E.cache=new(dt.Cache||Gs),E}dt.Cache=Gs;function Et(c){if(typeof c!="function")throw new Ti(l);return function(){var m=arguments;switch(m.length){case 0:return!c.call(this);case 1:return!c.call(this,m[0]);case 2:return!c.call(this,m[0],m[1]);case 3:return!c.call(this,m[0],m[1],m[2])}return!c.apply(this,m)}}function Sn(c){return Lt(2,c)}var lr=Ch(function(c,m){m=m.length==1&&On(m[0])?hr(m[0],Wr(ln())):hr(Kr(m,1),Wr(ln()));var E=m.length;return fn(function(N){for(var G=-1,K=Ii(N.length,E);++G=m}),Yd=tr(function(){return arguments}())?tr:function(c){return di(c)&&qn.call(c,"callee")&&!gc.call(c,"callee")},On=Be.isArray,Lv=Tu?Wr(Tu):Nr;function Hi(c){return c!=null&&Ah(c.length)&&!Mc(c)}function Jr(c){return di(c)&&Hi(c)}function ab(c){return c===!0||c===!1||di(c)&&_i(c)==rt}var ah=Id||wm,_T=xo?Wr(xo):ti;function bf(c){return di(c)&&c.nodeType===1&&!Hr(c)}function M_(c){if(c==null)return!0;if(Hi(c)&&(On(c)||typeof c=="string"||typeof c.splice=="function"||ah(c)||Jd(c)||Yd(c)))return!c.length;var m=hs(c);if(m==it||m==gt)return!c.size;if($c(c))return!ho(c).length;for(var E in c)if(qn.call(c,E))return!1;return!0}function Gi(c,m){return qr(c,m)}function Ro(c,m,E){E=typeof E=="function"?E:t;var N=E?E(c,m):t;return N===t?qr(c,m,t,E):!!N}function C0(c){if(!di(c))return!1;var m=_i(c);return m==ze||m==ut||typeof c.message=="string"&&typeof c.name=="string"&&!Hr(c)}function Nv(c){return typeof c=="number"&&Al(c)}function Mc(c){if(!ri(c))return!1;var m=_i(c);return m==$e||m==He||m==Ze||m==Ct}function M0(c){return typeof c=="number"&&c==An(c)}function Ah(c){return typeof c=="number"&&c>-1&&c%1==0&&c<=J}function ri(c){var m=typeof c;return c!=null&&(m=="object"||m=="function")}function di(c){return c!=null&&typeof c=="object"}var td=Su?Wr(Su):us;function As(c,m){return c===m||ts(c,m,em(m))}function _m(c,m,E){return E=typeof E=="function"?E:t,ts(c,m,em(m),E)}function Dv(c){return Xd(c)&&c!=+c}function Pv(c){if(S_(c))throw new rn(o);return au(c)}function A0(c){return c===null}function SE(c){return c==null}function Xd(c){return typeof c=="number"||di(c)&&_i(c)==st}function Hr(c){if(!di(c)||_i(c)!=kt)return!1;var m=Ha(c);if(m===null)return!0;var E=qn.call(m,"constructor")&&m.constructor;return typeof E=="function"&&E instanceof E&&$u.call(E)==Ua}var Kd=sl?Wr(sl):qu;function qa(c){return M0(c)&&c>=-J&&c<=J}var A_=Bi?Wr(Bi):Tc;function vm(c){return typeof c=="string"||!On(c)&&di(c)&&_i(c)==xe}function aa(c){return typeof c=="symbol"||di(c)&&_i(c)==ie}var Jd=Ci?Wr(Ci):Qu;function vT(c){return c===t}function yT(c){return di(c)&&hs(c)==Ye}function nd(c){return di(c)&&_i(c)==St}var lb=bn(ba),Zf=bn(function(c,m){return c<=m});function Bv(c){if(!c)return[];if(Hi(c))return vm(c)?Fr(c):ni(c);if(ea&&c[ea])return zh(c[ea]());var m=hs(c),E=m==it?Vu:m==gt?eu:Tf;return E(c)}function Ac(c){if(!c)return c===0?c:0;if(c=Ki(c),c===we||c===-we){var m=c<0?-1:1;return m*re}return c===c?c:0}function An(c){var m=Ac(c),E=m%1;return m===m?E?m-E:m:0}function I0(c){return c?Wa(An(c),0,fe):0}function Ki(c){if(typeof c=="number")return c;if(aa(c))return se;if(ri(c)){var m=typeof c.valueOf=="function"?c.valueOf():c;c=ri(m)?m+"":m}if(typeof c!="string")return c===0?c:+c;c=Fh(c);var E=si.test(c);return E||Yr.test(c)?Da(c.slice(2),E?2:8):$r.test(c)?se:+c}function ub(c){return cs(c,rs(c))}function ct(c){return c?Wa(An(c),-J,J):c===0?c:0}function sr(c){return c==null?"":oi(c)}var I_=Sa(function(c,m){if($c(m)||Hi(m)){cs(m,wi(m),c);return}for(var E in m)qn.call(m,E)&&$o(c,E,m[E])}),R_=Sa(function(c,m){cs(m,rs(m),c)}),rd=Sa(function(c,m,E,N){cs(m,rs(m),c,N)}),ig=Sa(function(c,m,E,N){cs(m,wi(m),c,N)}),Fv=zn(Xh);function R0(c,m){var E=xs(c);return m==null?E:as(E,m)}var cb=fn(function(c,m){c=vn(c);var E=-1,N=m.length,G=N>2?m[2]:t;for(G&&Ur(m[0],m[1],G)&&(N=1);++E1),K}),cs(c,Mr(c),E),N&&(E=ki(E,y|b|w,Ht));for(var G=m.length;G--;)Qc(E,m[G]);return E});function k0(c,m){return N_(c,Et(ln(m)))}var tn=zn(function(c,m){return c==null?{}:ec(c,m)});function N_(c,m){if(c==null)return{};var E=hr(Mr(c),function(N){return[N]});return m=ln(m),xh(c,E,function(N,G){return m(N,G[0])})}function wE(c,m,E){m=ia(m,c);var N=-1,G=m.length;for(G||(G=1,c=t);++Nm){var N=c;c=m,m=N}if(E||c%1||m%1){var G=Il();return Ii(c+G*(m-c+_h("1e-"+((G+"").length-1))),m)}return Os(c,m)}var mb=d(function(c,m,E){return m=m.toLowerCase(),c+(E?Sm(m):m)});function Sm(c){return P0(sr(c).toLowerCase())}function Uv(c){return c=sr(c),c&&c.replace(Oa,cf).replace(_s,"")}function gb(c,m,E){c=sr(c),m=oi(m);var N=c.length;E=E===t?N:Wa(An(E),0,N);var G=E;return E-=m.length,E>=0&&c.slice(E,G)==m}function _b(c){return c=sr(c),c&&Pr.test(c)?c.replace(xn,hf):c}function vb(c){return c=sr(c),c&&zt.test(c)?c.replace(at,"\\$&"):c}var B_=d(function(c,m,E){return c+(E?"-":"")+m.toLowerCase()}),CE=d(function(c,m,E){return c+(E?" ":"")+m.toLowerCase()}),MT=x("toLowerCase");function ME(c,m,E){c=sr(c),m=An(m);var N=m?is(c):0;if(!m||N>=m)return c;var G=(m-N)/2;return wt(nu(G),E)+c+wt(Yu(G),E)}function AE(c,m,E){c=sr(c),m=An(m);var N=m?is(c):0;return m&&N>>0,E?(c=sr(c),c&&(typeof m=="string"||m!=null&&!Kd(m))&&(m=oi(m),!m&&ol(c))?go(Fr(c),0,E):c.split(m,E)):[]}var F_=d(function(c,m,E){return c+(E?" ":"")+P0(m)});function IT(c,m,E){return c=sr(c),E=E==null?0:Wa(An(E),0,c.length),m=oi(m),c.slice(E,E+m.length)==m}function Sb(c,m,E){var N=X.templateSettings;E&&Ur(c,m,E)&&(m=t),c=sr(c),m=rd({},m,N,Le);var G=rd({},m.imports,N.imports,Le),K=wi(G),ce=Ai(G,K),_e,Ee,tt=0,nt=m.interpolate||Eo,ht="__p += '",Rt=zr((m.escape||Eo).source+"|"+nt.source+"|"+(nt===mr?rr:Eo).source+"|"+(m.evaluate||Eo).source+"|$","g"),Kt="//# sourceURL="+(qn.call(m,"sourceURL")?(m.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++yu+"]")+` +`;c.replace(Rt,function(dn,Yn,er,la,to,Ds){return er||(er=la),ht+=c.slice(tt,Ds).replace(Yl,pd),Yn&&(_e=!0,ht+=`' + __e(`+Yn+`) + -'`),to&&(Ee=!0,ct+=`'; +'`),to&&(Ee=!0,ht+=`'; `+to+`; -__p += '`),er&&(ct+=`' + +__p += '`),er&&(ht+=`' + ((__t = (`+er+`)) == null ? '' : __t) + -'`),et=Ds+dn.length,dn}),ct+=`'; -`;var pn=qn.call(m,"variable")&&m.variable;if(!pn)ct=`with (obj) { -`+ct+` +'`),tt=Ds+dn.length,dn}),ht+=`'; +`;var pn=qn.call(m,"variable")&&m.variable;if(!pn)ht=`with (obj) { +`+ht+` } -`;else if(Vt.test(pn))throw new rn(u);ct=(Ee?ct.replace(tn,""):ct).replace(_t,"$1").replace(Jt,"$1;"),ct="function("+(pn||"obj")+`) { +`;else if(Wt.test(pn))throw new rn(u);ht=(Ee?ht.replace(qt,""):ht).replace(pt,"$1").replace(Jt,"$1;"),ht="function("+(pn||"obj")+`) { `+(pn?"":`obj || (obj = {}); `)+"var __t, __p = ''"+(_e?", __e = _.escape":"")+(Ee?`, __j = Array.prototype.join; function print() { __p += __j.call(arguments, '') } `:`; -`)+ct+`return __p -}`;var Ln=B0(function(){return In(K,Xt+"return "+ct).apply(t,ce)});if(Ln.source=ct,C0(Ln))throw Ln;return Ln}function sd(c){return sr(c).toLowerCase()}function Dp(c){return sr(c).toUpperCase()}function IT(c,m,E){if(c=sr(c),c&&(E||m===t))return Fh(c);if(!c||!(m=oi(m)))return c;var N=Fr(c),G=Fr(m),K=ji(N,G),ce=fa(N,G)+1;return go(N,K,ce).join("")}function Hv(c,m,E){if(c=sr(c),c&&(E||m===t))return c.slice(0,Cl(c)+1);if(!c||!(m=oi(m)))return c;var N=Fr(c),G=fa(N,Fr(m))+1;return go(N,0,G).join("")}function RT(c,m,E){if(c=sr(c),c&&(E||m===t))return c.replace(sn,"");if(!c||!(m=oi(m)))return c;var N=Fr(c),G=ji(N,Fr(m));return go(N,G).join("")}function N0(c,m){var E=le,N=Z;if(ri(m)){var G="separator"in m?m.separator:G;E="length"in m?Mn(m.length):E,N="omission"in m?oi(m.omission):N}c=sr(c);var K=c.length;if(ol(c)){var ce=Fr(c);K=ce.length}if(E>=K)return c;var _e=E-is(N);if(_e<1)return N;var Ee=ce?go(ce,0,_e).join(""):c.slice(0,_e);if(G===t)return Ee+N;if(ce&&(_e+=Ee.length-_e),Kd(G)){if(c.slice(_e).search(G)){var et,tt=Ee;for(G.global||(G=zr(G.source,sr(_r.exec(G))+"g")),G.lastIndex=0;et=G.exec(tt);)var ct=et.index;Ee=Ee.slice(0,ct===t?_e:ct)}}else if(c.indexOf(oi(G),_e)!=_e){var Rt=Ee.lastIndexOf(G);Rt>-1&&(Ee=Ee.slice(0,Rt))}return Ee+N}function Gv(c){return c=sr(c),c&&ii.test(c)?c.replace(Kt,za):c}var D0=d(function(c,m,E){return c+(E?" ":"")+m.toUpperCase()}),P0=x("toUpperCase");function wb(c,m,E){return c=sr(c),m=E?t:m,m===t?Fc(c)?bh(c):Tp(c):c.match(m)||[]}var B0=fn(function(c,m){try{return Vn(c,t,m)}catch(E){return C0(E)?E:new rn(E)}}),Eb=zn(function(c,m){return Xr(m,function(E){E=yo(E),zo(c,E,Zt(c[E],c))}),c});function xb(c){var m=c==null?0:c.length,E=ln();return c=m?hr(c,function(N){if(typeof N[1]!="function")throw new Ti(l);return[E(N[0]),N[1]]}):[],fn(function(N){for(var G=-1;++GJ)return[];var E=fe,N=Ii(c,fe);m=ln(m),c-=fe;for(var G=ql(N,m);++E0||m<0)?new mn(E):(c<0?E=E.takeRight(-c):c&&(E=E.drop(c)),m!==t&&(m=Mn(m),E=m<0?E.dropRight(-m):E.take(m-c)),E)},mn.prototype.takeRightWhile=function(c){return this.reverse().takeWhile(c).reverse()},mn.prototype.toArray=function(){return this.take(fe)},ls(mn.prototype,function(c,m){var E=/^(?:filter|find|map|reject)|While$/.test(m),N=/^(?:head|last)$/.test(m),G=X[N?"take"+(m=="last"?"Right":""):m],K=N||/^find/.test(m);G&&(X.prototype[m]=function(){var ce=this.__wrapped__,_e=N?[1]:arguments,Ee=ce instanceof mn,et=_e[0],tt=Ee||kn(ce),ct=function(Yn){var er=G.apply(X,Qo([Yn],_e));return N&&Rt?er[0]:er};tt&&E&&typeof et=="function"&&et.length!=1&&(Ee=tt=!1);var Rt=this.__chain__,Xt=!!this.__actions__.length,pn=K&&!Rt,Ln=Ee&&!Xt;if(!K&&tt){ce=Ln?ce:new mn(this);var dn=c.apply(ce,_e);return dn.__actions__.push({func:jf,args:[ct],thisArg:t}),new Cr(dn,Rt)}return pn&&Ln?c.apply(this,_e):(dn=this.thru(ct),pn?N?dn.value()[0]:dn.value():dn)})}),Xr(["pop","push","shift","sort","splice","unshift"],function(c){var m=lo[c],E=/^(?:push|sort|unshift)$/.test(c)?"tap":"thru",N=/^(?:pop|shift)$/.test(c);X.prototype[c]=function(){var G=arguments;if(N&&!this.__chain__){var K=this.value();return m.apply(kn(K)?K:[],G)}return this[E](function(ce){return m.apply(kn(ce)?ce:[],G)})}}),ls(mn.prototype,function(c,m){var E=X[m];if(E){var N=E.name+"";qn.call(kl,N)||(kl[N]=[]),kl[N].push({name:m,func:E})}}),kl[W(t,k).name]=[{name:"wrapper",func:t}],mn.prototype.clone=zf,mn.prototype.reverse=cl,mn.prototype.value=Ri,X.prototype.at=ed,X.prototype.chain=hm,X.prototype.commit=Yf,X.prototype.next=Xf,X.prototype.plant=bd,X.prototype.reverse=yf,X.prototype.toJSON=X.prototype.valueOf=X.prototype.value=eg,X.prototype.first=X.prototype.head,ea&&(X.prototype[ea]=kp),X},pi=Ad();bi?((bi.exports=pi)._=pi,Rs._=pi):wr._=pi}).call(Vl)})(iR,iR.exports);var tue=iR.exports;const Z5=(n,e,t,r)=>fetch(n+"/openai/deployments/"+e+"/chat/completions?api-version=2024-02-01",{method:"POST",headers:{"Content-Type":"application/json","api-key":t},body:JSON.stringify({messages:r})}),Bn=ase((n,e)=>({ip:"",blocks:{},Start:{},lines:{},hulls:{},texts:{},points:{},widgets:{},counter:0,screenToShow:nF,blocklyWorkspaceXML:{},highlightBlocks:{},storyCreationGoals:{...Zle},chatMessageHistory:[{role:"user",content:ble},{role:"system",content:"How can I help you today?"}],lightMode:!0,simOnly:!1,isConnected:!1,workerThread:null,blocklyWorkspace:null,llmEndpoint:"",llmAPIKey:"",llmDeployment:"",userPrompt:"",programGoals:{...Yle},llmProcessing:!1,llmMode:!1,showGPTConsole:!1,fullScreenPanel:!0,displayLLMBlockPrompt:!1,mistyAudioList:[],mistyImageList:[],headerHeight:0,headerWidth:0,clock:new _le,tfs:{...GO},startingTfs:JSON.parse(JSON.stringify(GO)),endingTfs:JSON.parse(JSON.stringify(GO)),items:{...WO},startingItems:JSON.parse(JSON.stringify(WO)),endingItems:JSON.parse(JSON.stringify(WO)),activeModal:null,updateScreen:t=>n(r=>({screenToShow:t})),setActiveModal:t=>n(r=>({activeModal:t})),closeModal:()=>n(t=>({activeModal:null})),setChatMessageHistory:t=>n(r=>({chatMessageHistory:t})),addMessageToHistory:t=>{let r=e(),s=r.chatMessageHistory;n({llmProcessing:!0,chatMessageHistory:[...s,{role:"user",content:t.replace("
","")}]}),s=e().chatMessageHistory;let o=r.llmEndpoint,l=r.llmDeployment,u=r.llmAPIKey;Z5(o,l,u,s).then(h=>{if(!h.ok)throw new Error(`LLM Request failed with status ${h.status}`);return h.json()}).then(h=>{console.log(h);let f=h.choices[0].message.content;n({llmProcessing:!1,chatMessageHistory:[...s,{role:"system",content:f}]})}).catch(h=>{n({llmProcessing:!1}),alert(`Failed to connect to ChatGPT: ${h.message}`)})},toggleLLMMode:t=>n({llmMode:t}),setFullScreenPanel:t=>n({fullScreenPanel:t}),setShowGPTConsole:t=>n({showGPTConsole:t}),toggleLLMBlockPrompt:t=>n({displayLLMBlockPrompt:t}),toggleTheme:t=>n({lightMode:t}),getAllTasks:t=>t?e().storyCreationGoals:e().programGoals,getMainTasks:t=>{let r=t?e().storyCreationGoals:e().programGoals;return Object.keys(r).filter(s=>r[s].type==="task").sort((s,o)=>r[s].order-r[o].order).reduce((s,o)=>(s[o]=r[o],s),{})},getHighlightBlocks:()=>e().highlightBlocks,getBlocklyWorkspace:()=>e().blocklyWorkspace,setWorkerThread:t=>n({workerThread:t}),setBlocklyWorkspace:t=>n({blocklyWorkspace:t}),setAPIKey:t=>n({llmAPIKey:t}),setEndpoint:t=>n({llmEndpoint:t}),setDeployment:t=>n({llmDeployment:t}),setImageList:t=>n({mistyImageList:t}),setAudioList:t=>n({mistyAudioList:t}),setUserPrompt:t=>n({userPrompt:t}),setHighlightBlocks:t=>n({highlightBlocks:t}),setHeaderDimensions:(t,r)=>n({headerHeight:t,headerWidth:r}),generateProgramOutline:()=>{n({llmProcessing:!0});let t=e(),r=t.userPrompt,s=t.llmEndpoint,o=t.llmDeployment,l=t.llmAPIKey;Z5(s,o,l,[{role:"system",content:yle},{role:"user",content:'Give me the output for the following user prompt: "'+r+'"'}]).then(u=>{if(!u.ok)throw new Error(`LLM Request failed with status ${u.status}`);return u.json()}).then(u=>{let h=u.choices[0].message.content,f=u.choices[0].message.content.indexOf("{"),g=u.choices[0].message.content.lastIndexOf("}")+1;h=h.length>0?h.slice(f,g):"{}",n({programGoals:JSON.parse(h),llmProcessing:!1,activeModal:null})}).catch(u=>{n({llmProcessing:!1}),alert(`Failed to connect to ChatGPT: ${u.message}`)})},generateProgram:()=>{n({llmProcessing:!0});let t=e(),r=t.userPrompt,s=t.llmEndpoint,o=t.llmDeployment,l=t.llmAPIKey;fetch(s+"/openai/deployments/"+o+"/chat/completions?api-version=2024-02-01",{method:"POST",headers:{"Content-Type":"application/json","api-key":l},body:JSON.stringify({messages:[{role:"system",content:eue},{role:"user",content:'Give me the output for the following user prompt: "'+r+'"'}]})}).then(u=>{if(!u.ok)throw new Error(`LLM Request failed with status ${u.status}`);return u.json()}).then(u=>{console.log(u);let h=u.choices[0].message.content;console.log(h),n({llmProcessing:!1,activeModal:null}),e().loadBlocks(JSON.parse(h),e().blocklyWorkspace)}).catch(u=>{n({llmProcessing:!1}),alert(`Failed to connect to ChatGPT: ${u.message}`)})},clearProgram:()=>n({blocks:{}}),clearProgramExceptStart:()=>n({blocks:tue.pickBy(e().blocks,t=>t.type==="Start")}),loadBlocks:(t,r)=>{var y,b;let s=r.getBlocksByType("Start");s.length>0?e().clearProgramExceptStart():e().clearProgram();let o=s.length>0?s[0]:null,l=[],u=[],h=[t.data[0].id],f=[];for(let w=0;w{if(!(M=="id"||M=="value"||M=="type"||M=="nextStatement")){const A=r.getBlockById(u[l.indexOf(t.data[w][M])]);A&&C.getInput(M).connection.connect(A.outputConnection)}})}for(let w=1;wn({isConnected:t}),loadFromURDF:t=>n({tfs:{...mle(t)},items:{...gle(t)}}),setIp:t=>n({ip:t}),disconnect:()=>n({ip:"",isConnected:!1,mistyAudioList:[],mistyImageList:[]}),addBlock:(t,r)=>n(s=>({blocks:{...s.blocks,[t]:r}})),removeBlock:t=>n(r=>({blocks:Object.keys(r.blocks).reduce((o,l)=>(t.includes(l)||(o[l]=r.blocks[l]),o),{})})),updateBlock:(t,r)=>n(s=>({blocks:{...s.blocks,[t]:r}})),getBlock:t=>e().blocks[t],getBlocks:()=>e().blocks,getItems:()=>e().items,getEndingItems:()=>e().endingItems,addBlocktoStart:(t,r)=>n(s=>({Start:{...s.Start,[t]:r}})),removeBlockfromStart:t=>n(r=>({Start:Object.keys(r.Start).reduce((o,l)=>(l!==t&&(o[l]=r.Start[l]),o),{})})),getBlocksByType:t=>{const r=e().blocks;return Object.values(r).filter(s=>s.type===t)[0]},getBlockType:t=>{var s;return((s=e().blocks[t])==null?void 0:s.type)||"Unknown block type"},setWorkspaceXml:t=>n({blocklyWorkspaceXML:t}),getWorkspaceXml:()=>e().blocklyWorkspaceXML,onPointerMissed:()=>console.log("Missed Click"),onPointerOver:()=>{},onPointerOut:()=>{},resetSim:()=>{const t=JSON.parse(JSON.stringify(e().startingTfs)),r=JSON.parse(JSON.stringify(e().startingItems));n({tfs:{...t},endingTfs:{...t},items:{...r},endingItems:{...r}})},toggleSimOnly:t=>{n({simOnly:t})},setAnimationFrames:(t,r,s,o)=>{n({tfs:{...t},endingTfs:{...r},items:{...s},endingItems:{...o}})}}));let LD="";const uh=n=>{const t=new Date().toLocaleString();LD=LD.concat(` -`,`[${t}] ${n}`)};function nue(n,e){if(Object.is(n,e))return!0;if(typeof n!="object"||n===null||typeof e!="object"||e===null)return!1;if(n instanceof Map&&e instanceof Map){if(n.size!==e.size)return!1;for(const[r,s]of n)if(!Object.is(s,e.get(r)))return!1;return!0}if(n instanceof Set&&e instanceof Set){if(n.size!==e.size)return!1;for(const r of n)if(!e.has(r))return!1;return!0}const t=Object.keys(n);if(t.length!==Object.keys(e).length)return!1;for(const r of t)if(!Object.prototype.hasOwnProperty.call(e,r)||!Object.is(n[r],e[r]))return!1;return!0}const{useRef:rue}=yt;function qi(n){const e=rue();return t=>{const r=n(t);return nue(e.current,r)?e.current:e.current=r}}const iue={black:"#000",white:"#fff"},A$=iue,sue={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},lS=sue,oue={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff"},uS=oue,aue={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},cS=aue,lue={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea"},hS=lue,uue={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"},dS=uue,cue={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},ZE=cue,hue={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},due=hue;function J1(n){let e="https://mui.com/production-error/?code="+n;for(let t=1;t=0)&&(t[s]=n[s]);return t}function SX(n){var e=Object.create(null);return function(t){return e[t]===void 0&&(e[t]=n(t)),e[t]}}var mue=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,gue=SX(function(n){return mue.test(n)||n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&n.charCodeAt(2)<91});function _ue(n){if(n.sheet)return n.sheet;for(var e=0;e0?rf(oE,--Qp):0,Iw--,Nh===10&&(Iw=1,hk--),Nh}function Dm(){return Nh=Qp<$X?rf(oE,Qp++):0,Iw++,Nh===10&&(Iw=1,hk++),Nh}function l_(){return rf(oE,Qp)}function aI(){return Qp}function TC(n,e){return I$(oE,n,e)}function R$(n){switch(n){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function CX(n){return hk=Iw=1,$X=q0(oE=n),Qp=0,[]}function MX(n){return oE="",n}function lI(n){return xX(TC(Qp-1,DD(n===91?n+2:n===40?n+1:n)))}function Aue(n){for(;(Nh=l_())&&Nh<33;)Dm();return R$(n)>2||R$(Nh)>3?"":" "}function Iue(n,e){for(;--e&&Dm()&&!(Nh<48||Nh>102||Nh>57&&Nh<65||Nh>70&&Nh<97););return TC(n,aI()+(e<6&&l_()==32&&Dm()==32))}function DD(n){for(;Dm();)switch(Nh){case n:return Qp;case 34:case 39:n!==34&&n!==39&&DD(Nh);break;case 40:n===41&&DD(n);break;case 92:Dm();break}return Qp}function Rue(n,e){for(;Dm()&&n+Nh!==57;)if(n+Nh===84&&l_()===47)break;return"/*"+TC(e,Qp-1)+"*"+ck(n===47?n:Dm())}function kue(n){for(;!R$(l_());)Dm();return TC(n,Qp)}function Oue(n){return MX(uI("",null,null,null,[""],n=CX(n),0,[0],n))}function uI(n,e,t,r,s,o,l,u,h){for(var f=0,g=0,y=l,b=0,w=0,C=0,M=1,A=1,k=1,L=0,P="",D=s,z=o,U=r,V=P;A;)switch(C=L,L=Dm()){case 40:if(C!=108&&rf(V,y-1)==58){ND(V+=jo(lI(L),"&","&\f"),"&\f")!=-1&&(k=-1);break}case 34:case 39:case 91:V+=lI(L);break;case 9:case 10:case 13:case 32:V+=Aue(C);break;case 92:V+=Iue(aI()-1,7);continue;case 47:switch(l_()){case 42:case 47:NM(Lue(Rue(Dm(),aI()),e,t),h);break;default:V+="/"}break;case 123*M:u[f++]=q0(V)*k;case 125*M:case 59:case 0:switch(L){case 0:case 125:A=0;case 59+g:k==-1&&(V=jo(V,/\f/g,"")),w>0&&q0(V)-y&&NM(w>32?tH(V+";",r,t,y-1):tH(jo(V," ","")+";",r,t,y-2),h);break;case 59:V+=";";default:if(NM(U=eH(V,e,t,f,g,s,u,P,D=[],z=[],y),o),L===123)if(g===0)uI(V,e,U,U,D,o,y,u,z);else switch(b===99&&rf(V,3)===110?100:b){case 100:case 108:case 109:case 115:uI(n,U,U,r&&NM(eH(n,U,U,0,0,s,u,P,s,D=[],y),z),s,z,y,u,r?D:z);break;default:uI(V,U,U,U,[""],z,0,u,z)}}f=g=w=0,M=k=1,P=V="",y=l;break;case 58:y=1+q0(V),w=C;default:if(M<1){if(L==123)--M;else if(L==125&&M++==0&&Mue()==125)continue}switch(V+=ck(L),L*M){case 38:k=g>0?1:(V+="\f",-1);break;case 44:u[f++]=(q0(V)-1)*k,k=1;break;case 64:l_()===45&&(V+=lI(Dm())),b=l_(),g=y=q0(P=V+=kue(aI())),L++;break;case 45:C===45&&q0(V)==2&&(M=0)}}return o}function eH(n,e,t,r,s,o,l,u,h,f,g){for(var y=s-1,b=s===0?o:[""],w=oF(b),C=0,M=0,A=0;C0?b[k]+" "+L:jo(L,/&\f/g,b[k])))&&(h[A++]=P);return dk(n,e,t,s===0?iF:u,h,f,g)}function Lue(n,e,t){return dk(n,e,t,wX,ck(Cue()),I$(n,2,-2),0)}function tH(n,e,t,r){return dk(n,e,t,sF,I$(n,0,r),I$(n,r+1,-1),r)}function pw(n,e){for(var t="",r=oF(n),s=0;s6)switch(rf(n,e+1)){case 109:if(rf(n,e+4)!==45)break;case 102:return jo(n,/(.+:)(.+)-([^]+)/,"$1"+Vo+"$2-$3$1"+sR+(rf(n,e+3)==108?"$3":"$2-$3"))+n;case 115:return~ND(n,"stretch")?AX(jo(n,"stretch","fill-available"),e)+n:n}break;case 4949:if(rf(n,e+1)!==115)break;case 6444:switch(rf(n,q0(n)-3-(~ND(n,"!important")&&10))){case 107:return jo(n,":",":"+Vo)+n;case 101:return jo(n,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Vo+(rf(n,14)===45?"inline-":"")+"box$3$1"+Vo+"$2$3$1"+Mf+"$2box$3")+n}break;case 5936:switch(rf(n,e+11)){case 114:return Vo+n+Mf+jo(n,/[svh]\w+-[tblr]{2}/,"tb")+n;case 108:return Vo+n+Mf+jo(n,/[svh]\w+-[tblr]{2}/,"tb-rl")+n;case 45:return Vo+n+Mf+jo(n,/[svh]\w+-[tblr]{2}/,"lr")+n}return Vo+n+Mf+n+n}return n}var Gue=function(e,t,r,s){if(e.length>-1&&!e.return)switch(e.type){case sF:e.return=AX(e.value,e.length);break;case EX:return pw([ex(e,{value:jo(e.value,"@","@"+Vo)})],s);case iF:if(e.length)return $ue(e.props,function(o){switch(xue(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return pw([ex(e,{props:[jo(o,/:(read-\w+)/,":"+sR+"$1")]})],s);case"::placeholder":return pw([ex(e,{props:[jo(o,/:(plac\w+)/,":"+Vo+"input-$1")]}),ex(e,{props:[jo(o,/:(plac\w+)/,":"+sR+"$1")]}),ex(e,{props:[jo(o,/:(plac\w+)/,Mf+"input-$1")]})],s)}return""})}},Wue=[Gue],IX=function(e){var t=e.key;if(t==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(M){var A=M.getAttribute("data-emotion");A.indexOf(" ")!==-1&&(document.head.appendChild(M),M.setAttribute("data-s",""))})}var s=e.stylisPlugins||Wue,o={},l,u=[];l=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(M){for(var A=M.getAttribute("data-emotion").split(" "),k=1;k=K)return c;var _e=E-is(N);if(_e<1)return N;var Ee=ce?go(ce,0,_e).join(""):c.slice(0,_e);if(G===t)return Ee+N;if(ce&&(_e+=Ee.length-_e),Kd(G)){if(c.slice(_e).search(G)){var tt,nt=Ee;for(G.global||(G=zr(G.source,sr(_r.exec(G))+"g")),G.lastIndex=0;tt=G.exec(nt);)var ht=tt.index;Ee=Ee.slice(0,ht===t?_e:ht)}}else if(c.indexOf(oi(G),_e)!=_e){var Rt=Ee.lastIndexOf(G);Rt>-1&&(Ee=Ee.slice(0,Rt))}return Ee+N}function Gv(c){return c=sr(c),c&&ii.test(c)?c.replace(Xt,za):c}var D0=d(function(c,m,E){return c+(E?" ":"")+m.toUpperCase()}),P0=x("toUpperCase");function wb(c,m,E){return c=sr(c),m=E?t:m,m===t?Fc(c)?bh(c):Tp(c):c.match(m)||[]}var B0=fn(function(c,m){try{return Vn(c,t,m)}catch(E){return C0(E)?E:new rn(E)}}),Eb=zn(function(c,m){return Xr(m,function(E){E=yo(E),zo(c,E,en(c[E],c))}),c});function xb(c){var m=c==null?0:c.length,E=ln();return c=m?hr(c,function(N){if(typeof N[1]!="function")throw new Ti(l);return[E(N[0]),N[1]]}):[],fn(function(N){for(var G=-1;++GJ)return[];var E=fe,N=Ii(c,fe);m=ln(m),c-=fe;for(var G=ql(N,m);++E0||m<0)?new mn(E):(c<0?E=E.takeRight(-c):c&&(E=E.drop(c)),m!==t&&(m=An(m),E=m<0?E.dropRight(-m):E.take(m-c)),E)},mn.prototype.takeRightWhile=function(c){return this.reverse().takeWhile(c).reverse()},mn.prototype.toArray=function(){return this.take(fe)},ls(mn.prototype,function(c,m){var E=/^(?:filter|find|map|reject)|While$/.test(m),N=/^(?:head|last)$/.test(m),G=X[N?"take"+(m=="last"?"Right":""):m],K=N||/^find/.test(m);G&&(X.prototype[m]=function(){var ce=this.__wrapped__,_e=N?[1]:arguments,Ee=ce instanceof mn,tt=_e[0],nt=Ee||On(ce),ht=function(Yn){var er=G.apply(X,Qo([Yn],_e));return N&&Rt?er[0]:er};nt&&E&&typeof tt=="function"&&tt.length!=1&&(Ee=nt=!1);var Rt=this.__chain__,Kt=!!this.__actions__.length,pn=K&&!Rt,Ln=Ee&&!Kt;if(!K&&nt){ce=Ln?ce:new mn(this);var dn=c.apply(ce,_e);return dn.__actions__.push({func:jf,args:[ht],thisArg:t}),new Cr(dn,Rt)}return pn&&Ln?c.apply(this,_e):(dn=this.thru(ht),pn?N?dn.value()[0]:dn.value():dn)})}),Xr(["pop","push","shift","sort","splice","unshift"],function(c){var m=lo[c],E=/^(?:push|sort|unshift)$/.test(c)?"tap":"thru",N=/^(?:pop|shift)$/.test(c);X.prototype[c]=function(){var G=arguments;if(N&&!this.__chain__){var K=this.value();return m.apply(On(K)?K:[],G)}return this[E](function(ce){return m.apply(On(ce)?ce:[],G)})}}),ls(mn.prototype,function(c,m){var E=X[m];if(E){var N=E.name+"";qn.call(kl,N)||(kl[N]=[]),kl[N].push({name:m,func:E})}}),kl[W(t,k).name]=[{name:"wrapper",func:t}],mn.prototype.clone=zf,mn.prototype.reverse=cl,mn.prototype.value=Ri,X.prototype.at=ed,X.prototype.chain=hm,X.prototype.commit=Yf,X.prototype.next=Xf,X.prototype.plant=bd,X.prototype.reverse=yf,X.prototype.toJSON=X.prototype.valueOf=X.prototype.value=eg,X.prototype.first=X.prototype.head,ea&&(X.prototype[ea]=kp),X},pi=Ad();bi?((bi.exports=pi)._=pi,Rs._=pi):wr._=pi}).call(Vl)})(iR,iR.exports);var tue=iR.exports;const eH=(n,e,t,r)=>fetch(n+"/openai/deployments/"+e+"/chat/completions?api-version=2024-02-01",{method:"POST",headers:{"Content-Type":"application/json","api-key":t},body:JSON.stringify({messages:r})}),Bn=lse((n,e)=>({ip:"",blocks:{},Start:{},lines:{},hulls:{},texts:{},points:{},widgets:{},counter:0,screenToShow:nF,blocklyWorkspaceXML:{},highlightBlocks:{},storyCreationGoals:{...Zle},chatMessageHistory:[{role:"user",content:ble},{role:"system",content:"How can I help you today?"}],lightMode:!0,simOnly:!1,isConnected:!1,workerThread:null,blocklyWorkspace:null,llmEndpoint:"",llmAPIKey:"",llmDeployment:"",userPrompt:"",programGoals:{...Yle},llmProcessing:!1,llmMode:!1,showGPTConsole:!1,fullScreenPanel:!0,displayLLMBlockPrompt:!1,mistyAudioList:[],mistyImageList:[],headerHeight:0,headerWidth:0,clock:new _le,tfs:{...GO},startingTfs:JSON.parse(JSON.stringify(GO)),endingTfs:JSON.parse(JSON.stringify(GO)),items:{...WO},startingItems:JSON.parse(JSON.stringify(WO)),endingItems:JSON.parse(JSON.stringify(WO)),activeModal:null,updateScreen:t=>n(r=>({screenToShow:t})),setActiveModal:t=>n(r=>({activeModal:t})),closeModal:()=>n(t=>({activeModal:null})),setChatMessageHistory:t=>n(r=>({chatMessageHistory:t})),addMessageToHistory:t=>{let r=e(),s=r.chatMessageHistory;n({llmProcessing:!0,chatMessageHistory:[...s,{role:"user",content:t.replace("
","")}]}),s=e().chatMessageHistory;let o=r.llmEndpoint,l=r.llmDeployment,u=r.llmAPIKey;eH(o,l,u,s).then(h=>{if(!h.ok)throw new Error(`LLM Request failed with status ${h.status}`);return h.json()}).then(h=>{console.log(h);let f=h.choices[0].message.content;n({llmProcessing:!1,chatMessageHistory:[...s,{role:"system",content:f}]})}).catch(h=>{n({llmProcessing:!1}),alert(`Failed to connect to ChatGPT: ${h.message}`)})},toggleLLMMode:t=>n({llmMode:t}),setFullScreenPanel:t=>n({fullScreenPanel:t}),setShowGPTConsole:t=>n({showGPTConsole:t}),toggleLLMBlockPrompt:t=>n({displayLLMBlockPrompt:t}),toggleTheme:t=>n({lightMode:t}),getAllTasks:t=>t?e().storyCreationGoals:e().programGoals,getMainTasks:t=>{let r=t?e().storyCreationGoals:e().programGoals;return Object.keys(r).filter(s=>r[s].type==="task").sort((s,o)=>r[s].order-r[o].order).reduce((s,o)=>(s[o]=r[o],s),{})},getHighlightBlocks:()=>e().highlightBlocks,getBlocklyWorkspace:()=>e().blocklyWorkspace,setWorkerThread:t=>n({workerThread:t}),setBlocklyWorkspace:t=>n({blocklyWorkspace:t}),setAPIKey:t=>n({llmAPIKey:t}),setEndpoint:t=>n({llmEndpoint:t}),setDeployment:t=>n({llmDeployment:t}),setImageList:t=>n({mistyImageList:t}),setAudioList:t=>n({mistyAudioList:t}),setUserPrompt:t=>n({userPrompt:t}),setHighlightBlocks:t=>n({highlightBlocks:t}),setHeaderDimensions:(t,r)=>n({headerHeight:t,headerWidth:r}),generateProgramOutline:()=>{n({llmProcessing:!0});let t=e(),r=t.userPrompt,s=t.llmEndpoint,o=t.llmDeployment,l=t.llmAPIKey;eH(s,o,l,[{role:"system",content:yle},{role:"user",content:'Give me the output for the following user prompt: "'+r+'"'}]).then(u=>{if(!u.ok)throw new Error(`LLM Request failed with status ${u.status}`);return u.json()}).then(u=>{let h=u.choices[0].message.content,f=u.choices[0].message.content.indexOf("{"),g=u.choices[0].message.content.lastIndexOf("}")+1;h=h.length>0?h.slice(f,g):"{}",n({programGoals:JSON.parse(h),llmProcessing:!1,activeModal:null})}).catch(u=>{n({llmProcessing:!1}),alert(`Failed to connect to ChatGPT: ${u.message}`)})},generateProgram:()=>{n({llmProcessing:!0});let t=e(),r=t.userPrompt,s=t.llmEndpoint,o=t.llmDeployment,l=t.llmAPIKey;fetch(s+"/openai/deployments/"+o+"/chat/completions?api-version=2024-02-01",{method:"POST",headers:{"Content-Type":"application/json","api-key":l},body:JSON.stringify({messages:[{role:"system",content:eue},{role:"user",content:'Give me the output for the following user prompt: "'+r+'"'}]})}).then(u=>{if(!u.ok)throw new Error(`LLM Request failed with status ${u.status}`);return u.json()}).then(u=>{console.log(u);let h=u.choices[0].message.content;console.log(h),n({llmProcessing:!1,activeModal:null}),e().loadBlocks(JSON.parse(h),e().blocklyWorkspace)}).catch(u=>{n({llmProcessing:!1}),alert(`Failed to connect to ChatGPT: ${u.message}`)})},clearProgram:()=>n({blocks:{}}),clearProgramExceptStart:()=>n({blocks:tue.pickBy(e().blocks,t=>t.type==="Start")}),loadBlocks:(t,r)=>{var y,b;let s=r.getBlocksByType("Start");s.length>0?e().clearProgramExceptStart():e().clearProgram();let o=s.length>0?s[0]:null,l=[],u=[],h=[t.data[0].id],f=[];for(let w=0;w{if(!(M=="id"||M=="value"||M=="type"||M=="nextStatement")){const A=r.getBlockById(u[l.indexOf(t.data[w][M])]);A&&C.getInput(M).connection.connect(A.outputConnection)}})}for(let w=1;wn({isConnected:t}),loadFromURDF:t=>n({tfs:{...mle(t)},items:{...gle(t)}}),setIp:t=>n({ip:t}),disconnect:()=>n({ip:"",isConnected:!1,mistyAudioList:[],mistyImageList:[]}),addBlock:(t,r)=>n(s=>({blocks:{...s.blocks,[t]:r}})),removeBlock:t=>n(r=>({blocks:Object.keys(r.blocks).reduce((o,l)=>(t.includes(l)||(o[l]=r.blocks[l]),o),{})})),updateBlock:(t,r)=>n(s=>({blocks:{...s.blocks,[t]:r}})),getBlock:t=>e().blocks[t],getBlocks:()=>e().blocks,getItems:()=>e().items,getEndingItems:()=>e().endingItems,addBlocktoStart:(t,r)=>n(s=>({Start:{...s.Start,[t]:r}})),removeBlockfromStart:t=>n(r=>({Start:Object.keys(r.Start).reduce((o,l)=>(l!==t&&(o[l]=r.Start[l]),o),{})})),getBlocksByType:t=>{const r=e().blocks;return Object.values(r).filter(s=>s.type===t)[0]},getBlockType:t=>{var s;return((s=e().blocks[t])==null?void 0:s.type)||"Unknown block type"},setWorkspaceXml:t=>n({blocklyWorkspaceXML:t}),getWorkspaceXml:()=>e().blocklyWorkspaceXML,onPointerMissed:()=>console.log("Missed Click"),onPointerOver:()=>{},onPointerOut:()=>{},resetSim:()=>{const t=JSON.parse(JSON.stringify(e().startingTfs)),r=JSON.parse(JSON.stringify(e().startingItems));n({tfs:{...t},endingTfs:{...t},items:{...r},endingItems:{...r}})},toggleSimOnly:t=>{n({simOnly:t})},setAnimationFrames:(t,r,s,o)=>{n({tfs:{...t},endingTfs:{...r},items:{...s},endingItems:{...o}})}}));let LD="";const uh=n=>{const t=new Date().toLocaleString();LD=LD.concat(` +`,`[${t}] ${n}`)};function nue(n,e){if(Object.is(n,e))return!0;if(typeof n!="object"||n===null||typeof e!="object"||e===null)return!1;if(n instanceof Map&&e instanceof Map){if(n.size!==e.size)return!1;for(const[r,s]of n)if(!Object.is(s,e.get(r)))return!1;return!0}if(n instanceof Set&&e instanceof Set){if(n.size!==e.size)return!1;for(const r of n)if(!e.has(r))return!1;return!0}const t=Object.keys(n);if(t.length!==Object.keys(e).length)return!1;for(const r of t)if(!Object.prototype.hasOwnProperty.call(e,r)||!Object.is(n[r],e[r]))return!1;return!0}const{useRef:rue}=yt;function qi(n){const e=rue();return t=>{const r=n(t);return nue(e.current,r)?e.current:e.current=r}}const iue={black:"#000",white:"#fff"},A$=iue,sue={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},lS=sue,oue={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff"},uS=oue,aue={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},cS=aue,lue={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea"},hS=lue,uue={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"},dS=uue,cue={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},ZE=cue,hue={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},due=hue;function q1(n){let e="https://mui.com/production-error/?code="+n;for(let t=1;t=0)&&(t[s]=n[s]);return t}function wX(n){var e=Object.create(null);return function(t){return e[t]===void 0&&(e[t]=n(t)),e[t]}}var mue=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,gue=wX(function(n){return mue.test(n)||n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&n.charCodeAt(2)<91});function _ue(n){if(n.sheet)return n.sheet;for(var e=0;e0?rf(oE,--Qp):0,Iw--,Nh===10&&(Iw=1,hk--),Nh}function Dm(){return Nh=Qp2||R$(Nh)>3?"":" "}function Iue(n,e){for(;--e&&Dm()&&!(Nh<48||Nh>102||Nh>57&&Nh<65||Nh>70&&Nh<97););return TC(n,aI()+(e<6&&l_()==32&&Dm()==32))}function DD(n){for(;Dm();)switch(Nh){case n:return Qp;case 34:case 39:n!==34&&n!==39&&DD(Nh);break;case 40:n===41&&DD(n);break;case 92:Dm();break}return Qp}function Rue(n,e){for(;Dm()&&n+Nh!==57;)if(n+Nh===84&&l_()===47)break;return"/*"+TC(e,Qp-1)+"*"+ck(n===47?n:Dm())}function kue(n){for(;!R$(l_());)Dm();return TC(n,Qp)}function Oue(n){return AX(uI("",null,null,null,[""],n=MX(n),0,[0],n))}function uI(n,e,t,r,s,o,l,u,h){for(var f=0,g=0,y=l,b=0,w=0,C=0,M=1,A=1,k=1,L=0,P="",D=s,z=o,U=r,V=P;A;)switch(C=L,L=Dm()){case 40:if(C!=108&&rf(V,y-1)==58){ND(V+=jo(lI(L),"&","&\f"),"&\f")!=-1&&(k=-1);break}case 34:case 39:case 91:V+=lI(L);break;case 9:case 10:case 13:case 32:V+=Aue(C);break;case 92:V+=Iue(aI()-1,7);continue;case 47:switch(l_()){case 42:case 47:NM(Lue(Rue(Dm(),aI()),e,t),h);break;default:V+="/"}break;case 123*M:u[f++]=q0(V)*k;case 125*M:case 59:case 0:switch(L){case 0:case 125:A=0;case 59+g:k==-1&&(V=jo(V,/\f/g,"")),w>0&&q0(V)-y&&NM(w>32?nH(V+";",r,t,y-1):nH(jo(V," ","")+";",r,t,y-2),h);break;case 59:V+=";";default:if(NM(U=tH(V,e,t,f,g,s,u,P,D=[],z=[],y),o),L===123)if(g===0)uI(V,e,U,U,D,o,y,u,z);else switch(b===99&&rf(V,3)===110?100:b){case 100:case 108:case 109:case 115:uI(n,U,U,r&&NM(tH(n,U,U,0,0,s,u,P,s,D=[],y),z),s,z,y,u,r?D:z);break;default:uI(V,U,U,U,[""],z,0,u,z)}}f=g=w=0,M=k=1,P=V="",y=l;break;case 58:y=1+q0(V),w=C;default:if(M<1){if(L==123)--M;else if(L==125&&M++==0&&Mue()==125)continue}switch(V+=ck(L),L*M){case 38:k=g>0?1:(V+="\f",-1);break;case 44:u[f++]=(q0(V)-1)*k,k=1;break;case 64:l_()===45&&(V+=lI(Dm())),b=l_(),g=y=q0(P=V+=kue(aI())),L++;break;case 45:C===45&&q0(V)==2&&(M=0)}}return o}function tH(n,e,t,r,s,o,l,u,h,f,g){for(var y=s-1,b=s===0?o:[""],w=oF(b),C=0,M=0,A=0;C0?b[k]+" "+L:jo(L,/&\f/g,b[k])))&&(h[A++]=P);return dk(n,e,t,s===0?iF:u,h,f,g)}function Lue(n,e,t){return dk(n,e,t,EX,ck(Cue()),I$(n,2,-2),0)}function nH(n,e,t,r){return dk(n,e,t,sF,I$(n,0,r),I$(n,r+1,-1),r)}function pw(n,e){for(var t="",r=oF(n),s=0;s6)switch(rf(n,e+1)){case 109:if(rf(n,e+4)!==45)break;case 102:return jo(n,/(.+:)(.+)-([^]+)/,"$1"+Vo+"$2-$3$1"+sR+(rf(n,e+3)==108?"$3":"$2-$3"))+n;case 115:return~ND(n,"stretch")?IX(jo(n,"stretch","fill-available"),e)+n:n}break;case 4949:if(rf(n,e+1)!==115)break;case 6444:switch(rf(n,q0(n)-3-(~ND(n,"!important")&&10))){case 107:return jo(n,":",":"+Vo)+n;case 101:return jo(n,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Vo+(rf(n,14)===45?"inline-":"")+"box$3$1"+Vo+"$2$3$1"+Mf+"$2box$3")+n}break;case 5936:switch(rf(n,e+11)){case 114:return Vo+n+Mf+jo(n,/[svh]\w+-[tblr]{2}/,"tb")+n;case 108:return Vo+n+Mf+jo(n,/[svh]\w+-[tblr]{2}/,"tb-rl")+n;case 45:return Vo+n+Mf+jo(n,/[svh]\w+-[tblr]{2}/,"lr")+n}return Vo+n+Mf+n+n}return n}var Gue=function(e,t,r,s){if(e.length>-1&&!e.return)switch(e.type){case sF:e.return=IX(e.value,e.length);break;case xX:return pw([ex(e,{value:jo(e.value,"@","@"+Vo)})],s);case iF:if(e.length)return $ue(e.props,function(o){switch(xue(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return pw([ex(e,{props:[jo(o,/:(read-\w+)/,":"+sR+"$1")]})],s);case"::placeholder":return pw([ex(e,{props:[jo(o,/:(plac\w+)/,":"+Vo+"input-$1")]}),ex(e,{props:[jo(o,/:(plac\w+)/,":"+sR+"$1")]}),ex(e,{props:[jo(o,/:(plac\w+)/,Mf+"input-$1")]})],s)}return""})}},Wue=[Gue],RX=function(e){var t=e.key;if(t==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(M){var A=M.getAttribute("data-emotion");A.indexOf(" ")!==-1&&(document.head.appendChild(M),M.setAttribute("data-s",""))})}var s=e.stylisPlugins||Wue,o={},l,u=[];l=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(M){for(var A=M.getAttribute("data-emotion").split(" "),k=1;k=4;++r,s-=4)t=n.charCodeAt(r)&255|(n.charCodeAt(++r)&255)<<8|(n.charCodeAt(++r)&255)<<16|(n.charCodeAt(++r)&255)<<24,t=(t&65535)*1540483477+((t>>>16)*59797<<16),t^=t>>>24,e=(t&65535)*1540483477+((t>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(s){case 3:e^=(n.charCodeAt(r+2)&255)<<16;case 2:e^=(n.charCodeAt(r+1)&255)<<8;case 1:e^=n.charCodeAt(r)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}var nce={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},rce=/[A-Z]|^ms/g,ice=/_EMO_([^_]+?)_([^]*?)_EMO_/g,PX=function(e){return e.charCodeAt(1)===45},rH=function(e){return e!=null&&typeof e!="boolean"},VO=SX(function(n){return PX(n)?n:n.replace(rce,"-$&").toLowerCase()}),iH=function(e,t){switch(e){case"animation":case"animationName":if(typeof t=="string")return t.replace(ice,function(r,s,o){return Q0={name:s,styles:o,next:Q0},s})}return nce[e]!==1&&!PX(e)&&typeof t=="number"&&t!==0?t+"px":t};function k$(n,e,t){if(t==null)return"";if(t.__emotion_styles!==void 0)return t;switch(typeof t){case"boolean":return"";case"object":{if(t.anim===1)return Q0={name:t.name,styles:t.styles,next:Q0},t.name;if(t.styles!==void 0){var r=t.next;if(r!==void 0)for(;r!==void 0;)Q0={name:r.name,styles:r.styles,next:Q0},r=r.next;var s=t.styles+";";return s}return sce(n,e,t)}case"function":{if(n!==void 0){var o=Q0,l=t(n);return Q0=o,k$(n,e,l)}break}}if(e==null)return t;var u=e[t];return u!==void 0?u:t}function sce(n,e,t){var r="";if(Array.isArray(t))for(var s=0;s96?cce:hce},lH=function(e,t,r){var s;if(t){var o=t.shouldForwardProp;s=e.__emotion_forwardProp&&o?function(l){return e.__emotion_forwardProp(l)&&o(l)}:o}return typeof s!="function"&&r&&(s=e.__emotion_forwardProp),s},dce=function(e){var t=e.cache,r=e.serialized,s=e.isStringTag;return NX(t,r,s),ace(function(){return DX(t,r,s)}),null},fce=function n(e,t){var r=e.__emotion_real===e,s=r&&e.__emotion_base||e,o,l;t!==void 0&&(o=t.label,l=t.target);var u=lH(e,t,r),h=u||aH(s),f=!h("as");return function(){var g=arguments,y=r&&e.__emotion_styles!==void 0?e.__emotion_styles.slice(0):[];if(o!==void 0&&y.push("label:"+o+";"),g[0]==null||g[0].raw===void 0)y.push.apply(y,g);else{y.push(g[0][0]);for(var b=g.length,w=1;we(Tce(s)?t:s):e;return De.jsx(uce,{styles:r})}function hF(n,e){return PD(n,e)}const jX=(n,e)=>{Array.isArray(n.__emotion_styles)&&(n.__emotion_styles=e(n.__emotion_styles))},Sce=Object.freeze(Object.defineProperty({__proto__:null,GlobalStyles:VX,StyledEngineProvider:bce,ThemeContext:wk,css:UX,default:hF,internal_processStyles:jX,keyframes:Ek},Symbol.toStringTag,{value:"Module"}));function av(n){if(typeof n!="object"||n===null)return!1;const e=Object.getPrototypeOf(n);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in n)&&!(Symbol.iterator in n)}function YX(n){if(!av(n))return n;const e={};return Object.keys(n).forEach(t=>{e[t]=YX(n[t])}),e}function fp(n,e,t={clone:!0}){const r=t.clone?qe({},n):n;return av(n)&&av(e)&&Object.keys(e).forEach(s=>{s!=="__proto__"&&(av(e[s])&&s in n&&av(n[s])?r[s]=fp(n[s],e[s],t):t.clone?r[s]=av(e[s])?YX(e[s]):e[s]:r[s]=e[s])}),r}const wce=Object.freeze(Object.defineProperty({__proto__:null,default:fp,isPlainObject:av},Symbol.toStringTag,{value:"Module"})),Ece=["values","unit","step"],xce=n=>{const e=Object.keys(n).map(t=>({key:t,val:n[t]}))||[];return e.sort((t,r)=>t.val-r.val),e.reduce((t,r)=>qe({},t,{[r.key]:r.val}),{})};function XX(n){const{values:e={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:t="px",step:r=5}=n,s=Ar(n,Ece),o=xce(e),l=Object.keys(o);function u(b){return`@media (min-width:${typeof e[b]=="number"?e[b]:b}${t})`}function h(b){return`@media (max-width:${(typeof e[b]=="number"?e[b]:b)-r/100}${t})`}function f(b,w){const C=l.indexOf(w);return`@media (min-width:${typeof e[b]=="number"?e[b]:b}${t}) and (max-width:${(C!==-1&&typeof e[l[C]]=="number"?e[l[C]]:w)-r/100}${t})`}function g(b){return l.indexOf(b)+1`@media (min-width:${dF[n]}px)`};function Zp(n,e,t){const r=n.theme||{};if(Array.isArray(e)){const o=r.breakpoints||uH;return e.reduce((l,u,h)=>(l[o.up(o.keys[h])]=t(e[h]),l),{})}if(typeof e=="object"){const o=r.breakpoints||uH;return Object.keys(e).reduce((l,u)=>{if(Object.keys(o.values||dF).indexOf(u)!==-1){const h=o.up(u);l[h]=t(e[u],u)}else{const h=u;l[h]=e[h]}return l},{})}return t(e)}function KX(n={}){var e;return((e=n.keys)==null?void 0:e.reduce((r,s)=>{const o=n.up(s);return r[o]={},r},{}))||{}}function JX(n,e){return n.reduce((t,r)=>{const s=t[r];return(!s||Object.keys(s).length===0)&&delete t[r],t},e)}function Mce(n,...e){const t=KX(n),r=[t,...e].reduce((s,o)=>fp(s,o),{});return JX(Object.keys(t),r)}function Ace(n,e){if(typeof n!="object")return{};const t={},r=Object.keys(e);return Array.isArray(n)?r.forEach((s,o)=>{o{n[s]!=null&&(t[s]=!0)}),t}function O1({values:n,breakpoints:e,base:t}){const r=t||Ace(n,e),s=Object.keys(r);if(s.length===0)return n;let o;return s.reduce((l,u,h)=>(Array.isArray(n)?(l[u]=n[h]!=null?n[h]:n[o],o=h):typeof n=="object"?(l[u]=n[u]!=null?n[u]:n[o],o=u):l[u]=n,l),{})}function gr(n){if(typeof n!="string")throw new Error(J1(7));return n.charAt(0).toUpperCase()+n.slice(1)}const Ice=Object.freeze(Object.defineProperty({__proto__:null,default:gr},Symbol.toStringTag,{value:"Module"}));function xk(n,e,t=!0){if(!e||typeof e!="string")return null;if(n&&n.vars&&t){const r=`vars.${e}`.split(".").reduce((s,o)=>s&&s[o]?s[o]:null,n);if(r!=null)return r}return e.split(".").reduce((r,s)=>r&&r[s]!=null?r[s]:null,n)}function oR(n,e,t,r=t){let s;return typeof n=="function"?s=n(t):Array.isArray(n)?s=n[t]||r:s=xk(n,t)||r,e&&(s=e(s,r,n)),s}function fh(n){const{prop:e,cssProperty:t=n.prop,themeKey:r,transform:s}=n,o=l=>{if(l[e]==null)return null;const u=l[e],h=l.theme,f=xk(h,r)||{};return Zp(l,u,y=>{let b=oR(f,s,y);return y===b&&typeof y=="string"&&(b=oR(f,s,`${e}${y==="default"?"":gr(y)}`,y)),t===!1?b:{[t]:b}})};return o.propTypes={},o.filterProps=[e],o}function Rce(n){const e={};return t=>(e[t]===void 0&&(e[t]=n(t)),e[t])}const kce={m:"margin",p:"padding"},Oce={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},cH={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},Lce=Rce(n=>{if(n.length>2)if(cH[n])n=cH[n];else return[n];const[e,t]=n.split(""),r=kce[e],s=Oce[t]||"";return Array.isArray(s)?s.map(o=>r+o):[r+s]}),fF=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],pF=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...fF,...pF];function SC(n,e,t,r){var s;const o=(s=xk(n,e,!1))!=null?s:t;return typeof o=="number"?l=>typeof l=="string"?l:o*l:Array.isArray(o)?l=>typeof l=="string"?l:o[l]:typeof o=="function"?o:()=>{}}function mF(n){return SC(n,"spacing",8)}function q1(n,e){if(typeof e=="string"||e==null)return e;const t=Math.abs(e),r=n(t);return e>=0?r:typeof r=="number"?-r:`-${r}`}function Nce(n,e){return t=>n.reduce((r,s)=>(r[s]=q1(e,t),r),{})}function Dce(n,e,t,r){if(e.indexOf(t)===-1)return null;const s=Lce(t),o=Nce(s,r),l=n[t];return Zp(n,l,o)}function qX(n,e){const t=mF(n.theme);return Object.keys(n).map(r=>Dce(n,e,r,t)).reduce(Jx,{})}function kc(n){return qX(n,fF)}kc.propTypes={};kc.filterProps=fF;function Oc(n){return qX(n,pF)}Oc.propTypes={};Oc.filterProps=pF;function Pce(n=8){if(n.mui)return n;const e=mF({spacing:n}),t=(...r)=>(r.length===0?[1]:r).map(o=>{const l=e(o);return typeof l=="number"?`${l}px`:l}).join(" ");return t.mui=!0,t}function $k(...n){const e=n.reduce((r,s)=>(s.filterProps.forEach(o=>{r[o]=s}),r),{}),t=r=>Object.keys(r).reduce((s,o)=>e[o]?Jx(s,e[o](r)):s,{});return t.propTypes={},t.filterProps=n.reduce((r,s)=>r.concat(s.filterProps),[]),t}function vg(n){return typeof n!="number"?n:`${n}px solid`}function $g(n,e){return fh({prop:n,themeKey:"borders",transform:e})}const Bce=$g("border",vg),Fce=$g("borderTop",vg),zce=$g("borderRight",vg),Uce=$g("borderBottom",vg),Hce=$g("borderLeft",vg),Gce=$g("borderColor"),Wce=$g("borderTopColor"),Vce=$g("borderRightColor"),jce=$g("borderBottomColor"),Yce=$g("borderLeftColor"),Xce=$g("outline",vg),Kce=$g("outlineColor"),Ck=n=>{if(n.borderRadius!==void 0&&n.borderRadius!==null){const e=SC(n.theme,"shape.borderRadius",4),t=r=>({borderRadius:q1(e,r)});return Zp(n,n.borderRadius,t)}return null};Ck.propTypes={};Ck.filterProps=["borderRadius"];$k(Bce,Fce,zce,Uce,Hce,Gce,Wce,Vce,jce,Yce,Ck,Xce,Kce);const Mk=n=>{if(n.gap!==void 0&&n.gap!==null){const e=SC(n.theme,"spacing",8),t=r=>({gap:q1(e,r)});return Zp(n,n.gap,t)}return null};Mk.propTypes={};Mk.filterProps=["gap"];const Ak=n=>{if(n.columnGap!==void 0&&n.columnGap!==null){const e=SC(n.theme,"spacing",8),t=r=>({columnGap:q1(e,r)});return Zp(n,n.columnGap,t)}return null};Ak.propTypes={};Ak.filterProps=["columnGap"];const Ik=n=>{if(n.rowGap!==void 0&&n.rowGap!==null){const e=SC(n.theme,"spacing",8),t=r=>({rowGap:q1(e,r)});return Zp(n,n.rowGap,t)}return null};Ik.propTypes={};Ik.filterProps=["rowGap"];const Jce=fh({prop:"gridColumn"}),qce=fh({prop:"gridRow"}),Qce=fh({prop:"gridAutoFlow"}),Zce=fh({prop:"gridAutoColumns"}),ehe=fh({prop:"gridAutoRows"}),the=fh({prop:"gridTemplateColumns"}),nhe=fh({prop:"gridTemplateRows"}),rhe=fh({prop:"gridTemplateAreas"}),ihe=fh({prop:"gridArea"});$k(Mk,Ak,Ik,Jce,qce,Qce,Zce,ehe,the,nhe,rhe,ihe);function mw(n,e){return e==="grey"?e:n}const she=fh({prop:"color",themeKey:"palette",transform:mw}),ohe=fh({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:mw}),ahe=fh({prop:"backgroundColor",themeKey:"palette",transform:mw});$k(she,ohe,ahe);function Am(n){return n<=1&&n!==0?`${n*100}%`:n}const lhe=fh({prop:"width",transform:Am}),gF=n=>{if(n.maxWidth!==void 0&&n.maxWidth!==null){const e=t=>{var r,s;const o=((r=n.theme)==null||(r=r.breakpoints)==null||(r=r.values)==null?void 0:r[t])||dF[t];return o?((s=n.theme)==null||(s=s.breakpoints)==null?void 0:s.unit)!=="px"?{maxWidth:`${o}${n.theme.breakpoints.unit}`}:{maxWidth:o}:{maxWidth:Am(t)}};return Zp(n,n.maxWidth,e)}return null};gF.filterProps=["maxWidth"];const uhe=fh({prop:"minWidth",transform:Am}),che=fh({prop:"height",transform:Am}),hhe=fh({prop:"maxHeight",transform:Am}),dhe=fh({prop:"minHeight",transform:Am});fh({prop:"size",cssProperty:"width",transform:Am});fh({prop:"size",cssProperty:"height",transform:Am});const fhe=fh({prop:"boxSizing"});$k(lhe,gF,uhe,che,hhe,dhe,fhe);const phe={border:{themeKey:"borders",transform:vg},borderTop:{themeKey:"borders",transform:vg},borderRight:{themeKey:"borders",transform:vg},borderBottom:{themeKey:"borders",transform:vg},borderLeft:{themeKey:"borders",transform:vg},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:vg},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:Ck},color:{themeKey:"palette",transform:mw},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:mw},backgroundColor:{themeKey:"palette",transform:mw},p:{style:Oc},pt:{style:Oc},pr:{style:Oc},pb:{style:Oc},pl:{style:Oc},px:{style:Oc},py:{style:Oc},padding:{style:Oc},paddingTop:{style:Oc},paddingRight:{style:Oc},paddingBottom:{style:Oc},paddingLeft:{style:Oc},paddingX:{style:Oc},paddingY:{style:Oc},paddingInline:{style:Oc},paddingInlineStart:{style:Oc},paddingInlineEnd:{style:Oc},paddingBlock:{style:Oc},paddingBlockStart:{style:Oc},paddingBlockEnd:{style:Oc},m:{style:kc},mt:{style:kc},mr:{style:kc},mb:{style:kc},ml:{style:kc},mx:{style:kc},my:{style:kc},margin:{style:kc},marginTop:{style:kc},marginRight:{style:kc},marginBottom:{style:kc},marginLeft:{style:kc},marginX:{style:kc},marginY:{style:kc},marginInline:{style:kc},marginInlineStart:{style:kc},marginInlineEnd:{style:kc},marginBlock:{style:kc},marginBlockStart:{style:kc},marginBlockEnd:{style:kc},displayPrint:{cssProperty:!1,transform:n=>({"@media print":{display:n}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:Mk},rowGap:{style:Ik},columnGap:{style:Ak},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:Am},maxWidth:{style:gF},minWidth:{transform:Am},height:{transform:Am},maxHeight:{transform:Am},minHeight:{transform:Am},boxSizing:{},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}},wC=phe;function mhe(...n){const e=n.reduce((r,s)=>r.concat(Object.keys(s)),[]),t=new Set(e);return n.every(r=>t.size===Object.keys(r).length)}function ghe(n,e){return typeof n=="function"?n(e):n}function QX(){function n(t,r,s,o){const l={[t]:r,theme:s},u=o[t];if(!u)return{[t]:r};const{cssProperty:h=t,themeKey:f,transform:g,style:y}=u;if(r==null)return null;if(f==="typography"&&r==="inherit")return{[t]:r};const b=xk(s,f)||{};return y?y(l):Zp(l,r,C=>{let M=oR(b,g,C);return C===M&&typeof C=="string"&&(M=oR(b,g,`${t}${C==="default"?"":gr(C)}`,C)),h===!1?M:{[h]:M}})}function e(t){var r;const{sx:s,theme:o={}}=t||{};if(!s)return null;const l=(r=o.unstable_sxConfig)!=null?r:wC;function u(h){let f=h;if(typeof h=="function")f=h(o);else if(typeof h!="object")return h;if(!f)return null;const g=KX(o.breakpoints),y=Object.keys(g);let b=g;return Object.keys(f).forEach(w=>{const C=ghe(f[w],o);if(C!=null)if(typeof C=="object")if(l[w])b=Jx(b,n(w,C,o,l));else{const M=Zp({theme:o},C,A=>({[w]:A}));mhe(M,C)?b[w]=e({sx:C,theme:o}):b=Jx(b,M)}else b=Jx(b,n(w,C,o,l))}),JX(y,b)}return Array.isArray(s)?s.map(u):u(s)}return e}const ZX=QX();ZX.filterProps=["sx"];const EC=ZX;function eK(n,e){const t=this;return t.vars&&typeof t.getColorSchemeSelector=="function"?{[t.getColorSchemeSelector(n).replace(/(\[[^\]]+\])/,"*:where($1)")]:e}:t.palette.mode===n?e:{}}const _he=["breakpoints","palette","spacing","shape"];function aE(n={},...e){const{breakpoints:t={},palette:r={},spacing:s,shape:o={}}=n,l=Ar(n,_he),u=XX(t),h=Pce(s);let f=fp({breakpoints:u,direction:"ltr",components:{},palette:qe({mode:"light"},r),spacing:h,shape:qe({},Cce,o)},l);return f.applyStyles=eK,f=e.reduce((g,y)=>fp(g,y),f),f.unstable_sxConfig=qe({},wC,l==null?void 0:l.unstable_sxConfig),f.unstable_sx=function(y){return EC({sx:y,theme:this})},f}const vhe=Object.freeze(Object.defineProperty({__proto__:null,default:aE,private_createBreakpoints:XX,unstable_applyStyles:eK},Symbol.toStringTag,{value:"Module"}));function yhe(n){return Object.keys(n).length===0}function bhe(n=null){const e=pe.useContext(wk);return!e||yhe(e)?n:e}const The=aE();function Rk(n=The){return bhe(n)}function She({styles:n,themeId:e,defaultTheme:t={}}){const r=Rk(t),s=typeof n=="function"?n(e&&r[e]||r):n;return De.jsx(VX,{styles:s})}const whe=["sx"],Ehe=n=>{var e,t;const r={systemProps:{},otherProps:{}},s=(e=n==null||(t=n.theme)==null?void 0:t.unstable_sxConfig)!=null?e:wC;return Object.keys(n).forEach(o=>{s[o]?r.systemProps[o]=n[o]:r.otherProps[o]=n[o]}),r};function xC(n){const{sx:e}=n,t=Ar(n,whe),{systemProps:r,otherProps:s}=Ehe(t);let o;return Array.isArray(e)?o=[r,...e]:typeof e=="function"?o=(...l)=>{const u=e(...l);return av(u)?qe({},r,u):r}:o=qe({},r,e),qe({},s,{sx:o})}const xhe=Object.freeze(Object.defineProperty({__proto__:null,default:EC,extendSxProp:xC,unstable_createStyleFunctionSx:QX,unstable_defaultSxConfig:wC},Symbol.toStringTag,{value:"Module"})),hH=n=>n,$he=()=>{let n=hH;return{configure(e){n=e},generate(e){return n(e)},reset(){n=hH}}},Che=$he(),_F=Che;function tK(n){var e,t,r="";if(typeof n=="string"||typeof n=="number")r+=n;else if(typeof n=="object")if(Array.isArray(n)){var s=n.length;for(e=0;eu!=="theme"&&u!=="sx"&&u!=="as"})(EC);return pe.forwardRef(function(h,f){const g=Rk(t),y=xC(h),{className:b,component:w="div"}=y,C=Ar(y,Mhe);return De.jsx(o,qe({as:w,ref:f,className:ai(b,s?s(r):r),theme:e&&g[e]||g},C))})}const Ihe={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function Po(n,e,t="Mui"){const r=Ihe[e];return r?`${t}-${r}`:`${_F.generate(n)}-${e}`}function Xo(n,e,t="Mui"){const r={};return e.forEach(s=>{r[s]=Po(n,s,t)}),r}var nK={exports:{}},ka={};/** + */var $d=typeof Symbol=="function"&&Symbol.for,aF=$d?Symbol.for("react.element"):60103,lF=$d?Symbol.for("react.portal"):60106,fk=$d?Symbol.for("react.fragment"):60107,pk=$d?Symbol.for("react.strict_mode"):60108,mk=$d?Symbol.for("react.profiler"):60114,gk=$d?Symbol.for("react.provider"):60109,_k=$d?Symbol.for("react.context"):60110,uF=$d?Symbol.for("react.async_mode"):60111,vk=$d?Symbol.for("react.concurrent_mode"):60111,yk=$d?Symbol.for("react.forward_ref"):60112,bk=$d?Symbol.for("react.suspense"):60113,Vue=$d?Symbol.for("react.suspense_list"):60120,Tk=$d?Symbol.for("react.memo"):60115,Sk=$d?Symbol.for("react.lazy"):60116,jue=$d?Symbol.for("react.block"):60121,Yue=$d?Symbol.for("react.fundamental"):60117,Xue=$d?Symbol.for("react.responder"):60118,Kue=$d?Symbol.for("react.scope"):60119;function Wm(n){if(typeof n=="object"&&n!==null){var e=n.$$typeof;switch(e){case aF:switch(n=n.type,n){case uF:case vk:case fk:case mk:case pk:case bk:return n;default:switch(n=n&&n.$$typeof,n){case _k:case yk:case Sk:case Tk:case gk:return n;default:return e}}case lF:return e}}}function OX(n){return Wm(n)===vk}Ra.AsyncMode=uF;Ra.ConcurrentMode=vk;Ra.ContextConsumer=_k;Ra.ContextProvider=gk;Ra.Element=aF;Ra.ForwardRef=yk;Ra.Fragment=fk;Ra.Lazy=Sk;Ra.Memo=Tk;Ra.Portal=lF;Ra.Profiler=mk;Ra.StrictMode=pk;Ra.Suspense=bk;Ra.isAsyncMode=function(n){return OX(n)||Wm(n)===uF};Ra.isConcurrentMode=OX;Ra.isContextConsumer=function(n){return Wm(n)===_k};Ra.isContextProvider=function(n){return Wm(n)===gk};Ra.isElement=function(n){return typeof n=="object"&&n!==null&&n.$$typeof===aF};Ra.isForwardRef=function(n){return Wm(n)===yk};Ra.isFragment=function(n){return Wm(n)===fk};Ra.isLazy=function(n){return Wm(n)===Sk};Ra.isMemo=function(n){return Wm(n)===Tk};Ra.isPortal=function(n){return Wm(n)===lF};Ra.isProfiler=function(n){return Wm(n)===mk};Ra.isStrictMode=function(n){return Wm(n)===pk};Ra.isSuspense=function(n){return Wm(n)===bk};Ra.isValidElementType=function(n){return typeof n=="string"||typeof n=="function"||n===fk||n===vk||n===mk||n===pk||n===bk||n===Vue||typeof n=="object"&&n!==null&&(n.$$typeof===Sk||n.$$typeof===Tk||n.$$typeof===gk||n.$$typeof===_k||n.$$typeof===yk||n.$$typeof===Yue||n.$$typeof===Xue||n.$$typeof===Kue||n.$$typeof===jue)};Ra.typeOf=Wm;kX.exports=Ra;var Jue=kX.exports,LX=Jue,que={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Que={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},NX={};NX[LX.ForwardRef]=que;NX[LX.Memo]=Que;var Zue=!0;function ece(n,e,t){var r="";return t.split(" ").forEach(function(s){n[s]!==void 0?e.push(n[s]+";"):r+=s+" "}),r}var DX=function(e,t,r){var s=e.key+"-"+t.name;(r===!1||Zue===!1)&&e.registered[s]===void 0&&(e.registered[s]=t.styles)},PX=function(e,t,r){DX(e,t,r);var s=e.key+"-"+t.name;if(e.inserted[t.name]===void 0){var o=t;do e.insert(t===o?"."+s:"",o,e.sheet,!0),o=o.next;while(o!==void 0)}};function tce(n){for(var e=0,t,r=0,s=n.length;s>=4;++r,s-=4)t=n.charCodeAt(r)&255|(n.charCodeAt(++r)&255)<<8|(n.charCodeAt(++r)&255)<<16|(n.charCodeAt(++r)&255)<<24,t=(t&65535)*1540483477+((t>>>16)*59797<<16),t^=t>>>24,e=(t&65535)*1540483477+((t>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(s){case 3:e^=(n.charCodeAt(r+2)&255)<<16;case 2:e^=(n.charCodeAt(r+1)&255)<<8;case 1:e^=n.charCodeAt(r)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}var nce={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},rce=/[A-Z]|^ms/g,ice=/_EMO_([^_]+?)_([^]*?)_EMO_/g,BX=function(e){return e.charCodeAt(1)===45},iH=function(e){return e!=null&&typeof e!="boolean"},VO=wX(function(n){return BX(n)?n:n.replace(rce,"-$&").toLowerCase()}),sH=function(e,t){switch(e){case"animation":case"animationName":if(typeof t=="string")return t.replace(ice,function(r,s,o){return Q0={name:s,styles:o,next:Q0},s})}return nce[e]!==1&&!BX(e)&&typeof t=="number"&&t!==0?t+"px":t};function k$(n,e,t){if(t==null)return"";if(t.__emotion_styles!==void 0)return t;switch(typeof t){case"boolean":return"";case"object":{if(t.anim===1)return Q0={name:t.name,styles:t.styles,next:Q0},t.name;if(t.styles!==void 0){var r=t.next;if(r!==void 0)for(;r!==void 0;)Q0={name:r.name,styles:r.styles,next:Q0},r=r.next;var s=t.styles+";";return s}return sce(n,e,t)}case"function":{if(n!==void 0){var o=Q0,l=t(n);return Q0=o,k$(n,e,l)}break}}if(e==null)return t;var u=e[t];return u!==void 0?u:t}function sce(n,e,t){var r="";if(Array.isArray(t))for(var s=0;s96?cce:hce},uH=function(e,t,r){var s;if(t){var o=t.shouldForwardProp;s=e.__emotion_forwardProp&&o?function(l){return e.__emotion_forwardProp(l)&&o(l)}:o}return typeof s!="function"&&r&&(s=e.__emotion_forwardProp),s},dce=function(e){var t=e.cache,r=e.serialized,s=e.isStringTag;return DX(t,r,s),ace(function(){return PX(t,r,s)}),null},fce=function n(e,t){var r=e.__emotion_real===e,s=r&&e.__emotion_base||e,o,l;t!==void 0&&(o=t.label,l=t.target);var u=uH(e,t,r),h=u||lH(s),f=!h("as");return function(){var g=arguments,y=r&&e.__emotion_styles!==void 0?e.__emotion_styles.slice(0):[];if(o!==void 0&&y.push("label:"+o+";"),g[0]==null||g[0].raw===void 0)y.push.apply(y,g);else{y.push(g[0][0]);for(var b=g.length,w=1;we(Tce(s)?t:s):e;return Ne.jsx(uce,{styles:r})}function hF(n,e){return PD(n,e)}const YX=(n,e)=>{Array.isArray(n.__emotion_styles)&&(n.__emotion_styles=e(n.__emotion_styles))},Sce=Object.freeze(Object.defineProperty({__proto__:null,GlobalStyles:jX,StyledEngineProvider:bce,ThemeContext:wk,css:HX,default:hF,internal_processStyles:YX,keyframes:Ek},Symbol.toStringTag,{value:"Module"}));function av(n){if(typeof n!="object"||n===null)return!1;const e=Object.getPrototypeOf(n);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in n)&&!(Symbol.iterator in n)}function XX(n){if(!av(n))return n;const e={};return Object.keys(n).forEach(t=>{e[t]=XX(n[t])}),e}function fp(n,e,t={clone:!0}){const r=t.clone?Qe({},n):n;return av(n)&&av(e)&&Object.keys(e).forEach(s=>{s!=="__proto__"&&(av(e[s])&&s in n&&av(n[s])?r[s]=fp(n[s],e[s],t):t.clone?r[s]=av(e[s])?XX(e[s]):e[s]:r[s]=e[s])}),r}const wce=Object.freeze(Object.defineProperty({__proto__:null,default:fp,isPlainObject:av},Symbol.toStringTag,{value:"Module"})),Ece=["values","unit","step"],xce=n=>{const e=Object.keys(n).map(t=>({key:t,val:n[t]}))||[];return e.sort((t,r)=>t.val-r.val),e.reduce((t,r)=>Qe({},t,{[r.key]:r.val}),{})};function KX(n){const{values:e={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:t="px",step:r=5}=n,s=Ar(n,Ece),o=xce(e),l=Object.keys(o);function u(b){return`@media (min-width:${typeof e[b]=="number"?e[b]:b}${t})`}function h(b){return`@media (max-width:${(typeof e[b]=="number"?e[b]:b)-r/100}${t})`}function f(b,w){const C=l.indexOf(w);return`@media (min-width:${typeof e[b]=="number"?e[b]:b}${t}) and (max-width:${(C!==-1&&typeof e[l[C]]=="number"?e[l[C]]:w)-r/100}${t})`}function g(b){return l.indexOf(b)+1`@media (min-width:${dF[n]}px)`};function Zp(n,e,t){const r=n.theme||{};if(Array.isArray(e)){const o=r.breakpoints||cH;return e.reduce((l,u,h)=>(l[o.up(o.keys[h])]=t(e[h]),l),{})}if(typeof e=="object"){const o=r.breakpoints||cH;return Object.keys(e).reduce((l,u)=>{if(Object.keys(o.values||dF).indexOf(u)!==-1){const h=o.up(u);l[h]=t(e[u],u)}else{const h=u;l[h]=e[h]}return l},{})}return t(e)}function JX(n={}){var e;return((e=n.keys)==null?void 0:e.reduce((r,s)=>{const o=n.up(s);return r[o]={},r},{}))||{}}function qX(n,e){return n.reduce((t,r)=>{const s=t[r];return(!s||Object.keys(s).length===0)&&delete t[r],t},e)}function Mce(n,...e){const t=JX(n),r=[t,...e].reduce((s,o)=>fp(s,o),{});return qX(Object.keys(t),r)}function Ace(n,e){if(typeof n!="object")return{};const t={},r=Object.keys(e);return Array.isArray(n)?r.forEach((s,o)=>{o{n[s]!=null&&(t[s]=!0)}),t}function L1({values:n,breakpoints:e,base:t}){const r=t||Ace(n,e),s=Object.keys(r);if(s.length===0)return n;let o;return s.reduce((l,u,h)=>(Array.isArray(n)?(l[u]=n[h]!=null?n[h]:n[o],o=h):typeof n=="object"?(l[u]=n[u]!=null?n[u]:n[o],o=u):l[u]=n,l),{})}function gr(n){if(typeof n!="string")throw new Error(q1(7));return n.charAt(0).toUpperCase()+n.slice(1)}const Ice=Object.freeze(Object.defineProperty({__proto__:null,default:gr},Symbol.toStringTag,{value:"Module"}));function xk(n,e,t=!0){if(!e||typeof e!="string")return null;if(n&&n.vars&&t){const r=`vars.${e}`.split(".").reduce((s,o)=>s&&s[o]?s[o]:null,n);if(r!=null)return r}return e.split(".").reduce((r,s)=>r&&r[s]!=null?r[s]:null,n)}function oR(n,e,t,r=t){let s;return typeof n=="function"?s=n(t):Array.isArray(n)?s=n[t]||r:s=xk(n,t)||r,e&&(s=e(s,r,n)),s}function fh(n){const{prop:e,cssProperty:t=n.prop,themeKey:r,transform:s}=n,o=l=>{if(l[e]==null)return null;const u=l[e],h=l.theme,f=xk(h,r)||{};return Zp(l,u,y=>{let b=oR(f,s,y);return y===b&&typeof y=="string"&&(b=oR(f,s,`${e}${y==="default"?"":gr(y)}`,y)),t===!1?b:{[t]:b}})};return o.propTypes={},o.filterProps=[e],o}function Rce(n){const e={};return t=>(e[t]===void 0&&(e[t]=n(t)),e[t])}const kce={m:"margin",p:"padding"},Oce={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},hH={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},Lce=Rce(n=>{if(n.length>2)if(hH[n])n=hH[n];else return[n];const[e,t]=n.split(""),r=kce[e],s=Oce[t]||"";return Array.isArray(s)?s.map(o=>r+o):[r+s]}),fF=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],pF=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...fF,...pF];function SC(n,e,t,r){var s;const o=(s=xk(n,e,!1))!=null?s:t;return typeof o=="number"?l=>typeof l=="string"?l:o*l:Array.isArray(o)?l=>typeof l=="string"?l:o[l]:typeof o=="function"?o:()=>{}}function mF(n){return SC(n,"spacing",8)}function Q1(n,e){if(typeof e=="string"||e==null)return e;const t=Math.abs(e),r=n(t);return e>=0?r:typeof r=="number"?-r:`-${r}`}function Nce(n,e){return t=>n.reduce((r,s)=>(r[s]=Q1(e,t),r),{})}function Dce(n,e,t,r){if(e.indexOf(t)===-1)return null;const s=Lce(t),o=Nce(s,r),l=n[t];return Zp(n,l,o)}function QX(n,e){const t=mF(n.theme);return Object.keys(n).map(r=>Dce(n,e,r,t)).reduce(Jx,{})}function kc(n){return QX(n,fF)}kc.propTypes={};kc.filterProps=fF;function Oc(n){return QX(n,pF)}Oc.propTypes={};Oc.filterProps=pF;function Pce(n=8){if(n.mui)return n;const e=mF({spacing:n}),t=(...r)=>(r.length===0?[1]:r).map(o=>{const l=e(o);return typeof l=="number"?`${l}px`:l}).join(" ");return t.mui=!0,t}function $k(...n){const e=n.reduce((r,s)=>(s.filterProps.forEach(o=>{r[o]=s}),r),{}),t=r=>Object.keys(r).reduce((s,o)=>e[o]?Jx(s,e[o](r)):s,{});return t.propTypes={},t.filterProps=n.reduce((r,s)=>r.concat(s.filterProps),[]),t}function vg(n){return typeof n!="number"?n:`${n}px solid`}function $g(n,e){return fh({prop:n,themeKey:"borders",transform:e})}const Bce=$g("border",vg),Fce=$g("borderTop",vg),zce=$g("borderRight",vg),Uce=$g("borderBottom",vg),Hce=$g("borderLeft",vg),Gce=$g("borderColor"),Wce=$g("borderTopColor"),Vce=$g("borderRightColor"),jce=$g("borderBottomColor"),Yce=$g("borderLeftColor"),Xce=$g("outline",vg),Kce=$g("outlineColor"),Ck=n=>{if(n.borderRadius!==void 0&&n.borderRadius!==null){const e=SC(n.theme,"shape.borderRadius",4),t=r=>({borderRadius:Q1(e,r)});return Zp(n,n.borderRadius,t)}return null};Ck.propTypes={};Ck.filterProps=["borderRadius"];$k(Bce,Fce,zce,Uce,Hce,Gce,Wce,Vce,jce,Yce,Ck,Xce,Kce);const Mk=n=>{if(n.gap!==void 0&&n.gap!==null){const e=SC(n.theme,"spacing",8),t=r=>({gap:Q1(e,r)});return Zp(n,n.gap,t)}return null};Mk.propTypes={};Mk.filterProps=["gap"];const Ak=n=>{if(n.columnGap!==void 0&&n.columnGap!==null){const e=SC(n.theme,"spacing",8),t=r=>({columnGap:Q1(e,r)});return Zp(n,n.columnGap,t)}return null};Ak.propTypes={};Ak.filterProps=["columnGap"];const Ik=n=>{if(n.rowGap!==void 0&&n.rowGap!==null){const e=SC(n.theme,"spacing",8),t=r=>({rowGap:Q1(e,r)});return Zp(n,n.rowGap,t)}return null};Ik.propTypes={};Ik.filterProps=["rowGap"];const Jce=fh({prop:"gridColumn"}),qce=fh({prop:"gridRow"}),Qce=fh({prop:"gridAutoFlow"}),Zce=fh({prop:"gridAutoColumns"}),ehe=fh({prop:"gridAutoRows"}),the=fh({prop:"gridTemplateColumns"}),nhe=fh({prop:"gridTemplateRows"}),rhe=fh({prop:"gridTemplateAreas"}),ihe=fh({prop:"gridArea"});$k(Mk,Ak,Ik,Jce,qce,Qce,Zce,ehe,the,nhe,rhe,ihe);function mw(n,e){return e==="grey"?e:n}const she=fh({prop:"color",themeKey:"palette",transform:mw}),ohe=fh({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:mw}),ahe=fh({prop:"backgroundColor",themeKey:"palette",transform:mw});$k(she,ohe,ahe);function Am(n){return n<=1&&n!==0?`${n*100}%`:n}const lhe=fh({prop:"width",transform:Am}),gF=n=>{if(n.maxWidth!==void 0&&n.maxWidth!==null){const e=t=>{var r,s;const o=((r=n.theme)==null||(r=r.breakpoints)==null||(r=r.values)==null?void 0:r[t])||dF[t];return o?((s=n.theme)==null||(s=s.breakpoints)==null?void 0:s.unit)!=="px"?{maxWidth:`${o}${n.theme.breakpoints.unit}`}:{maxWidth:o}:{maxWidth:Am(t)}};return Zp(n,n.maxWidth,e)}return null};gF.filterProps=["maxWidth"];const uhe=fh({prop:"minWidth",transform:Am}),che=fh({prop:"height",transform:Am}),hhe=fh({prop:"maxHeight",transform:Am}),dhe=fh({prop:"minHeight",transform:Am});fh({prop:"size",cssProperty:"width",transform:Am});fh({prop:"size",cssProperty:"height",transform:Am});const fhe=fh({prop:"boxSizing"});$k(lhe,gF,uhe,che,hhe,dhe,fhe);const phe={border:{themeKey:"borders",transform:vg},borderTop:{themeKey:"borders",transform:vg},borderRight:{themeKey:"borders",transform:vg},borderBottom:{themeKey:"borders",transform:vg},borderLeft:{themeKey:"borders",transform:vg},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:vg},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:Ck},color:{themeKey:"palette",transform:mw},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:mw},backgroundColor:{themeKey:"palette",transform:mw},p:{style:Oc},pt:{style:Oc},pr:{style:Oc},pb:{style:Oc},pl:{style:Oc},px:{style:Oc},py:{style:Oc},padding:{style:Oc},paddingTop:{style:Oc},paddingRight:{style:Oc},paddingBottom:{style:Oc},paddingLeft:{style:Oc},paddingX:{style:Oc},paddingY:{style:Oc},paddingInline:{style:Oc},paddingInlineStart:{style:Oc},paddingInlineEnd:{style:Oc},paddingBlock:{style:Oc},paddingBlockStart:{style:Oc},paddingBlockEnd:{style:Oc},m:{style:kc},mt:{style:kc},mr:{style:kc},mb:{style:kc},ml:{style:kc},mx:{style:kc},my:{style:kc},margin:{style:kc},marginTop:{style:kc},marginRight:{style:kc},marginBottom:{style:kc},marginLeft:{style:kc},marginX:{style:kc},marginY:{style:kc},marginInline:{style:kc},marginInlineStart:{style:kc},marginInlineEnd:{style:kc},marginBlock:{style:kc},marginBlockStart:{style:kc},marginBlockEnd:{style:kc},displayPrint:{cssProperty:!1,transform:n=>({"@media print":{display:n}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:Mk},rowGap:{style:Ik},columnGap:{style:Ak},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:Am},maxWidth:{style:gF},minWidth:{transform:Am},height:{transform:Am},maxHeight:{transform:Am},minHeight:{transform:Am},boxSizing:{},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}},wC=phe;function mhe(...n){const e=n.reduce((r,s)=>r.concat(Object.keys(s)),[]),t=new Set(e);return n.every(r=>t.size===Object.keys(r).length)}function ghe(n,e){return typeof n=="function"?n(e):n}function ZX(){function n(t,r,s,o){const l={[t]:r,theme:s},u=o[t];if(!u)return{[t]:r};const{cssProperty:h=t,themeKey:f,transform:g,style:y}=u;if(r==null)return null;if(f==="typography"&&r==="inherit")return{[t]:r};const b=xk(s,f)||{};return y?y(l):Zp(l,r,C=>{let M=oR(b,g,C);return C===M&&typeof C=="string"&&(M=oR(b,g,`${t}${C==="default"?"":gr(C)}`,C)),h===!1?M:{[h]:M}})}function e(t){var r;const{sx:s,theme:o={}}=t||{};if(!s)return null;const l=(r=o.unstable_sxConfig)!=null?r:wC;function u(h){let f=h;if(typeof h=="function")f=h(o);else if(typeof h!="object")return h;if(!f)return null;const g=JX(o.breakpoints),y=Object.keys(g);let b=g;return Object.keys(f).forEach(w=>{const C=ghe(f[w],o);if(C!=null)if(typeof C=="object")if(l[w])b=Jx(b,n(w,C,o,l));else{const M=Zp({theme:o},C,A=>({[w]:A}));mhe(M,C)?b[w]=e({sx:C,theme:o}):b=Jx(b,M)}else b=Jx(b,n(w,C,o,l))}),qX(y,b)}return Array.isArray(s)?s.map(u):u(s)}return e}const eK=ZX();eK.filterProps=["sx"];const EC=eK;function tK(n,e){const t=this;return t.vars&&typeof t.getColorSchemeSelector=="function"?{[t.getColorSchemeSelector(n).replace(/(\[[^\]]+\])/,"*:where($1)")]:e}:t.palette.mode===n?e:{}}const _he=["breakpoints","palette","spacing","shape"];function aE(n={},...e){const{breakpoints:t={},palette:r={},spacing:s,shape:o={}}=n,l=Ar(n,_he),u=KX(t),h=Pce(s);let f=fp({breakpoints:u,direction:"ltr",components:{},palette:Qe({mode:"light"},r),spacing:h,shape:Qe({},Cce,o)},l);return f.applyStyles=tK,f=e.reduce((g,y)=>fp(g,y),f),f.unstable_sxConfig=Qe({},wC,l==null?void 0:l.unstable_sxConfig),f.unstable_sx=function(y){return EC({sx:y,theme:this})},f}const vhe=Object.freeze(Object.defineProperty({__proto__:null,default:aE,private_createBreakpoints:KX,unstable_applyStyles:tK},Symbol.toStringTag,{value:"Module"}));function yhe(n){return Object.keys(n).length===0}function bhe(n=null){const e=me.useContext(wk);return!e||yhe(e)?n:e}const The=aE();function Rk(n=The){return bhe(n)}function She({styles:n,themeId:e,defaultTheme:t={}}){const r=Rk(t),s=typeof n=="function"?n(e&&r[e]||r):n;return Ne.jsx(jX,{styles:s})}const whe=["sx"],Ehe=n=>{var e,t;const r={systemProps:{},otherProps:{}},s=(e=n==null||(t=n.theme)==null?void 0:t.unstable_sxConfig)!=null?e:wC;return Object.keys(n).forEach(o=>{s[o]?r.systemProps[o]=n[o]:r.otherProps[o]=n[o]}),r};function xC(n){const{sx:e}=n,t=Ar(n,whe),{systemProps:r,otherProps:s}=Ehe(t);let o;return Array.isArray(e)?o=[r,...e]:typeof e=="function"?o=(...l)=>{const u=e(...l);return av(u)?Qe({},r,u):r}:o=Qe({},r,e),Qe({},s,{sx:o})}const xhe=Object.freeze(Object.defineProperty({__proto__:null,default:EC,extendSxProp:xC,unstable_createStyleFunctionSx:ZX,unstable_defaultSxConfig:wC},Symbol.toStringTag,{value:"Module"})),dH=n=>n,$he=()=>{let n=dH;return{configure(e){n=e},generate(e){return n(e)},reset(){n=dH}}},Che=$he(),_F=Che;function nK(n){var e,t,r="";if(typeof n=="string"||typeof n=="number")r+=n;else if(typeof n=="object")if(Array.isArray(n)){var s=n.length;for(e=0;eu!=="theme"&&u!=="sx"&&u!=="as"})(EC);return me.forwardRef(function(h,f){const g=Rk(t),y=xC(h),{className:b,component:w="div"}=y,C=Ar(y,Mhe);return Ne.jsx(o,Qe({as:w,ref:f,className:ai(b,s?s(r):r),theme:e&&g[e]||g},C))})}const Ihe={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function Po(n,e,t="Mui"){const r=Ihe[e];return r?`${t}-${r}`:`${_F.generate(n)}-${e}`}function Xo(n,e,t="Mui"){const r={};return e.forEach(s=>{r[s]=Po(n,s,t)}),r}var rK={exports:{}},ka={};/** * @license React * react-is.production.min.js * @@ -1618,7 +1618,7 @@ function print() { __p += __j.call(arguments, '') } * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var vF=Symbol.for("react.element"),yF=Symbol.for("react.portal"),kk=Symbol.for("react.fragment"),Ok=Symbol.for("react.strict_mode"),Lk=Symbol.for("react.profiler"),Nk=Symbol.for("react.provider"),Dk=Symbol.for("react.context"),Rhe=Symbol.for("react.server_context"),Pk=Symbol.for("react.forward_ref"),Bk=Symbol.for("react.suspense"),Fk=Symbol.for("react.suspense_list"),zk=Symbol.for("react.memo"),Uk=Symbol.for("react.lazy"),khe=Symbol.for("react.offscreen"),rK;rK=Symbol.for("react.module.reference");function Cg(n){if(typeof n=="object"&&n!==null){var e=n.$$typeof;switch(e){case vF:switch(n=n.type,n){case kk:case Lk:case Ok:case Bk:case Fk:return n;default:switch(n=n&&n.$$typeof,n){case Rhe:case Dk:case Pk:case Uk:case zk:case Nk:return n;default:return e}}case yF:return e}}}ka.ContextConsumer=Dk;ka.ContextProvider=Nk;ka.Element=vF;ka.ForwardRef=Pk;ka.Fragment=kk;ka.Lazy=Uk;ka.Memo=zk;ka.Portal=yF;ka.Profiler=Lk;ka.StrictMode=Ok;ka.Suspense=Bk;ka.SuspenseList=Fk;ka.isAsyncMode=function(){return!1};ka.isConcurrentMode=function(){return!1};ka.isContextConsumer=function(n){return Cg(n)===Dk};ka.isContextProvider=function(n){return Cg(n)===Nk};ka.isElement=function(n){return typeof n=="object"&&n!==null&&n.$$typeof===vF};ka.isForwardRef=function(n){return Cg(n)===Pk};ka.isFragment=function(n){return Cg(n)===kk};ka.isLazy=function(n){return Cg(n)===Uk};ka.isMemo=function(n){return Cg(n)===zk};ka.isPortal=function(n){return Cg(n)===yF};ka.isProfiler=function(n){return Cg(n)===Lk};ka.isStrictMode=function(n){return Cg(n)===Ok};ka.isSuspense=function(n){return Cg(n)===Bk};ka.isSuspenseList=function(n){return Cg(n)===Fk};ka.isValidElementType=function(n){return typeof n=="string"||typeof n=="function"||n===kk||n===Lk||n===Ok||n===Bk||n===Fk||n===khe||typeof n=="object"&&n!==null&&(n.$$typeof===Uk||n.$$typeof===zk||n.$$typeof===Nk||n.$$typeof===Dk||n.$$typeof===Pk||n.$$typeof===rK||n.getModuleId!==void 0)};ka.typeOf=Cg;nK.exports=ka;var dH=nK.exports;const Ohe=/^\s*function(?:\s|\s*\/\*.*\*\/\s*)+([^(\s/]*)\s*/;function iK(n){const e=`${n}`.match(Ohe);return e&&e[1]||""}function sK(n,e=""){return n.displayName||n.name||iK(n)||e}function fH(n,e,t){const r=sK(e);return n.displayName||(r!==""?`${t}(${r})`:t)}function Lhe(n){if(n!=null){if(typeof n=="string")return n;if(typeof n=="function")return sK(n,"Component");if(typeof n=="object")switch(n.$$typeof){case dH.ForwardRef:return fH(n,n.render,"ForwardRef");case dH.Memo:return fH(n,n.type,"memo");default:return}}}const Nhe=Object.freeze(Object.defineProperty({__proto__:null,default:Lhe,getFunctionName:iK},Symbol.toStringTag,{value:"Module"})),Dhe=["ownerState"],Phe=["variants"],Bhe=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function Fhe(n){return Object.keys(n).length===0}function zhe(n){return typeof n=="string"&&n.charCodeAt(0)>96}function jO(n){return n!=="ownerState"&&n!=="theme"&&n!=="sx"&&n!=="as"}const Uhe=aE(),Hhe=n=>n&&n.charAt(0).toLowerCase()+n.slice(1);function DM({defaultTheme:n,theme:e,themeId:t}){return Fhe(e)?n:e[t]||e}function Ghe(n){return n?(e,t)=>t[n]:null}function cI(n,e){let{ownerState:t}=e,r=Ar(e,Dhe);const s=typeof n=="function"?n(qe({ownerState:t},r)):n;if(Array.isArray(s))return s.flatMap(o=>cI(o,qe({ownerState:t},r)));if(s&&typeof s=="object"&&Array.isArray(s.variants)){const{variants:o=[]}=s;let u=Ar(s,Phe);return o.forEach(h=>{let f=!0;typeof h.props=="function"?f=h.props(qe({ownerState:t},r,t)):Object.keys(h.props).forEach(g=>{(t==null?void 0:t[g])!==h.props[g]&&r[g]!==h.props[g]&&(f=!1)}),f&&(Array.isArray(u)||(u=[u]),u.push(typeof h.style=="function"?h.style(qe({ownerState:t},r,t)):h.style))}),u}return s}function Whe(n={}){const{themeId:e,defaultTheme:t=Uhe,rootShouldForwardProp:r=jO,slotShouldForwardProp:s=jO}=n,o=l=>EC(qe({},l,{theme:DM(qe({},l,{defaultTheme:t,themeId:e}))}));return o.__mui_systemSx=!0,(l,u={})=>{jX(l,z=>z.filter(U=>!(U!=null&&U.__mui_systemSx)));const{name:h,slot:f,skipVariantsResolver:g,skipSx:y,overridesResolver:b=Ghe(Hhe(f))}=u,w=Ar(u,Bhe),C=g!==void 0?g:f&&f!=="Root"&&f!=="root"||!1,M=y||!1;let A,k=jO;f==="Root"||f==="root"?k=r:f?k=s:zhe(l)&&(k=void 0);const L=hF(l,qe({shouldForwardProp:k,label:A},w)),P=z=>typeof z=="function"&&z.__emotion_real!==z||av(z)?U=>cI(z,qe({},U,{theme:DM({theme:U.theme,defaultTheme:t,themeId:e})})):z,D=(z,...U)=>{let V=P(z);const H=U?U.map(P):[];h&&b&&H.push(Z=>{const q=DM(qe({},Z,{defaultTheme:t,themeId:e}));if(!q.components||!q.components[h]||!q.components[h].styleOverrides)return null;const he=q.components[h].styleOverrides,ae={};return Object.entries(he).forEach(([ue,ge])=>{ae[ue]=cI(ge,qe({},Z,{theme:q}))}),b(Z,ae)}),h&&!C&&H.push(Z=>{var q;const he=DM(qe({},Z,{defaultTheme:t,themeId:e})),ae=he==null||(q=he.components)==null||(q=q[h])==null?void 0:q.variants;return cI({variants:ae},qe({},Z,{theme:he}))}),M||H.push(o);const oe=H.length-U.length;if(Array.isArray(z)&&oe>0){const Z=new Array(oe).fill("");V=[...z,...Z],V.raw=[...z.raw,...Z]}const le=L(V,...H);return l.muiName&&(le.muiName=l.muiName),le};return L.withConfig&&(D.withConfig=L.withConfig),D}}const oK=Whe();function bF(n,e){const t=qe({},e);return Object.keys(n).forEach(r=>{if(r.toString().match(/^(components|slots)$/))t[r]=qe({},n[r],t[r]);else if(r.toString().match(/^(componentsProps|slotProps)$/)){const s=n[r]||{},o=e[r];t[r]={},!o||!Object.keys(o)?t[r]=s:!s||!Object.keys(s)?t[r]=o:(t[r]=qe({},o),Object.keys(s).forEach(l=>{t[r][l]=bF(s[l],o[l])}))}else t[r]===void 0&&(t[r]=n[r])}),t}function Vhe(n){const{theme:e,name:t,props:r}=n;return!e||!e.components||!e.components[t]||!e.components[t].defaultProps?r:bF(e.components[t].defaultProps,r)}function TF({props:n,name:e,defaultTheme:t,themeId:r}){let s=Rk(t);return r&&(s=s[r]||s),Vhe({theme:s,name:e,props:n})}const jhe=typeof window<"u"?pe.useLayoutEffect:pe.useEffect,Uy=jhe;function Yhe(n,e=Number.MIN_SAFE_INTEGER,t=Number.MAX_SAFE_INTEGER){return Math.max(e,Math.min(n,t))}const Xhe=Object.freeze(Object.defineProperty({__proto__:null,default:Yhe},Symbol.toStringTag,{value:"Module"}));function FD(...n){return n.reduce((e,t)=>t==null?e:function(...s){e.apply(this,s),t.apply(this,s)},()=>{})}function SF(n,e=166){let t;function r(...s){const o=()=>{n.apply(this,s)};clearTimeout(t),t=setTimeout(o,e)}return r.clear=()=>{clearTimeout(t)},r}function Khe(n,e){return()=>null}function hI(n,e){var t,r;return pe.isValidElement(n)&&e.indexOf((t=n.type.muiName)!=null?t:(r=n.type)==null||(r=r._payload)==null||(r=r.value)==null?void 0:r.muiName)!==-1}function Jp(n){return n&&n.ownerDocument||document}function Hy(n){return Jp(n).defaultView||window}function Jhe(n,e){return()=>null}function aR(n,e){typeof n=="function"?n(e):n&&(n.current=e)}let pH=0;function qhe(n){const[e,t]=pe.useState(n),r=n||e;return pe.useEffect(()=>{e==null&&(pH+=1,t(`mui-${pH}`))},[e]),r}const mH=RN.useId;function Hk(n){if(mH!==void 0){const e=mH();return n??e}return qhe(n)}function Qhe(n,e,t,r,s){return null}function lR({controlled:n,default:e,name:t,state:r="value"}){const{current:s}=pe.useRef(n!==void 0),[o,l]=pe.useState(e),u=s?n:o,h=pe.useCallback(f=>{s||l(f)},[]);return[u,h]}function T1(n){const e=pe.useRef(n);return Uy(()=>{e.current=n}),pe.useRef((...t)=>(0,e.current)(...t)).current}function gp(...n){return pe.useMemo(()=>n.every(e=>e==null)?null:e=>{n.forEach(t=>{aR(t,e)})},n)}const gH={};function Zhe(n,e){const t=pe.useRef(gH);return t.current===gH&&(t.current=n(e)),t}const ede=[];function tde(n){pe.useEffect(n,ede)}class Gk{constructor(){this.currentId=null,this.clear=()=>{this.currentId!==null&&(clearTimeout(this.currentId),this.currentId=null)},this.disposeEffect=()=>this.clear}static create(){return new Gk}start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,t()},e)}}function aK(){const n=Zhe(Gk.create).current;return tde(n.disposeEffect),n}let Wk=!0,zD=!1;const nde=new Gk,rde={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function ide(n){const{type:e,tagName:t}=n;return!!(t==="INPUT"&&rde[e]&&!n.readOnly||t==="TEXTAREA"&&!n.readOnly||n.isContentEditable)}function sde(n){n.metaKey||n.altKey||n.ctrlKey||(Wk=!0)}function YO(){Wk=!1}function ode(){this.visibilityState==="hidden"&&zD&&(Wk=!0)}function ade(n){n.addEventListener("keydown",sde,!0),n.addEventListener("mousedown",YO,!0),n.addEventListener("pointerdown",YO,!0),n.addEventListener("touchstart",YO,!0),n.addEventListener("visibilitychange",ode,!0)}function lde(n){const{target:e}=n;try{return e.matches(":focus-visible")}catch{}return Wk||ide(e)}function lK(){const n=pe.useCallback(s=>{s!=null&&ade(s.ownerDocument)},[]),e=pe.useRef(!1);function t(){return e.current?(zD=!0,nde.start(100,()=>{zD=!1}),e.current=!1,!0):!1}function r(s){return lde(s)?(e.current=!0,!0):!1}return{isFocusVisibleRef:e,onFocus:r,onBlur:t,ref:n}}function uK(n){const e=n.documentElement.clientWidth;return Math.abs(window.innerWidth-e)}function Ko(n,e,t=void 0){const r={};return Object.keys(n).forEach(s=>{r[s]=n[s].reduce((o,l)=>{if(l){const u=e(l);u!==""&&o.push(u),t&&t[l]&&o.push(t[l])}return o},[]).join(" ")}),r}const ude=pe.createContext(),cde=()=>{const n=pe.useContext(ude);return n??!1};function O$(n){"@babel/helpers - typeof";return O$=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},O$(n)}function hde(n,e){if(O$(n)!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(O$(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function dde(n){var e=hde(n,"string");return O$(e)=="symbol"?e:e+""}const fde=["className","component","disableGutters","fixed","maxWidth","classes"],pde=aE(),mde=oK("div",{name:"MuiContainer",slot:"Root",overridesResolver:(n,e)=>{const{ownerState:t}=n;return[e.root,e[`maxWidth${gr(String(t.maxWidth))}`],t.fixed&&e.fixed,t.disableGutters&&e.disableGutters]}}),gde=n=>TF({props:n,name:"MuiContainer",defaultTheme:pde}),_de=(n,e)=>{const t=h=>Po(e,h),{classes:r,fixed:s,disableGutters:o,maxWidth:l}=n,u={root:["root",l&&`maxWidth${gr(String(l))}`,s&&"fixed",o&&"disableGutters"]};return Ko(u,t,r)};function vde(n={}){const{createStyledComponent:e=mde,useThemeProps:t=gde,componentName:r="MuiContainer"}=n,s=e(({theme:l,ownerState:u})=>qe({width:"100%",marginLeft:"auto",boxSizing:"border-box",marginRight:"auto",display:"block"},!u.disableGutters&&{paddingLeft:l.spacing(2),paddingRight:l.spacing(2),[l.breakpoints.up("sm")]:{paddingLeft:l.spacing(3),paddingRight:l.spacing(3)}}),({theme:l,ownerState:u})=>u.fixed&&Object.keys(l.breakpoints.values).reduce((h,f)=>{const g=f,y=l.breakpoints.values[g];return y!==0&&(h[l.breakpoints.up(g)]={maxWidth:`${y}${l.breakpoints.unit}`}),h},{}),({theme:l,ownerState:u})=>qe({},u.maxWidth==="xs"&&{[l.breakpoints.up("xs")]:{maxWidth:Math.max(l.breakpoints.values.xs,444)}},u.maxWidth&&u.maxWidth!=="xs"&&{[l.breakpoints.up(u.maxWidth)]:{maxWidth:`${l.breakpoints.values[u.maxWidth]}${l.breakpoints.unit}`}}));return pe.forwardRef(function(u,h){const f=t(u),{className:g,component:y="div",disableGutters:b=!1,fixed:w=!1,maxWidth:C="lg"}=f,M=Ar(f,fde),A=qe({},f,{component:y,disableGutters:b,fixed:w,maxWidth:C}),k=_de(A,r);return De.jsx(s,qe({as:y,ownerState:A,className:ai(k.root,g),ref:h},M))})}const yde=["component","direction","spacing","divider","children","className","useFlexGap"],bde=aE(),Tde=oK("div",{name:"MuiStack",slot:"Root",overridesResolver:(n,e)=>e.root});function Sde(n){return TF({props:n,name:"MuiStack",defaultTheme:bde})}function wde(n,e){const t=pe.Children.toArray(n).filter(Boolean);return t.reduce((r,s,o)=>(r.push(s),o({row:"Left","row-reverse":"Right",column:"Top","column-reverse":"Bottom"})[n],xde=({ownerState:n,theme:e})=>{let t=qe({display:"flex",flexDirection:"column"},Zp({theme:e},O1({values:n.direction,breakpoints:e.breakpoints.values}),r=>({flexDirection:r})));if(n.spacing){const r=mF(e),s=Object.keys(e.breakpoints.values).reduce((h,f)=>((typeof n.spacing=="object"&&n.spacing[f]!=null||typeof n.direction=="object"&&n.direction[f]!=null)&&(h[f]=!0),h),{}),o=O1({values:n.direction,base:s}),l=O1({values:n.spacing,base:s});typeof o=="object"&&Object.keys(o).forEach((h,f,g)=>{if(!o[h]){const b=f>0?o[g[f-1]]:"column";o[h]=b}}),t=fp(t,Zp({theme:e},l,(h,f)=>n.useFlexGap?{gap:q1(r,h)}:{"& > :not(style):not(style)":{margin:0},"& > :not(style) ~ :not(style)":{[`margin${Ede(f?o[f]:n.direction)}`]:q1(r,h)}}))}return t=Mce(e.breakpoints,t),t};function $de(n={}){const{createStyledComponent:e=Tde,useThemeProps:t=Sde,componentName:r="MuiStack"}=n,s=()=>Ko({root:["root"]},h=>Po(r,h),{}),o=e(xde);return pe.forwardRef(function(h,f){const g=t(h),y=xC(g),{component:b="div",direction:w="column",spacing:C=0,divider:M,children:A,className:k,useFlexGap:L=!1}=y,P=Ar(y,yde),D={direction:w,spacing:C,useFlexGap:L},z=s();return De.jsx(o,qe({as:b,ownerState:D,ref:f,className:ai(z.root,k)},P,{children:M?wde(A,M):A}))})}function Cde(n,e){return qe({toolbar:{minHeight:56,[n.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[n.up("sm")]:{minHeight:64}}},e)}var ph={},cK={exports:{}};(function(n){function e(t){return t&&t.__esModule?t:{default:t}}n.exports=e,n.exports.__esModule=!0,n.exports.default=n.exports})(cK);var aT=cK.exports;const Mde=__(fue),Ade=__(Xhe);var hK=aT;Object.defineProperty(ph,"__esModule",{value:!0});var r0=ph.alpha=_K;ph.blend=zde;ph.colorChannel=void 0;var dK=ph.darken=EF;ph.decomposeColor=Eg;ph.emphasize=vK;var Ide=ph.getContrastRatio=Nde;ph.getLuminance=uR;ph.hexToRgb=pK;ph.hslToRgb=gK;var fK=ph.lighten=xF;ph.private_safeAlpha=Dde;ph.private_safeColorChannel=void 0;ph.private_safeDarken=Pde;ph.private_safeEmphasize=Fde;ph.private_safeLighten=Bde;ph.recomposeColor=lE;ph.rgbToHex=Lde;var _H=hK(Mde),Rde=hK(Ade);function wF(n,e=0,t=1){return(0,Rde.default)(n,e,t)}function pK(n){n=n.slice(1);const e=new RegExp(`.{1,${n.length>=6?2:1}}`,"g");let t=n.match(e);return t&&t[0].length===1&&(t=t.map(r=>r+r)),t?`rgb${t.length===4?"a":""}(${t.map((r,s)=>s<3?parseInt(r,16):Math.round(parseInt(r,16)/255*1e3)/1e3).join(", ")})`:""}function kde(n){const e=n.toString(16);return e.length===1?`0${e}`:e}function Eg(n){if(n.type)return n;if(n.charAt(0)==="#")return Eg(pK(n));const e=n.indexOf("("),t=n.substring(0,e);if(["rgb","rgba","hsl","hsla","color"].indexOf(t)===-1)throw new Error((0,_H.default)(9,n));let r=n.substring(e+1,n.length-1),s;if(t==="color"){if(r=r.split(" "),s=r.shift(),r.length===4&&r[3].charAt(0)==="/"&&(r[3]=r[3].slice(1)),["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(s)===-1)throw new Error((0,_H.default)(10,s))}else r=r.split(",");return r=r.map(o=>parseFloat(o)),{type:t,values:r,colorSpace:s}}const mK=n=>{const e=Eg(n);return e.values.slice(0,3).map((t,r)=>e.type.indexOf("hsl")!==-1&&r!==0?`${t}%`:t).join(" ")};ph.colorChannel=mK;const Ode=(n,e)=>{try{return mK(n)}catch{return n}};ph.private_safeColorChannel=Ode;function lE(n){const{type:e,colorSpace:t}=n;let{values:r}=n;return e.indexOf("rgb")!==-1?r=r.map((s,o)=>o<3?parseInt(s,10):s):e.indexOf("hsl")!==-1&&(r[1]=`${r[1]}%`,r[2]=`${r[2]}%`),e.indexOf("color")!==-1?r=`${t} ${r.join(" ")}`:r=`${r.join(", ")}`,`${e}(${r})`}function Lde(n){if(n.indexOf("#")===0)return n;const{values:e}=Eg(n);return`#${e.map((t,r)=>kde(r===3?Math.round(255*t):t)).join("")}`}function gK(n){n=Eg(n);const{values:e}=n,t=e[0],r=e[1]/100,s=e[2]/100,o=r*Math.min(s,1-s),l=(f,g=(f+t/30)%12)=>s-o*Math.max(Math.min(g-3,9-g,1),-1);let u="rgb";const h=[Math.round(l(0)*255),Math.round(l(8)*255),Math.round(l(4)*255)];return n.type==="hsla"&&(u+="a",h.push(e[3])),lE({type:u,values:h})}function uR(n){n=Eg(n);let e=n.type==="hsl"||n.type==="hsla"?Eg(gK(n)).values:n.values;return e=e.map(t=>(n.type!=="color"&&(t/=255),t<=.03928?t/12.92:((t+.055)/1.055)**2.4)),Number((.2126*e[0]+.7152*e[1]+.0722*e[2]).toFixed(3))}function Nde(n,e){const t=uR(n),r=uR(e);return(Math.max(t,r)+.05)/(Math.min(t,r)+.05)}function _K(n,e){return n=Eg(n),e=wF(e),(n.type==="rgb"||n.type==="hsl")&&(n.type+="a"),n.type==="color"?n.values[3]=`/${e}`:n.values[3]=e,lE(n)}function Dde(n,e,t){try{return _K(n,e)}catch{return n}}function EF(n,e){if(n=Eg(n),e=wF(e),n.type.indexOf("hsl")!==-1)n.values[2]*=1-e;else if(n.type.indexOf("rgb")!==-1||n.type.indexOf("color")!==-1)for(let t=0;t<3;t+=1)n.values[t]*=1-e;return lE(n)}function Pde(n,e,t){try{return EF(n,e)}catch{return n}}function xF(n,e){if(n=Eg(n),e=wF(e),n.type.indexOf("hsl")!==-1)n.values[2]+=(100-n.values[2])*e;else if(n.type.indexOf("rgb")!==-1)for(let t=0;t<3;t+=1)n.values[t]+=(255-n.values[t])*e;else if(n.type.indexOf("color")!==-1)for(let t=0;t<3;t+=1)n.values[t]+=(1-n.values[t])*e;return lE(n)}function Bde(n,e,t){try{return xF(n,e)}catch{return n}}function vK(n,e=.15){return uR(n)>.5?EF(n,e):xF(n,e)}function Fde(n,e,t){try{return vK(n,e)}catch{return n}}function zde(n,e,t,r=1){const s=(h,f)=>Math.round((h**(1/r)*(1-t)+f**(1/r)*t)**r),o=Eg(n),l=Eg(e),u=[s(o.values[0],l.values[0]),s(o.values[1],l.values[1]),s(o.values[2],l.values[2])];return lE({type:"rgb",values:u})}const Ude=["mode","contrastThreshold","tonalOffset"],vH={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:A$.white,default:A$.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},XO={text:{primary:A$.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:A$.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function yH(n,e,t,r){const s=r.light||r,o=r.dark||r*1.5;n[e]||(n.hasOwnProperty(t)?n[e]=n[t]:e==="light"?n.light=fK(n.main,s):e==="dark"&&(n.dark=dK(n.main,o)))}function Hde(n="light"){return n==="dark"?{main:cS[200],light:cS[50],dark:cS[400]}:{main:cS[700],light:cS[400],dark:cS[800]}}function Gde(n="light"){return n==="dark"?{main:uS[200],light:uS[50],dark:uS[400]}:{main:uS[500],light:uS[300],dark:uS[700]}}function Wde(n="light"){return n==="dark"?{main:lS[500],light:lS[300],dark:lS[700]}:{main:lS[700],light:lS[400],dark:lS[800]}}function Vde(n="light"){return n==="dark"?{main:hS[400],light:hS[300],dark:hS[700]}:{main:hS[700],light:hS[500],dark:hS[900]}}function jde(n="light"){return n==="dark"?{main:dS[400],light:dS[300],dark:dS[700]}:{main:dS[800],light:dS[500],dark:dS[900]}}function Yde(n="light"){return n==="dark"?{main:ZE[400],light:ZE[300],dark:ZE[700]}:{main:"#ed6c02",light:ZE[500],dark:ZE[900]}}function Xde(n){const{mode:e="light",contrastThreshold:t=3,tonalOffset:r=.2}=n,s=Ar(n,Ude),o=n.primary||Hde(e),l=n.secondary||Gde(e),u=n.error||Wde(e),h=n.info||Vde(e),f=n.success||jde(e),g=n.warning||Yde(e);function y(M){return Ide(M,XO.text.primary)>=t?XO.text.primary:vH.text.primary}const b=({color:M,name:A,mainShade:k=500,lightShade:L=300,darkShade:P=700})=>{if(M=qe({},M),!M.main&&M[k]&&(M.main=M[k]),!M.hasOwnProperty("main"))throw new Error(J1(11,A?` (${A})`:"",k));if(typeof M.main!="string")throw new Error(J1(12,A?` (${A})`:"",JSON.stringify(M.main)));return yH(M,"light",L,r),yH(M,"dark",P,r),M.contrastText||(M.contrastText=y(M.main)),M},w={dark:XO,light:vH};return fp(qe({common:qe({},A$),mode:e,primary:b({color:o,name:"primary"}),secondary:b({color:l,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:b({color:u,name:"error"}),warning:b({color:g,name:"warning"}),info:b({color:h,name:"info"}),success:b({color:f,name:"success"}),grey:due,contrastThreshold:t,getContrastText:y,augmentColor:b,tonalOffset:r},w[e]),s)}const Kde=["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"];function Jde(n){return Math.round(n*1e5)/1e5}const bH={textTransform:"uppercase"},TH='"Roboto", "Helvetica", "Arial", sans-serif';function qde(n,e){const t=typeof e=="function"?e(n):e,{fontFamily:r=TH,fontSize:s=14,fontWeightLight:o=300,fontWeightRegular:l=400,fontWeightMedium:u=500,fontWeightBold:h=700,htmlFontSize:f=16,allVariants:g,pxToRem:y}=t,b=Ar(t,Kde),w=s/14,C=y||(k=>`${k/f*w}rem`),M=(k,L,P,D,z)=>qe({fontFamily:r,fontWeight:k,fontSize:C(L),lineHeight:P},r===TH?{letterSpacing:`${Jde(D/L)}em`}:{},z,g),A={h1:M(o,96,1.167,-1.5),h2:M(o,60,1.2,-.5),h3:M(l,48,1.167,0),h4:M(l,34,1.235,.25),h5:M(l,24,1.334,0),h6:M(u,20,1.6,.15),subtitle1:M(l,16,1.75,.15),subtitle2:M(u,14,1.57,.1),body1:M(l,16,1.5,.15),body2:M(l,14,1.43,.15),button:M(u,14,1.75,.4,bH),caption:M(l,12,1.66,.4),overline:M(l,12,2.66,1,bH),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return fp(qe({htmlFontSize:f,pxToRem:C,fontFamily:r,fontSize:s,fontWeightLight:o,fontWeightRegular:l,fontWeightMedium:u,fontWeightBold:h},A),b,{clone:!1})}const Qde=.2,Zde=.14,efe=.12;function Nu(...n){return[`${n[0]}px ${n[1]}px ${n[2]}px ${n[3]}px rgba(0,0,0,${Qde})`,`${n[4]}px ${n[5]}px ${n[6]}px ${n[7]}px rgba(0,0,0,${Zde})`,`${n[8]}px ${n[9]}px ${n[10]}px ${n[11]}px rgba(0,0,0,${efe})`].join(",")}const tfe=["none",Nu(0,2,1,-1,0,1,1,0,0,1,3,0),Nu(0,3,1,-2,0,2,2,0,0,1,5,0),Nu(0,3,3,-2,0,3,4,0,0,1,8,0),Nu(0,2,4,-1,0,4,5,0,0,1,10,0),Nu(0,3,5,-1,0,5,8,0,0,1,14,0),Nu(0,3,5,-1,0,6,10,0,0,1,18,0),Nu(0,4,5,-2,0,7,10,1,0,2,16,1),Nu(0,5,5,-3,0,8,10,1,0,3,14,2),Nu(0,5,6,-3,0,9,12,1,0,3,16,2),Nu(0,6,6,-3,0,10,14,1,0,4,18,3),Nu(0,6,7,-4,0,11,15,1,0,4,20,3),Nu(0,7,8,-4,0,12,17,2,0,5,22,4),Nu(0,7,8,-4,0,13,19,2,0,5,24,4),Nu(0,7,9,-4,0,14,21,2,0,5,26,4),Nu(0,8,9,-5,0,15,22,2,0,6,28,5),Nu(0,8,10,-5,0,16,24,2,0,6,30,5),Nu(0,8,11,-5,0,17,26,2,0,6,32,5),Nu(0,9,11,-5,0,18,28,2,0,7,34,6),Nu(0,9,12,-6,0,19,29,2,0,7,36,6),Nu(0,10,13,-6,0,20,31,3,0,8,38,7),Nu(0,10,13,-6,0,21,33,3,0,8,40,7),Nu(0,10,14,-6,0,22,35,3,0,8,42,7),Nu(0,11,14,-7,0,23,36,3,0,9,44,8),Nu(0,11,15,-7,0,24,38,3,0,9,46,8)],nfe=["duration","easing","delay"],rfe={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},ife={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function SH(n){return`${Math.round(n)}ms`}function sfe(n){if(!n)return 0;const e=n/36;return Math.round((4+15*e**.25+e/5)*10)}function ofe(n){const e=qe({},rfe,n.easing),t=qe({},ife,n.duration);return qe({getAutoHeightDuration:sfe,create:(s=["all"],o={})=>{const{duration:l=t.standard,easing:u=e.easeInOut,delay:h=0}=o;return Ar(o,nfe),(Array.isArray(s)?s:[s]).map(f=>`${f} ${typeof l=="string"?l:SH(l)} ${u} ${typeof h=="string"?h:SH(h)}`).join(",")}},n,{easing:e,duration:t})}const afe={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500},lfe=afe,ufe=["breakpoints","mixins","spacing","palette","transitions","typography","shape"];function yK(n={},...e){const{mixins:t={},palette:r={},transitions:s={},typography:o={}}=n,l=Ar(n,ufe);if(n.vars)throw new Error(J1(18));const u=Xde(r),h=aE(n);let f=fp(h,{mixins:Cde(h.breakpoints,t),palette:u,shadows:tfe.slice(),typography:qde(u,o),transitions:ofe(s),zIndex:qe({},lfe)});return f=fp(f,l),f=e.reduce((g,y)=>fp(g,y),f),f.unstable_sxConfig=qe({},wC,l==null?void 0:l.unstable_sxConfig),f.unstable_sx=function(y){return EC({sx:y,theme:this})},f}const cfe=yK(),Vk=cfe;function jk(){const n=Rk(Vk);return n[bC]||n}function ua({props:n,name:e}){return TF({props:n,name:e,defaultTheme:Vk,themeId:bC})}var $C={};const hfe=__(pue);var KO={exports:{}},wH;function dfe(){return wH||(wH=1,function(n){function e(t,r){if(t==null)return{};var s={},o=Object.keys(t),l,u;for(u=0;u=0)&&(s[l]=t[l]);return s}n.exports=e,n.exports.__esModule=!0,n.exports.default=n.exports}(KO)),KO.exports}const ffe=__(Sce),pfe=__(wce),mfe=__(Ice),gfe=__(Nhe),_fe=__(vhe),vfe=__(xhe);var uE=aT;Object.defineProperty($C,"__esModule",{value:!0});var yfe=$C.default=kfe;$C.shouldForwardProp=dI;$C.systemDefaultTheme=void 0;var hg=uE(hfe),UD=uE(dfe()),EH=$fe(ffe),bfe=pfe;uE(mfe);uE(gfe);var Tfe=uE(_fe),Sfe=uE(vfe);const wfe=["ownerState"],Efe=["variants"],xfe=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function bK(n){if(typeof WeakMap!="function")return null;var e=new WeakMap,t=new WeakMap;return(bK=function(r){return r?t:e})(n)}function $fe(n,e){if(!e&&n&&n.__esModule)return n;if(n===null||typeof n!="object"&&typeof n!="function")return{default:n};var t=bK(e);if(t&&t.has(n))return t.get(n);var r={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in n)if(o!=="default"&&Object.prototype.hasOwnProperty.call(n,o)){var l=s?Object.getOwnPropertyDescriptor(n,o):null;l&&(l.get||l.set)?Object.defineProperty(r,o,l):r[o]=n[o]}return r.default=n,t&&t.set(n,r),r}function Cfe(n){return Object.keys(n).length===0}function Mfe(n){return typeof n=="string"&&n.charCodeAt(0)>96}function dI(n){return n!=="ownerState"&&n!=="theme"&&n!=="sx"&&n!=="as"}const Afe=$C.systemDefaultTheme=(0,Tfe.default)(),Ife=n=>n&&n.charAt(0).toLowerCase()+n.slice(1);function PM({defaultTheme:n,theme:e,themeId:t}){return Cfe(e)?n:e[t]||e}function Rfe(n){return n?(e,t)=>t[n]:null}function fI(n,e){let{ownerState:t}=e,r=(0,UD.default)(e,wfe);const s=typeof n=="function"?n((0,hg.default)({ownerState:t},r)):n;if(Array.isArray(s))return s.flatMap(o=>fI(o,(0,hg.default)({ownerState:t},r)));if(s&&typeof s=="object"&&Array.isArray(s.variants)){const{variants:o=[]}=s;let u=(0,UD.default)(s,Efe);return o.forEach(h=>{let f=!0;typeof h.props=="function"?f=h.props((0,hg.default)({ownerState:t},r,t)):Object.keys(h.props).forEach(g=>{(t==null?void 0:t[g])!==h.props[g]&&r[g]!==h.props[g]&&(f=!1)}),f&&(Array.isArray(u)||(u=[u]),u.push(typeof h.style=="function"?h.style((0,hg.default)({ownerState:t},r,t)):h.style))}),u}return s}function kfe(n={}){const{themeId:e,defaultTheme:t=Afe,rootShouldForwardProp:r=dI,slotShouldForwardProp:s=dI}=n,o=l=>(0,Sfe.default)((0,hg.default)({},l,{theme:PM((0,hg.default)({},l,{defaultTheme:t,themeId:e}))}));return o.__mui_systemSx=!0,(l,u={})=>{(0,EH.internal_processStyles)(l,z=>z.filter(U=>!(U!=null&&U.__mui_systemSx)));const{name:h,slot:f,skipVariantsResolver:g,skipSx:y,overridesResolver:b=Rfe(Ife(f))}=u,w=(0,UD.default)(u,xfe),C=g!==void 0?g:f&&f!=="Root"&&f!=="root"||!1,M=y||!1;let A,k=dI;f==="Root"||f==="root"?k=r:f?k=s:Mfe(l)&&(k=void 0);const L=(0,EH.default)(l,(0,hg.default)({shouldForwardProp:k,label:A},w)),P=z=>typeof z=="function"&&z.__emotion_real!==z||(0,bfe.isPlainObject)(z)?U=>fI(z,(0,hg.default)({},U,{theme:PM({theme:U.theme,defaultTheme:t,themeId:e})})):z,D=(z,...U)=>{let V=P(z);const H=U?U.map(P):[];h&&b&&H.push(Z=>{const q=PM((0,hg.default)({},Z,{defaultTheme:t,themeId:e}));if(!q.components||!q.components[h]||!q.components[h].styleOverrides)return null;const he=q.components[h].styleOverrides,ae={};return Object.entries(he).forEach(([ue,ge])=>{ae[ue]=fI(ge,(0,hg.default)({},Z,{theme:q}))}),b(Z,ae)}),h&&!C&&H.push(Z=>{var q;const he=PM((0,hg.default)({},Z,{defaultTheme:t,themeId:e})),ae=he==null||(q=he.components)==null||(q=q[h])==null?void 0:q.variants;return fI({variants:ae},(0,hg.default)({},Z,{theme:he}))}),M||H.push(o);const oe=H.length-U.length;if(Array.isArray(z)&&oe>0){const Z=new Array(oe).fill("");V=[...z,...Z],V.raw=[...z.raw,...Z]}const le=L(V,...H);return l.muiName&&(le.muiName=l.muiName),le};return L.withConfig&&(D.withConfig=L.withConfig),D}}function TK(n){return n!=="ownerState"&&n!=="theme"&&n!=="sx"&&n!=="as"}const Ofe=n=>TK(n)&&n!=="classes",Vm=Ofe,pr=yfe({themeId:bC,defaultTheme:Vk,rootShouldForwardProp:Vm}),xH=n=>{let e;return n<1?e=5.11916*n**2:e=4.5*Math.log(n+1)+2,(e/100).toFixed(2)};function Lfe(n){return Po("MuiSvgIcon",n)}Xo("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const Nfe=["children","className","color","component","fontSize","htmlColor","inheritViewBox","titleAccess","viewBox"],Dfe=n=>{const{color:e,fontSize:t,classes:r}=n,s={root:["root",e!=="inherit"&&`color${gr(e)}`,`fontSize${gr(t)}`]};return Ko(s,Lfe,r)},Pfe=pr("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(n,e)=>{const{ownerState:t}=n;return[e.root,t.color!=="inherit"&&e[`color${gr(t.color)}`],e[`fontSize${gr(t.fontSize)}`]]}})(({theme:n,ownerState:e})=>{var t,r,s,o,l,u,h,f,g,y,b,w,C;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:e.hasSvgAsChild?void 0:"currentColor",flexShrink:0,transition:(t=n.transitions)==null||(r=t.create)==null?void 0:r.call(t,"fill",{duration:(s=n.transitions)==null||(s=s.duration)==null?void 0:s.shorter}),fontSize:{inherit:"inherit",small:((o=n.typography)==null||(l=o.pxToRem)==null?void 0:l.call(o,20))||"1.25rem",medium:((u=n.typography)==null||(h=u.pxToRem)==null?void 0:h.call(u,24))||"1.5rem",large:((f=n.typography)==null||(g=f.pxToRem)==null?void 0:g.call(f,35))||"2.1875rem"}[e.fontSize],color:(y=(b=(n.vars||n).palette)==null||(b=b[e.color])==null?void 0:b.main)!=null?y:{action:(w=(n.vars||n).palette)==null||(w=w.action)==null?void 0:w.active,disabled:(C=(n.vars||n).palette)==null||(C=C.action)==null?void 0:C.disabled,inherit:void 0}[e.color]}}),HD=pe.forwardRef(function(e,t){const r=ua({props:e,name:"MuiSvgIcon"}),{children:s,className:o,color:l="inherit",component:u="svg",fontSize:h="medium",htmlColor:f,inheritViewBox:g=!1,titleAccess:y,viewBox:b="0 0 24 24"}=r,w=Ar(r,Nfe),C=pe.isValidElement(s)&&s.type==="svg",M=qe({},r,{color:l,component:u,fontSize:h,instanceFontSize:e.fontSize,inheritViewBox:g,viewBox:b,hasSvgAsChild:C}),A={};g||(A.viewBox=b);const k=Dfe(M);return De.jsxs(Pfe,qe({as:u,className:ai(k.root,o),focusable:"false",color:f,"aria-hidden":y?void 0:!0,role:y?"img":void 0,ref:t},A,w,C&&s.props,{ownerState:M,children:[C?s.props.children:s,y?De.jsx("title",{children:y}):null]}))});HD.muiName="SvgIcon";function CC(n,e){function t(r,s){return De.jsx(HD,qe({"data-testid":`${e}Icon`,ref:s},r,{children:n}))}return t.muiName=HD.muiName,pe.memo(pe.forwardRef(t))}const Bfe={configure:n=>{_F.configure(n)}},Ffe=Object.freeze(Object.defineProperty({__proto__:null,capitalize:gr,createChainedFunction:FD,createSvgIcon:CC,debounce:SF,deprecatedPropType:Khe,isMuiElement:hI,ownerDocument:Jp,ownerWindow:Hy,requirePropFactory:Jhe,setRef:aR,unstable_ClassNameGenerator:Bfe,unstable_useEnhancedEffect:Uy,unstable_useId:Hk,unsupportedProp:Qhe,useControlled:lR,useEventCallback:T1,useForkRef:gp,useIsFocusVisible:lK},Symbol.toStringTag,{value:"Module"}));function zfe(n){return ua}function GD(n,e){return GD=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},GD(n,e)}function $F(n,e){n.prototype=Object.create(e.prototype),n.prototype.constructor=n,GD(n,e)}const $H={disabled:!1},cR=yt.createContext(null);var Ufe=function(e){return e.scrollTop},Ax="unmounted",o1="exited",a1="entering",LS="entered",WD="exiting",Mv=function(n){$F(e,n);function e(r,s){var o;o=n.call(this,r,s)||this;var l=s,u=l&&!l.isMounting?r.enter:r.appear,h;return o.appearStatus=null,r.in?u?(h=o1,o.appearStatus=a1):h=LS:r.unmountOnExit||r.mountOnEnter?h=Ax:h=o1,o.state={status:h},o.nextCallback=null,o}e.getDerivedStateFromProps=function(s,o){var l=s.in;return l&&o.status===Ax?{status:o1}:null};var t=e.prototype;return t.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},t.componentDidUpdate=function(s){var o=null;if(s!==this.props){var l=this.state.status;this.props.in?l!==a1&&l!==LS&&(o=a1):(l===a1||l===LS)&&(o=WD)}this.updateStatus(!1,o)},t.componentWillUnmount=function(){this.cancelNextCallback()},t.getTimeouts=function(){var s=this.props.timeout,o,l,u;return o=l=u=s,s!=null&&typeof s!="number"&&(o=s.exit,l=s.enter,u=s.appear!==void 0?s.appear:l),{exit:o,enter:l,appear:u}},t.updateStatus=function(s,o){if(s===void 0&&(s=!1),o!==null)if(this.cancelNextCallback(),o===a1){if(this.props.unmountOnExit||this.props.mountOnEnter){var l=this.props.nodeRef?this.props.nodeRef.current:uM.findDOMNode(this);l&&Ufe(l)}this.performEnter(s)}else this.performExit();else this.props.unmountOnExit&&this.state.status===o1&&this.setState({status:Ax})},t.performEnter=function(s){var o=this,l=this.props.enter,u=this.context?this.context.isMounting:s,h=this.props.nodeRef?[u]:[uM.findDOMNode(this),u],f=h[0],g=h[1],y=this.getTimeouts(),b=u?y.appear:y.enter;if(!s&&!l||$H.disabled){this.safeSetState({status:LS},function(){o.props.onEntered(f)});return}this.props.onEnter(f,g),this.safeSetState({status:a1},function(){o.props.onEntering(f,g),o.onTransitionEnd(b,function(){o.safeSetState({status:LS},function(){o.props.onEntered(f,g)})})})},t.performExit=function(){var s=this,o=this.props.exit,l=this.getTimeouts(),u=this.props.nodeRef?void 0:uM.findDOMNode(this);if(!o||$H.disabled){this.safeSetState({status:o1},function(){s.props.onExited(u)});return}this.props.onExit(u),this.safeSetState({status:WD},function(){s.props.onExiting(u),s.onTransitionEnd(l.exit,function(){s.safeSetState({status:o1},function(){s.props.onExited(u)})})})},t.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},t.safeSetState=function(s,o){o=this.setNextCallback(o),this.setState(s,o)},t.setNextCallback=function(s){var o=this,l=!0;return this.nextCallback=function(u){l&&(l=!1,o.nextCallback=null,s(u))},this.nextCallback.cancel=function(){l=!1},this.nextCallback},t.onTransitionEnd=function(s,o){this.setNextCallback(o);var l=this.props.nodeRef?this.props.nodeRef.current:uM.findDOMNode(this),u=s==null&&!this.props.addEndListener;if(!l||u){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var h=this.props.nodeRef?[this.nextCallback]:[l,this.nextCallback],f=h[0],g=h[1];this.props.addEndListener(f,g)}s!=null&&setTimeout(this.nextCallback,s)},t.render=function(){var s=this.state.status;if(s===Ax)return null;var o=this.props,l=o.children;o.in,o.mountOnEnter,o.unmountOnExit,o.appear,o.enter,o.exit,o.timeout,o.addEndListener,o.onEnter,o.onEntering,o.onEntered,o.onExit,o.onExiting,o.onExited,o.nodeRef;var u=Ar(o,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return yt.createElement(cR.Provider,{value:null},typeof l=="function"?l(s,u):yt.cloneElement(yt.Children.only(l),u))},e}(yt.Component);Mv.contextType=cR;Mv.propTypes={};function fS(){}Mv.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:fS,onEntering:fS,onEntered:fS,onExit:fS,onExiting:fS,onExited:fS};Mv.UNMOUNTED=Ax;Mv.EXITED=o1;Mv.ENTERING=a1;Mv.ENTERED=LS;Mv.EXITING=WD;const SK=Mv;function Hfe(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function CF(n,e){var t=function(o){return e&&pe.isValidElement(o)?e(o):o},r=Object.create(null);return n&&pe.Children.map(n,function(s){return s}).forEach(function(s){r[s.key]=t(s)}),r}function Gfe(n,e){n=n||{},e=e||{};function t(g){return g in e?e[g]:n[g]}var r=Object.create(null),s=[];for(var o in n)o in e?s.length&&(r[o]=s,s=[]):s.push(o);var l,u={};for(var h in e){if(r[h])for(l=0;ln.scrollTop;function hR(n,e){var t,r;const{timeout:s,easing:o,style:l={}}=n;return{duration:(t=l.transitionDuration)!=null?t:typeof s=="number"?s:s[e.mode]||0,easing:(r=l.transitionTimingFunction)!=null?r:typeof o=="object"?o[e.mode]:o,delay:l.transitionDelay}}function Kfe(n){return Po("MuiPaper",n)}Xo("MuiPaper",["root","rounded","outlined","elevation","elevation0","elevation1","elevation2","elevation3","elevation4","elevation5","elevation6","elevation7","elevation8","elevation9","elevation10","elevation11","elevation12","elevation13","elevation14","elevation15","elevation16","elevation17","elevation18","elevation19","elevation20","elevation21","elevation22","elevation23","elevation24"]);const Jfe=["className","component","elevation","square","variant"],qfe=n=>{const{square:e,elevation:t,variant:r,classes:s}=n,o={root:["root",r,!e&&"rounded",r==="elevation"&&`elevation${t}`]};return Ko(o,Kfe,s)},Qfe=pr("div",{name:"MuiPaper",slot:"Root",overridesResolver:(n,e)=>{const{ownerState:t}=n;return[e.root,e[t.variant],!t.square&&e.rounded,t.variant==="elevation"&&e[`elevation${t.elevation}`]]}})(({theme:n,ownerState:e})=>{var t;return qe({backgroundColor:(n.vars||n).palette.background.paper,color:(n.vars||n).palette.text.primary,transition:n.transitions.create("box-shadow")},!e.square&&{borderRadius:n.shape.borderRadius},e.variant==="outlined"&&{border:`1px solid ${(n.vars||n).palette.divider}`},e.variant==="elevation"&&qe({boxShadow:(n.vars||n).shadows[e.elevation]},!n.vars&&n.palette.mode==="dark"&&{backgroundImage:`linear-gradient(${r0("#fff",xH(e.elevation))}, ${r0("#fff",xH(e.elevation))})`},n.vars&&{backgroundImage:(t=n.vars.overlays)==null?void 0:t[e.elevation]}))}),Zfe=pe.forwardRef(function(e,t){const r=ua({props:e,name:"MuiPaper"}),{className:s,component:o="div",elevation:l=1,square:u=!1,variant:h="elevation"}=r,f=Ar(r,Jfe),g=qe({},r,{component:o,elevation:l,square:u,variant:h}),y=qfe(g);return De.jsx(Qfe,qe({as:o,ownerState:g,className:ai(y.root,s),ref:t},f))}),AF=Zfe;function dR(n){return typeof n=="string"}function epe(n,e,t){return n===void 0||dR(n)?e:qe({},e,{ownerState:qe({},e.ownerState,t)})}function EK(n,e=[]){if(n===void 0)return{};const t={};return Object.keys(n).filter(r=>r.match(/^on[A-Z]/)&&typeof n[r]=="function"&&!e.includes(r)).forEach(r=>{t[r]=n[r]}),t}function tpe(n,e,t){return typeof n=="function"?n(e,t):n}function CH(n){if(n===void 0)return{};const e={};return Object.keys(n).filter(t=>!(t.match(/^on[A-Z]/)&&typeof n[t]=="function")).forEach(t=>{e[t]=n[t]}),e}function npe(n){const{getSlotProps:e,additionalProps:t,externalSlotProps:r,externalForwardedProps:s,className:o}=n;if(!e){const w=ai(t==null?void 0:t.className,o,s==null?void 0:s.className,r==null?void 0:r.className),C=qe({},t==null?void 0:t.style,s==null?void 0:s.style,r==null?void 0:r.style),M=qe({},t,s,r);return w.length>0&&(M.className=w),Object.keys(C).length>0&&(M.style=C),{props:M,internalRef:void 0}}const l=EK(qe({},s,r)),u=CH(r),h=CH(s),f=e(l),g=ai(f==null?void 0:f.className,t==null?void 0:t.className,o,s==null?void 0:s.className,r==null?void 0:r.className),y=qe({},f==null?void 0:f.style,t==null?void 0:t.style,s==null?void 0:s.style,r==null?void 0:r.style),b=qe({},f,t,h,u);return g.length>0&&(b.className=g),Object.keys(y).length>0&&(b.style=y),{props:b,internalRef:f.ref}}const rpe=["elementType","externalSlotProps","ownerState","skipResolvingSlotProps"];function Rw(n){var e;const{elementType:t,externalSlotProps:r,ownerState:s,skipResolvingSlotProps:o=!1}=n,l=Ar(n,rpe),u=o?{}:tpe(r,s),{props:h,internalRef:f}=npe(qe({},l,{externalSlotProps:u})),g=gp(f,u==null?void 0:u.ref,(e=n.additionalProps)==null?void 0:e.ref);return epe(t,qe({},h,{ref:g}),s)}function ipe(n){const{className:e,classes:t,pulsate:r=!1,rippleX:s,rippleY:o,rippleSize:l,in:u,onExited:h,timeout:f}=n,[g,y]=pe.useState(!1),b=ai(e,t.ripple,t.rippleVisible,r&&t.ripplePulsate),w={width:l,height:l,top:-(l/2)+o,left:-(l/2)+s},C=ai(t.child,g&&t.childLeaving,r&&t.childPulsate);return!u&&!g&&y(!0),pe.useEffect(()=>{if(!u&&h!=null){const M=setTimeout(h,f);return()=>{clearTimeout(M)}}},[h,u,f]),De.jsx("span",{className:b,style:w,children:De.jsx("span",{className:C})})}const fg=Xo("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),spe=["center","classes","className"];let Yk=n=>n,MH,AH,IH,RH;const VD=550,ope=80,ape=Ek(MH||(MH=Yk` + */var vF=Symbol.for("react.element"),yF=Symbol.for("react.portal"),kk=Symbol.for("react.fragment"),Ok=Symbol.for("react.strict_mode"),Lk=Symbol.for("react.profiler"),Nk=Symbol.for("react.provider"),Dk=Symbol.for("react.context"),Rhe=Symbol.for("react.server_context"),Pk=Symbol.for("react.forward_ref"),Bk=Symbol.for("react.suspense"),Fk=Symbol.for("react.suspense_list"),zk=Symbol.for("react.memo"),Uk=Symbol.for("react.lazy"),khe=Symbol.for("react.offscreen"),iK;iK=Symbol.for("react.module.reference");function Cg(n){if(typeof n=="object"&&n!==null){var e=n.$$typeof;switch(e){case vF:switch(n=n.type,n){case kk:case Lk:case Ok:case Bk:case Fk:return n;default:switch(n=n&&n.$$typeof,n){case Rhe:case Dk:case Pk:case Uk:case zk:case Nk:return n;default:return e}}case yF:return e}}}ka.ContextConsumer=Dk;ka.ContextProvider=Nk;ka.Element=vF;ka.ForwardRef=Pk;ka.Fragment=kk;ka.Lazy=Uk;ka.Memo=zk;ka.Portal=yF;ka.Profiler=Lk;ka.StrictMode=Ok;ka.Suspense=Bk;ka.SuspenseList=Fk;ka.isAsyncMode=function(){return!1};ka.isConcurrentMode=function(){return!1};ka.isContextConsumer=function(n){return Cg(n)===Dk};ka.isContextProvider=function(n){return Cg(n)===Nk};ka.isElement=function(n){return typeof n=="object"&&n!==null&&n.$$typeof===vF};ka.isForwardRef=function(n){return Cg(n)===Pk};ka.isFragment=function(n){return Cg(n)===kk};ka.isLazy=function(n){return Cg(n)===Uk};ka.isMemo=function(n){return Cg(n)===zk};ka.isPortal=function(n){return Cg(n)===yF};ka.isProfiler=function(n){return Cg(n)===Lk};ka.isStrictMode=function(n){return Cg(n)===Ok};ka.isSuspense=function(n){return Cg(n)===Bk};ka.isSuspenseList=function(n){return Cg(n)===Fk};ka.isValidElementType=function(n){return typeof n=="string"||typeof n=="function"||n===kk||n===Lk||n===Ok||n===Bk||n===Fk||n===khe||typeof n=="object"&&n!==null&&(n.$$typeof===Uk||n.$$typeof===zk||n.$$typeof===Nk||n.$$typeof===Dk||n.$$typeof===Pk||n.$$typeof===iK||n.getModuleId!==void 0)};ka.typeOf=Cg;rK.exports=ka;var fH=rK.exports;const Ohe=/^\s*function(?:\s|\s*\/\*.*\*\/\s*)+([^(\s/]*)\s*/;function sK(n){const e=`${n}`.match(Ohe);return e&&e[1]||""}function oK(n,e=""){return n.displayName||n.name||sK(n)||e}function pH(n,e,t){const r=oK(e);return n.displayName||(r!==""?`${t}(${r})`:t)}function Lhe(n){if(n!=null){if(typeof n=="string")return n;if(typeof n=="function")return oK(n,"Component");if(typeof n=="object")switch(n.$$typeof){case fH.ForwardRef:return pH(n,n.render,"ForwardRef");case fH.Memo:return pH(n,n.type,"memo");default:return}}}const Nhe=Object.freeze(Object.defineProperty({__proto__:null,default:Lhe,getFunctionName:sK},Symbol.toStringTag,{value:"Module"})),Dhe=["ownerState"],Phe=["variants"],Bhe=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function Fhe(n){return Object.keys(n).length===0}function zhe(n){return typeof n=="string"&&n.charCodeAt(0)>96}function jO(n){return n!=="ownerState"&&n!=="theme"&&n!=="sx"&&n!=="as"}const Uhe=aE(),Hhe=n=>n&&n.charAt(0).toLowerCase()+n.slice(1);function DM({defaultTheme:n,theme:e,themeId:t}){return Fhe(e)?n:e[t]||e}function Ghe(n){return n?(e,t)=>t[n]:null}function cI(n,e){let{ownerState:t}=e,r=Ar(e,Dhe);const s=typeof n=="function"?n(Qe({ownerState:t},r)):n;if(Array.isArray(s))return s.flatMap(o=>cI(o,Qe({ownerState:t},r)));if(s&&typeof s=="object"&&Array.isArray(s.variants)){const{variants:o=[]}=s;let u=Ar(s,Phe);return o.forEach(h=>{let f=!0;typeof h.props=="function"?f=h.props(Qe({ownerState:t},r,t)):Object.keys(h.props).forEach(g=>{(t==null?void 0:t[g])!==h.props[g]&&r[g]!==h.props[g]&&(f=!1)}),f&&(Array.isArray(u)||(u=[u]),u.push(typeof h.style=="function"?h.style(Qe({ownerState:t},r,t)):h.style))}),u}return s}function Whe(n={}){const{themeId:e,defaultTheme:t=Uhe,rootShouldForwardProp:r=jO,slotShouldForwardProp:s=jO}=n,o=l=>EC(Qe({},l,{theme:DM(Qe({},l,{defaultTheme:t,themeId:e}))}));return o.__mui_systemSx=!0,(l,u={})=>{YX(l,z=>z.filter(U=>!(U!=null&&U.__mui_systemSx)));const{name:h,slot:f,skipVariantsResolver:g,skipSx:y,overridesResolver:b=Ghe(Hhe(f))}=u,w=Ar(u,Bhe),C=g!==void 0?g:f&&f!=="Root"&&f!=="root"||!1,M=y||!1;let A,k=jO;f==="Root"||f==="root"?k=r:f?k=s:zhe(l)&&(k=void 0);const L=hF(l,Qe({shouldForwardProp:k,label:A},w)),P=z=>typeof z=="function"&&z.__emotion_real!==z||av(z)?U=>cI(z,Qe({},U,{theme:DM({theme:U.theme,defaultTheme:t,themeId:e})})):z,D=(z,...U)=>{let V=P(z);const H=U?U.map(P):[];h&&b&&H.push(Z=>{const q=DM(Qe({},Z,{defaultTheme:t,themeId:e}));if(!q.components||!q.components[h]||!q.components[h].styleOverrides)return null;const he=q.components[h].styleOverrides,ae={};return Object.entries(he).forEach(([ue,ge])=>{ae[ue]=cI(ge,Qe({},Z,{theme:q}))}),b(Z,ae)}),h&&!C&&H.push(Z=>{var q;const he=DM(Qe({},Z,{defaultTheme:t,themeId:e})),ae=he==null||(q=he.components)==null||(q=q[h])==null?void 0:q.variants;return cI({variants:ae},Qe({},Z,{theme:he}))}),M||H.push(o);const oe=H.length-U.length;if(Array.isArray(z)&&oe>0){const Z=new Array(oe).fill("");V=[...z,...Z],V.raw=[...z.raw,...Z]}const le=L(V,...H);return l.muiName&&(le.muiName=l.muiName),le};return L.withConfig&&(D.withConfig=L.withConfig),D}}const aK=Whe();function bF(n,e){const t=Qe({},e);return Object.keys(n).forEach(r=>{if(r.toString().match(/^(components|slots)$/))t[r]=Qe({},n[r],t[r]);else if(r.toString().match(/^(componentsProps|slotProps)$/)){const s=n[r]||{},o=e[r];t[r]={},!o||!Object.keys(o)?t[r]=s:!s||!Object.keys(s)?t[r]=o:(t[r]=Qe({},o),Object.keys(s).forEach(l=>{t[r][l]=bF(s[l],o[l])}))}else t[r]===void 0&&(t[r]=n[r])}),t}function Vhe(n){const{theme:e,name:t,props:r}=n;return!e||!e.components||!e.components[t]||!e.components[t].defaultProps?r:bF(e.components[t].defaultProps,r)}function TF({props:n,name:e,defaultTheme:t,themeId:r}){let s=Rk(t);return r&&(s=s[r]||s),Vhe({theme:s,name:e,props:n})}const jhe=typeof window<"u"?me.useLayoutEffect:me.useEffect,Uy=jhe;function Yhe(n,e=Number.MIN_SAFE_INTEGER,t=Number.MAX_SAFE_INTEGER){return Math.max(e,Math.min(n,t))}const Xhe=Object.freeze(Object.defineProperty({__proto__:null,default:Yhe},Symbol.toStringTag,{value:"Module"}));function FD(...n){return n.reduce((e,t)=>t==null?e:function(...s){e.apply(this,s),t.apply(this,s)},()=>{})}function SF(n,e=166){let t;function r(...s){const o=()=>{n.apply(this,s)};clearTimeout(t),t=setTimeout(o,e)}return r.clear=()=>{clearTimeout(t)},r}function Khe(n,e){return()=>null}function hI(n,e){var t,r;return me.isValidElement(n)&&e.indexOf((t=n.type.muiName)!=null?t:(r=n.type)==null||(r=r._payload)==null||(r=r.value)==null?void 0:r.muiName)!==-1}function Jp(n){return n&&n.ownerDocument||document}function Hy(n){return Jp(n).defaultView||window}function Jhe(n,e){return()=>null}function aR(n,e){typeof n=="function"?n(e):n&&(n.current=e)}let mH=0;function qhe(n){const[e,t]=me.useState(n),r=n||e;return me.useEffect(()=>{e==null&&(mH+=1,t(`mui-${mH}`))},[e]),r}const gH=RN.useId;function Hk(n){if(gH!==void 0){const e=gH();return n??e}return qhe(n)}function Qhe(n,e,t,r,s){return null}function lR({controlled:n,default:e,name:t,state:r="value"}){const{current:s}=me.useRef(n!==void 0),[o,l]=me.useState(e),u=s?n:o,h=me.useCallback(f=>{s||l(f)},[]);return[u,h]}function S1(n){const e=me.useRef(n);return Uy(()=>{e.current=n}),me.useRef((...t)=>(0,e.current)(...t)).current}function gp(...n){return me.useMemo(()=>n.every(e=>e==null)?null:e=>{n.forEach(t=>{aR(t,e)})},n)}const _H={};function Zhe(n,e){const t=me.useRef(_H);return t.current===_H&&(t.current=n(e)),t}const ede=[];function tde(n){me.useEffect(n,ede)}class Gk{constructor(){this.currentId=null,this.clear=()=>{this.currentId!==null&&(clearTimeout(this.currentId),this.currentId=null)},this.disposeEffect=()=>this.clear}static create(){return new Gk}start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,t()},e)}}function lK(){const n=Zhe(Gk.create).current;return tde(n.disposeEffect),n}let Wk=!0,zD=!1;const nde=new Gk,rde={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function ide(n){const{type:e,tagName:t}=n;return!!(t==="INPUT"&&rde[e]&&!n.readOnly||t==="TEXTAREA"&&!n.readOnly||n.isContentEditable)}function sde(n){n.metaKey||n.altKey||n.ctrlKey||(Wk=!0)}function YO(){Wk=!1}function ode(){this.visibilityState==="hidden"&&zD&&(Wk=!0)}function ade(n){n.addEventListener("keydown",sde,!0),n.addEventListener("mousedown",YO,!0),n.addEventListener("pointerdown",YO,!0),n.addEventListener("touchstart",YO,!0),n.addEventListener("visibilitychange",ode,!0)}function lde(n){const{target:e}=n;try{return e.matches(":focus-visible")}catch{}return Wk||ide(e)}function uK(){const n=me.useCallback(s=>{s!=null&&ade(s.ownerDocument)},[]),e=me.useRef(!1);function t(){return e.current?(zD=!0,nde.start(100,()=>{zD=!1}),e.current=!1,!0):!1}function r(s){return lde(s)?(e.current=!0,!0):!1}return{isFocusVisibleRef:e,onFocus:r,onBlur:t,ref:n}}function cK(n){const e=n.documentElement.clientWidth;return Math.abs(window.innerWidth-e)}function Ko(n,e,t=void 0){const r={};return Object.keys(n).forEach(s=>{r[s]=n[s].reduce((o,l)=>{if(l){const u=e(l);u!==""&&o.push(u),t&&t[l]&&o.push(t[l])}return o},[]).join(" ")}),r}const ude=me.createContext(),cde=()=>{const n=me.useContext(ude);return n??!1};function O$(n){"@babel/helpers - typeof";return O$=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},O$(n)}function hde(n,e){if(O$(n)!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(O$(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function dde(n){var e=hde(n,"string");return O$(e)=="symbol"?e:e+""}const fde=["className","component","disableGutters","fixed","maxWidth","classes"],pde=aE(),mde=aK("div",{name:"MuiContainer",slot:"Root",overridesResolver:(n,e)=>{const{ownerState:t}=n;return[e.root,e[`maxWidth${gr(String(t.maxWidth))}`],t.fixed&&e.fixed,t.disableGutters&&e.disableGutters]}}),gde=n=>TF({props:n,name:"MuiContainer",defaultTheme:pde}),_de=(n,e)=>{const t=h=>Po(e,h),{classes:r,fixed:s,disableGutters:o,maxWidth:l}=n,u={root:["root",l&&`maxWidth${gr(String(l))}`,s&&"fixed",o&&"disableGutters"]};return Ko(u,t,r)};function vde(n={}){const{createStyledComponent:e=mde,useThemeProps:t=gde,componentName:r="MuiContainer"}=n,s=e(({theme:l,ownerState:u})=>Qe({width:"100%",marginLeft:"auto",boxSizing:"border-box",marginRight:"auto",display:"block"},!u.disableGutters&&{paddingLeft:l.spacing(2),paddingRight:l.spacing(2),[l.breakpoints.up("sm")]:{paddingLeft:l.spacing(3),paddingRight:l.spacing(3)}}),({theme:l,ownerState:u})=>u.fixed&&Object.keys(l.breakpoints.values).reduce((h,f)=>{const g=f,y=l.breakpoints.values[g];return y!==0&&(h[l.breakpoints.up(g)]={maxWidth:`${y}${l.breakpoints.unit}`}),h},{}),({theme:l,ownerState:u})=>Qe({},u.maxWidth==="xs"&&{[l.breakpoints.up("xs")]:{maxWidth:Math.max(l.breakpoints.values.xs,444)}},u.maxWidth&&u.maxWidth!=="xs"&&{[l.breakpoints.up(u.maxWidth)]:{maxWidth:`${l.breakpoints.values[u.maxWidth]}${l.breakpoints.unit}`}}));return me.forwardRef(function(u,h){const f=t(u),{className:g,component:y="div",disableGutters:b=!1,fixed:w=!1,maxWidth:C="lg"}=f,M=Ar(f,fde),A=Qe({},f,{component:y,disableGutters:b,fixed:w,maxWidth:C}),k=_de(A,r);return Ne.jsx(s,Qe({as:y,ownerState:A,className:ai(k.root,g),ref:h},M))})}const yde=["component","direction","spacing","divider","children","className","useFlexGap"],bde=aE(),Tde=aK("div",{name:"MuiStack",slot:"Root",overridesResolver:(n,e)=>e.root});function Sde(n){return TF({props:n,name:"MuiStack",defaultTheme:bde})}function wde(n,e){const t=me.Children.toArray(n).filter(Boolean);return t.reduce((r,s,o)=>(r.push(s),o({row:"Left","row-reverse":"Right",column:"Top","column-reverse":"Bottom"})[n],xde=({ownerState:n,theme:e})=>{let t=Qe({display:"flex",flexDirection:"column"},Zp({theme:e},L1({values:n.direction,breakpoints:e.breakpoints.values}),r=>({flexDirection:r})));if(n.spacing){const r=mF(e),s=Object.keys(e.breakpoints.values).reduce((h,f)=>((typeof n.spacing=="object"&&n.spacing[f]!=null||typeof n.direction=="object"&&n.direction[f]!=null)&&(h[f]=!0),h),{}),o=L1({values:n.direction,base:s}),l=L1({values:n.spacing,base:s});typeof o=="object"&&Object.keys(o).forEach((h,f,g)=>{if(!o[h]){const b=f>0?o[g[f-1]]:"column";o[h]=b}}),t=fp(t,Zp({theme:e},l,(h,f)=>n.useFlexGap?{gap:Q1(r,h)}:{"& > :not(style):not(style)":{margin:0},"& > :not(style) ~ :not(style)":{[`margin${Ede(f?o[f]:n.direction)}`]:Q1(r,h)}}))}return t=Mce(e.breakpoints,t),t};function $de(n={}){const{createStyledComponent:e=Tde,useThemeProps:t=Sde,componentName:r="MuiStack"}=n,s=()=>Ko({root:["root"]},h=>Po(r,h),{}),o=e(xde);return me.forwardRef(function(h,f){const g=t(h),y=xC(g),{component:b="div",direction:w="column",spacing:C=0,divider:M,children:A,className:k,useFlexGap:L=!1}=y,P=Ar(y,yde),D={direction:w,spacing:C,useFlexGap:L},z=s();return Ne.jsx(o,Qe({as:b,ownerState:D,ref:f,className:ai(z.root,k)},P,{children:M?wde(A,M):A}))})}function Cde(n,e){return Qe({toolbar:{minHeight:56,[n.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[n.up("sm")]:{minHeight:64}}},e)}var ph={},hK={exports:{}};(function(n){function e(t){return t&&t.__esModule?t:{default:t}}n.exports=e,n.exports.__esModule=!0,n.exports.default=n.exports})(hK);var lT=hK.exports;const Mde=__(fue),Ade=__(Xhe);var dK=lT;Object.defineProperty(ph,"__esModule",{value:!0});var r0=ph.alpha=vK;ph.blend=zde;ph.colorChannel=void 0;var fK=ph.darken=EF;ph.decomposeColor=Eg;ph.emphasize=yK;var Ide=ph.getContrastRatio=Nde;ph.getLuminance=uR;ph.hexToRgb=mK;ph.hslToRgb=_K;var pK=ph.lighten=xF;ph.private_safeAlpha=Dde;ph.private_safeColorChannel=void 0;ph.private_safeDarken=Pde;ph.private_safeEmphasize=Fde;ph.private_safeLighten=Bde;ph.recomposeColor=lE;ph.rgbToHex=Lde;var vH=dK(Mde),Rde=dK(Ade);function wF(n,e=0,t=1){return(0,Rde.default)(n,e,t)}function mK(n){n=n.slice(1);const e=new RegExp(`.{1,${n.length>=6?2:1}}`,"g");let t=n.match(e);return t&&t[0].length===1&&(t=t.map(r=>r+r)),t?`rgb${t.length===4?"a":""}(${t.map((r,s)=>s<3?parseInt(r,16):Math.round(parseInt(r,16)/255*1e3)/1e3).join(", ")})`:""}function kde(n){const e=n.toString(16);return e.length===1?`0${e}`:e}function Eg(n){if(n.type)return n;if(n.charAt(0)==="#")return Eg(mK(n));const e=n.indexOf("("),t=n.substring(0,e);if(["rgb","rgba","hsl","hsla","color"].indexOf(t)===-1)throw new Error((0,vH.default)(9,n));let r=n.substring(e+1,n.length-1),s;if(t==="color"){if(r=r.split(" "),s=r.shift(),r.length===4&&r[3].charAt(0)==="/"&&(r[3]=r[3].slice(1)),["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(s)===-1)throw new Error((0,vH.default)(10,s))}else r=r.split(",");return r=r.map(o=>parseFloat(o)),{type:t,values:r,colorSpace:s}}const gK=n=>{const e=Eg(n);return e.values.slice(0,3).map((t,r)=>e.type.indexOf("hsl")!==-1&&r!==0?`${t}%`:t).join(" ")};ph.colorChannel=gK;const Ode=(n,e)=>{try{return gK(n)}catch{return n}};ph.private_safeColorChannel=Ode;function lE(n){const{type:e,colorSpace:t}=n;let{values:r}=n;return e.indexOf("rgb")!==-1?r=r.map((s,o)=>o<3?parseInt(s,10):s):e.indexOf("hsl")!==-1&&(r[1]=`${r[1]}%`,r[2]=`${r[2]}%`),e.indexOf("color")!==-1?r=`${t} ${r.join(" ")}`:r=`${r.join(", ")}`,`${e}(${r})`}function Lde(n){if(n.indexOf("#")===0)return n;const{values:e}=Eg(n);return`#${e.map((t,r)=>kde(r===3?Math.round(255*t):t)).join("")}`}function _K(n){n=Eg(n);const{values:e}=n,t=e[0],r=e[1]/100,s=e[2]/100,o=r*Math.min(s,1-s),l=(f,g=(f+t/30)%12)=>s-o*Math.max(Math.min(g-3,9-g,1),-1);let u="rgb";const h=[Math.round(l(0)*255),Math.round(l(8)*255),Math.round(l(4)*255)];return n.type==="hsla"&&(u+="a",h.push(e[3])),lE({type:u,values:h})}function uR(n){n=Eg(n);let e=n.type==="hsl"||n.type==="hsla"?Eg(_K(n)).values:n.values;return e=e.map(t=>(n.type!=="color"&&(t/=255),t<=.03928?t/12.92:((t+.055)/1.055)**2.4)),Number((.2126*e[0]+.7152*e[1]+.0722*e[2]).toFixed(3))}function Nde(n,e){const t=uR(n),r=uR(e);return(Math.max(t,r)+.05)/(Math.min(t,r)+.05)}function vK(n,e){return n=Eg(n),e=wF(e),(n.type==="rgb"||n.type==="hsl")&&(n.type+="a"),n.type==="color"?n.values[3]=`/${e}`:n.values[3]=e,lE(n)}function Dde(n,e,t){try{return vK(n,e)}catch{return n}}function EF(n,e){if(n=Eg(n),e=wF(e),n.type.indexOf("hsl")!==-1)n.values[2]*=1-e;else if(n.type.indexOf("rgb")!==-1||n.type.indexOf("color")!==-1)for(let t=0;t<3;t+=1)n.values[t]*=1-e;return lE(n)}function Pde(n,e,t){try{return EF(n,e)}catch{return n}}function xF(n,e){if(n=Eg(n),e=wF(e),n.type.indexOf("hsl")!==-1)n.values[2]+=(100-n.values[2])*e;else if(n.type.indexOf("rgb")!==-1)for(let t=0;t<3;t+=1)n.values[t]+=(255-n.values[t])*e;else if(n.type.indexOf("color")!==-1)for(let t=0;t<3;t+=1)n.values[t]+=(1-n.values[t])*e;return lE(n)}function Bde(n,e,t){try{return xF(n,e)}catch{return n}}function yK(n,e=.15){return uR(n)>.5?EF(n,e):xF(n,e)}function Fde(n,e,t){try{return yK(n,e)}catch{return n}}function zde(n,e,t,r=1){const s=(h,f)=>Math.round((h**(1/r)*(1-t)+f**(1/r)*t)**r),o=Eg(n),l=Eg(e),u=[s(o.values[0],l.values[0]),s(o.values[1],l.values[1]),s(o.values[2],l.values[2])];return lE({type:"rgb",values:u})}const Ude=["mode","contrastThreshold","tonalOffset"],yH={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:A$.white,default:A$.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},XO={text:{primary:A$.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:A$.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function bH(n,e,t,r){const s=r.light||r,o=r.dark||r*1.5;n[e]||(n.hasOwnProperty(t)?n[e]=n[t]:e==="light"?n.light=pK(n.main,s):e==="dark"&&(n.dark=fK(n.main,o)))}function Hde(n="light"){return n==="dark"?{main:cS[200],light:cS[50],dark:cS[400]}:{main:cS[700],light:cS[400],dark:cS[800]}}function Gde(n="light"){return n==="dark"?{main:uS[200],light:uS[50],dark:uS[400]}:{main:uS[500],light:uS[300],dark:uS[700]}}function Wde(n="light"){return n==="dark"?{main:lS[500],light:lS[300],dark:lS[700]}:{main:lS[700],light:lS[400],dark:lS[800]}}function Vde(n="light"){return n==="dark"?{main:hS[400],light:hS[300],dark:hS[700]}:{main:hS[700],light:hS[500],dark:hS[900]}}function jde(n="light"){return n==="dark"?{main:dS[400],light:dS[300],dark:dS[700]}:{main:dS[800],light:dS[500],dark:dS[900]}}function Yde(n="light"){return n==="dark"?{main:ZE[400],light:ZE[300],dark:ZE[700]}:{main:"#ed6c02",light:ZE[500],dark:ZE[900]}}function Xde(n){const{mode:e="light",contrastThreshold:t=3,tonalOffset:r=.2}=n,s=Ar(n,Ude),o=n.primary||Hde(e),l=n.secondary||Gde(e),u=n.error||Wde(e),h=n.info||Vde(e),f=n.success||jde(e),g=n.warning||Yde(e);function y(M){return Ide(M,XO.text.primary)>=t?XO.text.primary:yH.text.primary}const b=({color:M,name:A,mainShade:k=500,lightShade:L=300,darkShade:P=700})=>{if(M=Qe({},M),!M.main&&M[k]&&(M.main=M[k]),!M.hasOwnProperty("main"))throw new Error(q1(11,A?` (${A})`:"",k));if(typeof M.main!="string")throw new Error(q1(12,A?` (${A})`:"",JSON.stringify(M.main)));return bH(M,"light",L,r),bH(M,"dark",P,r),M.contrastText||(M.contrastText=y(M.main)),M},w={dark:XO,light:yH};return fp(Qe({common:Qe({},A$),mode:e,primary:b({color:o,name:"primary"}),secondary:b({color:l,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:b({color:u,name:"error"}),warning:b({color:g,name:"warning"}),info:b({color:h,name:"info"}),success:b({color:f,name:"success"}),grey:due,contrastThreshold:t,getContrastText:y,augmentColor:b,tonalOffset:r},w[e]),s)}const Kde=["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"];function Jde(n){return Math.round(n*1e5)/1e5}const TH={textTransform:"uppercase"},SH='"Roboto", "Helvetica", "Arial", sans-serif';function qde(n,e){const t=typeof e=="function"?e(n):e,{fontFamily:r=SH,fontSize:s=14,fontWeightLight:o=300,fontWeightRegular:l=400,fontWeightMedium:u=500,fontWeightBold:h=700,htmlFontSize:f=16,allVariants:g,pxToRem:y}=t,b=Ar(t,Kde),w=s/14,C=y||(k=>`${k/f*w}rem`),M=(k,L,P,D,z)=>Qe({fontFamily:r,fontWeight:k,fontSize:C(L),lineHeight:P},r===SH?{letterSpacing:`${Jde(D/L)}em`}:{},z,g),A={h1:M(o,96,1.167,-1.5),h2:M(o,60,1.2,-.5),h3:M(l,48,1.167,0),h4:M(l,34,1.235,.25),h5:M(l,24,1.334,0),h6:M(u,20,1.6,.15),subtitle1:M(l,16,1.75,.15),subtitle2:M(u,14,1.57,.1),body1:M(l,16,1.5,.15),body2:M(l,14,1.43,.15),button:M(u,14,1.75,.4,TH),caption:M(l,12,1.66,.4),overline:M(l,12,2.66,1,TH),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return fp(Qe({htmlFontSize:f,pxToRem:C,fontFamily:r,fontSize:s,fontWeightLight:o,fontWeightRegular:l,fontWeightMedium:u,fontWeightBold:h},A),b,{clone:!1})}const Qde=.2,Zde=.14,efe=.12;function Nu(...n){return[`${n[0]}px ${n[1]}px ${n[2]}px ${n[3]}px rgba(0,0,0,${Qde})`,`${n[4]}px ${n[5]}px ${n[6]}px ${n[7]}px rgba(0,0,0,${Zde})`,`${n[8]}px ${n[9]}px ${n[10]}px ${n[11]}px rgba(0,0,0,${efe})`].join(",")}const tfe=["none",Nu(0,2,1,-1,0,1,1,0,0,1,3,0),Nu(0,3,1,-2,0,2,2,0,0,1,5,0),Nu(0,3,3,-2,0,3,4,0,0,1,8,0),Nu(0,2,4,-1,0,4,5,0,0,1,10,0),Nu(0,3,5,-1,0,5,8,0,0,1,14,0),Nu(0,3,5,-1,0,6,10,0,0,1,18,0),Nu(0,4,5,-2,0,7,10,1,0,2,16,1),Nu(0,5,5,-3,0,8,10,1,0,3,14,2),Nu(0,5,6,-3,0,9,12,1,0,3,16,2),Nu(0,6,6,-3,0,10,14,1,0,4,18,3),Nu(0,6,7,-4,0,11,15,1,0,4,20,3),Nu(0,7,8,-4,0,12,17,2,0,5,22,4),Nu(0,7,8,-4,0,13,19,2,0,5,24,4),Nu(0,7,9,-4,0,14,21,2,0,5,26,4),Nu(0,8,9,-5,0,15,22,2,0,6,28,5),Nu(0,8,10,-5,0,16,24,2,0,6,30,5),Nu(0,8,11,-5,0,17,26,2,0,6,32,5),Nu(0,9,11,-5,0,18,28,2,0,7,34,6),Nu(0,9,12,-6,0,19,29,2,0,7,36,6),Nu(0,10,13,-6,0,20,31,3,0,8,38,7),Nu(0,10,13,-6,0,21,33,3,0,8,40,7),Nu(0,10,14,-6,0,22,35,3,0,8,42,7),Nu(0,11,14,-7,0,23,36,3,0,9,44,8),Nu(0,11,15,-7,0,24,38,3,0,9,46,8)],nfe=["duration","easing","delay"],rfe={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},ife={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function wH(n){return`${Math.round(n)}ms`}function sfe(n){if(!n)return 0;const e=n/36;return Math.round((4+15*e**.25+e/5)*10)}function ofe(n){const e=Qe({},rfe,n.easing),t=Qe({},ife,n.duration);return Qe({getAutoHeightDuration:sfe,create:(s=["all"],o={})=>{const{duration:l=t.standard,easing:u=e.easeInOut,delay:h=0}=o;return Ar(o,nfe),(Array.isArray(s)?s:[s]).map(f=>`${f} ${typeof l=="string"?l:wH(l)} ${u} ${typeof h=="string"?h:wH(h)}`).join(",")}},n,{easing:e,duration:t})}const afe={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500},lfe=afe,ufe=["breakpoints","mixins","spacing","palette","transitions","typography","shape"];function bK(n={},...e){const{mixins:t={},palette:r={},transitions:s={},typography:o={}}=n,l=Ar(n,ufe);if(n.vars)throw new Error(q1(18));const u=Xde(r),h=aE(n);let f=fp(h,{mixins:Cde(h.breakpoints,t),palette:u,shadows:tfe.slice(),typography:qde(u,o),transitions:ofe(s),zIndex:Qe({},lfe)});return f=fp(f,l),f=e.reduce((g,y)=>fp(g,y),f),f.unstable_sxConfig=Qe({},wC,l==null?void 0:l.unstable_sxConfig),f.unstable_sx=function(y){return EC({sx:y,theme:this})},f}const cfe=bK(),Vk=cfe;function jk(){const n=Rk(Vk);return n[bC]||n}function ua({props:n,name:e}){return TF({props:n,name:e,defaultTheme:Vk,themeId:bC})}var $C={};const hfe=__(pue);var KO={exports:{}},EH;function dfe(){return EH||(EH=1,function(n){function e(t,r){if(t==null)return{};var s={},o=Object.keys(t),l,u;for(u=0;u=0)&&(s[l]=t[l]);return s}n.exports=e,n.exports.__esModule=!0,n.exports.default=n.exports}(KO)),KO.exports}const ffe=__(Sce),pfe=__(wce),mfe=__(Ice),gfe=__(Nhe),_fe=__(vhe),vfe=__(xhe);var uE=lT;Object.defineProperty($C,"__esModule",{value:!0});var yfe=$C.default=kfe;$C.shouldForwardProp=dI;$C.systemDefaultTheme=void 0;var hg=uE(hfe),UD=uE(dfe()),xH=$fe(ffe),bfe=pfe;uE(mfe);uE(gfe);var Tfe=uE(_fe),Sfe=uE(vfe);const wfe=["ownerState"],Efe=["variants"],xfe=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function TK(n){if(typeof WeakMap!="function")return null;var e=new WeakMap,t=new WeakMap;return(TK=function(r){return r?t:e})(n)}function $fe(n,e){if(!e&&n&&n.__esModule)return n;if(n===null||typeof n!="object"&&typeof n!="function")return{default:n};var t=TK(e);if(t&&t.has(n))return t.get(n);var r={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in n)if(o!=="default"&&Object.prototype.hasOwnProperty.call(n,o)){var l=s?Object.getOwnPropertyDescriptor(n,o):null;l&&(l.get||l.set)?Object.defineProperty(r,o,l):r[o]=n[o]}return r.default=n,t&&t.set(n,r),r}function Cfe(n){return Object.keys(n).length===0}function Mfe(n){return typeof n=="string"&&n.charCodeAt(0)>96}function dI(n){return n!=="ownerState"&&n!=="theme"&&n!=="sx"&&n!=="as"}const Afe=$C.systemDefaultTheme=(0,Tfe.default)(),Ife=n=>n&&n.charAt(0).toLowerCase()+n.slice(1);function PM({defaultTheme:n,theme:e,themeId:t}){return Cfe(e)?n:e[t]||e}function Rfe(n){return n?(e,t)=>t[n]:null}function fI(n,e){let{ownerState:t}=e,r=(0,UD.default)(e,wfe);const s=typeof n=="function"?n((0,hg.default)({ownerState:t},r)):n;if(Array.isArray(s))return s.flatMap(o=>fI(o,(0,hg.default)({ownerState:t},r)));if(s&&typeof s=="object"&&Array.isArray(s.variants)){const{variants:o=[]}=s;let u=(0,UD.default)(s,Efe);return o.forEach(h=>{let f=!0;typeof h.props=="function"?f=h.props((0,hg.default)({ownerState:t},r,t)):Object.keys(h.props).forEach(g=>{(t==null?void 0:t[g])!==h.props[g]&&r[g]!==h.props[g]&&(f=!1)}),f&&(Array.isArray(u)||(u=[u]),u.push(typeof h.style=="function"?h.style((0,hg.default)({ownerState:t},r,t)):h.style))}),u}return s}function kfe(n={}){const{themeId:e,defaultTheme:t=Afe,rootShouldForwardProp:r=dI,slotShouldForwardProp:s=dI}=n,o=l=>(0,Sfe.default)((0,hg.default)({},l,{theme:PM((0,hg.default)({},l,{defaultTheme:t,themeId:e}))}));return o.__mui_systemSx=!0,(l,u={})=>{(0,xH.internal_processStyles)(l,z=>z.filter(U=>!(U!=null&&U.__mui_systemSx)));const{name:h,slot:f,skipVariantsResolver:g,skipSx:y,overridesResolver:b=Rfe(Ife(f))}=u,w=(0,UD.default)(u,xfe),C=g!==void 0?g:f&&f!=="Root"&&f!=="root"||!1,M=y||!1;let A,k=dI;f==="Root"||f==="root"?k=r:f?k=s:Mfe(l)&&(k=void 0);const L=(0,xH.default)(l,(0,hg.default)({shouldForwardProp:k,label:A},w)),P=z=>typeof z=="function"&&z.__emotion_real!==z||(0,bfe.isPlainObject)(z)?U=>fI(z,(0,hg.default)({},U,{theme:PM({theme:U.theme,defaultTheme:t,themeId:e})})):z,D=(z,...U)=>{let V=P(z);const H=U?U.map(P):[];h&&b&&H.push(Z=>{const q=PM((0,hg.default)({},Z,{defaultTheme:t,themeId:e}));if(!q.components||!q.components[h]||!q.components[h].styleOverrides)return null;const he=q.components[h].styleOverrides,ae={};return Object.entries(he).forEach(([ue,ge])=>{ae[ue]=fI(ge,(0,hg.default)({},Z,{theme:q}))}),b(Z,ae)}),h&&!C&&H.push(Z=>{var q;const he=PM((0,hg.default)({},Z,{defaultTheme:t,themeId:e})),ae=he==null||(q=he.components)==null||(q=q[h])==null?void 0:q.variants;return fI({variants:ae},(0,hg.default)({},Z,{theme:he}))}),M||H.push(o);const oe=H.length-U.length;if(Array.isArray(z)&&oe>0){const Z=new Array(oe).fill("");V=[...z,...Z],V.raw=[...z.raw,...Z]}const le=L(V,...H);return l.muiName&&(le.muiName=l.muiName),le};return L.withConfig&&(D.withConfig=L.withConfig),D}}function SK(n){return n!=="ownerState"&&n!=="theme"&&n!=="sx"&&n!=="as"}const Ofe=n=>SK(n)&&n!=="classes",Vm=Ofe,pr=yfe({themeId:bC,defaultTheme:Vk,rootShouldForwardProp:Vm}),$H=n=>{let e;return n<1?e=5.11916*n**2:e=4.5*Math.log(n+1)+2,(e/100).toFixed(2)};function Lfe(n){return Po("MuiSvgIcon",n)}Xo("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const Nfe=["children","className","color","component","fontSize","htmlColor","inheritViewBox","titleAccess","viewBox"],Dfe=n=>{const{color:e,fontSize:t,classes:r}=n,s={root:["root",e!=="inherit"&&`color${gr(e)}`,`fontSize${gr(t)}`]};return Ko(s,Lfe,r)},Pfe=pr("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(n,e)=>{const{ownerState:t}=n;return[e.root,t.color!=="inherit"&&e[`color${gr(t.color)}`],e[`fontSize${gr(t.fontSize)}`]]}})(({theme:n,ownerState:e})=>{var t,r,s,o,l,u,h,f,g,y,b,w,C;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:e.hasSvgAsChild?void 0:"currentColor",flexShrink:0,transition:(t=n.transitions)==null||(r=t.create)==null?void 0:r.call(t,"fill",{duration:(s=n.transitions)==null||(s=s.duration)==null?void 0:s.shorter}),fontSize:{inherit:"inherit",small:((o=n.typography)==null||(l=o.pxToRem)==null?void 0:l.call(o,20))||"1.25rem",medium:((u=n.typography)==null||(h=u.pxToRem)==null?void 0:h.call(u,24))||"1.5rem",large:((f=n.typography)==null||(g=f.pxToRem)==null?void 0:g.call(f,35))||"2.1875rem"}[e.fontSize],color:(y=(b=(n.vars||n).palette)==null||(b=b[e.color])==null?void 0:b.main)!=null?y:{action:(w=(n.vars||n).palette)==null||(w=w.action)==null?void 0:w.active,disabled:(C=(n.vars||n).palette)==null||(C=C.action)==null?void 0:C.disabled,inherit:void 0}[e.color]}}),HD=me.forwardRef(function(e,t){const r=ua({props:e,name:"MuiSvgIcon"}),{children:s,className:o,color:l="inherit",component:u="svg",fontSize:h="medium",htmlColor:f,inheritViewBox:g=!1,titleAccess:y,viewBox:b="0 0 24 24"}=r,w=Ar(r,Nfe),C=me.isValidElement(s)&&s.type==="svg",M=Qe({},r,{color:l,component:u,fontSize:h,instanceFontSize:e.fontSize,inheritViewBox:g,viewBox:b,hasSvgAsChild:C}),A={};g||(A.viewBox=b);const k=Dfe(M);return Ne.jsxs(Pfe,Qe({as:u,className:ai(k.root,o),focusable:"false",color:f,"aria-hidden":y?void 0:!0,role:y?"img":void 0,ref:t},A,w,C&&s.props,{ownerState:M,children:[C?s.props.children:s,y?Ne.jsx("title",{children:y}):null]}))});HD.muiName="SvgIcon";function CC(n,e){function t(r,s){return Ne.jsx(HD,Qe({"data-testid":`${e}Icon`,ref:s},r,{children:n}))}return t.muiName=HD.muiName,me.memo(me.forwardRef(t))}const Bfe={configure:n=>{_F.configure(n)}},Ffe=Object.freeze(Object.defineProperty({__proto__:null,capitalize:gr,createChainedFunction:FD,createSvgIcon:CC,debounce:SF,deprecatedPropType:Khe,isMuiElement:hI,ownerDocument:Jp,ownerWindow:Hy,requirePropFactory:Jhe,setRef:aR,unstable_ClassNameGenerator:Bfe,unstable_useEnhancedEffect:Uy,unstable_useId:Hk,unsupportedProp:Qhe,useControlled:lR,useEventCallback:S1,useForkRef:gp,useIsFocusVisible:uK},Symbol.toStringTag,{value:"Module"}));function zfe(n){return ua}function GD(n,e){return GD=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},GD(n,e)}function $F(n,e){n.prototype=Object.create(e.prototype),n.prototype.constructor=n,GD(n,e)}const CH={disabled:!1},cR=yt.createContext(null);var Ufe=function(e){return e.scrollTop},Ax="unmounted",a1="exited",l1="entering",LS="entered",WD="exiting",Mv=function(n){$F(e,n);function e(r,s){var o;o=n.call(this,r,s)||this;var l=s,u=l&&!l.isMounting?r.enter:r.appear,h;return o.appearStatus=null,r.in?u?(h=a1,o.appearStatus=l1):h=LS:r.unmountOnExit||r.mountOnEnter?h=Ax:h=a1,o.state={status:h},o.nextCallback=null,o}e.getDerivedStateFromProps=function(s,o){var l=s.in;return l&&o.status===Ax?{status:a1}:null};var t=e.prototype;return t.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},t.componentDidUpdate=function(s){var o=null;if(s!==this.props){var l=this.state.status;this.props.in?l!==l1&&l!==LS&&(o=l1):(l===l1||l===LS)&&(o=WD)}this.updateStatus(!1,o)},t.componentWillUnmount=function(){this.cancelNextCallback()},t.getTimeouts=function(){var s=this.props.timeout,o,l,u;return o=l=u=s,s!=null&&typeof s!="number"&&(o=s.exit,l=s.enter,u=s.appear!==void 0?s.appear:l),{exit:o,enter:l,appear:u}},t.updateStatus=function(s,o){if(s===void 0&&(s=!1),o!==null)if(this.cancelNextCallback(),o===l1){if(this.props.unmountOnExit||this.props.mountOnEnter){var l=this.props.nodeRef?this.props.nodeRef.current:uM.findDOMNode(this);l&&Ufe(l)}this.performEnter(s)}else this.performExit();else this.props.unmountOnExit&&this.state.status===a1&&this.setState({status:Ax})},t.performEnter=function(s){var o=this,l=this.props.enter,u=this.context?this.context.isMounting:s,h=this.props.nodeRef?[u]:[uM.findDOMNode(this),u],f=h[0],g=h[1],y=this.getTimeouts(),b=u?y.appear:y.enter;if(!s&&!l||CH.disabled){this.safeSetState({status:LS},function(){o.props.onEntered(f)});return}this.props.onEnter(f,g),this.safeSetState({status:l1},function(){o.props.onEntering(f,g),o.onTransitionEnd(b,function(){o.safeSetState({status:LS},function(){o.props.onEntered(f,g)})})})},t.performExit=function(){var s=this,o=this.props.exit,l=this.getTimeouts(),u=this.props.nodeRef?void 0:uM.findDOMNode(this);if(!o||CH.disabled){this.safeSetState({status:a1},function(){s.props.onExited(u)});return}this.props.onExit(u),this.safeSetState({status:WD},function(){s.props.onExiting(u),s.onTransitionEnd(l.exit,function(){s.safeSetState({status:a1},function(){s.props.onExited(u)})})})},t.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},t.safeSetState=function(s,o){o=this.setNextCallback(o),this.setState(s,o)},t.setNextCallback=function(s){var o=this,l=!0;return this.nextCallback=function(u){l&&(l=!1,o.nextCallback=null,s(u))},this.nextCallback.cancel=function(){l=!1},this.nextCallback},t.onTransitionEnd=function(s,o){this.setNextCallback(o);var l=this.props.nodeRef?this.props.nodeRef.current:uM.findDOMNode(this),u=s==null&&!this.props.addEndListener;if(!l||u){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var h=this.props.nodeRef?[this.nextCallback]:[l,this.nextCallback],f=h[0],g=h[1];this.props.addEndListener(f,g)}s!=null&&setTimeout(this.nextCallback,s)},t.render=function(){var s=this.state.status;if(s===Ax)return null;var o=this.props,l=o.children;o.in,o.mountOnEnter,o.unmountOnExit,o.appear,o.enter,o.exit,o.timeout,o.addEndListener,o.onEnter,o.onEntering,o.onEntered,o.onExit,o.onExiting,o.onExited,o.nodeRef;var u=Ar(o,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return yt.createElement(cR.Provider,{value:null},typeof l=="function"?l(s,u):yt.cloneElement(yt.Children.only(l),u))},e}(yt.Component);Mv.contextType=cR;Mv.propTypes={};function fS(){}Mv.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:fS,onEntering:fS,onEntered:fS,onExit:fS,onExiting:fS,onExited:fS};Mv.UNMOUNTED=Ax;Mv.EXITED=a1;Mv.ENTERING=l1;Mv.ENTERED=LS;Mv.EXITING=WD;const wK=Mv;function Hfe(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function CF(n,e){var t=function(o){return e&&me.isValidElement(o)?e(o):o},r=Object.create(null);return n&&me.Children.map(n,function(s){return s}).forEach(function(s){r[s.key]=t(s)}),r}function Gfe(n,e){n=n||{},e=e||{};function t(g){return g in e?e[g]:n[g]}var r=Object.create(null),s=[];for(var o in n)o in e?s.length&&(r[o]=s,s=[]):s.push(o);var l,u={};for(var h in e){if(r[h])for(l=0;ln.scrollTop;function hR(n,e){var t,r;const{timeout:s,easing:o,style:l={}}=n;return{duration:(t=l.transitionDuration)!=null?t:typeof s=="number"?s:s[e.mode]||0,easing:(r=l.transitionTimingFunction)!=null?r:typeof o=="object"?o[e.mode]:o,delay:l.transitionDelay}}function Kfe(n){return Po("MuiPaper",n)}Xo("MuiPaper",["root","rounded","outlined","elevation","elevation0","elevation1","elevation2","elevation3","elevation4","elevation5","elevation6","elevation7","elevation8","elevation9","elevation10","elevation11","elevation12","elevation13","elevation14","elevation15","elevation16","elevation17","elevation18","elevation19","elevation20","elevation21","elevation22","elevation23","elevation24"]);const Jfe=["className","component","elevation","square","variant"],qfe=n=>{const{square:e,elevation:t,variant:r,classes:s}=n,o={root:["root",r,!e&&"rounded",r==="elevation"&&`elevation${t}`]};return Ko(o,Kfe,s)},Qfe=pr("div",{name:"MuiPaper",slot:"Root",overridesResolver:(n,e)=>{const{ownerState:t}=n;return[e.root,e[t.variant],!t.square&&e.rounded,t.variant==="elevation"&&e[`elevation${t.elevation}`]]}})(({theme:n,ownerState:e})=>{var t;return Qe({backgroundColor:(n.vars||n).palette.background.paper,color:(n.vars||n).palette.text.primary,transition:n.transitions.create("box-shadow")},!e.square&&{borderRadius:n.shape.borderRadius},e.variant==="outlined"&&{border:`1px solid ${(n.vars||n).palette.divider}`},e.variant==="elevation"&&Qe({boxShadow:(n.vars||n).shadows[e.elevation]},!n.vars&&n.palette.mode==="dark"&&{backgroundImage:`linear-gradient(${r0("#fff",$H(e.elevation))}, ${r0("#fff",$H(e.elevation))})`},n.vars&&{backgroundImage:(t=n.vars.overlays)==null?void 0:t[e.elevation]}))}),Zfe=me.forwardRef(function(e,t){const r=ua({props:e,name:"MuiPaper"}),{className:s,component:o="div",elevation:l=1,square:u=!1,variant:h="elevation"}=r,f=Ar(r,Jfe),g=Qe({},r,{component:o,elevation:l,square:u,variant:h}),y=qfe(g);return Ne.jsx(Qfe,Qe({as:o,ownerState:g,className:ai(y.root,s),ref:t},f))}),AF=Zfe;function dR(n){return typeof n=="string"}function epe(n,e,t){return n===void 0||dR(n)?e:Qe({},e,{ownerState:Qe({},e.ownerState,t)})}function xK(n,e=[]){if(n===void 0)return{};const t={};return Object.keys(n).filter(r=>r.match(/^on[A-Z]/)&&typeof n[r]=="function"&&!e.includes(r)).forEach(r=>{t[r]=n[r]}),t}function tpe(n,e,t){return typeof n=="function"?n(e,t):n}function MH(n){if(n===void 0)return{};const e={};return Object.keys(n).filter(t=>!(t.match(/^on[A-Z]/)&&typeof n[t]=="function")).forEach(t=>{e[t]=n[t]}),e}function npe(n){const{getSlotProps:e,additionalProps:t,externalSlotProps:r,externalForwardedProps:s,className:o}=n;if(!e){const w=ai(t==null?void 0:t.className,o,s==null?void 0:s.className,r==null?void 0:r.className),C=Qe({},t==null?void 0:t.style,s==null?void 0:s.style,r==null?void 0:r.style),M=Qe({},t,s,r);return w.length>0&&(M.className=w),Object.keys(C).length>0&&(M.style=C),{props:M,internalRef:void 0}}const l=xK(Qe({},s,r)),u=MH(r),h=MH(s),f=e(l),g=ai(f==null?void 0:f.className,t==null?void 0:t.className,o,s==null?void 0:s.className,r==null?void 0:r.className),y=Qe({},f==null?void 0:f.style,t==null?void 0:t.style,s==null?void 0:s.style,r==null?void 0:r.style),b=Qe({},f,t,h,u);return g.length>0&&(b.className=g),Object.keys(y).length>0&&(b.style=y),{props:b,internalRef:f.ref}}const rpe=["elementType","externalSlotProps","ownerState","skipResolvingSlotProps"];function Rw(n){var e;const{elementType:t,externalSlotProps:r,ownerState:s,skipResolvingSlotProps:o=!1}=n,l=Ar(n,rpe),u=o?{}:tpe(r,s),{props:h,internalRef:f}=npe(Qe({},l,{externalSlotProps:u})),g=gp(f,u==null?void 0:u.ref,(e=n.additionalProps)==null?void 0:e.ref);return epe(t,Qe({},h,{ref:g}),s)}function ipe(n){const{className:e,classes:t,pulsate:r=!1,rippleX:s,rippleY:o,rippleSize:l,in:u,onExited:h,timeout:f}=n,[g,y]=me.useState(!1),b=ai(e,t.ripple,t.rippleVisible,r&&t.ripplePulsate),w={width:l,height:l,top:-(l/2)+o,left:-(l/2)+s},C=ai(t.child,g&&t.childLeaving,r&&t.childPulsate);return!u&&!g&&y(!0),me.useEffect(()=>{if(!u&&h!=null){const M=setTimeout(h,f);return()=>{clearTimeout(M)}}},[h,u,f]),Ne.jsx("span",{className:b,style:w,children:Ne.jsx("span",{className:C})})}const fg=Xo("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),spe=["center","classes","className"];let Yk=n=>n,AH,IH,RH,kH;const VD=550,ope=80,ape=Ek(AH||(AH=Yk` 0% { transform: scale(0); opacity: 0.1; @@ -1628,7 +1628,7 @@ function print() { __p += __j.call(arguments, '') } transform: scale(1); opacity: 0.3; } -`)),lpe=Ek(AH||(AH=Yk` +`)),lpe=Ek(IH||(IH=Yk` 0% { opacity: 1; } @@ -1636,7 +1636,7 @@ function print() { __p += __j.call(arguments, '') } 100% { opacity: 0; } -`)),upe=Ek(IH||(IH=Yk` +`)),upe=Ek(RH||(RH=Yk` 0% { transform: scale(1); } @@ -1648,7 +1648,7 @@ function print() { __p += __j.call(arguments, '') } 100% { transform: scale(1); } -`)),cpe=pr("span",{name:"MuiTouchRipple",slot:"Root"})({overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"}),hpe=pr(ipe,{name:"MuiTouchRipple",slot:"Ripple"})(RH||(RH=Yk` +`)),cpe=pr("span",{name:"MuiTouchRipple",slot:"Root"})({overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"}),hpe=pr(ipe,{name:"MuiTouchRipple",slot:"Ripple"})(kH||(kH=Yk` opacity: 0; position: absolute; @@ -1691,12 +1691,12 @@ function print() { __p += __j.call(arguments, '') } animation-iteration-count: infinite; animation-delay: 200ms; } -`),fg.rippleVisible,ape,VD,({theme:n})=>n.transitions.easing.easeInOut,fg.ripplePulsate,({theme:n})=>n.transitions.duration.shorter,fg.child,fg.childLeaving,lpe,VD,({theme:n})=>n.transitions.easing.easeInOut,fg.childPulsate,upe,({theme:n})=>n.transitions.easing.easeInOut),dpe=pe.forwardRef(function(e,t){const r=ua({props:e,name:"MuiTouchRipple"}),{center:s=!1,classes:o={},className:l}=r,u=Ar(r,spe),[h,f]=pe.useState([]),g=pe.useRef(0),y=pe.useRef(null);pe.useEffect(()=>{y.current&&(y.current(),y.current=null)},[h]);const b=pe.useRef(!1),w=aK(),C=pe.useRef(null),M=pe.useRef(null),A=pe.useCallback(D=>{const{pulsate:z,rippleX:U,rippleY:V,rippleSize:H,cb:oe}=D;f(le=>[...le,De.jsx(hpe,{classes:{ripple:ai(o.ripple,fg.ripple),rippleVisible:ai(o.rippleVisible,fg.rippleVisible),ripplePulsate:ai(o.ripplePulsate,fg.ripplePulsate),child:ai(o.child,fg.child),childLeaving:ai(o.childLeaving,fg.childLeaving),childPulsate:ai(o.childPulsate,fg.childPulsate)},timeout:VD,pulsate:z,rippleX:U,rippleY:V,rippleSize:H},g.current)]),g.current+=1,y.current=oe},[o]),k=pe.useCallback((D={},z={},U=()=>{})=>{const{pulsate:V=!1,center:H=s||z.pulsate,fakeElement:oe=!1}=z;if((D==null?void 0:D.type)==="mousedown"&&b.current){b.current=!1;return}(D==null?void 0:D.type)==="touchstart"&&(b.current=!0);const le=oe?null:M.current,Z=le?le.getBoundingClientRect():{width:0,height:0,left:0,top:0};let q,he,ae;if(H||D===void 0||D.clientX===0&&D.clientY===0||!D.clientX&&!D.touches)q=Math.round(Z.width/2),he=Math.round(Z.height/2);else{const{clientX:ue,clientY:ge}=D.touches&&D.touches.length>0?D.touches[0]:D;q=Math.round(ue-Z.left),he=Math.round(ge-Z.top)}if(H)ae=Math.sqrt((2*Z.width**2+Z.height**2)/3),ae%2===0&&(ae+=1);else{const ue=Math.max(Math.abs((le?le.clientWidth:0)-q),q)*2+2,ge=Math.max(Math.abs((le?le.clientHeight:0)-he),he)*2+2;ae=Math.sqrt(ue**2+ge**2)}D!=null&&D.touches?C.current===null&&(C.current=()=>{A({pulsate:V,rippleX:q,rippleY:he,rippleSize:ae,cb:U})},w.start(ope,()=>{C.current&&(C.current(),C.current=null)})):A({pulsate:V,rippleX:q,rippleY:he,rippleSize:ae,cb:U})},[s,A,w]),L=pe.useCallback(()=>{k({},{pulsate:!0})},[k]),P=pe.useCallback((D,z)=>{if(w.clear(),(D==null?void 0:D.type)==="touchend"&&C.current){C.current(),C.current=null,w.start(0,()=>{P(D,z)});return}C.current=null,f(U=>U.length>0?U.slice(1):U),y.current=z},[w]);return pe.useImperativeHandle(t,()=>({pulsate:L,start:k,stop:P}),[L,k,P]),De.jsx(cpe,qe({className:ai(fg.root,o.root,l),ref:M},u,{children:De.jsx(Xfe,{component:null,exit:!0,children:h})}))}),fpe=dpe;function ppe(n){return Po("MuiButtonBase",n)}const mpe=Xo("MuiButtonBase",["root","disabled","focusVisible"]),gpe=["action","centerRipple","children","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","LinkComponent","onBlur","onClick","onContextMenu","onDragLeave","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","tabIndex","TouchRippleProps","touchRippleRef","type"],_pe=n=>{const{disabled:e,focusVisible:t,focusVisibleClassName:r,classes:s}=n,l=Ko({root:["root",e&&"disabled",t&&"focusVisible"]},ppe,s);return t&&r&&(l.root+=` ${r}`),l},vpe=pr("button",{name:"MuiButtonBase",slot:"Root",overridesResolver:(n,e)=>e.root})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${mpe.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),ype=pe.forwardRef(function(e,t){const r=ua({props:e,name:"MuiButtonBase"}),{action:s,centerRipple:o=!1,children:l,className:u,component:h="button",disabled:f=!1,disableRipple:g=!1,disableTouchRipple:y=!1,focusRipple:b=!1,LinkComponent:w="a",onBlur:C,onClick:M,onContextMenu:A,onDragLeave:k,onFocus:L,onFocusVisible:P,onKeyDown:D,onKeyUp:z,onMouseDown:U,onMouseLeave:V,onMouseUp:H,onTouchEnd:oe,onTouchMove:le,onTouchStart:Z,tabIndex:q=0,TouchRippleProps:he,touchRippleRef:ae,type:ue}=r,ge=Ar(r,gpe),we=pe.useRef(null),J=pe.useRef(null),re=gp(J,ae),{isFocusVisibleRef:ie,onFocus:fe,onBlur:Te,ref:Fe}=lK(),[Ie,Je]=pe.useState(!1);f&&Ie&&Je(!1),pe.useImperativeHandle(s,()=>({focusVisible:()=>{Je(!0),we.current.focus()}}),[]);const[Re,Qe]=pe.useState(!1);pe.useEffect(()=>{Qe(!0)},[]);const nt=Re&&!g&&!f;pe.useEffect(()=>{Ie&&b&&!g&&Re&&J.current.pulsate()},[g,b,Ie,Re]);function ft(Ke,Le,Q=y){return T1(te=>(Le&&Le(te),!Q&&J.current&&J.current[Ke](te),!0))}const lt=ft("start",U),ze=ft("stop",A),Ce=ft("stop",k),He=ft("stop",H),rt=ft("stop",Ke=>{Ie&&Ke.preventDefault(),V&&V(Ke)}),it=ft("start",Z),Nt=ft("stop",oe),kt=ft("stop",le),vt=ft("stop",Ke=>{Te(Ke),ie.current===!1&&Je(!1),C&&C(Ke)},!1),Mt=T1(Ke=>{we.current||(we.current=Ke.currentTarget),fe(Ke),ie.current===!0&&(Je(!0),P&&P(Ke)),L&&L(Ke)}),At=()=>{const Ke=we.current;return h&&h!=="button"&&!(Ke.tagName==="A"&&Ke.href)},mt=pe.useRef(!1),xe=T1(Ke=>{b&&!mt.current&&Ie&&J.current&&Ke.key===" "&&(mt.current=!0,J.current.stop(Ke,()=>{J.current.start(Ke)})),Ke.target===Ke.currentTarget&&At()&&Ke.key===" "&&Ke.preventDefault(),D&&D(Ke),Ke.target===Ke.currentTarget&&At()&&Ke.key==="Enter"&&!f&&(Ke.preventDefault(),M&&M(Ke))}),se=T1(Ke=>{b&&Ke.key===" "&&J.current&&Ie&&!Ke.defaultPrevented&&(mt.current=!1,J.current.stop(Ke,()=>{J.current.pulsate(Ke)})),z&&z(Ke),M&&Ke.target===Ke.currentTarget&&At()&&Ke.key===" "&&!Ke.defaultPrevented&&M(Ke)});let $e=h;$e==="button"&&(ge.href||ge.to)&&($e=w);const ht={};$e==="button"?(ht.type=ue===void 0?"button":ue,ht.disabled=f):(!ge.href&&!ge.to&&(ht.role="button"),f&&(ht["aria-disabled"]=f));const St=gp(t,Fe,we),It=qe({},r,{centerRipple:o,component:h,disabled:f,disableRipple:g,disableTouchRipple:y,focusRipple:b,tabIndex:q,focusVisible:Ie}),pt=_pe(It);return De.jsxs(vpe,qe({as:$e,className:ai(pt.root,u),ownerState:It,onBlur:vt,onClick:M,onContextMenu:ze,onFocus:Mt,onKeyDown:xe,onKeyUp:se,onMouseDown:lt,onMouseLeave:rt,onMouseUp:He,onDragLeave:Ce,onTouchEnd:Nt,onTouchMove:kt,onTouchStart:it,ref:St,tabIndex:f?-1:q,type:ue},ht,ge,{children:[l,nt?De.jsx(fpe,qe({ref:re,center:o},he)):null]}))}),IF=ype;function bpe(n){return Po("MuiIconButton",n)}const Tpe=Xo("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge"]),Spe=["edge","children","className","color","disabled","disableFocusRipple","size"],wpe=n=>{const{classes:e,disabled:t,color:r,edge:s,size:o}=n,l={root:["root",t&&"disabled",r!=="default"&&`color${gr(r)}`,s&&`edge${gr(s)}`,`size${gr(o)}`]};return Ko(l,bpe,e)},Epe=pr(IF,{name:"MuiIconButton",slot:"Root",overridesResolver:(n,e)=>{const{ownerState:t}=n;return[e.root,t.color!=="default"&&e[`color${gr(t.color)}`],t.edge&&e[`edge${gr(t.edge)}`],e[`size${gr(t.size)}`]]}})(({theme:n,ownerState:e})=>qe({textAlign:"center",flex:"0 0 auto",fontSize:n.typography.pxToRem(24),padding:8,borderRadius:"50%",overflow:"visible",color:(n.vars||n).palette.action.active,transition:n.transitions.create("background-color",{duration:n.transitions.duration.shortest})},!e.disableRipple&&{"&:hover":{backgroundColor:n.vars?`rgba(${n.vars.palette.action.activeChannel} / ${n.vars.palette.action.hoverOpacity})`:r0(n.palette.action.active,n.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},e.edge==="start"&&{marginLeft:e.size==="small"?-3:-12},e.edge==="end"&&{marginRight:e.size==="small"?-3:-12}),({theme:n,ownerState:e})=>{var t;const r=(t=(n.vars||n).palette)==null?void 0:t[e.color];return qe({},e.color==="inherit"&&{color:"inherit"},e.color!=="inherit"&&e.color!=="default"&&qe({color:r==null?void 0:r.main},!e.disableRipple&&{"&:hover":qe({},r&&{backgroundColor:n.vars?`rgba(${r.mainChannel} / ${n.vars.palette.action.hoverOpacity})`:r0(r.main,n.palette.action.hoverOpacity)},{"@media (hover: none)":{backgroundColor:"transparent"}})}),e.size==="small"&&{padding:5,fontSize:n.typography.pxToRem(18)},e.size==="large"&&{padding:12,fontSize:n.typography.pxToRem(28)},{[`&.${Tpe.disabled}`]:{backgroundColor:"transparent",color:(n.vars||n).palette.action.disabled}})}),xpe=pe.forwardRef(function(e,t){const r=ua({props:e,name:"MuiIconButton"}),{edge:s=!1,children:o,className:l,color:u="default",disabled:h=!1,disableFocusRipple:f=!1,size:g="medium"}=r,y=Ar(r,Spe),b=qe({},r,{edge:s,color:u,disabled:h,disableFocusRipple:f,size:g}),w=wpe(b);return De.jsx(Epe,qe({className:ai(w.root,l),centerRipple:!0,focusRipple:!f,disabled:h,ref:t},y,{ownerState:b,children:o}))}),pI=xpe;function $pe(n){return Po("MuiTypography",n)}Xo("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]);const Cpe=["align","className","component","gutterBottom","noWrap","paragraph","variant","variantMapping"],Mpe=n=>{const{align:e,gutterBottom:t,noWrap:r,paragraph:s,variant:o,classes:l}=n,u={root:["root",o,n.align!=="inherit"&&`align${gr(e)}`,t&&"gutterBottom",r&&"noWrap",s&&"paragraph"]};return Ko(u,$pe,l)},Ape=pr("span",{name:"MuiTypography",slot:"Root",overridesResolver:(n,e)=>{const{ownerState:t}=n;return[e.root,t.variant&&e[t.variant],t.align!=="inherit"&&e[`align${gr(t.align)}`],t.noWrap&&e.noWrap,t.gutterBottom&&e.gutterBottom,t.paragraph&&e.paragraph]}})(({theme:n,ownerState:e})=>qe({margin:0},e.variant==="inherit"&&{font:"inherit"},e.variant!=="inherit"&&n.typography[e.variant],e.align!=="inherit"&&{textAlign:e.align},e.noWrap&&{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},e.gutterBottom&&{marginBottom:"0.35em"},e.paragraph&&{marginBottom:16})),kH={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},Ipe={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},Rpe=n=>Ipe[n]||n,kpe=pe.forwardRef(function(e,t){const r=ua({props:e,name:"MuiTypography"}),s=Rpe(r.color),o=xC(qe({},r,{color:s})),{align:l="inherit",className:u,component:h,gutterBottom:f=!1,noWrap:g=!1,paragraph:y=!1,variant:b="body1",variantMapping:w=kH}=o,C=Ar(o,Cpe),M=qe({},o,{align:l,color:s,className:u,component:h,gutterBottom:f,noWrap:g,paragraph:y,variant:b,variantMapping:w}),A=h||(y?"p":w[b]||kH[b])||"span",k=Mpe(M);return De.jsx(Ape,qe({as:A,ref:t,ownerState:M,className:ai(k.root,u)},C))}),f_=kpe,Ope=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function Lpe(n){const e=parseInt(n.getAttribute("tabindex")||"",10);return Number.isNaN(e)?n.contentEditable==="true"||(n.nodeName==="AUDIO"||n.nodeName==="VIDEO"||n.nodeName==="DETAILS")&&n.getAttribute("tabindex")===null?0:n.tabIndex:e}function Npe(n){if(n.tagName!=="INPUT"||n.type!=="radio"||!n.name)return!1;const e=r=>n.ownerDocument.querySelector(`input[type="radio"]${r}`);let t=e(`[name="${n.name}"]:checked`);return t||(t=e(`[name="${n.name}"]`)),t!==n}function Dpe(n){return!(n.disabled||n.tagName==="INPUT"&&n.type==="hidden"||Npe(n))}function Ppe(n){const e=[],t=[];return Array.from(n.querySelectorAll(Ope)).forEach((r,s)=>{const o=Lpe(r);o===-1||!Dpe(r)||(o===0?e.push(r):t.push({documentOrder:s,tabIndex:o,node:r}))}),t.sort((r,s)=>r.tabIndex===s.tabIndex?r.documentOrder-s.documentOrder:r.tabIndex-s.tabIndex).map(r=>r.node).concat(e)}function Bpe(){return!0}function Fpe(n){const{children:e,disableAutoFocus:t=!1,disableEnforceFocus:r=!1,disableRestoreFocus:s=!1,getTabbable:o=Ppe,isEnabled:l=Bpe,open:u}=n,h=pe.useRef(!1),f=pe.useRef(null),g=pe.useRef(null),y=pe.useRef(null),b=pe.useRef(null),w=pe.useRef(!1),C=pe.useRef(null),M=gp(e.ref,C),A=pe.useRef(null);pe.useEffect(()=>{!u||!C.current||(w.current=!t)},[t,u]),pe.useEffect(()=>{if(!u||!C.current)return;const P=Jp(C.current);return C.current.contains(P.activeElement)||(C.current.hasAttribute("tabIndex")||C.current.setAttribute("tabIndex","-1"),w.current&&C.current.focus()),()=>{s||(y.current&&y.current.focus&&(h.current=!0,y.current.focus()),y.current=null)}},[u]),pe.useEffect(()=>{if(!u||!C.current)return;const P=Jp(C.current),D=V=>{A.current=V,!(r||!l()||V.key!=="Tab")&&P.activeElement===C.current&&V.shiftKey&&(h.current=!0,g.current&&g.current.focus())},z=()=>{const V=C.current;if(V===null)return;if(!P.hasFocus()||!l()||h.current){h.current=!1;return}if(V.contains(P.activeElement)||r&&P.activeElement!==f.current&&P.activeElement!==g.current)return;if(P.activeElement!==b.current)b.current=null;else if(b.current!==null)return;if(!w.current)return;let H=[];if((P.activeElement===f.current||P.activeElement===g.current)&&(H=o(C.current)),H.length>0){var oe,le;const Z=!!((oe=A.current)!=null&&oe.shiftKey&&((le=A.current)==null?void 0:le.key)==="Tab"),q=H[0],he=H[H.length-1];typeof q!="string"&&typeof he!="string"&&(Z?he.focus():q.focus())}else V.focus()};P.addEventListener("focusin",z),P.addEventListener("keydown",D,!0);const U=setInterval(()=>{P.activeElement&&P.activeElement.tagName==="BODY"&&z()},50);return()=>{clearInterval(U),P.removeEventListener("focusin",z),P.removeEventListener("keydown",D,!0)}},[t,r,s,l,u,o]);const k=P=>{y.current===null&&(y.current=P.relatedTarget),w.current=!0,b.current=P.target;const D=e.props.onFocus;D&&D(P)},L=P=>{y.current===null&&(y.current=P.relatedTarget),w.current=!0};return De.jsxs(pe.Fragment,{children:[De.jsx("div",{tabIndex:u?0:-1,onFocus:L,ref:f,"data-testid":"sentinelStart"}),pe.cloneElement(e,{ref:M,onFocus:k}),De.jsx("div",{tabIndex:u?0:-1,onFocus:L,ref:g,"data-testid":"sentinelEnd"})]})}function zpe(n){return typeof n=="function"?n():n}const Upe=pe.forwardRef(function(e,t){const{children:r,container:s,disablePortal:o=!1}=e,[l,u]=pe.useState(null),h=gp(pe.isValidElement(r)?r.ref:null,t);if(Uy(()=>{o||u(zpe(s)||document.body)},[s,o]),Uy(()=>{if(l&&!o)return aR(t,l),()=>{aR(t,null)}},[t,l,o]),o){if(pe.isValidElement(r)){const f={ref:h};return pe.cloneElement(r,f)}return De.jsx(pe.Fragment,{children:r})}return De.jsx(pe.Fragment,{children:l&&O3.createPortal(r,l)})});function Hpe(n){const e=Jp(n);return e.body===n?Hy(n).innerWidth>e.documentElement.clientWidth:n.scrollHeight>n.clientHeight}function qx(n,e){e?n.setAttribute("aria-hidden","true"):n.removeAttribute("aria-hidden")}function OH(n){return parseInt(Hy(n).getComputedStyle(n).paddingRight,10)||0}function Gpe(n){const t=["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].indexOf(n.tagName)!==-1,r=n.tagName==="INPUT"&&n.getAttribute("type")==="hidden";return t||r}function LH(n,e,t,r,s){const o=[e,t,...r];[].forEach.call(n.children,l=>{const u=o.indexOf(l)===-1,h=!Gpe(l);u&&h&&qx(l,s)})}function JO(n,e){let t=-1;return n.some((r,s)=>e(r)?(t=s,!0):!1),t}function Wpe(n,e){const t=[],r=n.container;if(!e.disableScrollLock){if(Hpe(r)){const l=uK(Jp(r));t.push({value:r.style.paddingRight,property:"padding-right",el:r}),r.style.paddingRight=`${OH(r)+l}px`;const u=Jp(r).querySelectorAll(".mui-fixed");[].forEach.call(u,h=>{t.push({value:h.style.paddingRight,property:"padding-right",el:h}),h.style.paddingRight=`${OH(h)+l}px`})}let o;if(r.parentNode instanceof DocumentFragment)o=Jp(r).body;else{const l=r.parentElement,u=Hy(r);o=(l==null?void 0:l.nodeName)==="HTML"&&u.getComputedStyle(l).overflowY==="scroll"?l:r}t.push({value:o.style.overflow,property:"overflow",el:o},{value:o.style.overflowX,property:"overflow-x",el:o},{value:o.style.overflowY,property:"overflow-y",el:o}),o.style.overflow="hidden"}return()=>{t.forEach(({value:o,el:l,property:u})=>{o?l.style.setProperty(u,o):l.style.removeProperty(u)})}}function Vpe(n){const e=[];return[].forEach.call(n.children,t=>{t.getAttribute("aria-hidden")==="true"&&e.push(t)}),e}class jpe{constructor(){this.containers=void 0,this.modals=void 0,this.modals=[],this.containers=[]}add(e,t){let r=this.modals.indexOf(e);if(r!==-1)return r;r=this.modals.length,this.modals.push(e),e.modalRef&&qx(e.modalRef,!1);const s=Vpe(t);LH(t,e.mount,e.modalRef,s,!0);const o=JO(this.containers,l=>l.container===t);return o!==-1?(this.containers[o].modals.push(e),r):(this.containers.push({modals:[e],container:t,restore:null,hiddenSiblings:s}),r)}mount(e,t){const r=JO(this.containers,o=>o.modals.indexOf(e)!==-1),s=this.containers[r];s.restore||(s.restore=Wpe(s,t))}remove(e,t=!0){const r=this.modals.indexOf(e);if(r===-1)return r;const s=JO(this.containers,l=>l.modals.indexOf(e)!==-1),o=this.containers[s];if(o.modals.splice(o.modals.indexOf(e),1),this.modals.splice(r,1),o.modals.length===0)o.restore&&o.restore(),e.modalRef&&qx(e.modalRef,t),LH(o.container,e.mount,e.modalRef,o.hiddenSiblings,!1),this.containers.splice(s,1);else{const l=o.modals[o.modals.length-1];l.modalRef&&qx(l.modalRef,!1)}return r}isTopModal(e){return this.modals.length>0&&this.modals[this.modals.length-1]===e}}function Ype(n){return typeof n=="function"?n():n}function Xpe(n){return n?n.props.hasOwnProperty("in"):!1}const Kpe=new jpe;function Jpe(n){const{container:e,disableEscapeKeyDown:t=!1,disableScrollLock:r=!1,manager:s=Kpe,closeAfterTransition:o=!1,onTransitionEnter:l,onTransitionExited:u,children:h,onClose:f,open:g,rootRef:y}=n,b=pe.useRef({}),w=pe.useRef(null),C=pe.useRef(null),M=gp(C,y),[A,k]=pe.useState(!g),L=Xpe(h);let P=!0;(n["aria-hidden"]==="false"||n["aria-hidden"]===!1)&&(P=!1);const D=()=>Jp(w.current),z=()=>(b.current.modalRef=C.current,b.current.mount=w.current,b.current),U=()=>{s.mount(z(),{disableScrollLock:r}),C.current&&(C.current.scrollTop=0)},V=T1(()=>{const ge=Ype(e)||D().body;s.add(z(),ge),C.current&&U()}),H=pe.useCallback(()=>s.isTopModal(z()),[s]),oe=T1(ge=>{w.current=ge,ge&&(g&&H()?U():C.current&&qx(C.current,P))}),le=pe.useCallback(()=>{s.remove(z(),P)},[P,s]);pe.useEffect(()=>()=>{le()},[le]),pe.useEffect(()=>{g?V():(!L||!o)&&le()},[g,le,L,o,V]);const Z=ge=>we=>{var J;(J=ge.onKeyDown)==null||J.call(ge,we),!(we.key!=="Escape"||we.which===229||!H())&&(t||(we.stopPropagation(),f&&f(we,"escapeKeyDown")))},q=ge=>we=>{var J;(J=ge.onClick)==null||J.call(ge,we),we.target===we.currentTarget&&f&&f(we,"backdropClick")};return{getRootProps:(ge={})=>{const we=EK(n);delete we.onTransitionEnter,delete we.onTransitionExited;const J=qe({},we,ge);return qe({role:"presentation"},J,{onKeyDown:Z(J),ref:M})},getBackdropProps:(ge={})=>{const we=ge;return qe({"aria-hidden":!0},we,{onClick:q(we),open:g})},getTransitionProps:()=>{const ge=()=>{k(!1),l&&l()},we=()=>{k(!0),u&&u(),o&&le()};return{onEnter:FD(ge,h==null?void 0:h.props.onEnter),onExited:FD(we,h==null?void 0:h.props.onExited)}},rootRef:M,portalRef:oe,isTopModal:H,exited:A,hasTransition:L}}const qpe=["onChange","maxRows","minRows","style","value"];function BM(n){return parseInt(n,10)||0}const Qpe={shadow:{visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"}};function Zpe(n){return n==null||Object.keys(n).length===0||n.outerHeightStyle===0&&!n.overflowing}const eme=pe.forwardRef(function(e,t){const{onChange:r,maxRows:s,minRows:o=1,style:l,value:u}=e,h=Ar(e,qpe),{current:f}=pe.useRef(u!=null),g=pe.useRef(null),y=gp(t,g),b=pe.useRef(null),w=pe.useCallback(()=>{const A=g.current,L=Hy(A).getComputedStyle(A);if(L.width==="0px")return{outerHeightStyle:0,overflowing:!1};const P=b.current;P.style.width=L.width,P.value=A.value||e.placeholder||"x",P.value.slice(-1)===` -`&&(P.value+=" ");const D=L.boxSizing,z=BM(L.paddingBottom)+BM(L.paddingTop),U=BM(L.borderBottomWidth)+BM(L.borderTopWidth),V=P.scrollHeight;P.value="x";const H=P.scrollHeight;let oe=V;o&&(oe=Math.max(Number(o)*H,oe)),s&&(oe=Math.min(Number(s)*H,oe)),oe=Math.max(oe,H);const le=oe+(D==="border-box"?z+U:0),Z=Math.abs(oe-V)<=1;return{outerHeightStyle:le,overflowing:Z}},[s,o,e.placeholder]),C=pe.useCallback(()=>{const A=w();if(Zpe(A))return;const k=g.current;k.style.height=`${A.outerHeightStyle}px`,k.style.overflow=A.overflowing?"hidden":""},[w]);Uy(()=>{const A=()=>{C()};let k;const L=SF(A),P=g.current,D=Hy(P);D.addEventListener("resize",L);let z;return typeof ResizeObserver<"u"&&(z=new ResizeObserver(A),z.observe(P)),()=>{L.clear(),cancelAnimationFrame(k),D.removeEventListener("resize",L),z&&z.disconnect()}},[w,C]),Uy(()=>{C()});const M=A=>{f||C(),r&&r(A)};return De.jsxs(pe.Fragment,{children:[De.jsx("textarea",qe({value:u,onChange:M,ref:y,rows:o,style:l},h)),De.jsx("textarea",{"aria-hidden":!0,className:e.className,readOnly:!0,ref:b,tabIndex:-1,style:qe({},Qpe.shadow,l,{paddingTop:0,paddingBottom:0})})]})});function tb({props:n,states:e,muiFormControl:t}){return e.reduce((r,s)=>(r[s]=n[s],t&&typeof n[s]>"u"&&(r[s]=t[s]),r),{})}const tme=pe.createContext(void 0),RF=tme;function Av(){return pe.useContext(RF)}function nme(n){return De.jsx(She,qe({},n,{defaultTheme:Vk,themeId:bC}))}function NH(n){return n!=null&&!(Array.isArray(n)&&n.length===0)}function fR(n,e=!1){return n&&(NH(n.value)&&n.value!==""||e&&NH(n.defaultValue)&&n.defaultValue!=="")}function rme(n){return n.startAdornment}function ime(n){return Po("MuiInputBase",n)}const sme=Xo("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]),kw=sme,ome=["aria-describedby","autoComplete","autoFocus","className","color","components","componentsProps","defaultValue","disabled","disableInjectingGlobalStyles","endAdornment","error","fullWidth","id","inputComponent","inputProps","inputRef","margin","maxRows","minRows","multiline","name","onBlur","onChange","onClick","onFocus","onKeyDown","onKeyUp","placeholder","readOnly","renderSuffix","rows","size","slotProps","slots","startAdornment","type","value"],Xk=(n,e)=>{const{ownerState:t}=n;return[e.root,t.formControl&&e.formControl,t.startAdornment&&e.adornedStart,t.endAdornment&&e.adornedEnd,t.error&&e.error,t.size==="small"&&e.sizeSmall,t.multiline&&e.multiline,t.color&&e[`color${gr(t.color)}`],t.fullWidth&&e.fullWidth,t.hiddenLabel&&e.hiddenLabel]},Kk=(n,e)=>{const{ownerState:t}=n;return[e.input,t.size==="small"&&e.inputSizeSmall,t.multiline&&e.inputMultiline,t.type==="search"&&e.inputTypeSearch,t.startAdornment&&e.inputAdornedStart,t.endAdornment&&e.inputAdornedEnd,t.hiddenLabel&&e.inputHiddenLabel]},ame=n=>{const{classes:e,color:t,disabled:r,error:s,endAdornment:o,focused:l,formControl:u,fullWidth:h,hiddenLabel:f,multiline:g,readOnly:y,size:b,startAdornment:w,type:C}=n,M={root:["root",`color${gr(t)}`,r&&"disabled",s&&"error",h&&"fullWidth",l&&"focused",u&&"formControl",b&&b!=="medium"&&`size${gr(b)}`,g&&"multiline",w&&"adornedStart",o&&"adornedEnd",f&&"hiddenLabel",y&&"readOnly"],input:["input",r&&"disabled",C==="search"&&"inputTypeSearch",g&&"inputMultiline",b==="small"&&"inputSizeSmall",f&&"inputHiddenLabel",w&&"inputAdornedStart",o&&"inputAdornedEnd",y&&"readOnly"]};return Ko(M,ime,e)},Jk=pr("div",{name:"MuiInputBase",slot:"Root",overridesResolver:Xk})(({theme:n,ownerState:e})=>qe({},n.typography.body1,{color:(n.vars||n).palette.text.primary,lineHeight:"1.4375em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center",[`&.${kw.disabled}`]:{color:(n.vars||n).palette.text.disabled,cursor:"default"}},e.multiline&&qe({padding:"4px 0 5px"},e.size==="small"&&{paddingTop:1}),e.fullWidth&&{width:"100%"})),qk=pr("input",{name:"MuiInputBase",slot:"Input",overridesResolver:Kk})(({theme:n,ownerState:e})=>{const t=n.palette.mode==="light",r=qe({color:"currentColor"},n.vars?{opacity:n.vars.opacity.inputPlaceholder}:{opacity:t?.42:.5},{transition:n.transitions.create("opacity",{duration:n.transitions.duration.shorter})}),s={opacity:"0 !important"},o=n.vars?{opacity:n.vars.opacity.inputPlaceholder}:{opacity:t?.42:.5};return qe({font:"inherit",letterSpacing:"inherit",color:"currentColor",padding:"4px 0 5px",border:0,boxSizing:"content-box",background:"none",height:"1.4375em",margin:0,WebkitTapHighlightColor:"transparent",display:"block",minWidth:0,width:"100%",animationName:"mui-auto-fill-cancel",animationDuration:"10ms","&::-webkit-input-placeholder":r,"&::-moz-placeholder":r,"&:-ms-input-placeholder":r,"&::-ms-input-placeholder":r,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{WebkitAppearance:"none"},[`label[data-shrink=false] + .${kw.formControl} &`]:{"&::-webkit-input-placeholder":s,"&::-moz-placeholder":s,"&:-ms-input-placeholder":s,"&::-ms-input-placeholder":s,"&:focus::-webkit-input-placeholder":o,"&:focus::-moz-placeholder":o,"&:focus:-ms-input-placeholder":o,"&:focus::-ms-input-placeholder":o},[`&.${kw.disabled}`]:{opacity:1,WebkitTextFillColor:(n.vars||n).palette.text.disabled},"&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}},e.size==="small"&&{paddingTop:1},e.multiline&&{height:"auto",resize:"none",padding:0,paddingTop:0},e.type==="search"&&{MozAppearance:"textfield"})}),lme=De.jsx(nme,{styles:{"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}}),ume=pe.forwardRef(function(e,t){var r;const s=ua({props:e,name:"MuiInputBase"}),{"aria-describedby":o,autoComplete:l,autoFocus:u,className:h,components:f={},componentsProps:g={},defaultValue:y,disabled:b,disableInjectingGlobalStyles:w,endAdornment:C,fullWidth:M=!1,id:A,inputComponent:k="input",inputProps:L={},inputRef:P,maxRows:D,minRows:z,multiline:U=!1,name:V,onBlur:H,onChange:oe,onClick:le,onFocus:Z,onKeyDown:q,onKeyUp:he,placeholder:ae,readOnly:ue,renderSuffix:ge,rows:we,slotProps:J={},slots:re={},startAdornment:ie,type:fe="text",value:Te}=s,Fe=Ar(s,ome),Ie=L.value!=null?L.value:Te,{current:Je}=pe.useRef(Ie!=null),Re=pe.useRef(),Qe=pe.useCallback(pt=>{},[]),nt=gp(Re,P,L.ref,Qe),[ft,lt]=pe.useState(!1),ze=Av(),Ce=tb({props:s,muiFormControl:ze,states:["color","disabled","error","hiddenLabel","size","required","filled"]});Ce.focused=ze?ze.focused:ft,pe.useEffect(()=>{!ze&&b&&ft&&(lt(!1),H&&H())},[ze,b,ft,H]);const He=ze&&ze.onFilled,rt=ze&&ze.onEmpty,it=pe.useCallback(pt=>{fR(pt)?He&&He():rt&&rt()},[He,rt]);Uy(()=>{Je&&it({value:Ie})},[Ie,it,Je]);const Nt=pt=>{if(Ce.disabled){pt.stopPropagation();return}Z&&Z(pt),L.onFocus&&L.onFocus(pt),ze&&ze.onFocus?ze.onFocus(pt):lt(!0)},kt=pt=>{H&&H(pt),L.onBlur&&L.onBlur(pt),ze&&ze.onBlur?ze.onBlur(pt):lt(!1)},vt=(pt,...Ke)=>{if(!Je){const Le=pt.target||Re.current;if(Le==null)throw new Error(J1(1));it({value:Le.value})}L.onChange&&L.onChange(pt,...Ke),oe&&oe(pt,...Ke)};pe.useEffect(()=>{it(Re.current)},[]);const Mt=pt=>{Re.current&&pt.currentTarget===pt.target&&Re.current.focus(),le&&le(pt)};let At=k,mt=L;U&&At==="input"&&(we?mt=qe({type:void 0,minRows:we,maxRows:we},mt):mt=qe({type:void 0,maxRows:D,minRows:z},mt),At=eme);const xe=pt=>{it(pt.animationName==="mui-auto-fill-cancel"?Re.current:{value:"x"})};pe.useEffect(()=>{ze&&ze.setAdornedStart(!!ie)},[ze,ie]);const se=qe({},s,{color:Ce.color||"primary",disabled:Ce.disabled,endAdornment:C,error:Ce.error,focused:Ce.focused,formControl:ze,fullWidth:M,hiddenLabel:Ce.hiddenLabel,multiline:U,size:Ce.size,startAdornment:ie,type:fe}),$e=ame(se),ht=re.root||f.Root||Jk,St=J.root||g.root||{},It=re.input||f.Input||qk;return mt=qe({},mt,(r=J.input)!=null?r:g.input),De.jsxs(pe.Fragment,{children:[!w&&lme,De.jsxs(ht,qe({},St,!dR(ht)&&{ownerState:qe({},se,St.ownerState)},{ref:t,onClick:Mt},Fe,{className:ai($e.root,St.className,h,ue&&"MuiInputBase-readOnly"),children:[ie,De.jsx(RF.Provider,{value:null,children:De.jsx(It,qe({ownerState:se,"aria-invalid":Ce.error,"aria-describedby":o,autoComplete:l,autoFocus:u,defaultValue:y,disabled:Ce.disabled,id:A,onAnimationStart:xe,name:V,placeholder:ae,readOnly:ue,required:Ce.required,rows:we,value:Ie,onKeyDown:q,onKeyUp:he,type:fe},mt,!dR(It)&&{as:At,ownerState:qe({},se,mt.ownerState)},{ref:nt,className:ai($e.input,mt.className,ue&&"MuiInputBase-readOnly"),onBlur:kt,onChange:vt,onFocus:Nt}))}),C,ge?ge(qe({},Ce,{startAdornment:ie})):null]}))]})}),kF=ume;function cme(n){return Po("MuiInput",n)}const hme=qe({},kw,Xo("MuiInput",["root","underline","input"])),tx=hme;function dme(n){return Po("MuiOutlinedInput",n)}const fme=qe({},kw,Xo("MuiOutlinedInput",["root","notchedOutline","input"])),ny=fme;function pme(n){return Po("MuiFilledInput",n)}const mme=qe({},kw,Xo("MuiFilledInput",["root","underline","input"])),Hb=mme,gme=CC(De.jsx("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown"),_me=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"],vme={entering:{opacity:1},entered:{opacity:1}},yme=pe.forwardRef(function(e,t){const r=jk(),s={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:o,appear:l=!0,children:u,easing:h,in:f,onEnter:g,onEntered:y,onEntering:b,onExit:w,onExited:C,onExiting:M,style:A,timeout:k=s,TransitionComponent:L=SK}=e,P=Ar(e,_me),D=pe.useRef(null),z=gp(D,u.ref,t),U=ae=>ue=>{if(ae){const ge=D.current;ue===void 0?ae(ge):ae(ge,ue)}},V=U(b),H=U((ae,ue)=>{wK(ae);const ge=hR({style:A,timeout:k,easing:h},{mode:"enter"});ae.style.webkitTransition=r.transitions.create("opacity",ge),ae.style.transition=r.transitions.create("opacity",ge),g&&g(ae,ue)}),oe=U(y),le=U(M),Z=U(ae=>{const ue=hR({style:A,timeout:k,easing:h},{mode:"exit"});ae.style.webkitTransition=r.transitions.create("opacity",ue),ae.style.transition=r.transitions.create("opacity",ue),w&&w(ae)}),q=U(C),he=ae=>{o&&o(D.current,ae)};return De.jsx(L,qe({appear:l,in:f,nodeRef:D,onEnter:H,onEntered:oe,onEntering:V,onExit:Z,onExited:q,onExiting:le,addEndListener:he,timeout:k},P,{children:(ae,ue)=>pe.cloneElement(u,qe({style:qe({opacity:0,visibility:ae==="exited"&&!f?"hidden":void 0},vme[ae],A,u.props.style),ref:z},ue))}))}),xK=yme;function bme(n){return Po("MuiBackdrop",n)}Xo("MuiBackdrop",["root","invisible"]);const Tme=["children","className","component","components","componentsProps","invisible","open","slotProps","slots","TransitionComponent","transitionDuration"],Sme=n=>{const{classes:e,invisible:t}=n;return Ko({root:["root",t&&"invisible"]},bme,e)},wme=pr("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(n,e)=>{const{ownerState:t}=n;return[e.root,t.invisible&&e.invisible]}})(({ownerState:n})=>qe({position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent"},n.invisible&&{backgroundColor:"transparent"})),Eme=pe.forwardRef(function(e,t){var r,s,o;const l=ua({props:e,name:"MuiBackdrop"}),{children:u,className:h,component:f="div",components:g={},componentsProps:y={},invisible:b=!1,open:w,slotProps:C={},slots:M={},TransitionComponent:A=xK,transitionDuration:k}=l,L=Ar(l,Tme),P=qe({},l,{component:f,invisible:b}),D=Sme(P),z=(r=C.root)!=null?r:y.root;return De.jsx(A,qe({in:w,timeout:k},L,{children:De.jsx(wme,qe({"aria-hidden":!0},z,{as:(s=(o=M.root)!=null?o:g.Root)!=null?s:f,className:ai(D.root,h,z==null?void 0:z.className),ownerState:qe({},P,z==null?void 0:z.ownerState),classes:D,ref:t,children:u}))}))}),OF=Eme,xme=Xo("MuiBox",["root"]),$me=xme,Cme=yK(),Mme=Ahe({themeId:bC,defaultTheme:Cme,defaultClassName:$me.root,generateClassName:_F.generate}),Ey=Mme;function Ame(n){return Po("MuiButton",n)}const Ime=Xo("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","colorPrimary","colorSecondary","colorSuccess","colorError","colorInfo","colorWarning","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","icon","iconSizeSmall","iconSizeMedium","iconSizeLarge"]),FM=Ime,Rme=pe.createContext({}),kme=Rme,Ome=pe.createContext(void 0),Lme=Ome,Nme=["children","color","component","className","disabled","disableElevation","disableFocusRipple","endIcon","focusVisibleClassName","fullWidth","size","startIcon","type","variant"],Dme=n=>{const{color:e,disableElevation:t,fullWidth:r,size:s,variant:o,classes:l}=n,u={root:["root",o,`${o}${gr(e)}`,`size${gr(s)}`,`${o}Size${gr(s)}`,`color${gr(e)}`,t&&"disableElevation",r&&"fullWidth"],label:["label"],startIcon:["icon","startIcon",`iconSize${gr(s)}`],endIcon:["icon","endIcon",`iconSize${gr(s)}`]},h=Ko(u,Ame,l);return qe({},l,h)},$K=n=>qe({},n.size==="small"&&{"& > *:nth-of-type(1)":{fontSize:18}},n.size==="medium"&&{"& > *:nth-of-type(1)":{fontSize:20}},n.size==="large"&&{"& > *:nth-of-type(1)":{fontSize:22}}),Pme=pr(IF,{shouldForwardProp:n=>Vm(n)||n==="classes",name:"MuiButton",slot:"Root",overridesResolver:(n,e)=>{const{ownerState:t}=n;return[e.root,e[t.variant],e[`${t.variant}${gr(t.color)}`],e[`size${gr(t.size)}`],e[`${t.variant}Size${gr(t.size)}`],t.color==="inherit"&&e.colorInherit,t.disableElevation&&e.disableElevation,t.fullWidth&&e.fullWidth]}})(({theme:n,ownerState:e})=>{var t,r;const s=n.palette.mode==="light"?n.palette.grey[300]:n.palette.grey[800],o=n.palette.mode==="light"?n.palette.grey.A100:n.palette.grey[700];return qe({},n.typography.button,{minWidth:64,padding:"6px 16px",borderRadius:(n.vars||n).shape.borderRadius,transition:n.transitions.create(["background-color","box-shadow","border-color","color"],{duration:n.transitions.duration.short}),"&:hover":qe({textDecoration:"none",backgroundColor:n.vars?`rgba(${n.vars.palette.text.primaryChannel} / ${n.vars.palette.action.hoverOpacity})`:r0(n.palette.text.primary,n.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},e.variant==="text"&&e.color!=="inherit"&&{backgroundColor:n.vars?`rgba(${n.vars.palette[e.color].mainChannel} / ${n.vars.palette.action.hoverOpacity})`:r0(n.palette[e.color].main,n.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},e.variant==="outlined"&&e.color!=="inherit"&&{border:`1px solid ${(n.vars||n).palette[e.color].main}`,backgroundColor:n.vars?`rgba(${n.vars.palette[e.color].mainChannel} / ${n.vars.palette.action.hoverOpacity})`:r0(n.palette[e.color].main,n.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},e.variant==="contained"&&{backgroundColor:n.vars?n.vars.palette.Button.inheritContainedHoverBg:o,boxShadow:(n.vars||n).shadows[4],"@media (hover: none)":{boxShadow:(n.vars||n).shadows[2],backgroundColor:(n.vars||n).palette.grey[300]}},e.variant==="contained"&&e.color!=="inherit"&&{backgroundColor:(n.vars||n).palette[e.color].dark,"@media (hover: none)":{backgroundColor:(n.vars||n).palette[e.color].main}}),"&:active":qe({},e.variant==="contained"&&{boxShadow:(n.vars||n).shadows[8]}),[`&.${FM.focusVisible}`]:qe({},e.variant==="contained"&&{boxShadow:(n.vars||n).shadows[6]}),[`&.${FM.disabled}`]:qe({color:(n.vars||n).palette.action.disabled},e.variant==="outlined"&&{border:`1px solid ${(n.vars||n).palette.action.disabledBackground}`},e.variant==="contained"&&{color:(n.vars||n).palette.action.disabled,boxShadow:(n.vars||n).shadows[0],backgroundColor:(n.vars||n).palette.action.disabledBackground})},e.variant==="text"&&{padding:"6px 8px"},e.variant==="text"&&e.color!=="inherit"&&{color:(n.vars||n).palette[e.color].main},e.variant==="outlined"&&{padding:"5px 15px",border:"1px solid currentColor"},e.variant==="outlined"&&e.color!=="inherit"&&{color:(n.vars||n).palette[e.color].main,border:n.vars?`1px solid rgba(${n.vars.palette[e.color].mainChannel} / 0.5)`:`1px solid ${r0(n.palette[e.color].main,.5)}`},e.variant==="contained"&&{color:n.vars?n.vars.palette.text.primary:(t=(r=n.palette).getContrastText)==null?void 0:t.call(r,n.palette.grey[300]),backgroundColor:n.vars?n.vars.palette.Button.inheritContainedBg:s,boxShadow:(n.vars||n).shadows[2]},e.variant==="contained"&&e.color!=="inherit"&&{color:(n.vars||n).palette[e.color].contrastText,backgroundColor:(n.vars||n).palette[e.color].main},e.color==="inherit"&&{color:"inherit",borderColor:"currentColor"},e.size==="small"&&e.variant==="text"&&{padding:"4px 5px",fontSize:n.typography.pxToRem(13)},e.size==="large"&&e.variant==="text"&&{padding:"8px 11px",fontSize:n.typography.pxToRem(15)},e.size==="small"&&e.variant==="outlined"&&{padding:"3px 9px",fontSize:n.typography.pxToRem(13)},e.size==="large"&&e.variant==="outlined"&&{padding:"7px 21px",fontSize:n.typography.pxToRem(15)},e.size==="small"&&e.variant==="contained"&&{padding:"4px 10px",fontSize:n.typography.pxToRem(13)},e.size==="large"&&e.variant==="contained"&&{padding:"8px 22px",fontSize:n.typography.pxToRem(15)},e.fullWidth&&{width:"100%"})},({ownerState:n})=>n.disableElevation&&{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${FM.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${FM.disabled}`]:{boxShadow:"none"}}),Bme=pr("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(n,e)=>{const{ownerState:t}=n;return[e.startIcon,e[`iconSize${gr(t.size)}`]]}})(({ownerState:n})=>qe({display:"inherit",marginRight:8,marginLeft:-4},n.size==="small"&&{marginLeft:-2},$K(n))),Fme=pr("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(n,e)=>{const{ownerState:t}=n;return[e.endIcon,e[`iconSize${gr(t.size)}`]]}})(({ownerState:n})=>qe({display:"inherit",marginRight:-4,marginLeft:8},n.size==="small"&&{marginRight:-2},$K(n))),zme=pe.forwardRef(function(e,t){const r=pe.useContext(kme),s=pe.useContext(Lme),o=bF(r,e),l=ua({props:o,name:"MuiButton"}),{children:u,color:h="primary",component:f="button",className:g,disabled:y=!1,disableElevation:b=!1,disableFocusRipple:w=!1,endIcon:C,focusVisibleClassName:M,fullWidth:A=!1,size:k="medium",startIcon:L,type:P,variant:D="text"}=l,z=Ar(l,Nme),U=qe({},l,{color:h,component:f,disabled:y,disableElevation:b,disableFocusRipple:w,fullWidth:A,size:k,type:P,variant:D}),V=Dme(U),H=L&&De.jsx(Bme,{className:V.startIcon,ownerState:U,children:L}),oe=C&&De.jsx(Fme,{className:V.endIcon,ownerState:U,children:C}),le=s||"";return De.jsxs(Pme,qe({ownerState:U,className:ai(r.className,V.root,g,le),component:f,disabled:y,focusRipple:!w,focusVisibleClassName:ai(V.focusVisible,M),ref:t,type:P},z,{classes:V,children:[H,u,oe]}))}),Ume=zme;function Hme(n){return Po("PrivateSwitchBase",n)}Xo("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const Gme=["autoFocus","checked","checkedIcon","className","defaultChecked","disabled","disableFocusRipple","edge","icon","id","inputProps","inputRef","name","onBlur","onChange","onFocus","readOnly","required","tabIndex","type","value"],Wme=n=>{const{classes:e,checked:t,disabled:r,edge:s}=n,o={root:["root",t&&"checked",r&&"disabled",s&&`edge${gr(s)}`],input:["input"]};return Ko(o,Hme,e)},Vme=pr(IF)(({ownerState:n})=>qe({padding:9,borderRadius:"50%"},n.edge==="start"&&{marginLeft:n.size==="small"?-3:-12},n.edge==="end"&&{marginRight:n.size==="small"?-3:-12})),jme=pr("input",{shouldForwardProp:Vm})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),Yme=pe.forwardRef(function(e,t){const{autoFocus:r,checked:s,checkedIcon:o,className:l,defaultChecked:u,disabled:h,disableFocusRipple:f=!1,edge:g=!1,icon:y,id:b,inputProps:w,inputRef:C,name:M,onBlur:A,onChange:k,onFocus:L,readOnly:P,required:D=!1,tabIndex:z,type:U,value:V}=e,H=Ar(e,Gme),[oe,le]=lR({controlled:s,default:!!u,name:"SwitchBase",state:"checked"}),Z=Av(),q=re=>{L&&L(re),Z&&Z.onFocus&&Z.onFocus(re)},he=re=>{A&&A(re),Z&&Z.onBlur&&Z.onBlur(re)},ae=re=>{if(re.nativeEvent.defaultPrevented)return;const ie=re.target.checked;le(ie),k&&k(re,ie)};let ue=h;Z&&typeof ue>"u"&&(ue=Z.disabled);const ge=U==="checkbox"||U==="radio",we=qe({},e,{checked:oe,disabled:ue,disableFocusRipple:f,edge:g}),J=Wme(we);return De.jsxs(Vme,qe({component:"span",className:ai(J.root,l),centerRipple:!0,focusRipple:!f,disabled:ue,tabIndex:null,role:void 0,onFocus:q,onBlur:he,ownerState:we,ref:t},H,{children:[De.jsx(jme,qe({autoFocus:r,checked:s,defaultChecked:u,className:J.input,disabled:ue,id:ge?b:void 0,name:M,onChange:ae,readOnly:P,ref:C,required:D,ownerState:we,tabIndex:z,type:U},U==="checkbox"&&V===void 0?{}:{value:V},w)),oe?o:y]}))}),CK=Yme,Xme=CC(De.jsx("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}),"CheckBoxOutlineBlank"),Kme=CC(De.jsx("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckBox"),Jme=CC(De.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}),"IndeterminateCheckBox");function qme(n){return Po("MuiCheckbox",n)}const Qme=Xo("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary","sizeSmall","sizeMedium"]),qO=Qme,Zme=["checkedIcon","color","icon","indeterminate","indeterminateIcon","inputProps","size","className"],ege=n=>{const{classes:e,indeterminate:t,color:r,size:s}=n,o={root:["root",t&&"indeterminate",`color${gr(r)}`,`size${gr(s)}`]},l=Ko(o,qme,e);return qe({},e,l)},tge=pr(CK,{shouldForwardProp:n=>Vm(n)||n==="classes",name:"MuiCheckbox",slot:"Root",overridesResolver:(n,e)=>{const{ownerState:t}=n;return[e.root,t.indeterminate&&e.indeterminate,e[`size${gr(t.size)}`],t.color!=="default"&&e[`color${gr(t.color)}`]]}})(({theme:n,ownerState:e})=>qe({color:(n.vars||n).palette.text.secondary},!e.disableRipple&&{"&:hover":{backgroundColor:n.vars?`rgba(${e.color==="default"?n.vars.palette.action.activeChannel:n.vars.palette[e.color].mainChannel} / ${n.vars.palette.action.hoverOpacity})`:r0(e.color==="default"?n.palette.action.active:n.palette[e.color].main,n.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},e.color!=="default"&&{[`&.${qO.checked}, &.${qO.indeterminate}`]:{color:(n.vars||n).palette[e.color].main},[`&.${qO.disabled}`]:{color:(n.vars||n).palette.action.disabled}})),nge=De.jsx(Kme,{}),rge=De.jsx(Xme,{}),ige=De.jsx(Jme,{}),sge=pe.forwardRef(function(e,t){var r,s;const o=ua({props:e,name:"MuiCheckbox"}),{checkedIcon:l=nge,color:u="primary",icon:h=rge,indeterminate:f=!1,indeterminateIcon:g=ige,inputProps:y,size:b="medium",className:w}=o,C=Ar(o,Zme),M=f?g:h,A=f?g:l,k=qe({},o,{color:u,indeterminate:f,size:b}),L=ege(k);return De.jsx(tge,qe({type:"checkbox",inputProps:qe({"data-indeterminate":f},y),icon:pe.cloneElement(M,{fontSize:(r=M.props.fontSize)!=null?r:b}),checkedIcon:pe.cloneElement(A,{fontSize:(s=A.props.fontSize)!=null?s:b}),ownerState:k,ref:t,className:ai(L.root,w)},C,{classes:L}))}),oge=sge,age=vde({createStyledComponent:pr("div",{name:"MuiContainer",slot:"Root",overridesResolver:(n,e)=>{const{ownerState:t}=n;return[e.root,e[`maxWidth${gr(String(t.maxWidth))}`],t.fixed&&e.fixed,t.disableGutters&&e.disableGutters]}}),useThemeProps:n=>ua({props:n,name:"MuiContainer"})}),DH=age;function lge(n){return Po("MuiModal",n)}Xo("MuiModal",["root","hidden","backdrop"]);const uge=["BackdropComponent","BackdropProps","classes","className","closeAfterTransition","children","container","component","components","componentsProps","disableAutoFocus","disableEnforceFocus","disableEscapeKeyDown","disablePortal","disableRestoreFocus","disableScrollLock","hideBackdrop","keepMounted","onBackdropClick","onClose","onTransitionEnter","onTransitionExited","open","slotProps","slots","theme"],cge=n=>{const{open:e,exited:t,classes:r}=n;return Ko({root:["root",!e&&t&&"hidden"],backdrop:["backdrop"]},lge,r)},hge=pr("div",{name:"MuiModal",slot:"Root",overridesResolver:(n,e)=>{const{ownerState:t}=n;return[e.root,!t.open&&t.exited&&e.hidden]}})(({theme:n,ownerState:e})=>qe({position:"fixed",zIndex:(n.vars||n).zIndex.modal,right:0,bottom:0,top:0,left:0},!e.open&&e.exited&&{visibility:"hidden"})),dge=pr(OF,{name:"MuiModal",slot:"Backdrop",overridesResolver:(n,e)=>e.backdrop})({zIndex:-1}),fge=pe.forwardRef(function(e,t){var r,s,o,l,u,h;const f=ua({name:"MuiModal",props:e}),{BackdropComponent:g=dge,BackdropProps:y,className:b,closeAfterTransition:w=!1,children:C,container:M,component:A,components:k={},componentsProps:L={},disableAutoFocus:P=!1,disableEnforceFocus:D=!1,disableEscapeKeyDown:z=!1,disablePortal:U=!1,disableRestoreFocus:V=!1,disableScrollLock:H=!1,hideBackdrop:oe=!1,keepMounted:le=!1,onBackdropClick:Z,open:q,slotProps:he,slots:ae}=f,ue=Ar(f,uge),ge=qe({},f,{closeAfterTransition:w,disableAutoFocus:P,disableEnforceFocus:D,disableEscapeKeyDown:z,disablePortal:U,disableRestoreFocus:V,disableScrollLock:H,hideBackdrop:oe,keepMounted:le}),{getRootProps:we,getBackdropProps:J,getTransitionProps:re,portalRef:ie,isTopModal:fe,exited:Te,hasTransition:Fe}=Jpe(qe({},ge,{rootRef:t})),Ie=qe({},ge,{exited:Te}),Je=cge(Ie),Re={};if(C.props.tabIndex===void 0&&(Re.tabIndex="-1"),Fe){const{onEnter:He,onExited:rt}=re();Re.onEnter=He,Re.onExited=rt}const Qe=(r=(s=ae==null?void 0:ae.root)!=null?s:k.Root)!=null?r:hge,nt=(o=(l=ae==null?void 0:ae.backdrop)!=null?l:k.Backdrop)!=null?o:g,ft=(u=he==null?void 0:he.root)!=null?u:L.root,lt=(h=he==null?void 0:he.backdrop)!=null?h:L.backdrop,ze=Rw({elementType:Qe,externalSlotProps:ft,externalForwardedProps:ue,getSlotProps:we,additionalProps:{ref:t,as:A},ownerState:Ie,className:ai(b,ft==null?void 0:ft.className,Je==null?void 0:Je.root,!Ie.open&&Ie.exited&&(Je==null?void 0:Je.hidden))}),Ce=Rw({elementType:nt,externalSlotProps:lt,additionalProps:y,getSlotProps:He=>J(qe({},He,{onClick:rt=>{Z&&Z(rt),He!=null&&He.onClick&&He.onClick(rt)}})),className:ai(lt==null?void 0:lt.className,y==null?void 0:y.className,Je==null?void 0:Je.backdrop),ownerState:Ie});return!le&&!q&&(!Fe||Te)?null:De.jsx(Upe,{ref:ie,container:M,disablePortal:U,children:De.jsxs(Qe,qe({},ze,{children:[!oe&&g?De.jsx(nt,qe({},Ce)):null,De.jsx(Fpe,{disableEnforceFocus:D,disableAutoFocus:P,disableRestoreFocus:V,isEnabled:fe,open:q,children:pe.cloneElement(C,Re)})]}))})}),MK=fge;function pge(n){return Po("MuiDialog",n)}const mge=Xo("MuiDialog",["root","scrollPaper","scrollBody","container","paper","paperScrollPaper","paperScrollBody","paperWidthFalse","paperWidthXs","paperWidthSm","paperWidthMd","paperWidthLg","paperWidthXl","paperFullWidth","paperFullScreen"]),QO=mge,gge=pe.createContext({}),_ge=gge,vge=["aria-describedby","aria-labelledby","BackdropComponent","BackdropProps","children","className","disableEscapeKeyDown","fullScreen","fullWidth","maxWidth","onBackdropClick","onClose","open","PaperComponent","PaperProps","scroll","TransitionComponent","transitionDuration","TransitionProps"],yge=pr(OF,{name:"MuiDialog",slot:"Backdrop",overrides:(n,e)=>e.backdrop})({zIndex:-1}),bge=n=>{const{classes:e,scroll:t,maxWidth:r,fullWidth:s,fullScreen:o}=n,l={root:["root"],container:["container",`scroll${gr(t)}`],paper:["paper",`paperScroll${gr(t)}`,`paperWidth${gr(String(r))}`,s&&"paperFullWidth",o&&"paperFullScreen"]};return Ko(l,pge,e)},Tge=pr(MK,{name:"MuiDialog",slot:"Root",overridesResolver:(n,e)=>e.root})({"@media print":{position:"absolute !important"}}),Sge=pr("div",{name:"MuiDialog",slot:"Container",overridesResolver:(n,e)=>{const{ownerState:t}=n;return[e.container,e[`scroll${gr(t.scroll)}`]]}})(({ownerState:n})=>qe({height:"100%","@media print":{height:"auto"},outline:0},n.scroll==="paper"&&{display:"flex",justifyContent:"center",alignItems:"center"},n.scroll==="body"&&{overflowY:"auto",overflowX:"hidden",textAlign:"center","&::after":{content:'""',display:"inline-block",verticalAlign:"middle",height:"100%",width:"0"}})),wge=pr(AF,{name:"MuiDialog",slot:"Paper",overridesResolver:(n,e)=>{const{ownerState:t}=n;return[e.paper,e[`scrollPaper${gr(t.scroll)}`],e[`paperWidth${gr(String(t.maxWidth))}`],t.fullWidth&&e.paperFullWidth,t.fullScreen&&e.paperFullScreen]}})(({theme:n,ownerState:e})=>qe({margin:32,position:"relative",overflowY:"auto","@media print":{overflowY:"visible",boxShadow:"none"}},e.scroll==="paper"&&{display:"flex",flexDirection:"column",maxHeight:"calc(100% - 64px)"},e.scroll==="body"&&{display:"inline-block",verticalAlign:"middle",textAlign:"left"},!e.maxWidth&&{maxWidth:"calc(100% - 64px)"},e.maxWidth==="xs"&&{maxWidth:n.breakpoints.unit==="px"?Math.max(n.breakpoints.values.xs,444):`max(${n.breakpoints.values.xs}${n.breakpoints.unit}, 444px)`,[`&.${QO.paperScrollBody}`]:{[n.breakpoints.down(Math.max(n.breakpoints.values.xs,444)+32*2)]:{maxWidth:"calc(100% - 64px)"}}},e.maxWidth&&e.maxWidth!=="xs"&&{maxWidth:`${n.breakpoints.values[e.maxWidth]}${n.breakpoints.unit}`,[`&.${QO.paperScrollBody}`]:{[n.breakpoints.down(n.breakpoints.values[e.maxWidth]+32*2)]:{maxWidth:"calc(100% - 64px)"}}},e.fullWidth&&{width:"calc(100% - 64px)"},e.fullScreen&&{margin:0,width:"100%",maxWidth:"100%",height:"100%",maxHeight:"none",borderRadius:0,[`&.${QO.paperScrollBody}`]:{margin:0,maxWidth:"100%"}})),Ege=pe.forwardRef(function(e,t){const r=ua({props:e,name:"MuiDialog"}),s=jk(),o={enter:s.transitions.duration.enteringScreen,exit:s.transitions.duration.leavingScreen},{"aria-describedby":l,"aria-labelledby":u,BackdropComponent:h,BackdropProps:f,children:g,className:y,disableEscapeKeyDown:b=!1,fullScreen:w=!1,fullWidth:C=!1,maxWidth:M="sm",onBackdropClick:A,onClose:k,open:L,PaperComponent:P=AF,PaperProps:D={},scroll:z="paper",TransitionComponent:U=xK,transitionDuration:V=o,TransitionProps:H}=r,oe=Ar(r,vge),le=qe({},r,{disableEscapeKeyDown:b,fullScreen:w,fullWidth:C,maxWidth:M,scroll:z}),Z=bge(le),q=pe.useRef(),he=we=>{q.current=we.target===we.currentTarget},ae=we=>{q.current&&(q.current=null,A&&A(we),k&&k(we,"backdropClick"))},ue=Hk(u),ge=pe.useMemo(()=>({titleId:ue}),[ue]);return De.jsx(Tge,qe({className:ai(Z.root,y),closeAfterTransition:!0,components:{Backdrop:yge},componentsProps:{backdrop:qe({transitionDuration:V,as:h},f)},disableEscapeKeyDown:b,onClose:k,open:L,ref:t,onClick:ae,ownerState:le},oe,{children:De.jsx(U,qe({appear:!0,in:L,timeout:V,role:"presentation"},H,{children:De.jsx(Sge,{className:ai(Z.container),onMouseDown:he,ownerState:le,children:De.jsx(wge,qe({as:P,elevation:24,role:"dialog","aria-describedby":l,"aria-labelledby":ue},D,{className:ai(Z.paper,D.className),ownerState:le,children:De.jsx(_ge.Provider,{value:ge,children:g})}))})}))}))}),AK=Ege,xge=["disableUnderline","components","componentsProps","fullWidth","hiddenLabel","inputComponent","multiline","slotProps","slots","type"],$ge=n=>{const{classes:e,disableUnderline:t}=n,s=Ko({root:["root",!t&&"underline"],input:["input"]},pme,e);return qe({},e,s)},Cge=pr(Jk,{shouldForwardProp:n=>Vm(n)||n==="classes",name:"MuiFilledInput",slot:"Root",overridesResolver:(n,e)=>{const{ownerState:t}=n;return[...Xk(n,e),!t.disableUnderline&&e.underline]}})(({theme:n,ownerState:e})=>{var t;const r=n.palette.mode==="light",s=r?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",o=r?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",l=r?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",u=r?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return qe({position:"relative",backgroundColor:n.vars?n.vars.palette.FilledInput.bg:o,borderTopLeftRadius:(n.vars||n).shape.borderRadius,borderTopRightRadius:(n.vars||n).shape.borderRadius,transition:n.transitions.create("background-color",{duration:n.transitions.duration.shorter,easing:n.transitions.easing.easeOut}),"&:hover":{backgroundColor:n.vars?n.vars.palette.FilledInput.hoverBg:l,"@media (hover: none)":{backgroundColor:n.vars?n.vars.palette.FilledInput.bg:o}},[`&.${Hb.focused}`]:{backgroundColor:n.vars?n.vars.palette.FilledInput.bg:o},[`&.${Hb.disabled}`]:{backgroundColor:n.vars?n.vars.palette.FilledInput.disabledBg:u}},!e.disableUnderline&&{"&::after":{borderBottom:`2px solid ${(t=(n.vars||n).palette[e.color||"primary"])==null?void 0:t.main}`,left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:n.transitions.create("transform",{duration:n.transitions.duration.shorter,easing:n.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${Hb.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${Hb.error}`]:{"&::before, &::after":{borderBottomColor:(n.vars||n).palette.error.main}},"&::before":{borderBottom:`1px solid ${n.vars?`rgba(${n.vars.palette.common.onBackgroundChannel} / ${n.vars.opacity.inputUnderline})`:s}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:n.transitions.create("border-bottom-color",{duration:n.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${Hb.disabled}, .${Hb.error}):before`]:{borderBottom:`1px solid ${(n.vars||n).palette.text.primary}`},[`&.${Hb.disabled}:before`]:{borderBottomStyle:"dotted"}},e.startAdornment&&{paddingLeft:12},e.endAdornment&&{paddingRight:12},e.multiline&&qe({padding:"25px 12px 8px"},e.size==="small"&&{paddingTop:21,paddingBottom:4},e.hiddenLabel&&{paddingTop:16,paddingBottom:17},e.hiddenLabel&&e.size==="small"&&{paddingTop:8,paddingBottom:9}))}),Mge=pr(qk,{name:"MuiFilledInput",slot:"Input",overridesResolver:Kk})(({theme:n,ownerState:e})=>qe({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12},!n.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:n.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:n.palette.mode==="light"?null:"#fff",caretColor:n.palette.mode==="light"?null:"#fff",borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"}},n.vars&&{"&:-webkit-autofill":{borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"},[n.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},e.size==="small"&&{paddingTop:21,paddingBottom:4},e.hiddenLabel&&{paddingTop:16,paddingBottom:17},e.startAdornment&&{paddingLeft:0},e.endAdornment&&{paddingRight:0},e.hiddenLabel&&e.size==="small"&&{paddingTop:8,paddingBottom:9},e.multiline&&{paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0})),IK=pe.forwardRef(function(e,t){var r,s,o,l;const u=ua({props:e,name:"MuiFilledInput"}),{components:h={},componentsProps:f,fullWidth:g=!1,inputComponent:y="input",multiline:b=!1,slotProps:w,slots:C={},type:M="text"}=u,A=Ar(u,xge),k=qe({},u,{fullWidth:g,inputComponent:y,multiline:b,type:M}),L=$ge(u),P={root:{ownerState:k},input:{ownerState:k}},D=w??f?fp(P,w??f):P,z=(r=(s=C.root)!=null?s:h.Root)!=null?r:Cge,U=(o=(l=C.input)!=null?l:h.Input)!=null?o:Mge;return De.jsx(kF,qe({slots:{root:z,input:U},componentsProps:D,fullWidth:g,inputComponent:y,multiline:b,ref:t,type:M},A,{classes:L}))});IK.muiName="Input";const RK=IK;function Age(n){return Po("MuiFormControl",n)}Xo("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);const Ige=["children","className","color","component","disabled","error","focused","fullWidth","hiddenLabel","margin","required","size","variant"],Rge=n=>{const{classes:e,margin:t,fullWidth:r}=n,s={root:["root",t!=="none"&&`margin${gr(t)}`,r&&"fullWidth"]};return Ko(s,Age,e)},kge=pr("div",{name:"MuiFormControl",slot:"Root",overridesResolver:({ownerState:n},e)=>qe({},e.root,e[`margin${gr(n.margin)}`],n.fullWidth&&e.fullWidth)})(({ownerState:n})=>qe({display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top"},n.margin==="normal"&&{marginTop:16,marginBottom:8},n.margin==="dense"&&{marginTop:8,marginBottom:4},n.fullWidth&&{width:"100%"})),Oge=pe.forwardRef(function(e,t){const r=ua({props:e,name:"MuiFormControl"}),{children:s,className:o,color:l="primary",component:u="div",disabled:h=!1,error:f=!1,focused:g,fullWidth:y=!1,hiddenLabel:b=!1,margin:w="none",required:C=!1,size:M="medium",variant:A="outlined"}=r,k=Ar(r,Ige),L=qe({},r,{color:l,component:u,disabled:h,error:f,fullWidth:y,hiddenLabel:b,margin:w,required:C,size:M,variant:A}),P=Rge(L),[D,z]=pe.useState(()=>{let he=!1;return s&&pe.Children.forEach(s,ae=>{if(!hI(ae,["Input","Select"]))return;const ue=hI(ae,["Select"])?ae.props.input:ae;ue&&rme(ue.props)&&(he=!0)}),he}),[U,V]=pe.useState(()=>{let he=!1;return s&&pe.Children.forEach(s,ae=>{hI(ae,["Input","Select"])&&(fR(ae.props,!0)||fR(ae.props.inputProps,!0))&&(he=!0)}),he}),[H,oe]=pe.useState(!1);h&&H&&oe(!1);const le=g!==void 0&&!h?g:H;let Z;const q=pe.useMemo(()=>({adornedStart:D,setAdornedStart:z,color:l,disabled:h,error:f,filled:U,focused:le,fullWidth:y,hiddenLabel:b,size:M,onBlur:()=>{oe(!1)},onEmpty:()=>{V(!1)},onFilled:()=>{V(!0)},onFocus:()=>{oe(!0)},registerEffect:Z,required:C,variant:A}),[D,l,h,f,U,le,y,b,Z,C,M,A]);return De.jsx(RF.Provider,{value:q,children:De.jsx(kge,qe({as:u,ownerState:L,className:ai(P.root,o),ref:t},k,{children:s}))})}),Lge=Oge,Nge=$de({createStyledComponent:pr("div",{name:"MuiStack",slot:"Root",overridesResolver:(n,e)=>e.root}),useThemeProps:n=>ua({props:n,name:"MuiStack"})}),L$=Nge;function Dge(n){return Po("MuiFormControlLabel",n)}const Pge=Xo("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error","required","asterisk"]),Ix=Pge,Bge=["checked","className","componentsProps","control","disabled","disableTypography","inputRef","label","labelPlacement","name","onChange","required","slotProps","value"],Fge=n=>{const{classes:e,disabled:t,labelPlacement:r,error:s,required:o}=n,l={root:["root",t&&"disabled",`labelPlacement${gr(r)}`,s&&"error",o&&"required"],label:["label",t&&"disabled"],asterisk:["asterisk",s&&"error"]};return Ko(l,Dge,e)},zge=pr("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(n,e)=>{const{ownerState:t}=n;return[{[`& .${Ix.label}`]:e.label},e.root,e[`labelPlacement${gr(t.labelPlacement)}`]]}})(({theme:n,ownerState:e})=>qe({display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,[`&.${Ix.disabled}`]:{cursor:"default"}},e.labelPlacement==="start"&&{flexDirection:"row-reverse",marginLeft:16,marginRight:-11},e.labelPlacement==="top"&&{flexDirection:"column-reverse",marginLeft:16},e.labelPlacement==="bottom"&&{flexDirection:"column",marginLeft:16},{[`& .${Ix.label}`]:{[`&.${Ix.disabled}`]:{color:(n.vars||n).palette.text.disabled}}})),Uge=pr("span",{name:"MuiFormControlLabel",slot:"Asterisk",overridesResolver:(n,e)=>e.asterisk})(({theme:n})=>({[`&.${Ix.error}`]:{color:(n.vars||n).palette.error.main}})),Hge=pe.forwardRef(function(e,t){var r,s;const o=ua({props:e,name:"MuiFormControlLabel"}),{className:l,componentsProps:u={},control:h,disabled:f,disableTypography:g,label:y,labelPlacement:b="end",required:w,slotProps:C={}}=o,M=Ar(o,Bge),A=Av(),k=(r=f??h.props.disabled)!=null?r:A==null?void 0:A.disabled,L=w??h.props.required,P={disabled:k,required:L};["checked","name","onChange","value","inputRef"].forEach(oe=>{typeof h.props[oe]>"u"&&typeof o[oe]<"u"&&(P[oe]=o[oe])});const D=tb({props:o,muiFormControl:A,states:["error"]}),z=qe({},o,{disabled:k,labelPlacement:b,required:L,error:D.error}),U=Fge(z),V=(s=C.typography)!=null?s:u.typography;let H=y;return H!=null&&H.type!==f_&&!g&&(H=De.jsx(f_,qe({component:"span"},V,{className:ai(U.label,V==null?void 0:V.className),children:H}))),De.jsxs(zge,qe({className:ai(U.root,l),ownerState:z,ref:t},M,{children:[pe.cloneElement(h,P),L?De.jsxs(L$,{display:"block",children:[H,De.jsxs(Uge,{ownerState:z,"aria-hidden":!0,className:U.asterisk,children:[" ","*"]})]}):H]}))}),kK=Hge;function Gge(n){return Po("MuiFormGroup",n)}Xo("MuiFormGroup",["root","row","error"]);const Wge=["className","row"],Vge=n=>{const{classes:e,row:t,error:r}=n;return Ko({root:["root",t&&"row",r&&"error"]},Gge,e)},jge=pr("div",{name:"MuiFormGroup",slot:"Root",overridesResolver:(n,e)=>{const{ownerState:t}=n;return[e.root,t.row&&e.row]}})(({ownerState:n})=>qe({display:"flex",flexDirection:"column",flexWrap:"wrap"},n.row&&{flexDirection:"row"})),Yge=pe.forwardRef(function(e,t){const r=ua({props:e,name:"MuiFormGroup"}),{className:s,row:o=!1}=r,l=Ar(r,Wge),u=Av(),h=tb({props:r,muiFormControl:u,states:["error"]}),f=qe({},r,{row:o,error:h.error}),g=Vge(f);return De.jsx(jge,qe({className:ai(g.root,s),ownerState:f,ref:t},l))}),OK=Yge;function Xge(n){return Po("MuiFormHelperText",n)}const Kge=Xo("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]),PH=Kge;var BH;const Jge=["children","className","component","disabled","error","filled","focused","margin","required","variant"],qge=n=>{const{classes:e,contained:t,size:r,disabled:s,error:o,filled:l,focused:u,required:h}=n,f={root:["root",s&&"disabled",o&&"error",r&&`size${gr(r)}`,t&&"contained",u&&"focused",l&&"filled",h&&"required"]};return Ko(f,Xge,e)},Qge=pr("p",{name:"MuiFormHelperText",slot:"Root",overridesResolver:(n,e)=>{const{ownerState:t}=n;return[e.root,t.size&&e[`size${gr(t.size)}`],t.contained&&e.contained,t.filled&&e.filled]}})(({theme:n,ownerState:e})=>qe({color:(n.vars||n).palette.text.secondary},n.typography.caption,{textAlign:"left",marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${PH.disabled}`]:{color:(n.vars||n).palette.text.disabled},[`&.${PH.error}`]:{color:(n.vars||n).palette.error.main}},e.size==="small"&&{marginTop:4},e.contained&&{marginLeft:14,marginRight:14})),Zge=pe.forwardRef(function(e,t){const r=ua({props:e,name:"MuiFormHelperText"}),{children:s,className:o,component:l="p"}=r,u=Ar(r,Jge),h=Av(),f=tb({props:r,muiFormControl:h,states:["variant","size","disabled","error","filled","focused","required"]}),g=qe({},r,{component:l,contained:f.variant==="filled"||f.variant==="outlined",variant:f.variant,size:f.size,disabled:f.disabled,error:f.error,filled:f.filled,focused:f.focused,required:f.required}),y=qge(g);return De.jsx(Qge,qe({as:l,ownerState:g,className:ai(y.root,o),ref:t},u,{children:s===" "?BH||(BH=De.jsx("span",{className:"notranslate",children:"​"})):s}))}),e0e=Zge;function t0e(n){return Po("MuiFormLabel",n)}const n0e=Xo("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]),Qx=n0e,r0e=["children","className","color","component","disabled","error","filled","focused","required"],i0e=n=>{const{classes:e,color:t,focused:r,disabled:s,error:o,filled:l,required:u}=n,h={root:["root",`color${gr(t)}`,s&&"disabled",o&&"error",l&&"filled",r&&"focused",u&&"required"],asterisk:["asterisk",o&&"error"]};return Ko(h,t0e,e)},s0e=pr("label",{name:"MuiFormLabel",slot:"Root",overridesResolver:({ownerState:n},e)=>qe({},e.root,n.color==="secondary"&&e.colorSecondary,n.filled&&e.filled)})(({theme:n,ownerState:e})=>qe({color:(n.vars||n).palette.text.secondary},n.typography.body1,{lineHeight:"1.4375em",padding:0,position:"relative",[`&.${Qx.focused}`]:{color:(n.vars||n).palette[e.color].main},[`&.${Qx.disabled}`]:{color:(n.vars||n).palette.text.disabled},[`&.${Qx.error}`]:{color:(n.vars||n).palette.error.main}})),o0e=pr("span",{name:"MuiFormLabel",slot:"Asterisk",overridesResolver:(n,e)=>e.asterisk})(({theme:n})=>({[`&.${Qx.error}`]:{color:(n.vars||n).palette.error.main}})),a0e=pe.forwardRef(function(e,t){const r=ua({props:e,name:"MuiFormLabel"}),{children:s,className:o,component:l="label"}=r,u=Ar(r,r0e),h=Av(),f=tb({props:r,muiFormControl:h,states:["color","required","focused","disabled","error","filled"]}),g=qe({},r,{color:f.color||"primary",component:l,disabled:f.disabled,error:f.error,filled:f.filled,focused:f.focused,required:f.required}),y=i0e(g);return De.jsxs(s0e,qe({as:l,ownerState:g,className:ai(y.root,o),ref:t},u,{children:[s,f.required&&De.jsxs(o0e,{ownerState:g,"aria-hidden":!0,className:y.asterisk,children:[" ","*"]})]}))}),l0e=a0e,u0e=pe.createContext(),FH=u0e;function c0e(n){return Po("MuiGrid",n)}const h0e=[0,1,2,3,4,5,6,7,8,9,10],d0e=["column-reverse","column","row-reverse","row"],f0e=["nowrap","wrap-reverse","wrap"],nx=["auto",!0,1,2,3,4,5,6,7,8,9,10,11,12],N$=Xo("MuiGrid",["root","container","item","zeroMinWidth",...h0e.map(n=>`spacing-xs-${n}`),...d0e.map(n=>`direction-xs-${n}`),...f0e.map(n=>`wrap-xs-${n}`),...nx.map(n=>`grid-xs-${n}`),...nx.map(n=>`grid-sm-${n}`),...nx.map(n=>`grid-md-${n}`),...nx.map(n=>`grid-lg-${n}`),...nx.map(n=>`grid-xl-${n}`)]),p0e=["className","columns","columnSpacing","component","container","direction","item","rowSpacing","spacing","wrap","zeroMinWidth"];function gw(n){const e=parseFloat(n);return`${e}${String(n).replace(String(e),"")||"px"}`}function m0e({theme:n,ownerState:e}){let t;return n.breakpoints.keys.reduce((r,s)=>{let o={};if(e[s]&&(t=e[s]),!t)return r;if(t===!0)o={flexBasis:0,flexGrow:1,maxWidth:"100%"};else if(t==="auto")o={flexBasis:"auto",flexGrow:0,flexShrink:0,maxWidth:"none",width:"auto"};else{const l=O1({values:e.columns,breakpoints:n.breakpoints.values}),u=typeof l=="object"?l[s]:l;if(u==null)return r;const h=`${Math.round(t/u*1e8)/1e6}%`;let f={};if(e.container&&e.item&&e.columnSpacing!==0){const g=n.spacing(e.columnSpacing);if(g!=="0px"){const y=`calc(${h} + ${gw(g)})`;f={flexBasis:y,maxWidth:y}}}o=qe({flexBasis:h,flexGrow:0,maxWidth:h},f)}return n.breakpoints.values[s]===0?Object.assign(r,o):r[n.breakpoints.up(s)]=o,r},{})}function g0e({theme:n,ownerState:e}){const t=O1({values:e.direction,breakpoints:n.breakpoints.values});return Zp({theme:n},t,r=>{const s={flexDirection:r};return r.indexOf("column")===0&&(s[`& > .${N$.item}`]={maxWidth:"none"}),s})}function LK({breakpoints:n,values:e}){let t="";Object.keys(e).forEach(s=>{t===""&&e[s]!==0&&(t=s)});const r=Object.keys(n).sort((s,o)=>n[s]-n[o]);return r.slice(0,r.indexOf(t))}function _0e({theme:n,ownerState:e}){const{container:t,rowSpacing:r}=e;let s={};if(t&&r!==0){const o=O1({values:r,breakpoints:n.breakpoints.values});let l;typeof o=="object"&&(l=LK({breakpoints:n.breakpoints.values,values:o})),s=Zp({theme:n},o,(u,h)=>{var f;const g=n.spacing(u);return g!=="0px"?{marginTop:`-${gw(g)}`,[`& > .${N$.item}`]:{paddingTop:gw(g)}}:(f=l)!=null&&f.includes(h)?{}:{marginTop:0,[`& > .${N$.item}`]:{paddingTop:0}}})}return s}function v0e({theme:n,ownerState:e}){const{container:t,columnSpacing:r}=e;let s={};if(t&&r!==0){const o=O1({values:r,breakpoints:n.breakpoints.values});let l;typeof o=="object"&&(l=LK({breakpoints:n.breakpoints.values,values:o})),s=Zp({theme:n},o,(u,h)=>{var f;const g=n.spacing(u);return g!=="0px"?{width:`calc(100% + ${gw(g)})`,marginLeft:`-${gw(g)}`,[`& > .${N$.item}`]:{paddingLeft:gw(g)}}:(f=l)!=null&&f.includes(h)?{}:{width:"100%",marginLeft:0,[`& > .${N$.item}`]:{paddingLeft:0}}})}return s}function y0e(n,e,t={}){if(!n||n<=0)return[];if(typeof n=="string"&&!Number.isNaN(Number(n))||typeof n=="number")return[t[`spacing-xs-${String(n)}`]];const r=[];return e.forEach(s=>{const o=n[s];Number(o)>0&&r.push(t[`spacing-${s}-${String(o)}`])}),r}const b0e=pr("div",{name:"MuiGrid",slot:"Root",overridesResolver:(n,e)=>{const{ownerState:t}=n,{container:r,direction:s,item:o,spacing:l,wrap:u,zeroMinWidth:h,breakpoints:f}=t;let g=[];r&&(g=y0e(l,f,e));const y=[];return f.forEach(b=>{const w=t[b];w&&y.push(e[`grid-${b}-${String(w)}`])}),[e.root,r&&e.container,o&&e.item,h&&e.zeroMinWidth,...g,s!=="row"&&e[`direction-xs-${String(s)}`],u!=="wrap"&&e[`wrap-xs-${String(u)}`],...y]}})(({ownerState:n})=>qe({boxSizing:"border-box"},n.container&&{display:"flex",flexWrap:"wrap",width:"100%"},n.item&&{margin:0},n.zeroMinWidth&&{minWidth:0},n.wrap!=="wrap"&&{flexWrap:n.wrap}),g0e,_0e,v0e,m0e);function T0e(n,e){if(!n||n<=0)return[];if(typeof n=="string"&&!Number.isNaN(Number(n))||typeof n=="number")return[`spacing-xs-${String(n)}`];const t=[];return e.forEach(r=>{const s=n[r];if(Number(s)>0){const o=`spacing-${r}-${String(s)}`;t.push(o)}}),t}const S0e=n=>{const{classes:e,container:t,direction:r,item:s,spacing:o,wrap:l,zeroMinWidth:u,breakpoints:h}=n;let f=[];t&&(f=T0e(o,h));const g=[];h.forEach(b=>{const w=n[b];w&&g.push(`grid-${b}-${String(w)}`)});const y={root:["root",t&&"container",s&&"item",u&&"zeroMinWidth",...f,r!=="row"&&`direction-xs-${String(r)}`,l!=="wrap"&&`wrap-xs-${String(l)}`,...g]};return Ko(y,c0e,e)},w0e=pe.forwardRef(function(e,t){const r=ua({props:e,name:"MuiGrid"}),{breakpoints:s}=jk(),o=xC(r),{className:l,columns:u,columnSpacing:h,component:f="div",container:g=!1,direction:y="row",item:b=!1,rowSpacing:w,spacing:C=0,wrap:M="wrap",zeroMinWidth:A=!1}=o,k=Ar(o,p0e),L=w||C,P=h||C,D=pe.useContext(FH),z=g?u||12:D,U={},V=qe({},k);s.keys.forEach(le=>{k[le]!=null&&(U[le]=k[le],delete V[le])});const H=qe({},o,{columns:z,container:g,direction:y,item:b,rowSpacing:L,columnSpacing:P,wrap:M,zeroMinWidth:A,spacing:C},U,{breakpoints:s.keys}),oe=S0e(H);return De.jsx(FH.Provider,{value:z,children:De.jsx(b0e,qe({ownerState:H,className:ai(oe.root,l),as:f,ref:t},V))})}),oc=w0e,E0e=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function jD(n){return`scale(${n}, ${n**2})`}const x0e={entering:{opacity:1,transform:jD(1)},entered:{opacity:1,transform:"none"}},ZO=typeof navigator<"u"&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),NK=pe.forwardRef(function(e,t){const{addEndListener:r,appear:s=!0,children:o,easing:l,in:u,onEnter:h,onEntered:f,onEntering:g,onExit:y,onExited:b,onExiting:w,style:C,timeout:M="auto",TransitionComponent:A=SK}=e,k=Ar(e,E0e),L=aK(),P=pe.useRef(),D=jk(),z=pe.useRef(null),U=gp(z,o.ref,t),V=ue=>ge=>{if(ue){const we=z.current;ge===void 0?ue(we):ue(we,ge)}},H=V(g),oe=V((ue,ge)=>{wK(ue);const{duration:we,delay:J,easing:re}=hR({style:C,timeout:M,easing:l},{mode:"enter"});let ie;M==="auto"?(ie=D.transitions.getAutoHeightDuration(ue.clientHeight),P.current=ie):ie=we,ue.style.transition=[D.transitions.create("opacity",{duration:ie,delay:J}),D.transitions.create("transform",{duration:ZO?ie:ie*.666,delay:J,easing:re})].join(","),h&&h(ue,ge)}),le=V(f),Z=V(w),q=V(ue=>{const{duration:ge,delay:we,easing:J}=hR({style:C,timeout:M,easing:l},{mode:"exit"});let re;M==="auto"?(re=D.transitions.getAutoHeightDuration(ue.clientHeight),P.current=re):re=ge,ue.style.transition=[D.transitions.create("opacity",{duration:re,delay:we}),D.transitions.create("transform",{duration:ZO?re:re*.666,delay:ZO?we:we||re*.333,easing:J})].join(","),ue.style.opacity=0,ue.style.transform=jD(.75),y&&y(ue)}),he=V(b),ae=ue=>{M==="auto"&&L.start(P.current||0,ue),r&&r(z.current,ue)};return De.jsx(A,qe({appear:s,in:u,nodeRef:z,onEnter:oe,onEntered:le,onEntering:H,onExit:q,onExited:he,onExiting:Z,addEndListener:ae,timeout:M==="auto"?null:M},k,{children:(ue,ge)=>pe.cloneElement(o,qe({style:qe({opacity:0,transform:jD(.75),visibility:ue==="exited"&&!u?"hidden":void 0},x0e[ue],C,o.props.style),ref:U},ge))}))});NK.muiSupportAuto=!0;const $0e=NK,C0e=["disableUnderline","components","componentsProps","fullWidth","inputComponent","multiline","slotProps","slots","type"],M0e=n=>{const{classes:e,disableUnderline:t}=n,s=Ko({root:["root",!t&&"underline"],input:["input"]},cme,e);return qe({},e,s)},A0e=pr(Jk,{shouldForwardProp:n=>Vm(n)||n==="classes",name:"MuiInput",slot:"Root",overridesResolver:(n,e)=>{const{ownerState:t}=n;return[...Xk(n,e),!t.disableUnderline&&e.underline]}})(({theme:n,ownerState:e})=>{let r=n.palette.mode==="light"?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return n.vars&&(r=`rgba(${n.vars.palette.common.onBackgroundChannel} / ${n.vars.opacity.inputUnderline})`),qe({position:"relative"},e.formControl&&{"label + &":{marginTop:16}},!e.disableUnderline&&{"&::after":{borderBottom:`2px solid ${(n.vars||n).palette[e.color].main}`,left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:n.transitions.create("transform",{duration:n.transitions.duration.shorter,easing:n.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${tx.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${tx.error}`]:{"&::before, &::after":{borderBottomColor:(n.vars||n).palette.error.main}},"&::before":{borderBottom:`1px solid ${r}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:n.transitions.create("border-bottom-color",{duration:n.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${tx.disabled}, .${tx.error}):before`]:{borderBottom:`2px solid ${(n.vars||n).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${r}`}},[`&.${tx.disabled}:before`]:{borderBottomStyle:"dotted"}})}),I0e=pr(qk,{name:"MuiInput",slot:"Input",overridesResolver:Kk})({}),DK=pe.forwardRef(function(e,t){var r,s,o,l;const u=ua({props:e,name:"MuiInput"}),{disableUnderline:h,components:f={},componentsProps:g,fullWidth:y=!1,inputComponent:b="input",multiline:w=!1,slotProps:C,slots:M={},type:A="text"}=u,k=Ar(u,C0e),L=M0e(u),D={root:{ownerState:{disableUnderline:h}}},z=C??g?fp(C??g,D):D,U=(r=(s=M.root)!=null?s:f.Root)!=null?r:A0e,V=(o=(l=M.input)!=null?l:f.Input)!=null?o:I0e;return De.jsx(kF,qe({slots:{root:U,input:V},slotProps:z,fullWidth:y,inputComponent:b,multiline:w,ref:t,type:A},k,{classes:L}))});DK.muiName="Input";const LF=DK;function R0e(n){return Po("MuiInputLabel",n)}Xo("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);const k0e=["disableAnimation","margin","shrink","variant","className"],O0e=n=>{const{classes:e,formControl:t,size:r,shrink:s,disableAnimation:o,variant:l,required:u}=n,h={root:["root",t&&"formControl",!o&&"animated",s&&"shrink",r&&r!=="normal"&&`size${gr(r)}`,l],asterisk:[u&&"asterisk"]},f=Ko(h,R0e,e);return qe({},e,f)},L0e=pr(l0e,{shouldForwardProp:n=>Vm(n)||n==="classes",name:"MuiInputLabel",slot:"Root",overridesResolver:(n,e)=>{const{ownerState:t}=n;return[{[`& .${Qx.asterisk}`]:e.asterisk},e.root,t.formControl&&e.formControl,t.size==="small"&&e.sizeSmall,t.shrink&&e.shrink,!t.disableAnimation&&e.animated,t.focused&&e.focused,e[t.variant]]}})(({theme:n,ownerState:e})=>qe({display:"block",transformOrigin:"top left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"},e.formControl&&{position:"absolute",left:0,top:0,transform:"translate(0, 20px) scale(1)"},e.size==="small"&&{transform:"translate(0, 17px) scale(1)"},e.shrink&&{transform:"translate(0, -1.5px) scale(0.75)",transformOrigin:"top left",maxWidth:"133%"},!e.disableAnimation&&{transition:n.transitions.create(["color","transform","max-width"],{duration:n.transitions.duration.shorter,easing:n.transitions.easing.easeOut})},e.variant==="filled"&&qe({zIndex:1,pointerEvents:"none",transform:"translate(12px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},e.size==="small"&&{transform:"translate(12px, 13px) scale(1)"},e.shrink&&qe({userSelect:"none",pointerEvents:"auto",transform:"translate(12px, 7px) scale(0.75)",maxWidth:"calc(133% - 24px)"},e.size==="small"&&{transform:"translate(12px, 4px) scale(0.75)"})),e.variant==="outlined"&&qe({zIndex:1,pointerEvents:"none",transform:"translate(14px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},e.size==="small"&&{transform:"translate(14px, 9px) scale(1)"},e.shrink&&{userSelect:"none",pointerEvents:"auto",maxWidth:"calc(133% - 32px)",transform:"translate(14px, -9px) scale(0.75)"}))),N0e=pe.forwardRef(function(e,t){const r=ua({name:"MuiInputLabel",props:e}),{disableAnimation:s=!1,shrink:o,className:l}=r,u=Ar(r,k0e),h=Av();let f=o;typeof f>"u"&&h&&(f=h.filled||h.focused||h.adornedStart);const g=tb({props:r,muiFormControl:h,states:["size","variant","required","focused"]}),y=qe({},r,{disableAnimation:s,formControl:h,shrink:f,size:g.size,variant:g.variant,required:g.required,focused:g.focused}),b=O0e(y);return De.jsx(L0e,qe({"data-shrink":f,ownerState:y,ref:t,className:ai(b.root,l)},u,{classes:b}))}),D0e=N0e,P0e=pe.createContext({}),B0e=P0e;function F0e(n){return Po("MuiList",n)}Xo("MuiList",["root","padding","dense","subheader"]);const z0e=["children","className","component","dense","disablePadding","subheader"],U0e=n=>{const{classes:e,disablePadding:t,dense:r,subheader:s}=n;return Ko({root:["root",!t&&"padding",r&&"dense",s&&"subheader"]},F0e,e)},H0e=pr("ul",{name:"MuiList",slot:"Root",overridesResolver:(n,e)=>{const{ownerState:t}=n;return[e.root,!t.disablePadding&&e.padding,t.dense&&e.dense,t.subheader&&e.subheader]}})(({ownerState:n})=>qe({listStyle:"none",margin:0,padding:0,position:"relative"},!n.disablePadding&&{paddingTop:8,paddingBottom:8},n.subheader&&{paddingTop:0})),G0e=pe.forwardRef(function(e,t){const r=ua({props:e,name:"MuiList"}),{children:s,className:o,component:l="ul",dense:u=!1,disablePadding:h=!1,subheader:f}=r,g=Ar(r,z0e),y=pe.useMemo(()=>({dense:u}),[u]),b=qe({},r,{component:l,dense:u,disablePadding:h}),w=U0e(b);return De.jsx(B0e.Provider,{value:y,children:De.jsxs(H0e,qe({as:l,className:ai(w.root,o),ref:t,ownerState:b},g,{children:[f,s]}))})}),W0e=G0e,V0e=["actions","autoFocus","autoFocusItem","children","className","disabledItemsFocusable","disableListWrap","onKeyDown","variant"];function eL(n,e,t){return n===e?n.firstChild:e&&e.nextElementSibling?e.nextElementSibling:t?null:n.firstChild}function zH(n,e,t){return n===e?t?n.firstChild:n.lastChild:e&&e.previousElementSibling?e.previousElementSibling:t?null:n.lastChild}function PK(n,e){if(e===void 0)return!0;let t=n.innerText;return t===void 0&&(t=n.textContent),t=t.trim().toLowerCase(),t.length===0?!1:e.repeating?t[0]===e.keys[0]:t.indexOf(e.keys.join(""))===0}function rx(n,e,t,r,s,o){let l=!1,u=s(n,e,e?t:!1);for(;u;){if(u===n.firstChild){if(l)return!1;l=!0}const h=r?!1:u.disabled||u.getAttribute("aria-disabled")==="true";if(!u.hasAttribute("tabindex")||!PK(u,o)||h)u=s(n,u,t);else return u.focus(),!0}return!1}const j0e=pe.forwardRef(function(e,t){const{actions:r,autoFocus:s=!1,autoFocusItem:o=!1,children:l,className:u,disabledItemsFocusable:h=!1,disableListWrap:f=!1,onKeyDown:g,variant:y="selectedMenu"}=e,b=Ar(e,V0e),w=pe.useRef(null),C=pe.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});Uy(()=>{s&&w.current.focus()},[s]),pe.useImperativeHandle(r,()=>({adjustStyleForScrollbar:(P,{direction:D})=>{const z=!w.current.style.width;if(P.clientHeight{const D=w.current,z=P.key,U=Jp(D).activeElement;if(z==="ArrowDown")P.preventDefault(),rx(D,U,f,h,eL);else if(z==="ArrowUp")P.preventDefault(),rx(D,U,f,h,zH);else if(z==="Home")P.preventDefault(),rx(D,null,f,h,eL);else if(z==="End")P.preventDefault(),rx(D,null,f,h,zH);else if(z.length===1){const V=C.current,H=z.toLowerCase(),oe=performance.now();V.keys.length>0&&(oe-V.lastTime>500?(V.keys=[],V.repeating=!0,V.previousKeyMatched=!0):V.repeating&&H!==V.keys[0]&&(V.repeating=!1)),V.lastTime=oe,V.keys.push(H);const le=U&&!V.repeating&&PK(U,V);V.previousKeyMatched&&(le||rx(D,U,!1,h,eL,V))?P.preventDefault():V.previousKeyMatched=!1}g&&g(P)},A=gp(w,t);let k=-1;pe.Children.forEach(l,(P,D)=>{if(!pe.isValidElement(P)){k===D&&(k+=1,k>=l.length&&(k=-1));return}P.props.disabled||(y==="selectedMenu"&&P.props.selected||k===-1)&&(k=D),k===D&&(P.props.disabled||P.props.muiSkipListHighlight||P.type.muiSkipListHighlight)&&(k+=1,k>=l.length&&(k=-1))});const L=pe.Children.map(l,(P,D)=>{if(D===k){const z={};return o&&(z.autoFocus=!0),P.props.tabIndex===void 0&&y==="selectedMenu"&&(z.tabIndex=0),pe.cloneElement(P,z)}return P});return De.jsx(W0e,qe({role:"menu",ref:A,className:u,onKeyDown:M,tabIndex:s?0:-1},b,{children:L}))}),Y0e=j0e;function X0e(n){return Po("MuiPopover",n)}Xo("MuiPopover",["root","paper"]);const K0e=["onEntering"],J0e=["action","anchorEl","anchorOrigin","anchorPosition","anchorReference","children","className","container","elevation","marginThreshold","open","PaperProps","slots","slotProps","transformOrigin","TransitionComponent","transitionDuration","TransitionProps","disableScrollLock"],q0e=["slotProps"];function UH(n,e){let t=0;return typeof e=="number"?t=e:e==="center"?t=n.height/2:e==="bottom"&&(t=n.height),t}function HH(n,e){let t=0;return typeof e=="number"?t=e:e==="center"?t=n.width/2:e==="right"&&(t=n.width),t}function GH(n){return[n.horizontal,n.vertical].map(e=>typeof e=="number"?`${e}px`:e).join(" ")}function tL(n){return typeof n=="function"?n():n}const Q0e=n=>{const{classes:e}=n;return Ko({root:["root"],paper:["paper"]},X0e,e)},Z0e=pr(MK,{name:"MuiPopover",slot:"Root",overridesResolver:(n,e)=>e.root})({}),BK=pr(AF,{name:"MuiPopover",slot:"Paper",overridesResolver:(n,e)=>e.paper})({position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}),e_e=pe.forwardRef(function(e,t){var r,s,o;const l=ua({props:e,name:"MuiPopover"}),{action:u,anchorEl:h,anchorOrigin:f={vertical:"top",horizontal:"left"},anchorPosition:g,anchorReference:y="anchorEl",children:b,className:w,container:C,elevation:M=8,marginThreshold:A=16,open:k,PaperProps:L={},slots:P,slotProps:D,transformOrigin:z={vertical:"top",horizontal:"left"},TransitionComponent:U=$0e,transitionDuration:V="auto",TransitionProps:{onEntering:H}={},disableScrollLock:oe=!1}=l,le=Ar(l.TransitionProps,K0e),Z=Ar(l,J0e),q=(r=D==null?void 0:D.paper)!=null?r:L,he=pe.useRef(),ae=gp(he,q.ref),ue=qe({},l,{anchorOrigin:f,anchorReference:y,elevation:M,marginThreshold:A,externalPaperSlotProps:q,transformOrigin:z,TransitionComponent:U,transitionDuration:V,TransitionProps:le}),ge=Q0e(ue),we=pe.useCallback(()=>{if(y==="anchorPosition")return g;const He=tL(h),it=(He&&He.nodeType===1?He:Jp(he.current).body).getBoundingClientRect();return{top:it.top+UH(it,f.vertical),left:it.left+HH(it,f.horizontal)}},[h,f.horizontal,f.vertical,g,y]),J=pe.useCallback(He=>({vertical:UH(He,z.vertical),horizontal:HH(He,z.horizontal)}),[z.horizontal,z.vertical]),re=pe.useCallback(He=>{const rt={width:He.offsetWidth,height:He.offsetHeight},it=J(rt);if(y==="none")return{top:null,left:null,transformOrigin:GH(it)};const Nt=we();let kt=Nt.top-it.vertical,vt=Nt.left-it.horizontal;const Mt=kt+rt.height,At=vt+rt.width,mt=Hy(tL(h)),xe=mt.innerHeight-A,se=mt.innerWidth-A;if(A!==null&&ktxe){const $e=Mt-xe;kt-=$e,it.vertical+=$e}if(A!==null&&vtse){const $e=At-se;vt-=$e,it.horizontal+=$e}return{top:`${Math.round(kt)}px`,left:`${Math.round(vt)}px`,transformOrigin:GH(it)}},[h,y,we,J,A]),[ie,fe]=pe.useState(k),Te=pe.useCallback(()=>{const He=he.current;if(!He)return;const rt=re(He);rt.top!==null&&(He.style.top=rt.top),rt.left!==null&&(He.style.left=rt.left),He.style.transformOrigin=rt.transformOrigin,fe(!0)},[re]);pe.useEffect(()=>(oe&&window.addEventListener("scroll",Te),()=>window.removeEventListener("scroll",Te)),[h,oe,Te]);const Fe=(He,rt)=>{H&&H(He,rt),Te()},Ie=()=>{fe(!1)};pe.useEffect(()=>{k&&Te()}),pe.useImperativeHandle(u,()=>k?{updatePosition:()=>{Te()}}:null,[k,Te]),pe.useEffect(()=>{if(!k)return;const He=SF(()=>{Te()}),rt=Hy(h);return rt.addEventListener("resize",He),()=>{He.clear(),rt.removeEventListener("resize",He)}},[h,k,Te]);let Je=V;V==="auto"&&!U.muiSupportAuto&&(Je=void 0);const Re=C||(h?Jp(tL(h)).body:void 0),Qe=(s=P==null?void 0:P.root)!=null?s:Z0e,nt=(o=P==null?void 0:P.paper)!=null?o:BK,ft=Rw({elementType:nt,externalSlotProps:qe({},q,{style:ie?q.style:qe({},q.style,{opacity:0})}),additionalProps:{elevation:M,ref:ae},ownerState:ue,className:ai(ge.paper,q==null?void 0:q.className)}),lt=Rw({elementType:Qe,externalSlotProps:(D==null?void 0:D.root)||{},externalForwardedProps:Z,additionalProps:{ref:t,slotProps:{backdrop:{invisible:!0}},container:Re,open:k},ownerState:ue,className:ai(ge.root,w)}),{slotProps:ze}=lt,Ce=Ar(lt,q0e);return De.jsx(Qe,qe({},Ce,!dR(Qe)&&{slotProps:ze,disableScrollLock:oe},{children:De.jsx(U,qe({appear:!0,in:k,onEntering:Fe,onExited:Ie,timeout:Je},le,{children:De.jsx(nt,qe({},ft,{children:b}))}))}))}),t_e=e_e;function n_e(n){return Po("MuiMenu",n)}Xo("MuiMenu",["root","paper","list"]);const r_e=["onEntering"],i_e=["autoFocus","children","className","disableAutoFocusItem","MenuListProps","onClose","open","PaperProps","PopoverClasses","transitionDuration","TransitionProps","variant","slots","slotProps"],s_e={vertical:"top",horizontal:"right"},o_e={vertical:"top",horizontal:"left"},a_e=n=>{const{classes:e}=n;return Ko({root:["root"],paper:["paper"],list:["list"]},n_e,e)},l_e=pr(t_e,{shouldForwardProp:n=>Vm(n)||n==="classes",name:"MuiMenu",slot:"Root",overridesResolver:(n,e)=>e.root})({}),u_e=pr(BK,{name:"MuiMenu",slot:"Paper",overridesResolver:(n,e)=>e.paper})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),c_e=pr(Y0e,{name:"MuiMenu",slot:"List",overridesResolver:(n,e)=>e.list})({outline:0}),h_e=pe.forwardRef(function(e,t){var r,s;const o=ua({props:e,name:"MuiMenu"}),{autoFocus:l=!0,children:u,className:h,disableAutoFocusItem:f=!1,MenuListProps:g={},onClose:y,open:b,PaperProps:w={},PopoverClasses:C,transitionDuration:M="auto",TransitionProps:{onEntering:A}={},variant:k="selectedMenu",slots:L={},slotProps:P={}}=o,D=Ar(o.TransitionProps,r_e),z=Ar(o,i_e),U=cde(),V=qe({},o,{autoFocus:l,disableAutoFocusItem:f,MenuListProps:g,onEntering:A,PaperProps:w,transitionDuration:M,TransitionProps:D,variant:k}),H=a_e(V),oe=l&&!f&&b,le=pe.useRef(null),Z=(J,re)=>{le.current&&le.current.adjustStyleForScrollbar(J,{direction:U?"rtl":"ltr"}),A&&A(J,re)},q=J=>{J.key==="Tab"&&(J.preventDefault(),y&&y(J,"tabKeyDown"))};let he=-1;pe.Children.map(u,(J,re)=>{pe.isValidElement(J)&&(J.props.disabled||(k==="selectedMenu"&&J.props.selected||he===-1)&&(he=re))});const ae=(r=L.paper)!=null?r:u_e,ue=(s=P.paper)!=null?s:w,ge=Rw({elementType:L.root,externalSlotProps:P.root,ownerState:V,className:[H.root,h]}),we=Rw({elementType:ae,externalSlotProps:ue,ownerState:V,className:H.paper});return De.jsx(l_e,qe({onClose:y,anchorOrigin:{vertical:"bottom",horizontal:U?"right":"left"},transformOrigin:U?s_e:o_e,slots:{paper:ae,root:L.root},slotProps:{root:ge,paper:we},open:b,ref:t,transitionDuration:M,TransitionProps:qe({onEntering:Z},D),ownerState:V},z,{classes:C,children:De.jsx(c_e,qe({onKeyDown:q,actions:le,autoFocus:l&&(he===-1||f),autoFocusItem:oe,variant:k},g,{className:ai(H.list,g.className),children:u}))}))}),d_e=h_e;function f_e(n){return Po("MuiNativeSelect",n)}const p_e=Xo("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),NF=p_e,m_e=["className","disabled","error","IconComponent","inputRef","variant"],g_e=n=>{const{classes:e,variant:t,disabled:r,multiple:s,open:o,error:l}=n,u={select:["select",t,r&&"disabled",s&&"multiple",l&&"error"],icon:["icon",`icon${gr(t)}`,o&&"iconOpen",r&&"disabled"]};return Ko(u,f_e,e)},FK=({ownerState:n,theme:e})=>qe({MozAppearance:"none",WebkitAppearance:"none",userSelect:"none",borderRadius:0,cursor:"pointer","&:focus":qe({},e.vars?{backgroundColor:`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.05)`}:{backgroundColor:e.palette.mode==="light"?"rgba(0, 0, 0, 0.05)":"rgba(255, 255, 255, 0.05)"},{borderRadius:0}),"&::-ms-expand":{display:"none"},[`&.${NF.disabled}`]:{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:(e.vars||e).palette.background.paper},"&&&":{paddingRight:24,minWidth:16}},n.variant==="filled"&&{"&&&":{paddingRight:32}},n.variant==="outlined"&&{borderRadius:(e.vars||e).shape.borderRadius,"&:focus":{borderRadius:(e.vars||e).shape.borderRadius},"&&&":{paddingRight:32}}),__e=pr("select",{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:Vm,overridesResolver:(n,e)=>{const{ownerState:t}=n;return[e.select,e[t.variant],t.error&&e.error,{[`&.${NF.multiple}`]:e.multiple}]}})(FK),zK=({ownerState:n,theme:e})=>qe({position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(e.vars||e).palette.action.active,[`&.${NF.disabled}`]:{color:(e.vars||e).palette.action.disabled}},n.open&&{transform:"rotate(180deg)"},n.variant==="filled"&&{right:7},n.variant==="outlined"&&{right:7}),v_e=pr("svg",{name:"MuiNativeSelect",slot:"Icon",overridesResolver:(n,e)=>{const{ownerState:t}=n;return[e.icon,t.variant&&e[`icon${gr(t.variant)}`],t.open&&e.iconOpen]}})(zK),y_e=pe.forwardRef(function(e,t){const{className:r,disabled:s,error:o,IconComponent:l,inputRef:u,variant:h="standard"}=e,f=Ar(e,m_e),g=qe({},e,{disabled:s,variant:h,error:o}),y=g_e(g);return De.jsxs(pe.Fragment,{children:[De.jsx(__e,qe({ownerState:g,className:ai(y.select,r),disabled:s,ref:u||t},f)),e.multiple?null:De.jsx(v_e,{as:l,ownerState:g,className:y.icon})]})}),b_e=y_e;var WH;const T_e=["children","classes","className","label","notched"],S_e=pr("fieldset",{shouldForwardProp:Vm})({textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%"}),w_e=pr("legend",{shouldForwardProp:Vm})(({ownerState:n,theme:e})=>qe({float:"unset",width:"auto",overflow:"hidden"},!n.withLabel&&{padding:0,lineHeight:"11px",transition:e.transitions.create("width",{duration:150,easing:e.transitions.easing.easeOut})},n.withLabel&&qe({display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:e.transitions.create("max-width",{duration:50,easing:e.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}},n.notched&&{maxWidth:"100%",transition:e.transitions.create("max-width",{duration:100,easing:e.transitions.easing.easeOut,delay:50})})));function E_e(n){const{className:e,label:t,notched:r}=n,s=Ar(n,T_e),o=t!=null&&t!=="",l=qe({},n,{notched:r,withLabel:o});return De.jsx(S_e,qe({"aria-hidden":!0,className:e,ownerState:l},s,{children:De.jsx(w_e,{ownerState:l,children:o?De.jsx("span",{children:t}):WH||(WH=De.jsx("span",{className:"notranslate",children:"​"}))})}))}const x_e=["components","fullWidth","inputComponent","label","multiline","notched","slots","type"],$_e=n=>{const{classes:e}=n,r=Ko({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},dme,e);return qe({},e,r)},C_e=pr(Jk,{shouldForwardProp:n=>Vm(n)||n==="classes",name:"MuiOutlinedInput",slot:"Root",overridesResolver:Xk})(({theme:n,ownerState:e})=>{const t=n.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return qe({position:"relative",borderRadius:(n.vars||n).shape.borderRadius,[`&:hover .${ny.notchedOutline}`]:{borderColor:(n.vars||n).palette.text.primary},"@media (hover: none)":{[`&:hover .${ny.notchedOutline}`]:{borderColor:n.vars?`rgba(${n.vars.palette.common.onBackgroundChannel} / 0.23)`:t}},[`&.${ny.focused} .${ny.notchedOutline}`]:{borderColor:(n.vars||n).palette[e.color].main,borderWidth:2},[`&.${ny.error} .${ny.notchedOutline}`]:{borderColor:(n.vars||n).palette.error.main},[`&.${ny.disabled} .${ny.notchedOutline}`]:{borderColor:(n.vars||n).palette.action.disabled}},e.startAdornment&&{paddingLeft:14},e.endAdornment&&{paddingRight:14},e.multiline&&qe({padding:"16.5px 14px"},e.size==="small"&&{padding:"8.5px 14px"}))}),M_e=pr(E_e,{name:"MuiOutlinedInput",slot:"NotchedOutline",overridesResolver:(n,e)=>e.notchedOutline})(({theme:n})=>{const e=n.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{borderColor:n.vars?`rgba(${n.vars.palette.common.onBackgroundChannel} / 0.23)`:e}}),A_e=pr(qk,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:Kk})(({theme:n,ownerState:e})=>qe({padding:"16.5px 14px"},!n.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:n.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:n.palette.mode==="light"?null:"#fff",caretColor:n.palette.mode==="light"?null:"#fff",borderRadius:"inherit"}},n.vars&&{"&:-webkit-autofill":{borderRadius:"inherit"},[n.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},e.size==="small"&&{padding:"8.5px 14px"},e.multiline&&{padding:0},e.startAdornment&&{paddingLeft:0},e.endAdornment&&{paddingRight:0})),UK=pe.forwardRef(function(e,t){var r,s,o,l,u;const h=ua({props:e,name:"MuiOutlinedInput"}),{components:f={},fullWidth:g=!1,inputComponent:y="input",label:b,multiline:w=!1,notched:C,slots:M={},type:A="text"}=h,k=Ar(h,x_e),L=$_e(h),P=Av(),D=tb({props:h,muiFormControl:P,states:["color","disabled","error","focused","hiddenLabel","size","required"]}),z=qe({},h,{color:D.color||"primary",disabled:D.disabled,error:D.error,focused:D.focused,formControl:P,fullWidth:g,hiddenLabel:D.hiddenLabel,multiline:w,size:D.size,type:A}),U=(r=(s=M.root)!=null?s:f.Root)!=null?r:C_e,V=(o=(l=M.input)!=null?l:f.Input)!=null?o:A_e;return De.jsx(kF,qe({slots:{root:U,input:V},renderSuffix:H=>De.jsx(M_e,{ownerState:z,className:L.notchedOutline,label:b!=null&&b!==""&&D.required?u||(u=De.jsxs(pe.Fragment,{children:[b," ","*"]})):b,notched:typeof C<"u"?C:!!(H.startAdornment||H.filled||H.focused)}),fullWidth:g,inputComponent:y,multiline:w,ref:t,type:A},k,{classes:qe({},L,{notchedOutline:null})}))});UK.muiName="Input";const HK=UK;function I_e(n){return Po("MuiSelect",n)}const ix=Xo("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]);var VH;const R_e=["aria-describedby","aria-label","autoFocus","autoWidth","children","className","defaultOpen","defaultValue","disabled","displayEmpty","error","IconComponent","inputRef","labelId","MenuProps","multiple","name","onBlur","onChange","onClose","onFocus","onOpen","open","readOnly","renderValue","SelectDisplayProps","tabIndex","type","value","variant"],k_e=pr("div",{name:"MuiSelect",slot:"Select",overridesResolver:(n,e)=>{const{ownerState:t}=n;return[{[`&.${ix.select}`]:e.select},{[`&.${ix.select}`]:e[t.variant]},{[`&.${ix.error}`]:e.error},{[`&.${ix.multiple}`]:e.multiple}]}})(FK,{[`&.${ix.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),O_e=pr("svg",{name:"MuiSelect",slot:"Icon",overridesResolver:(n,e)=>{const{ownerState:t}=n;return[e.icon,t.variant&&e[`icon${gr(t.variant)}`],t.open&&e.iconOpen]}})(zK),L_e=pr("input",{shouldForwardProp:n=>TK(n)&&n!=="classes",name:"MuiSelect",slot:"NativeInput",overridesResolver:(n,e)=>e.nativeInput})({bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%",boxSizing:"border-box"});function jH(n,e){return typeof e=="object"&&e!==null?n===e:String(n)===String(e)}function N_e(n){return n==null||typeof n=="string"&&!n.trim()}const D_e=n=>{const{classes:e,variant:t,disabled:r,multiple:s,open:o,error:l}=n,u={select:["select",t,r&&"disabled",s&&"multiple",l&&"error"],icon:["icon",`icon${gr(t)}`,o&&"iconOpen",r&&"disabled"],nativeInput:["nativeInput"]};return Ko(u,I_e,e)},P_e=pe.forwardRef(function(e,t){var r;const{"aria-describedby":s,"aria-label":o,autoFocus:l,autoWidth:u,children:h,className:f,defaultOpen:g,defaultValue:y,disabled:b,displayEmpty:w,error:C=!1,IconComponent:M,inputRef:A,labelId:k,MenuProps:L={},multiple:P,name:D,onBlur:z,onChange:U,onClose:V,onFocus:H,onOpen:oe,open:le,readOnly:Z,renderValue:q,SelectDisplayProps:he={},tabIndex:ae,value:ue,variant:ge="standard"}=e,we=Ar(e,R_e),[J,re]=lR({controlled:ue,default:y,name:"Select"}),[ie,fe]=lR({controlled:le,default:g,name:"Select"}),Te=pe.useRef(null),Fe=pe.useRef(null),[Ie,Je]=pe.useState(null),{current:Re}=pe.useRef(le!=null),[Qe,nt]=pe.useState(),ft=gp(t,A),lt=pe.useCallback(me=>{Fe.current=me,me&&Je(me)},[]),ze=Ie==null?void 0:Ie.parentNode;pe.useImperativeHandle(ft,()=>({focus:()=>{Fe.current.focus()},node:Te.current,value:J}),[J]),pe.useEffect(()=>{g&&ie&&Ie&&!Re&&(nt(u?null:ze.clientWidth),Fe.current.focus())},[Ie,u]),pe.useEffect(()=>{l&&Fe.current.focus()},[l]),pe.useEffect(()=>{if(!k)return;const me=Jp(Fe.current).getElementById(k);if(me){const ke=()=>{getSelection().isCollapsed&&Fe.current.focus()};return me.addEventListener("click",ke),()=>{me.removeEventListener("click",ke)}}},[k]);const Ce=(me,ke)=>{me?oe&&oe(ke):V&&V(ke),Re||(nt(u?null:ze.clientWidth),fe(me))},He=me=>{me.button===0&&(me.preventDefault(),Fe.current.focus(),Ce(!0,me))},rt=me=>{Ce(!1,me)},it=pe.Children.toArray(h),Nt=me=>{const ke=it.find(Xe=>Xe.props.value===me.target.value);ke!==void 0&&(re(ke.props.value),U&&U(me,ke))},kt=me=>ke=>{let Xe;if(ke.currentTarget.hasAttribute("tabindex")){if(P){Xe=Array.isArray(J)?J.slice():[];const Wt=J.indexOf(me.props.value);Wt===-1?Xe.push(me.props.value):Xe.splice(Wt,1)}else Xe=me.props.value;if(me.props.onClick&&me.props.onClick(ke),J!==Xe&&(re(Xe),U)){const Wt=ke.nativeEvent||ke,Ge=new Wt.constructor(Wt.type,Wt);Object.defineProperty(Ge,"target",{writable:!0,value:{value:Xe,name:D}}),U(Ge,me)}P||Ce(!1,ke)}},vt=me=>{Z||[" ","ArrowUp","ArrowDown","Enter"].indexOf(me.key)!==-1&&(me.preventDefault(),Ce(!0,me))},Mt=Ie!==null&&ie,At=me=>{!Mt&&z&&(Object.defineProperty(me,"target",{writable:!0,value:{value:J,name:D}}),z(me))};delete we["aria-invalid"];let mt,xe;const se=[];let $e=!1;(fR({value:J})||w)&&(q?mt=q(J):$e=!0);const ht=it.map(me=>{if(!pe.isValidElement(me))return null;let ke;if(P){if(!Array.isArray(J))throw new Error(J1(2));ke=J.some(Xe=>jH(Xe,me.props.value)),ke&&$e&&se.push(me.props.children)}else ke=jH(J,me.props.value),ke&&$e&&(xe=me.props.children);return pe.cloneElement(me,{"aria-selected":ke?"true":"false",onClick:kt(me),onKeyUp:Xe=>{Xe.key===" "&&Xe.preventDefault(),me.props.onKeyUp&&me.props.onKeyUp(Xe)},role:"option",selected:ke,value:void 0,"data-value":me.props.value})});$e&&(P?se.length===0?mt=null:mt=se.reduce((me,ke,Xe)=>(me.push(ke),Xe{const{classes:e}=n;return e},DF={name:"MuiSelect",overridesResolver:(n,e)=>e.root,shouldForwardProp:n=>Vm(n)&&n!=="variant",slot:"Root"},H_e=pr(LF,DF)(""),G_e=pr(HK,DF)(""),W_e=pr(RK,DF)(""),GK=pe.forwardRef(function(e,t){const r=ua({name:"MuiSelect",props:e}),{autoWidth:s=!1,children:o,classes:l={},className:u,defaultOpen:h=!1,displayEmpty:f=!1,IconComponent:g=gme,id:y,input:b,inputProps:w,label:C,labelId:M,MenuProps:A,multiple:k=!1,native:L=!1,onClose:P,onOpen:D,open:z,renderValue:U,SelectDisplayProps:V,variant:H="outlined"}=r,oe=Ar(r,F_e),le=L?b_e:B_e,Z=Av(),q=tb({props:r,muiFormControl:Z,states:["variant","error"]}),he=q.variant||H,ae=qe({},r,{variant:he,classes:l}),ue=U_e(ae),ge=Ar(ue,z_e),we=b||{standard:De.jsx(H_e,{ownerState:ae}),outlined:De.jsx(G_e,{label:C,ownerState:ae}),filled:De.jsx(W_e,{ownerState:ae})}[he],J=gp(t,we.ref);return De.jsx(pe.Fragment,{children:pe.cloneElement(we,qe({inputComponent:le,inputProps:qe({children:o,error:q.error,IconComponent:g,variant:he,type:void 0,multiple:k},L?{id:y}:{autoWidth:s,defaultOpen:h,displayEmpty:f,labelId:M,MenuProps:A,onClose:P,onOpen:D,open:z,renderValue:U,SelectDisplayProps:qe({id:y},V)},w,{classes:w?fp(ge,w.classes):ge},b?b.props.inputProps:{})},(k&&L||f)&&he==="outlined"?{notched:!0}:{},{ref:J,className:ai(we.props.className,u,ue.root)},!b&&{variant:he},oe))})});GK.muiName="Select";const V_e=GK;function j_e(n){return Po("MuiSwitch",n)}const rp=Xo("MuiSwitch",["root","edgeStart","edgeEnd","switchBase","colorPrimary","colorSecondary","sizeSmall","sizeMedium","checked","disabled","input","thumb","track"]),Y_e=["className","color","edge","size","sx"],X_e=zfe(),K_e=n=>{const{classes:e,edge:t,size:r,color:s,checked:o,disabled:l}=n,u={root:["root",t&&`edge${gr(t)}`,`size${gr(r)}`],switchBase:["switchBase",`color${gr(s)}`,o&&"checked",l&&"disabled"],thumb:["thumb"],track:["track"],input:["input"]},h=Ko(u,j_e,e);return qe({},e,h)},J_e=pr("span",{name:"MuiSwitch",slot:"Root",overridesResolver:(n,e)=>{const{ownerState:t}=n;return[e.root,t.edge&&e[`edge${gr(t.edge)}`],e[`size${gr(t.size)}`]]}})({display:"inline-flex",width:34+12*2,height:14+12*2,overflow:"hidden",padding:12,boxSizing:"border-box",position:"relative",flexShrink:0,zIndex:0,verticalAlign:"middle","@media print":{colorAdjust:"exact"},variants:[{props:{edge:"start"},style:{marginLeft:-8}},{props:{edge:"end"},style:{marginRight:-8}},{props:{size:"small"},style:{width:40,height:24,padding:7,[`& .${rp.thumb}`]:{width:16,height:16},[`& .${rp.switchBase}`]:{padding:4,[`&.${rp.checked}`]:{transform:"translateX(16px)"}}}}]}),q_e=pr(CK,{name:"MuiSwitch",slot:"SwitchBase",overridesResolver:(n,e)=>{const{ownerState:t}=n;return[e.switchBase,{[`& .${rp.input}`]:e.input},t.color!=="default"&&e[`color${gr(t.color)}`]]}})(({theme:n})=>({position:"absolute",top:0,left:0,zIndex:1,color:n.vars?n.vars.palette.Switch.defaultColor:`${n.palette.mode==="light"?n.palette.common.white:n.palette.grey[300]}`,transition:n.transitions.create(["left","transform"],{duration:n.transitions.duration.shortest}),[`&.${rp.checked}`]:{transform:"translateX(20px)"},[`&.${rp.disabled}`]:{color:n.vars?n.vars.palette.Switch.defaultDisabledColor:`${n.palette.mode==="light"?n.palette.grey[100]:n.palette.grey[600]}`},[`&.${rp.checked} + .${rp.track}`]:{opacity:.5},[`&.${rp.disabled} + .${rp.track}`]:{opacity:n.vars?n.vars.opacity.switchTrackDisabled:`${n.palette.mode==="light"?.12:.2}`},[`& .${rp.input}`]:{left:"-100%",width:"300%"}}),({theme:n})=>({"&:hover":{backgroundColor:n.vars?`rgba(${n.vars.palette.action.activeChannel} / ${n.vars.palette.action.hoverOpacity})`:r0(n.palette.action.active,n.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},variants:[...Object.entries(n.palette).filter(([,e])=>e.main&&e.light).map(([e])=>({props:{color:e},style:{[`&.${rp.checked}`]:{color:(n.vars||n).palette[e].main,"&:hover":{backgroundColor:n.vars?`rgba(${n.vars.palette[e].mainChannel} / ${n.vars.palette.action.hoverOpacity})`:r0(n.palette[e].main,n.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${rp.disabled}`]:{color:n.vars?n.vars.palette.Switch[`${e}DisabledColor`]:`${n.palette.mode==="light"?fK(n.palette[e].main,.62):dK(n.palette[e].main,.55)}`}},[`&.${rp.checked} + .${rp.track}`]:{backgroundColor:(n.vars||n).palette[e].main}}}))]})),Q_e=pr("span",{name:"MuiSwitch",slot:"Track",overridesResolver:(n,e)=>e.track})(({theme:n})=>({height:"100%",width:"100%",borderRadius:14/2,zIndex:-1,transition:n.transitions.create(["opacity","background-color"],{duration:n.transitions.duration.shortest}),backgroundColor:n.vars?n.vars.palette.common.onBackground:`${n.palette.mode==="light"?n.palette.common.black:n.palette.common.white}`,opacity:n.vars?n.vars.opacity.switchTrack:`${n.palette.mode==="light"?.38:.3}`})),Z_e=pr("span",{name:"MuiSwitch",slot:"Thumb",overridesResolver:(n,e)=>e.thumb})(({theme:n})=>({boxShadow:(n.vars||n).shadows[1],backgroundColor:"currentColor",width:20,height:20,borderRadius:"50%"})),eve=pe.forwardRef(function(e,t){const r=X_e({props:e,name:"MuiSwitch"}),{className:s,color:o="primary",edge:l=!1,size:u="medium",sx:h}=r,f=Ar(r,Y_e),g=qe({},r,{color:o,edge:l,size:u}),y=K_e(g),b=De.jsx(Z_e,{className:y.thumb,ownerState:g});return De.jsxs(J_e,{className:ai(y.root,s),sx:h,ownerState:g,children:[De.jsx(q_e,qe({type:"checkbox",icon:b,checkedIcon:b,ref:t,ownerState:g},f,{classes:qe({},y,{root:y.switchBase})})),De.jsx(Q_e,{className:y.track,ownerState:g})]})}),tve=eve;function nve(n){return Po("MuiTextField",n)}Xo("MuiTextField",["root"]);const rve=["autoComplete","autoFocus","children","className","color","defaultValue","disabled","error","FormHelperTextProps","fullWidth","helperText","id","InputLabelProps","inputProps","InputProps","inputRef","label","maxRows","minRows","multiline","name","onBlur","onChange","onFocus","placeholder","required","rows","select","SelectProps","type","value","variant"],ive={standard:LF,filled:RK,outlined:HK},sve=n=>{const{classes:e}=n;return Ko({root:["root"]},nve,e)},ove=pr(Lge,{name:"MuiTextField",slot:"Root",overridesResolver:(n,e)=>e.root})({}),ave=pe.forwardRef(function(e,t){const r=ua({props:e,name:"MuiTextField"}),{autoComplete:s,autoFocus:o=!1,children:l,className:u,color:h="primary",defaultValue:f,disabled:g=!1,error:y=!1,FormHelperTextProps:b,fullWidth:w=!1,helperText:C,id:M,InputLabelProps:A,inputProps:k,InputProps:L,inputRef:P,label:D,maxRows:z,minRows:U,multiline:V=!1,name:H,onBlur:oe,onChange:le,onFocus:Z,placeholder:q,required:he=!1,rows:ae,select:ue=!1,SelectProps:ge,type:we,value:J,variant:re="outlined"}=r,ie=Ar(r,rve),fe=qe({},r,{autoFocus:o,color:h,disabled:g,error:y,fullWidth:w,multiline:V,required:he,select:ue,variant:re}),Te=sve(fe),Fe={};re==="outlined"&&(A&&typeof A.shrink<"u"&&(Fe.notched=A.shrink),Fe.label=D),ue&&((!ge||!ge.native)&&(Fe.id=void 0),Fe["aria-describedby"]=void 0);const Ie=Hk(M),Je=C&&Ie?`${Ie}-helper-text`:void 0,Re=D&&Ie?`${Ie}-label`:void 0,Qe=ive[re],nt=De.jsx(Qe,qe({"aria-describedby":Je,autoComplete:s,autoFocus:o,defaultValue:f,fullWidth:w,multiline:V,name:H,rows:ae,maxRows:z,minRows:U,type:we,value:J,id:Ie,inputRef:P,onBlur:oe,onChange:le,onFocus:Z,placeholder:q,inputProps:k},Fe,L));return De.jsxs(ove,qe({className:ai(Te.root,u),disabled:g,error:y,fullWidth:w,ref:t,required:he,color:h,variant:re,ownerState:fe},ie,{children:[D!=null&&D!==""&&De.jsx(D0e,qe({htmlFor:Ie,id:Re},A,{children:D})),ue?De.jsx(V_e,qe({"aria-describedby":Je,id:Ie,labelId:Re,value:J,input:nt},ge,{children:l})):nt,C&&De.jsx(e0e,qe({id:Je},b,{children:C}))]}))}),PF=ave,WK="/gpu-programming/assets/misty-Q0vWeXcA.svg",lve="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20width='100%25'%20height='100%25'%20viewBox='0%200%20400%20400'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20xml:space='preserve'%20xmlns:serif='http://www.serif.com/'%20style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;'%3e%3cg%20transform='matrix(1,0,0,1,-54.8776,-69.2073)'%3e%3cg%20transform='matrix(1.02822,0,0,1.03479,-55.9535,52.2937)'%3e%3cg%20transform='matrix(-0.423317,-0.423317,0.614768,-0.614768,286.809,459.697)'%3e%3cpath%20d='M470.009,231.909C470.009,241.104%20459.167,248.57%20445.813,248.57L104.238,248.57C90.884,248.57%2080.042,241.104%2080.042,231.909C80.042,222.713%2090.884,215.247%20104.238,215.247L445.813,215.247C459.167,215.247%20470.009,222.713%20470.009,231.909Z'/%3e%3c/g%3e%3cg%20transform='matrix(0.440957,0.440957,-0.704461,0.704461,267.224,-50.5009)'%3e%3cpath%20d='M451.221,155.518L212.117,155.518C200.001,141.06%20193.623,124.66%20193.623,107.966C193.623,55.476%20255.479,12.861%20331.669,12.861C407.859,12.861%20469.715,55.476%20469.715,107.966C469.715,124.66%20463.337,141.06%20451.221,155.518Z'%20style='fill:rgb(12,0,0);'/%3e%3c/g%3e%3cg%20transform='matrix(-0.249775,0.249775,-0.614768,-0.614768,655.131,143.162)'%3e%3cpath%20d='M470.009,231.909C470.009,241.104%20451.634,248.57%20429.001,248.57L121.05,248.57C98.417,248.57%2080.042,241.104%2080.042,231.909C80.042,222.713%2098.417,215.247%20121.05,215.247L429.001,215.247C451.634,215.247%20470.009,222.713%20470.009,231.909Z'%20style='fill:rgb(12,0,0);'/%3e%3c/g%3e%3c/g%3e%3cg%20transform='matrix(1.02822,0,0,1.03479,44.3939,-48.6949)'%3e%3cg%20transform='matrix(-0.423317,-0.423317,0.614768,-0.614768,171.204,575.302)'%3e%3cpath%20d='M470.009,231.909C470.009,241.104%20459.167,248.57%20445.813,248.57L104.238,248.57C90.884,248.57%2080.042,241.104%2080.042,231.909C80.042,222.713%2090.884,215.247%20104.238,215.247L445.813,215.247C459.167,215.247%20470.009,222.713%20470.009,231.909Z'%20style='fill:rgb(12,0,0);'/%3e%3c/g%3e%3cg%20transform='matrix(-0.216719,0.216719,-0.614768,-0.614768,453.376,402.183)'%3e%3cpath%20d='M470.009,231.909C470.009,241.104%20448.831,248.57%20422.746,248.57L127.305,248.57C101.22,248.57%2080.042,241.104%2080.042,231.909C80.042,222.713%20101.22,215.247%20127.305,215.247L422.746,215.247C448.831,215.247%20470.009,222.713%20470.009,231.909Z'%20style='fill:rgb(12,0,0);'/%3e%3c/g%3e%3cg%20transform='matrix(-0.249775,0.249775,-0.614768,-0.614768,274.402,521.42)'%3e%3cpath%20d='M470.009,231.909C470.009,241.104%20451.634,248.57%20429.001,248.57L121.05,248.57C98.417,248.57%2080.042,241.104%2080.042,231.909C80.042,222.713%2098.417,215.247%20121.05,215.247L429.001,215.247C451.634,215.247%20470.009,222.713%20470.009,231.909Z'%20style='fill:rgb(12,0,0);'/%3e%3c/g%3e%3cg%20transform='matrix(-0.440957,-0.440957,0.704461,-0.704461,241.43,564.525)'%3e%3cpath%20d='M451.221,155.518L212.117,155.518C200.001,141.06%20193.623,124.66%20193.623,107.966C193.623,55.476%20255.479,12.861%20331.669,12.861C407.859,12.861%20469.715,55.476%20469.715,107.966C469.715,124.66%20463.337,141.06%20451.221,155.518Z'%20style='fill:rgb(12,0,0);'/%3e%3c/g%3e%3cg%20transform='matrix(-0.216719,0.216719,-0.614768,-0.614768,395.716,343.809)'%3e%3cpath%20d='M470.009,231.909C470.009,241.104%20448.831,248.57%20422.746,248.57L127.305,248.57C101.22,248.57%2080.042,241.104%2080.042,231.909C80.042,222.713%20101.22,215.247%20127.305,215.247L422.746,215.247C448.831,215.247%20470.009,222.713%20470.009,231.909Z'%20style='fill:rgb(12,0,0);'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e",uve="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20width='100%25'%20height='100%25'%20viewBox='0%200%20401%20400'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20xml:space='preserve'%20xmlns:serif='http://www.serif.com/'%20style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;'%3e%3cg%20transform='matrix(1,0,0,1,-53.2986,-56.7857)'%3e%3cg%20transform='matrix(0.992184,0,0,0.998302,0.416603,0.0964004)'%3e%3cg%20transform='matrix(-0.423317,-0.423317,0.614768,-0.614768,286.809,459.697)'%3e%3cpath%20d='M470.009,231.909C470.009,241.104%20459.167,248.57%20445.813,248.57L104.238,248.57C90.884,248.57%2080.042,241.104%2080.042,231.909C80.042,222.713%2090.884,215.247%20104.238,215.247L445.813,215.247C459.167,215.247%20470.009,222.713%20470.009,231.909Z'/%3e%3c/g%3e%3cg%20transform='matrix(0.440957,0.440957,-0.704461,0.704461,267.224,-50.5009)'%3e%3cpath%20d='M451.221,155.518L212.117,155.518C200.001,141.06%20193.623,124.66%20193.623,107.966C193.623,55.476%20255.479,12.861%20331.669,12.861C407.859,12.861%20469.715,55.476%20469.715,107.966C469.715,124.66%20463.337,141.06%20451.221,155.518Z'%20style='fill:rgb(12,0,0);'/%3e%3c/g%3e%3cg%20transform='matrix(-0.237219,0.237219,-0.614768,-0.614768,613.767,184.608)'%3e%3cpath%20d='M470.009,231.909C470.009,241.104%20450.661,248.57%20426.831,248.57L123.22,248.57C99.39,248.57%2080.042,241.104%2080.042,231.909C80.042,222.713%2099.39,215.247%20123.22,215.247L426.831,215.247C450.661,215.247%20470.009,222.713%20470.009,231.909Z'%20style='fill:rgb(12,0,0);'/%3e%3c/g%3e%3c/g%3e%3cg%20transform='matrix(0.992184,0,0,0.998302,0.416603,0.0964004)'%3e%3cg%20transform='matrix(-0.423317,-0.423317,0.614768,-0.614768,171.204,575.302)'%3e%3cpath%20d='M470.009,231.909C470.009,241.104%20459.167,248.57%20445.813,248.57L104.238,248.57C90.884,248.57%2080.042,241.104%2080.042,231.909C80.042,222.713%2090.884,215.247%20104.238,215.247L445.813,215.247C459.167,215.247%20470.009,222.713%20470.009,231.909Z'%20style='fill:rgb(12,0,0);'/%3e%3c/g%3e%3cg%20transform='matrix(-0.216719,0.216719,-0.614768,-0.614768,453.376,402.183)'%3e%3cpath%20d='M470.009,231.909C470.009,241.104%20448.831,248.57%20422.746,248.57L127.305,248.57C101.22,248.57%2080.042,241.104%2080.042,231.909C80.042,222.713%20101.22,215.247%20127.305,215.247L422.746,215.247C448.831,215.247%20470.009,222.713%20470.009,231.909Z'%20style='fill:rgb(12,0,0);'/%3e%3c/g%3e%3cg%20transform='matrix(-0.237219,0.237219,-0.614768,-0.614768,311.603,484.301)'%3e%3cpath%20d='M470.009,231.909C470.009,241.104%20450.661,248.57%20426.831,248.57L123.22,248.57C99.39,248.57%2080.042,241.104%2080.042,231.909C80.042,222.713%2099.39,215.247%20123.22,215.247L426.831,215.247C450.661,215.247%20470.009,222.713%20470.009,231.909Z'%20style='fill:rgb(12,0,0);'/%3e%3c/g%3e%3cg%20transform='matrix(-0.440957,-0.440957,0.704461,-0.704461,241.43,564.525)'%3e%3cpath%20d='M451.221,155.518L212.117,155.518C200.001,141.06%20193.623,124.66%20193.623,107.966C193.623,55.476%20255.479,12.861%20331.669,12.861C407.859,12.861%20469.715,55.476%20469.715,107.966C469.715,124.66%20463.337,141.06%20451.221,155.518Z'%20style='fill:rgb(12,0,0);'/%3e%3c/g%3e%3cg%20transform='matrix(-0.216719,0.216719,-0.614768,-0.614768,395.716,343.809)'%3e%3cpath%20d='M470.009,231.909C470.009,241.104%20448.831,248.57%20422.746,248.57L127.305,248.57C101.22,248.57%2080.042,241.104%2080.042,231.909C80.042,222.713%20101.22,215.247%20127.305,215.247L422.746,215.247C448.831,215.247%20470.009,222.713%20470.009,231.909Z'%20style='fill:rgb(12,0,0);'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e";function qp({icon:n,text:e,clickFunction:t,disabled:r,style:s}){return De.jsx(Ume,{onClick:t,startIcon:n,disabled:r,classes:{disabled:"disabledDropShadowButton"},style:{margin:"5px",color:"black",backgroundColor:"#FAFAFA",borderRadius:"10px",filter:"drop-shadow(0px 10px 4px rgba(0,0,0,0.25))",...s},children:e})}var BF={},nL={};const cve=__(Ffe);var YH;function MC(){return YH||(YH=1,function(n){"use client";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"default",{enumerable:!0,get:function(){return e.createSvgIcon}});var e=cve}(nL)),nL}var hve=aT;Object.defineProperty(BF,"__esModule",{value:!0});var VK=BF.default=void 0,dve=hve(MC()),fve=De;VK=BF.default=(0,dve.default)((0,fve.jsx)("path",{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6"}),"Settings");function pve(n){const[e,t]=pe.useState(""),r=Bn(qi(M=>M.setIp)),s=Bn(qi(M=>M.setImageList)),o=Bn(qi(M=>M.setAudioList)),l=Bn(qi(M=>M.setIsConnected)),u=Bn(qi(M=>M.isConnected)),h=Bn(qi(M=>M.disconnect)),f=Bn(M=>M.setActiveModal),g=Bn(M=>M.setHeaderDimensions),y=Bn(qi(M=>M.screenToShow)),b=Bn(M=>M.updateScreen);pe.useEffect(()=>{const M=document.getElementById("website-header");new ResizeObserver(k=>{for(let L of k)g(M.offsetHeight,M.offsetWidth)}).observe(M)},[]);const w=()=>{r(e),fetch(`http://${e}/api/battery`,{method:"GET"}).then(M=>{if(!M.ok)throw new Error(`Request failed with status ${M.status}`);return M.json()}).then(M=>(console.log(`Successfully sent a GET request, the response is: ${M}`),l(!0),fetch(`http://${e}/api/audio/list`))).then(M=>{if(!M.ok)throw new Error(`Request failed with status ${M.status}`);return M.json()}).then(M=>(o(M.result),fetch(`http://${e}/api/images/list`))).then(M=>{if(!M.ok)throw new Error(`Request failed with status ${M.status}`);return M.json()}).then(M=>{s(M.result)}).catch(M=>{console.error("Error during fetch operation:",M.message),alert(`Error fetching data: ${M.message}`)}),uh("Hit Confirm IP Address Button")},C={backgroundColor:"#585D92",color:"#FFFFFF",filter:"drop-shadow(0px 10px 4px rgba(0,0,0,0.25))",zIndex:101,position:"relative",paddingLeft:"20px",paddingTop:"5px",paddingBottom:"5px"};return De.jsxs(oc,{id:"website-header",container:!0,direction:"row",justifyContent:"space-between",alignItems:"center",style:C,children:[De.jsx(oc,{item:!0,xs:12,sm:4,md:4,lg:3,xl:3,children:De.jsxs(L$,{direction:"row",alignItems:"center",children:[De.jsx("img",{style:{maxHeight:"35px",paddingRight:"5px"},src:WK}),De.jsx(f_,{display:"inline",variant:"h5",children:"Robo-Blocks"})]})}),De.jsx(oc,{item:!0,xs:12,sm:8,md:8,lg:9,xl:9,children:De.jsxs(oc,{container:!0,direction:"row",justifyContent:"space-between",alignItems:"center",children:[De.jsx(oc,{item:!0,xs:3,sm:3,md:3,lg:3,xl:3,style:{justifyContent:"right",display:"flex"},children:y!==nF&&De.jsx(qp,{text:y===fw?yX:bX,clickFunction:()=>b(y===fw?rF:fw)})}),De.jsx(oc,{item:!0,xs:9,sm:9,md:9,lg:9,xl:9,style:{justifyContent:"right",display:"flex"},children:De.jsxs(L$,{direction:"row",alignItems:"center",children:[!u&&De.jsx("div",{style:{backgroundColor:"#FF7E7E",width:"45px",height:"45px",borderRadius:"25px",marginRight:"10px",filter:"drop-shadow(0px 10px 4px rgba(0,0,0,0.25))"},children:De.jsx("img",{style:{height:"34px",position:"absolute",top:"5px",left:"5px"},src:uve})}),u&&De.jsx("div",{style:{backgroundColor:"#A0FF7E",width:"45px",height:"45px",borderRadius:"25px",marginRight:"10px",filter:"drop-shadow(0px 10px 4px rgba(0,0,0,0.25))"},children:De.jsx("img",{style:{height:"34px",position:"absolute",top:"5px",left:"5px"},src:lve})}),De.jsx(PF,{id:"robotIpAddress",disabled:u,label:"IP",variant:"filled",style:{backgroundColor:"#FFFFFF50",borderRadius:"5px",filter:"drop-shadow(0px 10px 4px rgba(0,0,0,0.25))",marginRight:"5px"},defaultValue:"",onChange:M=>t(M.target.value)}),!u&&De.jsx(qp,{text:"Connect",clickFunction:w}),u&&De.jsx(qp,{text:"Disconnect",clickFunction:h}),De.jsx(pI,{style:{margin:"5px",marginRight:"10px",color:"black",backgroundColor:"#FAFAFA",borderRadius:"10px",filter:"drop-shadow(0px 10px 4px rgba(0,0,0,0.25))"},onClick:()=>{f(vX)},children:De.jsx(VK,{})})]})})]})})]})}/** +`),fg.rippleVisible,ape,VD,({theme:n})=>n.transitions.easing.easeInOut,fg.ripplePulsate,({theme:n})=>n.transitions.duration.shorter,fg.child,fg.childLeaving,lpe,VD,({theme:n})=>n.transitions.easing.easeInOut,fg.childPulsate,upe,({theme:n})=>n.transitions.easing.easeInOut),dpe=me.forwardRef(function(e,t){const r=ua({props:e,name:"MuiTouchRipple"}),{center:s=!1,classes:o={},className:l}=r,u=Ar(r,spe),[h,f]=me.useState([]),g=me.useRef(0),y=me.useRef(null);me.useEffect(()=>{y.current&&(y.current(),y.current=null)},[h]);const b=me.useRef(!1),w=lK(),C=me.useRef(null),M=me.useRef(null),A=me.useCallback(D=>{const{pulsate:z,rippleX:U,rippleY:V,rippleSize:H,cb:oe}=D;f(le=>[...le,Ne.jsx(hpe,{classes:{ripple:ai(o.ripple,fg.ripple),rippleVisible:ai(o.rippleVisible,fg.rippleVisible),ripplePulsate:ai(o.ripplePulsate,fg.ripplePulsate),child:ai(o.child,fg.child),childLeaving:ai(o.childLeaving,fg.childLeaving),childPulsate:ai(o.childPulsate,fg.childPulsate)},timeout:VD,pulsate:z,rippleX:U,rippleY:V,rippleSize:H},g.current)]),g.current+=1,y.current=oe},[o]),k=me.useCallback((D={},z={},U=()=>{})=>{const{pulsate:V=!1,center:H=s||z.pulsate,fakeElement:oe=!1}=z;if((D==null?void 0:D.type)==="mousedown"&&b.current){b.current=!1;return}(D==null?void 0:D.type)==="touchstart"&&(b.current=!0);const le=oe?null:M.current,Z=le?le.getBoundingClientRect():{width:0,height:0,left:0,top:0};let q,he,ae;if(H||D===void 0||D.clientX===0&&D.clientY===0||!D.clientX&&!D.touches)q=Math.round(Z.width/2),he=Math.round(Z.height/2);else{const{clientX:ue,clientY:ge}=D.touches&&D.touches.length>0?D.touches[0]:D;q=Math.round(ue-Z.left),he=Math.round(ge-Z.top)}if(H)ae=Math.sqrt((2*Z.width**2+Z.height**2)/3),ae%2===0&&(ae+=1);else{const ue=Math.max(Math.abs((le?le.clientWidth:0)-q),q)*2+2,ge=Math.max(Math.abs((le?le.clientHeight:0)-he),he)*2+2;ae=Math.sqrt(ue**2+ge**2)}D!=null&&D.touches?C.current===null&&(C.current=()=>{A({pulsate:V,rippleX:q,rippleY:he,rippleSize:ae,cb:U})},w.start(ope,()=>{C.current&&(C.current(),C.current=null)})):A({pulsate:V,rippleX:q,rippleY:he,rippleSize:ae,cb:U})},[s,A,w]),L=me.useCallback(()=>{k({},{pulsate:!0})},[k]),P=me.useCallback((D,z)=>{if(w.clear(),(D==null?void 0:D.type)==="touchend"&&C.current){C.current(),C.current=null,w.start(0,()=>{P(D,z)});return}C.current=null,f(U=>U.length>0?U.slice(1):U),y.current=z},[w]);return me.useImperativeHandle(t,()=>({pulsate:L,start:k,stop:P}),[L,k,P]),Ne.jsx(cpe,Qe({className:ai(fg.root,o.root,l),ref:M},u,{children:Ne.jsx(Xfe,{component:null,exit:!0,children:h})}))}),fpe=dpe;function ppe(n){return Po("MuiButtonBase",n)}const mpe=Xo("MuiButtonBase",["root","disabled","focusVisible"]),gpe=["action","centerRipple","children","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","LinkComponent","onBlur","onClick","onContextMenu","onDragLeave","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","tabIndex","TouchRippleProps","touchRippleRef","type"],_pe=n=>{const{disabled:e,focusVisible:t,focusVisibleClassName:r,classes:s}=n,l=Ko({root:["root",e&&"disabled",t&&"focusVisible"]},ppe,s);return t&&r&&(l.root+=` ${r}`),l},vpe=pr("button",{name:"MuiButtonBase",slot:"Root",overridesResolver:(n,e)=>e.root})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${mpe.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),ype=me.forwardRef(function(e,t){const r=ua({props:e,name:"MuiButtonBase"}),{action:s,centerRipple:o=!1,children:l,className:u,component:h="button",disabled:f=!1,disableRipple:g=!1,disableTouchRipple:y=!1,focusRipple:b=!1,LinkComponent:w="a",onBlur:C,onClick:M,onContextMenu:A,onDragLeave:k,onFocus:L,onFocusVisible:P,onKeyDown:D,onKeyUp:z,onMouseDown:U,onMouseLeave:V,onMouseUp:H,onTouchEnd:oe,onTouchMove:le,onTouchStart:Z,tabIndex:q=0,TouchRippleProps:he,touchRippleRef:ae,type:ue}=r,ge=Ar(r,gpe),we=me.useRef(null),J=me.useRef(null),re=gp(J,ae),{isFocusVisibleRef:se,onFocus:fe,onBlur:Te,ref:Fe}=uK(),[Ie,qe]=me.useState(!1);f&&Ie&&qe(!1),me.useImperativeHandle(s,()=>({focusVisible:()=>{qe(!0),we.current.focus()}}),[]);const[Re,Ze]=me.useState(!1);me.useEffect(()=>{Ze(!0)},[]);const rt=Re&&!g&&!f;me.useEffect(()=>{Ie&&b&&!g&&Re&&J.current.pulsate()},[g,b,Ie,Re]);function ft(Ke,Oe,Q=y){return S1(te=>(Oe&&Oe(te),!Q&&J.current&&J.current[Ke](te),!0))}const ut=ft("start",U),ze=ft("stop",A),$e=ft("stop",k),He=ft("stop",H),it=ft("stop",Ke=>{Ie&&Ke.preventDefault(),V&&V(Ke)}),st=ft("start",Z),Nt=ft("stop",oe),kt=ft("stop",le),vt=ft("stop",Ke=>{Te(Ke),se.current===!1&&qe(!1),C&&C(Ke)},!1),Ct=S1(Ke=>{we.current||(we.current=Ke.currentTarget),fe(Ke),se.current===!0&&(qe(!0),P&&P(Ke)),L&&L(Ke)}),At=()=>{const Ke=we.current;return h&&h!=="button"&&!(Ke.tagName==="A"&&Ke.href)},gt=me.useRef(!1),xe=S1(Ke=>{b&&!gt.current&&Ie&&J.current&&Ke.key===" "&&(gt.current=!0,J.current.stop(Ke,()=>{J.current.start(Ke)})),Ke.target===Ke.currentTarget&&At()&&Ke.key===" "&&Ke.preventDefault(),D&&D(Ke),Ke.target===Ke.currentTarget&&At()&&Ke.key==="Enter"&&!f&&(Ke.preventDefault(),M&&M(Ke))}),ie=S1(Ke=>{b&&Ke.key===" "&&J.current&&Ie&&!Ke.defaultPrevented&&(gt.current=!1,J.current.stop(Ke,()=>{J.current.pulsate(Ke)})),z&&z(Ke),M&&Ke.target===Ke.currentTarget&&At()&&Ke.key===" "&&!Ke.defaultPrevented&&M(Ke)});let Pe=h;Pe==="button"&&(ge.href||ge.to)&&(Pe=w);const Ye={};Pe==="button"?(Ye.type=ue===void 0?"button":ue,Ye.disabled=f):(!ge.href&&!ge.to&&(Ye.role="button"),f&&(Ye["aria-disabled"]=f));const St=gp(t,Fe,we),It=Qe({},r,{centerRipple:o,component:h,disabled:f,disableRipple:g,disableTouchRipple:y,focusRipple:b,tabIndex:q,focusVisible:Ie}),mt=_pe(It);return Ne.jsxs(vpe,Qe({as:Pe,className:ai(mt.root,u),ownerState:It,onBlur:vt,onClick:M,onContextMenu:ze,onFocus:Ct,onKeyDown:xe,onKeyUp:ie,onMouseDown:ut,onMouseLeave:it,onMouseUp:He,onDragLeave:$e,onTouchEnd:Nt,onTouchMove:kt,onTouchStart:st,ref:St,tabIndex:f?-1:q,type:ue},Ye,ge,{children:[l,rt?Ne.jsx(fpe,Qe({ref:re,center:o},he)):null]}))}),IF=ype;function bpe(n){return Po("MuiIconButton",n)}const Tpe=Xo("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge"]),Spe=["edge","children","className","color","disabled","disableFocusRipple","size"],wpe=n=>{const{classes:e,disabled:t,color:r,edge:s,size:o}=n,l={root:["root",t&&"disabled",r!=="default"&&`color${gr(r)}`,s&&`edge${gr(s)}`,`size${gr(o)}`]};return Ko(l,bpe,e)},Epe=pr(IF,{name:"MuiIconButton",slot:"Root",overridesResolver:(n,e)=>{const{ownerState:t}=n;return[e.root,t.color!=="default"&&e[`color${gr(t.color)}`],t.edge&&e[`edge${gr(t.edge)}`],e[`size${gr(t.size)}`]]}})(({theme:n,ownerState:e})=>Qe({textAlign:"center",flex:"0 0 auto",fontSize:n.typography.pxToRem(24),padding:8,borderRadius:"50%",overflow:"visible",color:(n.vars||n).palette.action.active,transition:n.transitions.create("background-color",{duration:n.transitions.duration.shortest})},!e.disableRipple&&{"&:hover":{backgroundColor:n.vars?`rgba(${n.vars.palette.action.activeChannel} / ${n.vars.palette.action.hoverOpacity})`:r0(n.palette.action.active,n.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},e.edge==="start"&&{marginLeft:e.size==="small"?-3:-12},e.edge==="end"&&{marginRight:e.size==="small"?-3:-12}),({theme:n,ownerState:e})=>{var t;const r=(t=(n.vars||n).palette)==null?void 0:t[e.color];return Qe({},e.color==="inherit"&&{color:"inherit"},e.color!=="inherit"&&e.color!=="default"&&Qe({color:r==null?void 0:r.main},!e.disableRipple&&{"&:hover":Qe({},r&&{backgroundColor:n.vars?`rgba(${r.mainChannel} / ${n.vars.palette.action.hoverOpacity})`:r0(r.main,n.palette.action.hoverOpacity)},{"@media (hover: none)":{backgroundColor:"transparent"}})}),e.size==="small"&&{padding:5,fontSize:n.typography.pxToRem(18)},e.size==="large"&&{padding:12,fontSize:n.typography.pxToRem(28)},{[`&.${Tpe.disabled}`]:{backgroundColor:"transparent",color:(n.vars||n).palette.action.disabled}})}),xpe=me.forwardRef(function(e,t){const r=ua({props:e,name:"MuiIconButton"}),{edge:s=!1,children:o,className:l,color:u="default",disabled:h=!1,disableFocusRipple:f=!1,size:g="medium"}=r,y=Ar(r,Spe),b=Qe({},r,{edge:s,color:u,disabled:h,disableFocusRipple:f,size:g}),w=wpe(b);return Ne.jsx(Epe,Qe({className:ai(w.root,l),centerRipple:!0,focusRipple:!f,disabled:h,ref:t},y,{ownerState:b,children:o}))}),pI=xpe;function $pe(n){return Po("MuiTypography",n)}Xo("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]);const Cpe=["align","className","component","gutterBottom","noWrap","paragraph","variant","variantMapping"],Mpe=n=>{const{align:e,gutterBottom:t,noWrap:r,paragraph:s,variant:o,classes:l}=n,u={root:["root",o,n.align!=="inherit"&&`align${gr(e)}`,t&&"gutterBottom",r&&"noWrap",s&&"paragraph"]};return Ko(u,$pe,l)},Ape=pr("span",{name:"MuiTypography",slot:"Root",overridesResolver:(n,e)=>{const{ownerState:t}=n;return[e.root,t.variant&&e[t.variant],t.align!=="inherit"&&e[`align${gr(t.align)}`],t.noWrap&&e.noWrap,t.gutterBottom&&e.gutterBottom,t.paragraph&&e.paragraph]}})(({theme:n,ownerState:e})=>Qe({margin:0},e.variant==="inherit"&&{font:"inherit"},e.variant!=="inherit"&&n.typography[e.variant],e.align!=="inherit"&&{textAlign:e.align},e.noWrap&&{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},e.gutterBottom&&{marginBottom:"0.35em"},e.paragraph&&{marginBottom:16})),OH={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},Ipe={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},Rpe=n=>Ipe[n]||n,kpe=me.forwardRef(function(e,t){const r=ua({props:e,name:"MuiTypography"}),s=Rpe(r.color),o=xC(Qe({},r,{color:s})),{align:l="inherit",className:u,component:h,gutterBottom:f=!1,noWrap:g=!1,paragraph:y=!1,variant:b="body1",variantMapping:w=OH}=o,C=Ar(o,Cpe),M=Qe({},o,{align:l,color:s,className:u,component:h,gutterBottom:f,noWrap:g,paragraph:y,variant:b,variantMapping:w}),A=h||(y?"p":w[b]||OH[b])||"span",k=Mpe(M);return Ne.jsx(Ape,Qe({as:A,ref:t,ownerState:M,className:ai(k.root,u)},C))}),f_=kpe,Ope=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function Lpe(n){const e=parseInt(n.getAttribute("tabindex")||"",10);return Number.isNaN(e)?n.contentEditable==="true"||(n.nodeName==="AUDIO"||n.nodeName==="VIDEO"||n.nodeName==="DETAILS")&&n.getAttribute("tabindex")===null?0:n.tabIndex:e}function Npe(n){if(n.tagName!=="INPUT"||n.type!=="radio"||!n.name)return!1;const e=r=>n.ownerDocument.querySelector(`input[type="radio"]${r}`);let t=e(`[name="${n.name}"]:checked`);return t||(t=e(`[name="${n.name}"]`)),t!==n}function Dpe(n){return!(n.disabled||n.tagName==="INPUT"&&n.type==="hidden"||Npe(n))}function Ppe(n){const e=[],t=[];return Array.from(n.querySelectorAll(Ope)).forEach((r,s)=>{const o=Lpe(r);o===-1||!Dpe(r)||(o===0?e.push(r):t.push({documentOrder:s,tabIndex:o,node:r}))}),t.sort((r,s)=>r.tabIndex===s.tabIndex?r.documentOrder-s.documentOrder:r.tabIndex-s.tabIndex).map(r=>r.node).concat(e)}function Bpe(){return!0}function Fpe(n){const{children:e,disableAutoFocus:t=!1,disableEnforceFocus:r=!1,disableRestoreFocus:s=!1,getTabbable:o=Ppe,isEnabled:l=Bpe,open:u}=n,h=me.useRef(!1),f=me.useRef(null),g=me.useRef(null),y=me.useRef(null),b=me.useRef(null),w=me.useRef(!1),C=me.useRef(null),M=gp(e.ref,C),A=me.useRef(null);me.useEffect(()=>{!u||!C.current||(w.current=!t)},[t,u]),me.useEffect(()=>{if(!u||!C.current)return;const P=Jp(C.current);return C.current.contains(P.activeElement)||(C.current.hasAttribute("tabIndex")||C.current.setAttribute("tabIndex","-1"),w.current&&C.current.focus()),()=>{s||(y.current&&y.current.focus&&(h.current=!0,y.current.focus()),y.current=null)}},[u]),me.useEffect(()=>{if(!u||!C.current)return;const P=Jp(C.current),D=V=>{A.current=V,!(r||!l()||V.key!=="Tab")&&P.activeElement===C.current&&V.shiftKey&&(h.current=!0,g.current&&g.current.focus())},z=()=>{const V=C.current;if(V===null)return;if(!P.hasFocus()||!l()||h.current){h.current=!1;return}if(V.contains(P.activeElement)||r&&P.activeElement!==f.current&&P.activeElement!==g.current)return;if(P.activeElement!==b.current)b.current=null;else if(b.current!==null)return;if(!w.current)return;let H=[];if((P.activeElement===f.current||P.activeElement===g.current)&&(H=o(C.current)),H.length>0){var oe,le;const Z=!!((oe=A.current)!=null&&oe.shiftKey&&((le=A.current)==null?void 0:le.key)==="Tab"),q=H[0],he=H[H.length-1];typeof q!="string"&&typeof he!="string"&&(Z?he.focus():q.focus())}else V.focus()};P.addEventListener("focusin",z),P.addEventListener("keydown",D,!0);const U=setInterval(()=>{P.activeElement&&P.activeElement.tagName==="BODY"&&z()},50);return()=>{clearInterval(U),P.removeEventListener("focusin",z),P.removeEventListener("keydown",D,!0)}},[t,r,s,l,u,o]);const k=P=>{y.current===null&&(y.current=P.relatedTarget),w.current=!0,b.current=P.target;const D=e.props.onFocus;D&&D(P)},L=P=>{y.current===null&&(y.current=P.relatedTarget),w.current=!0};return Ne.jsxs(me.Fragment,{children:[Ne.jsx("div",{tabIndex:u?0:-1,onFocus:L,ref:f,"data-testid":"sentinelStart"}),me.cloneElement(e,{ref:M,onFocus:k}),Ne.jsx("div",{tabIndex:u?0:-1,onFocus:L,ref:g,"data-testid":"sentinelEnd"})]})}function zpe(n){return typeof n=="function"?n():n}const Upe=me.forwardRef(function(e,t){const{children:r,container:s,disablePortal:o=!1}=e,[l,u]=me.useState(null),h=gp(me.isValidElement(r)?r.ref:null,t);if(Uy(()=>{o||u(zpe(s)||document.body)},[s,o]),Uy(()=>{if(l&&!o)return aR(t,l),()=>{aR(t,null)}},[t,l,o]),o){if(me.isValidElement(r)){const f={ref:h};return me.cloneElement(r,f)}return Ne.jsx(me.Fragment,{children:r})}return Ne.jsx(me.Fragment,{children:l&&O3.createPortal(r,l)})});function Hpe(n){const e=Jp(n);return e.body===n?Hy(n).innerWidth>e.documentElement.clientWidth:n.scrollHeight>n.clientHeight}function qx(n,e){e?n.setAttribute("aria-hidden","true"):n.removeAttribute("aria-hidden")}function LH(n){return parseInt(Hy(n).getComputedStyle(n).paddingRight,10)||0}function Gpe(n){const t=["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].indexOf(n.tagName)!==-1,r=n.tagName==="INPUT"&&n.getAttribute("type")==="hidden";return t||r}function NH(n,e,t,r,s){const o=[e,t,...r];[].forEach.call(n.children,l=>{const u=o.indexOf(l)===-1,h=!Gpe(l);u&&h&&qx(l,s)})}function JO(n,e){let t=-1;return n.some((r,s)=>e(r)?(t=s,!0):!1),t}function Wpe(n,e){const t=[],r=n.container;if(!e.disableScrollLock){if(Hpe(r)){const l=cK(Jp(r));t.push({value:r.style.paddingRight,property:"padding-right",el:r}),r.style.paddingRight=`${LH(r)+l}px`;const u=Jp(r).querySelectorAll(".mui-fixed");[].forEach.call(u,h=>{t.push({value:h.style.paddingRight,property:"padding-right",el:h}),h.style.paddingRight=`${LH(h)+l}px`})}let o;if(r.parentNode instanceof DocumentFragment)o=Jp(r).body;else{const l=r.parentElement,u=Hy(r);o=(l==null?void 0:l.nodeName)==="HTML"&&u.getComputedStyle(l).overflowY==="scroll"?l:r}t.push({value:o.style.overflow,property:"overflow",el:o},{value:o.style.overflowX,property:"overflow-x",el:o},{value:o.style.overflowY,property:"overflow-y",el:o}),o.style.overflow="hidden"}return()=>{t.forEach(({value:o,el:l,property:u})=>{o?l.style.setProperty(u,o):l.style.removeProperty(u)})}}function Vpe(n){const e=[];return[].forEach.call(n.children,t=>{t.getAttribute("aria-hidden")==="true"&&e.push(t)}),e}class jpe{constructor(){this.containers=void 0,this.modals=void 0,this.modals=[],this.containers=[]}add(e,t){let r=this.modals.indexOf(e);if(r!==-1)return r;r=this.modals.length,this.modals.push(e),e.modalRef&&qx(e.modalRef,!1);const s=Vpe(t);NH(t,e.mount,e.modalRef,s,!0);const o=JO(this.containers,l=>l.container===t);return o!==-1?(this.containers[o].modals.push(e),r):(this.containers.push({modals:[e],container:t,restore:null,hiddenSiblings:s}),r)}mount(e,t){const r=JO(this.containers,o=>o.modals.indexOf(e)!==-1),s=this.containers[r];s.restore||(s.restore=Wpe(s,t))}remove(e,t=!0){const r=this.modals.indexOf(e);if(r===-1)return r;const s=JO(this.containers,l=>l.modals.indexOf(e)!==-1),o=this.containers[s];if(o.modals.splice(o.modals.indexOf(e),1),this.modals.splice(r,1),o.modals.length===0)o.restore&&o.restore(),e.modalRef&&qx(e.modalRef,t),NH(o.container,e.mount,e.modalRef,o.hiddenSiblings,!1),this.containers.splice(s,1);else{const l=o.modals[o.modals.length-1];l.modalRef&&qx(l.modalRef,!1)}return r}isTopModal(e){return this.modals.length>0&&this.modals[this.modals.length-1]===e}}function Ype(n){return typeof n=="function"?n():n}function Xpe(n){return n?n.props.hasOwnProperty("in"):!1}const Kpe=new jpe;function Jpe(n){const{container:e,disableEscapeKeyDown:t=!1,disableScrollLock:r=!1,manager:s=Kpe,closeAfterTransition:o=!1,onTransitionEnter:l,onTransitionExited:u,children:h,onClose:f,open:g,rootRef:y}=n,b=me.useRef({}),w=me.useRef(null),C=me.useRef(null),M=gp(C,y),[A,k]=me.useState(!g),L=Xpe(h);let P=!0;(n["aria-hidden"]==="false"||n["aria-hidden"]===!1)&&(P=!1);const D=()=>Jp(w.current),z=()=>(b.current.modalRef=C.current,b.current.mount=w.current,b.current),U=()=>{s.mount(z(),{disableScrollLock:r}),C.current&&(C.current.scrollTop=0)},V=S1(()=>{const ge=Ype(e)||D().body;s.add(z(),ge),C.current&&U()}),H=me.useCallback(()=>s.isTopModal(z()),[s]),oe=S1(ge=>{w.current=ge,ge&&(g&&H()?U():C.current&&qx(C.current,P))}),le=me.useCallback(()=>{s.remove(z(),P)},[P,s]);me.useEffect(()=>()=>{le()},[le]),me.useEffect(()=>{g?V():(!L||!o)&&le()},[g,le,L,o,V]);const Z=ge=>we=>{var J;(J=ge.onKeyDown)==null||J.call(ge,we),!(we.key!=="Escape"||we.which===229||!H())&&(t||(we.stopPropagation(),f&&f(we,"escapeKeyDown")))},q=ge=>we=>{var J;(J=ge.onClick)==null||J.call(ge,we),we.target===we.currentTarget&&f&&f(we,"backdropClick")};return{getRootProps:(ge={})=>{const we=xK(n);delete we.onTransitionEnter,delete we.onTransitionExited;const J=Qe({},we,ge);return Qe({role:"presentation"},J,{onKeyDown:Z(J),ref:M})},getBackdropProps:(ge={})=>{const we=ge;return Qe({"aria-hidden":!0},we,{onClick:q(we),open:g})},getTransitionProps:()=>{const ge=()=>{k(!1),l&&l()},we=()=>{k(!0),u&&u(),o&&le()};return{onEnter:FD(ge,h==null?void 0:h.props.onEnter),onExited:FD(we,h==null?void 0:h.props.onExited)}},rootRef:M,portalRef:oe,isTopModal:H,exited:A,hasTransition:L}}const qpe=["onChange","maxRows","minRows","style","value"];function BM(n){return parseInt(n,10)||0}const Qpe={shadow:{visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"}};function Zpe(n){return n==null||Object.keys(n).length===0||n.outerHeightStyle===0&&!n.overflowing}const eme=me.forwardRef(function(e,t){const{onChange:r,maxRows:s,minRows:o=1,style:l,value:u}=e,h=Ar(e,qpe),{current:f}=me.useRef(u!=null),g=me.useRef(null),y=gp(t,g),b=me.useRef(null),w=me.useCallback(()=>{const A=g.current,L=Hy(A).getComputedStyle(A);if(L.width==="0px")return{outerHeightStyle:0,overflowing:!1};const P=b.current;P.style.width=L.width,P.value=A.value||e.placeholder||"x",P.value.slice(-1)===` +`&&(P.value+=" ");const D=L.boxSizing,z=BM(L.paddingBottom)+BM(L.paddingTop),U=BM(L.borderBottomWidth)+BM(L.borderTopWidth),V=P.scrollHeight;P.value="x";const H=P.scrollHeight;let oe=V;o&&(oe=Math.max(Number(o)*H,oe)),s&&(oe=Math.min(Number(s)*H,oe)),oe=Math.max(oe,H);const le=oe+(D==="border-box"?z+U:0),Z=Math.abs(oe-V)<=1;return{outerHeightStyle:le,overflowing:Z}},[s,o,e.placeholder]),C=me.useCallback(()=>{const A=w();if(Zpe(A))return;const k=g.current;k.style.height=`${A.outerHeightStyle}px`,k.style.overflow=A.overflowing?"hidden":""},[w]);Uy(()=>{const A=()=>{C()};let k;const L=SF(A),P=g.current,D=Hy(P);D.addEventListener("resize",L);let z;return typeof ResizeObserver<"u"&&(z=new ResizeObserver(A),z.observe(P)),()=>{L.clear(),cancelAnimationFrame(k),D.removeEventListener("resize",L),z&&z.disconnect()}},[w,C]),Uy(()=>{C()});const M=A=>{f||C(),r&&r(A)};return Ne.jsxs(me.Fragment,{children:[Ne.jsx("textarea",Qe({value:u,onChange:M,ref:y,rows:o,style:l},h)),Ne.jsx("textarea",{"aria-hidden":!0,className:e.className,readOnly:!0,ref:b,tabIndex:-1,style:Qe({},Qpe.shadow,l,{paddingTop:0,paddingBottom:0})})]})});function tb({props:n,states:e,muiFormControl:t}){return e.reduce((r,s)=>(r[s]=n[s],t&&typeof n[s]>"u"&&(r[s]=t[s]),r),{})}const tme=me.createContext(void 0),RF=tme;function Av(){return me.useContext(RF)}function nme(n){return Ne.jsx(She,Qe({},n,{defaultTheme:Vk,themeId:bC}))}function DH(n){return n!=null&&!(Array.isArray(n)&&n.length===0)}function fR(n,e=!1){return n&&(DH(n.value)&&n.value!==""||e&&DH(n.defaultValue)&&n.defaultValue!=="")}function rme(n){return n.startAdornment}function ime(n){return Po("MuiInputBase",n)}const sme=Xo("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]),kw=sme,ome=["aria-describedby","autoComplete","autoFocus","className","color","components","componentsProps","defaultValue","disabled","disableInjectingGlobalStyles","endAdornment","error","fullWidth","id","inputComponent","inputProps","inputRef","margin","maxRows","minRows","multiline","name","onBlur","onChange","onClick","onFocus","onKeyDown","onKeyUp","placeholder","readOnly","renderSuffix","rows","size","slotProps","slots","startAdornment","type","value"],Xk=(n,e)=>{const{ownerState:t}=n;return[e.root,t.formControl&&e.formControl,t.startAdornment&&e.adornedStart,t.endAdornment&&e.adornedEnd,t.error&&e.error,t.size==="small"&&e.sizeSmall,t.multiline&&e.multiline,t.color&&e[`color${gr(t.color)}`],t.fullWidth&&e.fullWidth,t.hiddenLabel&&e.hiddenLabel]},Kk=(n,e)=>{const{ownerState:t}=n;return[e.input,t.size==="small"&&e.inputSizeSmall,t.multiline&&e.inputMultiline,t.type==="search"&&e.inputTypeSearch,t.startAdornment&&e.inputAdornedStart,t.endAdornment&&e.inputAdornedEnd,t.hiddenLabel&&e.inputHiddenLabel]},ame=n=>{const{classes:e,color:t,disabled:r,error:s,endAdornment:o,focused:l,formControl:u,fullWidth:h,hiddenLabel:f,multiline:g,readOnly:y,size:b,startAdornment:w,type:C}=n,M={root:["root",`color${gr(t)}`,r&&"disabled",s&&"error",h&&"fullWidth",l&&"focused",u&&"formControl",b&&b!=="medium"&&`size${gr(b)}`,g&&"multiline",w&&"adornedStart",o&&"adornedEnd",f&&"hiddenLabel",y&&"readOnly"],input:["input",r&&"disabled",C==="search"&&"inputTypeSearch",g&&"inputMultiline",b==="small"&&"inputSizeSmall",f&&"inputHiddenLabel",w&&"inputAdornedStart",o&&"inputAdornedEnd",y&&"readOnly"]};return Ko(M,ime,e)},Jk=pr("div",{name:"MuiInputBase",slot:"Root",overridesResolver:Xk})(({theme:n,ownerState:e})=>Qe({},n.typography.body1,{color:(n.vars||n).palette.text.primary,lineHeight:"1.4375em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center",[`&.${kw.disabled}`]:{color:(n.vars||n).palette.text.disabled,cursor:"default"}},e.multiline&&Qe({padding:"4px 0 5px"},e.size==="small"&&{paddingTop:1}),e.fullWidth&&{width:"100%"})),qk=pr("input",{name:"MuiInputBase",slot:"Input",overridesResolver:Kk})(({theme:n,ownerState:e})=>{const t=n.palette.mode==="light",r=Qe({color:"currentColor"},n.vars?{opacity:n.vars.opacity.inputPlaceholder}:{opacity:t?.42:.5},{transition:n.transitions.create("opacity",{duration:n.transitions.duration.shorter})}),s={opacity:"0 !important"},o=n.vars?{opacity:n.vars.opacity.inputPlaceholder}:{opacity:t?.42:.5};return Qe({font:"inherit",letterSpacing:"inherit",color:"currentColor",padding:"4px 0 5px",border:0,boxSizing:"content-box",background:"none",height:"1.4375em",margin:0,WebkitTapHighlightColor:"transparent",display:"block",minWidth:0,width:"100%",animationName:"mui-auto-fill-cancel",animationDuration:"10ms","&::-webkit-input-placeholder":r,"&::-moz-placeholder":r,"&:-ms-input-placeholder":r,"&::-ms-input-placeholder":r,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{WebkitAppearance:"none"},[`label[data-shrink=false] + .${kw.formControl} &`]:{"&::-webkit-input-placeholder":s,"&::-moz-placeholder":s,"&:-ms-input-placeholder":s,"&::-ms-input-placeholder":s,"&:focus::-webkit-input-placeholder":o,"&:focus::-moz-placeholder":o,"&:focus:-ms-input-placeholder":o,"&:focus::-ms-input-placeholder":o},[`&.${kw.disabled}`]:{opacity:1,WebkitTextFillColor:(n.vars||n).palette.text.disabled},"&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}},e.size==="small"&&{paddingTop:1},e.multiline&&{height:"auto",resize:"none",padding:0,paddingTop:0},e.type==="search"&&{MozAppearance:"textfield"})}),lme=Ne.jsx(nme,{styles:{"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}}),ume=me.forwardRef(function(e,t){var r;const s=ua({props:e,name:"MuiInputBase"}),{"aria-describedby":o,autoComplete:l,autoFocus:u,className:h,components:f={},componentsProps:g={},defaultValue:y,disabled:b,disableInjectingGlobalStyles:w,endAdornment:C,fullWidth:M=!1,id:A,inputComponent:k="input",inputProps:L={},inputRef:P,maxRows:D,minRows:z,multiline:U=!1,name:V,onBlur:H,onChange:oe,onClick:le,onFocus:Z,onKeyDown:q,onKeyUp:he,placeholder:ae,readOnly:ue,renderSuffix:ge,rows:we,slotProps:J={},slots:re={},startAdornment:se,type:fe="text",value:Te}=s,Fe=Ar(s,ome),Ie=L.value!=null?L.value:Te,{current:qe}=me.useRef(Ie!=null),Re=me.useRef(),Ze=me.useCallback(mt=>{},[]),rt=gp(Re,P,L.ref,Ze),[ft,ut]=me.useState(!1),ze=Av(),$e=tb({props:s,muiFormControl:ze,states:["color","disabled","error","hiddenLabel","size","required","filled"]});$e.focused=ze?ze.focused:ft,me.useEffect(()=>{!ze&&b&&ft&&(ut(!1),H&&H())},[ze,b,ft,H]);const He=ze&&ze.onFilled,it=ze&&ze.onEmpty,st=me.useCallback(mt=>{fR(mt)?He&&He():it&&it()},[He,it]);Uy(()=>{qe&&st({value:Ie})},[Ie,st,qe]);const Nt=mt=>{if($e.disabled){mt.stopPropagation();return}Z&&Z(mt),L.onFocus&&L.onFocus(mt),ze&&ze.onFocus?ze.onFocus(mt):ut(!0)},kt=mt=>{H&&H(mt),L.onBlur&&L.onBlur(mt),ze&&ze.onBlur?ze.onBlur(mt):ut(!1)},vt=(mt,...Ke)=>{if(!qe){const Oe=mt.target||Re.current;if(Oe==null)throw new Error(q1(1));st({value:Oe.value})}L.onChange&&L.onChange(mt,...Ke),oe&&oe(mt,...Ke)};me.useEffect(()=>{st(Re.current)},[]);const Ct=mt=>{Re.current&&mt.currentTarget===mt.target&&Re.current.focus(),le&&le(mt)};let At=k,gt=L;U&&At==="input"&&(we?gt=Qe({type:void 0,minRows:we,maxRows:we},gt):gt=Qe({type:void 0,maxRows:D,minRows:z},gt),At=eme);const xe=mt=>{st(mt.animationName==="mui-auto-fill-cancel"?Re.current:{value:"x"})};me.useEffect(()=>{ze&&ze.setAdornedStart(!!se)},[ze,se]);const ie=Qe({},s,{color:$e.color||"primary",disabled:$e.disabled,endAdornment:C,error:$e.error,focused:$e.focused,formControl:ze,fullWidth:M,hiddenLabel:$e.hiddenLabel,multiline:U,size:$e.size,startAdornment:se,type:fe}),Pe=ame(ie),Ye=re.root||f.Root||Jk,St=J.root||g.root||{},It=re.input||f.Input||qk;return gt=Qe({},gt,(r=J.input)!=null?r:g.input),Ne.jsxs(me.Fragment,{children:[!w&&lme,Ne.jsxs(Ye,Qe({},St,!dR(Ye)&&{ownerState:Qe({},ie,St.ownerState)},{ref:t,onClick:Ct},Fe,{className:ai(Pe.root,St.className,h,ue&&"MuiInputBase-readOnly"),children:[se,Ne.jsx(RF.Provider,{value:null,children:Ne.jsx(It,Qe({ownerState:ie,"aria-invalid":$e.error,"aria-describedby":o,autoComplete:l,autoFocus:u,defaultValue:y,disabled:$e.disabled,id:A,onAnimationStart:xe,name:V,placeholder:ae,readOnly:ue,required:$e.required,rows:we,value:Ie,onKeyDown:q,onKeyUp:he,type:fe},gt,!dR(It)&&{as:At,ownerState:Qe({},ie,gt.ownerState)},{ref:rt,className:ai(Pe.input,gt.className,ue&&"MuiInputBase-readOnly"),onBlur:kt,onChange:vt,onFocus:Nt}))}),C,ge?ge(Qe({},$e,{startAdornment:se})):null]}))]})}),kF=ume;function cme(n){return Po("MuiInput",n)}const hme=Qe({},kw,Xo("MuiInput",["root","underline","input"])),tx=hme;function dme(n){return Po("MuiOutlinedInput",n)}const fme=Qe({},kw,Xo("MuiOutlinedInput",["root","notchedOutline","input"])),ny=fme;function pme(n){return Po("MuiFilledInput",n)}const mme=Qe({},kw,Xo("MuiFilledInput",["root","underline","input"])),Gb=mme,gme=CC(Ne.jsx("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown"),_me=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"],vme={entering:{opacity:1},entered:{opacity:1}},yme=me.forwardRef(function(e,t){const r=jk(),s={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:o,appear:l=!0,children:u,easing:h,in:f,onEnter:g,onEntered:y,onEntering:b,onExit:w,onExited:C,onExiting:M,style:A,timeout:k=s,TransitionComponent:L=wK}=e,P=Ar(e,_me),D=me.useRef(null),z=gp(D,u.ref,t),U=ae=>ue=>{if(ae){const ge=D.current;ue===void 0?ae(ge):ae(ge,ue)}},V=U(b),H=U((ae,ue)=>{EK(ae);const ge=hR({style:A,timeout:k,easing:h},{mode:"enter"});ae.style.webkitTransition=r.transitions.create("opacity",ge),ae.style.transition=r.transitions.create("opacity",ge),g&&g(ae,ue)}),oe=U(y),le=U(M),Z=U(ae=>{const ue=hR({style:A,timeout:k,easing:h},{mode:"exit"});ae.style.webkitTransition=r.transitions.create("opacity",ue),ae.style.transition=r.transitions.create("opacity",ue),w&&w(ae)}),q=U(C),he=ae=>{o&&o(D.current,ae)};return Ne.jsx(L,Qe({appear:l,in:f,nodeRef:D,onEnter:H,onEntered:oe,onEntering:V,onExit:Z,onExited:q,onExiting:le,addEndListener:he,timeout:k},P,{children:(ae,ue)=>me.cloneElement(u,Qe({style:Qe({opacity:0,visibility:ae==="exited"&&!f?"hidden":void 0},vme[ae],A,u.props.style),ref:z},ue))}))}),$K=yme;function bme(n){return Po("MuiBackdrop",n)}Xo("MuiBackdrop",["root","invisible"]);const Tme=["children","className","component","components","componentsProps","invisible","open","slotProps","slots","TransitionComponent","transitionDuration"],Sme=n=>{const{classes:e,invisible:t}=n;return Ko({root:["root",t&&"invisible"]},bme,e)},wme=pr("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(n,e)=>{const{ownerState:t}=n;return[e.root,t.invisible&&e.invisible]}})(({ownerState:n})=>Qe({position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent"},n.invisible&&{backgroundColor:"transparent"})),Eme=me.forwardRef(function(e,t){var r,s,o;const l=ua({props:e,name:"MuiBackdrop"}),{children:u,className:h,component:f="div",components:g={},componentsProps:y={},invisible:b=!1,open:w,slotProps:C={},slots:M={},TransitionComponent:A=$K,transitionDuration:k}=l,L=Ar(l,Tme),P=Qe({},l,{component:f,invisible:b}),D=Sme(P),z=(r=C.root)!=null?r:y.root;return Ne.jsx(A,Qe({in:w,timeout:k},L,{children:Ne.jsx(wme,Qe({"aria-hidden":!0},z,{as:(s=(o=M.root)!=null?o:g.Root)!=null?s:f,className:ai(D.root,h,z==null?void 0:z.className),ownerState:Qe({},P,z==null?void 0:z.ownerState),classes:D,ref:t,children:u}))}))}),OF=Eme,xme=Xo("MuiBox",["root"]),$me=xme,Cme=bK(),Mme=Ahe({themeId:bC,defaultTheme:Cme,defaultClassName:$me.root,generateClassName:_F.generate}),Ey=Mme;function Ame(n){return Po("MuiButton",n)}const Ime=Xo("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","colorPrimary","colorSecondary","colorSuccess","colorError","colorInfo","colorWarning","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","icon","iconSizeSmall","iconSizeMedium","iconSizeLarge"]),FM=Ime,Rme=me.createContext({}),kme=Rme,Ome=me.createContext(void 0),Lme=Ome,Nme=["children","color","component","className","disabled","disableElevation","disableFocusRipple","endIcon","focusVisibleClassName","fullWidth","size","startIcon","type","variant"],Dme=n=>{const{color:e,disableElevation:t,fullWidth:r,size:s,variant:o,classes:l}=n,u={root:["root",o,`${o}${gr(e)}`,`size${gr(s)}`,`${o}Size${gr(s)}`,`color${gr(e)}`,t&&"disableElevation",r&&"fullWidth"],label:["label"],startIcon:["icon","startIcon",`iconSize${gr(s)}`],endIcon:["icon","endIcon",`iconSize${gr(s)}`]},h=Ko(u,Ame,l);return Qe({},l,h)},CK=n=>Qe({},n.size==="small"&&{"& > *:nth-of-type(1)":{fontSize:18}},n.size==="medium"&&{"& > *:nth-of-type(1)":{fontSize:20}},n.size==="large"&&{"& > *:nth-of-type(1)":{fontSize:22}}),Pme=pr(IF,{shouldForwardProp:n=>Vm(n)||n==="classes",name:"MuiButton",slot:"Root",overridesResolver:(n,e)=>{const{ownerState:t}=n;return[e.root,e[t.variant],e[`${t.variant}${gr(t.color)}`],e[`size${gr(t.size)}`],e[`${t.variant}Size${gr(t.size)}`],t.color==="inherit"&&e.colorInherit,t.disableElevation&&e.disableElevation,t.fullWidth&&e.fullWidth]}})(({theme:n,ownerState:e})=>{var t,r;const s=n.palette.mode==="light"?n.palette.grey[300]:n.palette.grey[800],o=n.palette.mode==="light"?n.palette.grey.A100:n.palette.grey[700];return Qe({},n.typography.button,{minWidth:64,padding:"6px 16px",borderRadius:(n.vars||n).shape.borderRadius,transition:n.transitions.create(["background-color","box-shadow","border-color","color"],{duration:n.transitions.duration.short}),"&:hover":Qe({textDecoration:"none",backgroundColor:n.vars?`rgba(${n.vars.palette.text.primaryChannel} / ${n.vars.palette.action.hoverOpacity})`:r0(n.palette.text.primary,n.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},e.variant==="text"&&e.color!=="inherit"&&{backgroundColor:n.vars?`rgba(${n.vars.palette[e.color].mainChannel} / ${n.vars.palette.action.hoverOpacity})`:r0(n.palette[e.color].main,n.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},e.variant==="outlined"&&e.color!=="inherit"&&{border:`1px solid ${(n.vars||n).palette[e.color].main}`,backgroundColor:n.vars?`rgba(${n.vars.palette[e.color].mainChannel} / ${n.vars.palette.action.hoverOpacity})`:r0(n.palette[e.color].main,n.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},e.variant==="contained"&&{backgroundColor:n.vars?n.vars.palette.Button.inheritContainedHoverBg:o,boxShadow:(n.vars||n).shadows[4],"@media (hover: none)":{boxShadow:(n.vars||n).shadows[2],backgroundColor:(n.vars||n).palette.grey[300]}},e.variant==="contained"&&e.color!=="inherit"&&{backgroundColor:(n.vars||n).palette[e.color].dark,"@media (hover: none)":{backgroundColor:(n.vars||n).palette[e.color].main}}),"&:active":Qe({},e.variant==="contained"&&{boxShadow:(n.vars||n).shadows[8]}),[`&.${FM.focusVisible}`]:Qe({},e.variant==="contained"&&{boxShadow:(n.vars||n).shadows[6]}),[`&.${FM.disabled}`]:Qe({color:(n.vars||n).palette.action.disabled},e.variant==="outlined"&&{border:`1px solid ${(n.vars||n).palette.action.disabledBackground}`},e.variant==="contained"&&{color:(n.vars||n).palette.action.disabled,boxShadow:(n.vars||n).shadows[0],backgroundColor:(n.vars||n).palette.action.disabledBackground})},e.variant==="text"&&{padding:"6px 8px"},e.variant==="text"&&e.color!=="inherit"&&{color:(n.vars||n).palette[e.color].main},e.variant==="outlined"&&{padding:"5px 15px",border:"1px solid currentColor"},e.variant==="outlined"&&e.color!=="inherit"&&{color:(n.vars||n).palette[e.color].main,border:n.vars?`1px solid rgba(${n.vars.palette[e.color].mainChannel} / 0.5)`:`1px solid ${r0(n.palette[e.color].main,.5)}`},e.variant==="contained"&&{color:n.vars?n.vars.palette.text.primary:(t=(r=n.palette).getContrastText)==null?void 0:t.call(r,n.palette.grey[300]),backgroundColor:n.vars?n.vars.palette.Button.inheritContainedBg:s,boxShadow:(n.vars||n).shadows[2]},e.variant==="contained"&&e.color!=="inherit"&&{color:(n.vars||n).palette[e.color].contrastText,backgroundColor:(n.vars||n).palette[e.color].main},e.color==="inherit"&&{color:"inherit",borderColor:"currentColor"},e.size==="small"&&e.variant==="text"&&{padding:"4px 5px",fontSize:n.typography.pxToRem(13)},e.size==="large"&&e.variant==="text"&&{padding:"8px 11px",fontSize:n.typography.pxToRem(15)},e.size==="small"&&e.variant==="outlined"&&{padding:"3px 9px",fontSize:n.typography.pxToRem(13)},e.size==="large"&&e.variant==="outlined"&&{padding:"7px 21px",fontSize:n.typography.pxToRem(15)},e.size==="small"&&e.variant==="contained"&&{padding:"4px 10px",fontSize:n.typography.pxToRem(13)},e.size==="large"&&e.variant==="contained"&&{padding:"8px 22px",fontSize:n.typography.pxToRem(15)},e.fullWidth&&{width:"100%"})},({ownerState:n})=>n.disableElevation&&{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${FM.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${FM.disabled}`]:{boxShadow:"none"}}),Bme=pr("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(n,e)=>{const{ownerState:t}=n;return[e.startIcon,e[`iconSize${gr(t.size)}`]]}})(({ownerState:n})=>Qe({display:"inherit",marginRight:8,marginLeft:-4},n.size==="small"&&{marginLeft:-2},CK(n))),Fme=pr("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(n,e)=>{const{ownerState:t}=n;return[e.endIcon,e[`iconSize${gr(t.size)}`]]}})(({ownerState:n})=>Qe({display:"inherit",marginRight:-4,marginLeft:8},n.size==="small"&&{marginRight:-2},CK(n))),zme=me.forwardRef(function(e,t){const r=me.useContext(kme),s=me.useContext(Lme),o=bF(r,e),l=ua({props:o,name:"MuiButton"}),{children:u,color:h="primary",component:f="button",className:g,disabled:y=!1,disableElevation:b=!1,disableFocusRipple:w=!1,endIcon:C,focusVisibleClassName:M,fullWidth:A=!1,size:k="medium",startIcon:L,type:P,variant:D="text"}=l,z=Ar(l,Nme),U=Qe({},l,{color:h,component:f,disabled:y,disableElevation:b,disableFocusRipple:w,fullWidth:A,size:k,type:P,variant:D}),V=Dme(U),H=L&&Ne.jsx(Bme,{className:V.startIcon,ownerState:U,children:L}),oe=C&&Ne.jsx(Fme,{className:V.endIcon,ownerState:U,children:C}),le=s||"";return Ne.jsxs(Pme,Qe({ownerState:U,className:ai(r.className,V.root,g,le),component:f,disabled:y,focusRipple:!w,focusVisibleClassName:ai(V.focusVisible,M),ref:t,type:P},z,{classes:V,children:[H,u,oe]}))}),Ume=zme;function Hme(n){return Po("PrivateSwitchBase",n)}Xo("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const Gme=["autoFocus","checked","checkedIcon","className","defaultChecked","disabled","disableFocusRipple","edge","icon","id","inputProps","inputRef","name","onBlur","onChange","onFocus","readOnly","required","tabIndex","type","value"],Wme=n=>{const{classes:e,checked:t,disabled:r,edge:s}=n,o={root:["root",t&&"checked",r&&"disabled",s&&`edge${gr(s)}`],input:["input"]};return Ko(o,Hme,e)},Vme=pr(IF)(({ownerState:n})=>Qe({padding:9,borderRadius:"50%"},n.edge==="start"&&{marginLeft:n.size==="small"?-3:-12},n.edge==="end"&&{marginRight:n.size==="small"?-3:-12})),jme=pr("input",{shouldForwardProp:Vm})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),Yme=me.forwardRef(function(e,t){const{autoFocus:r,checked:s,checkedIcon:o,className:l,defaultChecked:u,disabled:h,disableFocusRipple:f=!1,edge:g=!1,icon:y,id:b,inputProps:w,inputRef:C,name:M,onBlur:A,onChange:k,onFocus:L,readOnly:P,required:D=!1,tabIndex:z,type:U,value:V}=e,H=Ar(e,Gme),[oe,le]=lR({controlled:s,default:!!u,name:"SwitchBase",state:"checked"}),Z=Av(),q=re=>{L&&L(re),Z&&Z.onFocus&&Z.onFocus(re)},he=re=>{A&&A(re),Z&&Z.onBlur&&Z.onBlur(re)},ae=re=>{if(re.nativeEvent.defaultPrevented)return;const se=re.target.checked;le(se),k&&k(re,se)};let ue=h;Z&&typeof ue>"u"&&(ue=Z.disabled);const ge=U==="checkbox"||U==="radio",we=Qe({},e,{checked:oe,disabled:ue,disableFocusRipple:f,edge:g}),J=Wme(we);return Ne.jsxs(Vme,Qe({component:"span",className:ai(J.root,l),centerRipple:!0,focusRipple:!f,disabled:ue,tabIndex:null,role:void 0,onFocus:q,onBlur:he,ownerState:we,ref:t},H,{children:[Ne.jsx(jme,Qe({autoFocus:r,checked:s,defaultChecked:u,className:J.input,disabled:ue,id:ge?b:void 0,name:M,onChange:ae,readOnly:P,ref:C,required:D,ownerState:we,tabIndex:z,type:U},U==="checkbox"&&V===void 0?{}:{value:V},w)),oe?o:y]}))}),MK=Yme,Xme=CC(Ne.jsx("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}),"CheckBoxOutlineBlank"),Kme=CC(Ne.jsx("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckBox"),Jme=CC(Ne.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}),"IndeterminateCheckBox");function qme(n){return Po("MuiCheckbox",n)}const Qme=Xo("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary","sizeSmall","sizeMedium"]),qO=Qme,Zme=["checkedIcon","color","icon","indeterminate","indeterminateIcon","inputProps","size","className"],ege=n=>{const{classes:e,indeterminate:t,color:r,size:s}=n,o={root:["root",t&&"indeterminate",`color${gr(r)}`,`size${gr(s)}`]},l=Ko(o,qme,e);return Qe({},e,l)},tge=pr(MK,{shouldForwardProp:n=>Vm(n)||n==="classes",name:"MuiCheckbox",slot:"Root",overridesResolver:(n,e)=>{const{ownerState:t}=n;return[e.root,t.indeterminate&&e.indeterminate,e[`size${gr(t.size)}`],t.color!=="default"&&e[`color${gr(t.color)}`]]}})(({theme:n,ownerState:e})=>Qe({color:(n.vars||n).palette.text.secondary},!e.disableRipple&&{"&:hover":{backgroundColor:n.vars?`rgba(${e.color==="default"?n.vars.palette.action.activeChannel:n.vars.palette[e.color].mainChannel} / ${n.vars.palette.action.hoverOpacity})`:r0(e.color==="default"?n.palette.action.active:n.palette[e.color].main,n.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},e.color!=="default"&&{[`&.${qO.checked}, &.${qO.indeterminate}`]:{color:(n.vars||n).palette[e.color].main},[`&.${qO.disabled}`]:{color:(n.vars||n).palette.action.disabled}})),nge=Ne.jsx(Kme,{}),rge=Ne.jsx(Xme,{}),ige=Ne.jsx(Jme,{}),sge=me.forwardRef(function(e,t){var r,s;const o=ua({props:e,name:"MuiCheckbox"}),{checkedIcon:l=nge,color:u="primary",icon:h=rge,indeterminate:f=!1,indeterminateIcon:g=ige,inputProps:y,size:b="medium",className:w}=o,C=Ar(o,Zme),M=f?g:h,A=f?g:l,k=Qe({},o,{color:u,indeterminate:f,size:b}),L=ege(k);return Ne.jsx(tge,Qe({type:"checkbox",inputProps:Qe({"data-indeterminate":f},y),icon:me.cloneElement(M,{fontSize:(r=M.props.fontSize)!=null?r:b}),checkedIcon:me.cloneElement(A,{fontSize:(s=A.props.fontSize)!=null?s:b}),ownerState:k,ref:t,className:ai(L.root,w)},C,{classes:L}))}),oge=sge,age=vde({createStyledComponent:pr("div",{name:"MuiContainer",slot:"Root",overridesResolver:(n,e)=>{const{ownerState:t}=n;return[e.root,e[`maxWidth${gr(String(t.maxWidth))}`],t.fixed&&e.fixed,t.disableGutters&&e.disableGutters]}}),useThemeProps:n=>ua({props:n,name:"MuiContainer"})}),PH=age;function lge(n){return Po("MuiModal",n)}Xo("MuiModal",["root","hidden","backdrop"]);const uge=["BackdropComponent","BackdropProps","classes","className","closeAfterTransition","children","container","component","components","componentsProps","disableAutoFocus","disableEnforceFocus","disableEscapeKeyDown","disablePortal","disableRestoreFocus","disableScrollLock","hideBackdrop","keepMounted","onBackdropClick","onClose","onTransitionEnter","onTransitionExited","open","slotProps","slots","theme"],cge=n=>{const{open:e,exited:t,classes:r}=n;return Ko({root:["root",!e&&t&&"hidden"],backdrop:["backdrop"]},lge,r)},hge=pr("div",{name:"MuiModal",slot:"Root",overridesResolver:(n,e)=>{const{ownerState:t}=n;return[e.root,!t.open&&t.exited&&e.hidden]}})(({theme:n,ownerState:e})=>Qe({position:"fixed",zIndex:(n.vars||n).zIndex.modal,right:0,bottom:0,top:0,left:0},!e.open&&e.exited&&{visibility:"hidden"})),dge=pr(OF,{name:"MuiModal",slot:"Backdrop",overridesResolver:(n,e)=>e.backdrop})({zIndex:-1}),fge=me.forwardRef(function(e,t){var r,s,o,l,u,h;const f=ua({name:"MuiModal",props:e}),{BackdropComponent:g=dge,BackdropProps:y,className:b,closeAfterTransition:w=!1,children:C,container:M,component:A,components:k={},componentsProps:L={},disableAutoFocus:P=!1,disableEnforceFocus:D=!1,disableEscapeKeyDown:z=!1,disablePortal:U=!1,disableRestoreFocus:V=!1,disableScrollLock:H=!1,hideBackdrop:oe=!1,keepMounted:le=!1,onBackdropClick:Z,open:q,slotProps:he,slots:ae}=f,ue=Ar(f,uge),ge=Qe({},f,{closeAfterTransition:w,disableAutoFocus:P,disableEnforceFocus:D,disableEscapeKeyDown:z,disablePortal:U,disableRestoreFocus:V,disableScrollLock:H,hideBackdrop:oe,keepMounted:le}),{getRootProps:we,getBackdropProps:J,getTransitionProps:re,portalRef:se,isTopModal:fe,exited:Te,hasTransition:Fe}=Jpe(Qe({},ge,{rootRef:t})),Ie=Qe({},ge,{exited:Te}),qe=cge(Ie),Re={};if(C.props.tabIndex===void 0&&(Re.tabIndex="-1"),Fe){const{onEnter:He,onExited:it}=re();Re.onEnter=He,Re.onExited=it}const Ze=(r=(s=ae==null?void 0:ae.root)!=null?s:k.Root)!=null?r:hge,rt=(o=(l=ae==null?void 0:ae.backdrop)!=null?l:k.Backdrop)!=null?o:g,ft=(u=he==null?void 0:he.root)!=null?u:L.root,ut=(h=he==null?void 0:he.backdrop)!=null?h:L.backdrop,ze=Rw({elementType:Ze,externalSlotProps:ft,externalForwardedProps:ue,getSlotProps:we,additionalProps:{ref:t,as:A},ownerState:Ie,className:ai(b,ft==null?void 0:ft.className,qe==null?void 0:qe.root,!Ie.open&&Ie.exited&&(qe==null?void 0:qe.hidden))}),$e=Rw({elementType:rt,externalSlotProps:ut,additionalProps:y,getSlotProps:He=>J(Qe({},He,{onClick:it=>{Z&&Z(it),He!=null&&He.onClick&&He.onClick(it)}})),className:ai(ut==null?void 0:ut.className,y==null?void 0:y.className,qe==null?void 0:qe.backdrop),ownerState:Ie});return!le&&!q&&(!Fe||Te)?null:Ne.jsx(Upe,{ref:se,container:M,disablePortal:U,children:Ne.jsxs(Ze,Qe({},ze,{children:[!oe&&g?Ne.jsx(rt,Qe({},$e)):null,Ne.jsx(Fpe,{disableEnforceFocus:D,disableAutoFocus:P,disableRestoreFocus:V,isEnabled:fe,open:q,children:me.cloneElement(C,Re)})]}))})}),AK=fge;function pge(n){return Po("MuiDialog",n)}const mge=Xo("MuiDialog",["root","scrollPaper","scrollBody","container","paper","paperScrollPaper","paperScrollBody","paperWidthFalse","paperWidthXs","paperWidthSm","paperWidthMd","paperWidthLg","paperWidthXl","paperFullWidth","paperFullScreen"]),QO=mge,gge=me.createContext({}),_ge=gge,vge=["aria-describedby","aria-labelledby","BackdropComponent","BackdropProps","children","className","disableEscapeKeyDown","fullScreen","fullWidth","maxWidth","onBackdropClick","onClose","open","PaperComponent","PaperProps","scroll","TransitionComponent","transitionDuration","TransitionProps"],yge=pr(OF,{name:"MuiDialog",slot:"Backdrop",overrides:(n,e)=>e.backdrop})({zIndex:-1}),bge=n=>{const{classes:e,scroll:t,maxWidth:r,fullWidth:s,fullScreen:o}=n,l={root:["root"],container:["container",`scroll${gr(t)}`],paper:["paper",`paperScroll${gr(t)}`,`paperWidth${gr(String(r))}`,s&&"paperFullWidth",o&&"paperFullScreen"]};return Ko(l,pge,e)},Tge=pr(AK,{name:"MuiDialog",slot:"Root",overridesResolver:(n,e)=>e.root})({"@media print":{position:"absolute !important"}}),Sge=pr("div",{name:"MuiDialog",slot:"Container",overridesResolver:(n,e)=>{const{ownerState:t}=n;return[e.container,e[`scroll${gr(t.scroll)}`]]}})(({ownerState:n})=>Qe({height:"100%","@media print":{height:"auto"},outline:0},n.scroll==="paper"&&{display:"flex",justifyContent:"center",alignItems:"center"},n.scroll==="body"&&{overflowY:"auto",overflowX:"hidden",textAlign:"center","&::after":{content:'""',display:"inline-block",verticalAlign:"middle",height:"100%",width:"0"}})),wge=pr(AF,{name:"MuiDialog",slot:"Paper",overridesResolver:(n,e)=>{const{ownerState:t}=n;return[e.paper,e[`scrollPaper${gr(t.scroll)}`],e[`paperWidth${gr(String(t.maxWidth))}`],t.fullWidth&&e.paperFullWidth,t.fullScreen&&e.paperFullScreen]}})(({theme:n,ownerState:e})=>Qe({margin:32,position:"relative",overflowY:"auto","@media print":{overflowY:"visible",boxShadow:"none"}},e.scroll==="paper"&&{display:"flex",flexDirection:"column",maxHeight:"calc(100% - 64px)"},e.scroll==="body"&&{display:"inline-block",verticalAlign:"middle",textAlign:"left"},!e.maxWidth&&{maxWidth:"calc(100% - 64px)"},e.maxWidth==="xs"&&{maxWidth:n.breakpoints.unit==="px"?Math.max(n.breakpoints.values.xs,444):`max(${n.breakpoints.values.xs}${n.breakpoints.unit}, 444px)`,[`&.${QO.paperScrollBody}`]:{[n.breakpoints.down(Math.max(n.breakpoints.values.xs,444)+32*2)]:{maxWidth:"calc(100% - 64px)"}}},e.maxWidth&&e.maxWidth!=="xs"&&{maxWidth:`${n.breakpoints.values[e.maxWidth]}${n.breakpoints.unit}`,[`&.${QO.paperScrollBody}`]:{[n.breakpoints.down(n.breakpoints.values[e.maxWidth]+32*2)]:{maxWidth:"calc(100% - 64px)"}}},e.fullWidth&&{width:"calc(100% - 64px)"},e.fullScreen&&{margin:0,width:"100%",maxWidth:"100%",height:"100%",maxHeight:"none",borderRadius:0,[`&.${QO.paperScrollBody}`]:{margin:0,maxWidth:"100%"}})),Ege=me.forwardRef(function(e,t){const r=ua({props:e,name:"MuiDialog"}),s=jk(),o={enter:s.transitions.duration.enteringScreen,exit:s.transitions.duration.leavingScreen},{"aria-describedby":l,"aria-labelledby":u,BackdropComponent:h,BackdropProps:f,children:g,className:y,disableEscapeKeyDown:b=!1,fullScreen:w=!1,fullWidth:C=!1,maxWidth:M="sm",onBackdropClick:A,onClose:k,open:L,PaperComponent:P=AF,PaperProps:D={},scroll:z="paper",TransitionComponent:U=$K,transitionDuration:V=o,TransitionProps:H}=r,oe=Ar(r,vge),le=Qe({},r,{disableEscapeKeyDown:b,fullScreen:w,fullWidth:C,maxWidth:M,scroll:z}),Z=bge(le),q=me.useRef(),he=we=>{q.current=we.target===we.currentTarget},ae=we=>{q.current&&(q.current=null,A&&A(we),k&&k(we,"backdropClick"))},ue=Hk(u),ge=me.useMemo(()=>({titleId:ue}),[ue]);return Ne.jsx(Tge,Qe({className:ai(Z.root,y),closeAfterTransition:!0,components:{Backdrop:yge},componentsProps:{backdrop:Qe({transitionDuration:V,as:h},f)},disableEscapeKeyDown:b,onClose:k,open:L,ref:t,onClick:ae,ownerState:le},oe,{children:Ne.jsx(U,Qe({appear:!0,in:L,timeout:V,role:"presentation"},H,{children:Ne.jsx(Sge,{className:ai(Z.container),onMouseDown:he,ownerState:le,children:Ne.jsx(wge,Qe({as:P,elevation:24,role:"dialog","aria-describedby":l,"aria-labelledby":ue},D,{className:ai(Z.paper,D.className),ownerState:le,children:Ne.jsx(_ge.Provider,{value:ge,children:g})}))})}))}))}),IK=Ege,xge=["disableUnderline","components","componentsProps","fullWidth","hiddenLabel","inputComponent","multiline","slotProps","slots","type"],$ge=n=>{const{classes:e,disableUnderline:t}=n,s=Ko({root:["root",!t&&"underline"],input:["input"]},pme,e);return Qe({},e,s)},Cge=pr(Jk,{shouldForwardProp:n=>Vm(n)||n==="classes",name:"MuiFilledInput",slot:"Root",overridesResolver:(n,e)=>{const{ownerState:t}=n;return[...Xk(n,e),!t.disableUnderline&&e.underline]}})(({theme:n,ownerState:e})=>{var t;const r=n.palette.mode==="light",s=r?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",o=r?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",l=r?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",u=r?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return Qe({position:"relative",backgroundColor:n.vars?n.vars.palette.FilledInput.bg:o,borderTopLeftRadius:(n.vars||n).shape.borderRadius,borderTopRightRadius:(n.vars||n).shape.borderRadius,transition:n.transitions.create("background-color",{duration:n.transitions.duration.shorter,easing:n.transitions.easing.easeOut}),"&:hover":{backgroundColor:n.vars?n.vars.palette.FilledInput.hoverBg:l,"@media (hover: none)":{backgroundColor:n.vars?n.vars.palette.FilledInput.bg:o}},[`&.${Gb.focused}`]:{backgroundColor:n.vars?n.vars.palette.FilledInput.bg:o},[`&.${Gb.disabled}`]:{backgroundColor:n.vars?n.vars.palette.FilledInput.disabledBg:u}},!e.disableUnderline&&{"&::after":{borderBottom:`2px solid ${(t=(n.vars||n).palette[e.color||"primary"])==null?void 0:t.main}`,left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:n.transitions.create("transform",{duration:n.transitions.duration.shorter,easing:n.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${Gb.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${Gb.error}`]:{"&::before, &::after":{borderBottomColor:(n.vars||n).palette.error.main}},"&::before":{borderBottom:`1px solid ${n.vars?`rgba(${n.vars.palette.common.onBackgroundChannel} / ${n.vars.opacity.inputUnderline})`:s}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:n.transitions.create("border-bottom-color",{duration:n.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${Gb.disabled}, .${Gb.error}):before`]:{borderBottom:`1px solid ${(n.vars||n).palette.text.primary}`},[`&.${Gb.disabled}:before`]:{borderBottomStyle:"dotted"}},e.startAdornment&&{paddingLeft:12},e.endAdornment&&{paddingRight:12},e.multiline&&Qe({padding:"25px 12px 8px"},e.size==="small"&&{paddingTop:21,paddingBottom:4},e.hiddenLabel&&{paddingTop:16,paddingBottom:17},e.hiddenLabel&&e.size==="small"&&{paddingTop:8,paddingBottom:9}))}),Mge=pr(qk,{name:"MuiFilledInput",slot:"Input",overridesResolver:Kk})(({theme:n,ownerState:e})=>Qe({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12},!n.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:n.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:n.palette.mode==="light"?null:"#fff",caretColor:n.palette.mode==="light"?null:"#fff",borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"}},n.vars&&{"&:-webkit-autofill":{borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"},[n.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},e.size==="small"&&{paddingTop:21,paddingBottom:4},e.hiddenLabel&&{paddingTop:16,paddingBottom:17},e.startAdornment&&{paddingLeft:0},e.endAdornment&&{paddingRight:0},e.hiddenLabel&&e.size==="small"&&{paddingTop:8,paddingBottom:9},e.multiline&&{paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0})),RK=me.forwardRef(function(e,t){var r,s,o,l;const u=ua({props:e,name:"MuiFilledInput"}),{components:h={},componentsProps:f,fullWidth:g=!1,inputComponent:y="input",multiline:b=!1,slotProps:w,slots:C={},type:M="text"}=u,A=Ar(u,xge),k=Qe({},u,{fullWidth:g,inputComponent:y,multiline:b,type:M}),L=$ge(u),P={root:{ownerState:k},input:{ownerState:k}},D=w??f?fp(P,w??f):P,z=(r=(s=C.root)!=null?s:h.Root)!=null?r:Cge,U=(o=(l=C.input)!=null?l:h.Input)!=null?o:Mge;return Ne.jsx(kF,Qe({slots:{root:z,input:U},componentsProps:D,fullWidth:g,inputComponent:y,multiline:b,ref:t,type:M},A,{classes:L}))});RK.muiName="Input";const kK=RK;function Age(n){return Po("MuiFormControl",n)}Xo("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);const Ige=["children","className","color","component","disabled","error","focused","fullWidth","hiddenLabel","margin","required","size","variant"],Rge=n=>{const{classes:e,margin:t,fullWidth:r}=n,s={root:["root",t!=="none"&&`margin${gr(t)}`,r&&"fullWidth"]};return Ko(s,Age,e)},kge=pr("div",{name:"MuiFormControl",slot:"Root",overridesResolver:({ownerState:n},e)=>Qe({},e.root,e[`margin${gr(n.margin)}`],n.fullWidth&&e.fullWidth)})(({ownerState:n})=>Qe({display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top"},n.margin==="normal"&&{marginTop:16,marginBottom:8},n.margin==="dense"&&{marginTop:8,marginBottom:4},n.fullWidth&&{width:"100%"})),Oge=me.forwardRef(function(e,t){const r=ua({props:e,name:"MuiFormControl"}),{children:s,className:o,color:l="primary",component:u="div",disabled:h=!1,error:f=!1,focused:g,fullWidth:y=!1,hiddenLabel:b=!1,margin:w="none",required:C=!1,size:M="medium",variant:A="outlined"}=r,k=Ar(r,Ige),L=Qe({},r,{color:l,component:u,disabled:h,error:f,fullWidth:y,hiddenLabel:b,margin:w,required:C,size:M,variant:A}),P=Rge(L),[D,z]=me.useState(()=>{let he=!1;return s&&me.Children.forEach(s,ae=>{if(!hI(ae,["Input","Select"]))return;const ue=hI(ae,["Select"])?ae.props.input:ae;ue&&rme(ue.props)&&(he=!0)}),he}),[U,V]=me.useState(()=>{let he=!1;return s&&me.Children.forEach(s,ae=>{hI(ae,["Input","Select"])&&(fR(ae.props,!0)||fR(ae.props.inputProps,!0))&&(he=!0)}),he}),[H,oe]=me.useState(!1);h&&H&&oe(!1);const le=g!==void 0&&!h?g:H;let Z;const q=me.useMemo(()=>({adornedStart:D,setAdornedStart:z,color:l,disabled:h,error:f,filled:U,focused:le,fullWidth:y,hiddenLabel:b,size:M,onBlur:()=>{oe(!1)},onEmpty:()=>{V(!1)},onFilled:()=>{V(!0)},onFocus:()=>{oe(!0)},registerEffect:Z,required:C,variant:A}),[D,l,h,f,U,le,y,b,Z,C,M,A]);return Ne.jsx(RF.Provider,{value:q,children:Ne.jsx(kge,Qe({as:u,ownerState:L,className:ai(P.root,o),ref:t},k,{children:s}))})}),Lge=Oge,Nge=$de({createStyledComponent:pr("div",{name:"MuiStack",slot:"Root",overridesResolver:(n,e)=>e.root}),useThemeProps:n=>ua({props:n,name:"MuiStack"})}),L$=Nge;function Dge(n){return Po("MuiFormControlLabel",n)}const Pge=Xo("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error","required","asterisk"]),Ix=Pge,Bge=["checked","className","componentsProps","control","disabled","disableTypography","inputRef","label","labelPlacement","name","onChange","required","slotProps","value"],Fge=n=>{const{classes:e,disabled:t,labelPlacement:r,error:s,required:o}=n,l={root:["root",t&&"disabled",`labelPlacement${gr(r)}`,s&&"error",o&&"required"],label:["label",t&&"disabled"],asterisk:["asterisk",s&&"error"]};return Ko(l,Dge,e)},zge=pr("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(n,e)=>{const{ownerState:t}=n;return[{[`& .${Ix.label}`]:e.label},e.root,e[`labelPlacement${gr(t.labelPlacement)}`]]}})(({theme:n,ownerState:e})=>Qe({display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,[`&.${Ix.disabled}`]:{cursor:"default"}},e.labelPlacement==="start"&&{flexDirection:"row-reverse",marginLeft:16,marginRight:-11},e.labelPlacement==="top"&&{flexDirection:"column-reverse",marginLeft:16},e.labelPlacement==="bottom"&&{flexDirection:"column",marginLeft:16},{[`& .${Ix.label}`]:{[`&.${Ix.disabled}`]:{color:(n.vars||n).palette.text.disabled}}})),Uge=pr("span",{name:"MuiFormControlLabel",slot:"Asterisk",overridesResolver:(n,e)=>e.asterisk})(({theme:n})=>({[`&.${Ix.error}`]:{color:(n.vars||n).palette.error.main}})),Hge=me.forwardRef(function(e,t){var r,s;const o=ua({props:e,name:"MuiFormControlLabel"}),{className:l,componentsProps:u={},control:h,disabled:f,disableTypography:g,label:y,labelPlacement:b="end",required:w,slotProps:C={}}=o,M=Ar(o,Bge),A=Av(),k=(r=f??h.props.disabled)!=null?r:A==null?void 0:A.disabled,L=w??h.props.required,P={disabled:k,required:L};["checked","name","onChange","value","inputRef"].forEach(oe=>{typeof h.props[oe]>"u"&&typeof o[oe]<"u"&&(P[oe]=o[oe])});const D=tb({props:o,muiFormControl:A,states:["error"]}),z=Qe({},o,{disabled:k,labelPlacement:b,required:L,error:D.error}),U=Fge(z),V=(s=C.typography)!=null?s:u.typography;let H=y;return H!=null&&H.type!==f_&&!g&&(H=Ne.jsx(f_,Qe({component:"span"},V,{className:ai(U.label,V==null?void 0:V.className),children:H}))),Ne.jsxs(zge,Qe({className:ai(U.root,l),ownerState:z,ref:t},M,{children:[me.cloneElement(h,P),L?Ne.jsxs(L$,{display:"block",children:[H,Ne.jsxs(Uge,{ownerState:z,"aria-hidden":!0,className:U.asterisk,children:[" ","*"]})]}):H]}))}),OK=Hge;function Gge(n){return Po("MuiFormGroup",n)}Xo("MuiFormGroup",["root","row","error"]);const Wge=["className","row"],Vge=n=>{const{classes:e,row:t,error:r}=n;return Ko({root:["root",t&&"row",r&&"error"]},Gge,e)},jge=pr("div",{name:"MuiFormGroup",slot:"Root",overridesResolver:(n,e)=>{const{ownerState:t}=n;return[e.root,t.row&&e.row]}})(({ownerState:n})=>Qe({display:"flex",flexDirection:"column",flexWrap:"wrap"},n.row&&{flexDirection:"row"})),Yge=me.forwardRef(function(e,t){const r=ua({props:e,name:"MuiFormGroup"}),{className:s,row:o=!1}=r,l=Ar(r,Wge),u=Av(),h=tb({props:r,muiFormControl:u,states:["error"]}),f=Qe({},r,{row:o,error:h.error}),g=Vge(f);return Ne.jsx(jge,Qe({className:ai(g.root,s),ownerState:f,ref:t},l))}),LK=Yge;function Xge(n){return Po("MuiFormHelperText",n)}const Kge=Xo("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]),BH=Kge;var FH;const Jge=["children","className","component","disabled","error","filled","focused","margin","required","variant"],qge=n=>{const{classes:e,contained:t,size:r,disabled:s,error:o,filled:l,focused:u,required:h}=n,f={root:["root",s&&"disabled",o&&"error",r&&`size${gr(r)}`,t&&"contained",u&&"focused",l&&"filled",h&&"required"]};return Ko(f,Xge,e)},Qge=pr("p",{name:"MuiFormHelperText",slot:"Root",overridesResolver:(n,e)=>{const{ownerState:t}=n;return[e.root,t.size&&e[`size${gr(t.size)}`],t.contained&&e.contained,t.filled&&e.filled]}})(({theme:n,ownerState:e})=>Qe({color:(n.vars||n).palette.text.secondary},n.typography.caption,{textAlign:"left",marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${BH.disabled}`]:{color:(n.vars||n).palette.text.disabled},[`&.${BH.error}`]:{color:(n.vars||n).palette.error.main}},e.size==="small"&&{marginTop:4},e.contained&&{marginLeft:14,marginRight:14})),Zge=me.forwardRef(function(e,t){const r=ua({props:e,name:"MuiFormHelperText"}),{children:s,className:o,component:l="p"}=r,u=Ar(r,Jge),h=Av(),f=tb({props:r,muiFormControl:h,states:["variant","size","disabled","error","filled","focused","required"]}),g=Qe({},r,{component:l,contained:f.variant==="filled"||f.variant==="outlined",variant:f.variant,size:f.size,disabled:f.disabled,error:f.error,filled:f.filled,focused:f.focused,required:f.required}),y=qge(g);return Ne.jsx(Qge,Qe({as:l,ownerState:g,className:ai(y.root,o),ref:t},u,{children:s===" "?FH||(FH=Ne.jsx("span",{className:"notranslate",children:"​"})):s}))}),e0e=Zge;function t0e(n){return Po("MuiFormLabel",n)}const n0e=Xo("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]),Qx=n0e,r0e=["children","className","color","component","disabled","error","filled","focused","required"],i0e=n=>{const{classes:e,color:t,focused:r,disabled:s,error:o,filled:l,required:u}=n,h={root:["root",`color${gr(t)}`,s&&"disabled",o&&"error",l&&"filled",r&&"focused",u&&"required"],asterisk:["asterisk",o&&"error"]};return Ko(h,t0e,e)},s0e=pr("label",{name:"MuiFormLabel",slot:"Root",overridesResolver:({ownerState:n},e)=>Qe({},e.root,n.color==="secondary"&&e.colorSecondary,n.filled&&e.filled)})(({theme:n,ownerState:e})=>Qe({color:(n.vars||n).palette.text.secondary},n.typography.body1,{lineHeight:"1.4375em",padding:0,position:"relative",[`&.${Qx.focused}`]:{color:(n.vars||n).palette[e.color].main},[`&.${Qx.disabled}`]:{color:(n.vars||n).palette.text.disabled},[`&.${Qx.error}`]:{color:(n.vars||n).palette.error.main}})),o0e=pr("span",{name:"MuiFormLabel",slot:"Asterisk",overridesResolver:(n,e)=>e.asterisk})(({theme:n})=>({[`&.${Qx.error}`]:{color:(n.vars||n).palette.error.main}})),a0e=me.forwardRef(function(e,t){const r=ua({props:e,name:"MuiFormLabel"}),{children:s,className:o,component:l="label"}=r,u=Ar(r,r0e),h=Av(),f=tb({props:r,muiFormControl:h,states:["color","required","focused","disabled","error","filled"]}),g=Qe({},r,{color:f.color||"primary",component:l,disabled:f.disabled,error:f.error,filled:f.filled,focused:f.focused,required:f.required}),y=i0e(g);return Ne.jsxs(s0e,Qe({as:l,ownerState:g,className:ai(y.root,o),ref:t},u,{children:[s,f.required&&Ne.jsxs(o0e,{ownerState:g,"aria-hidden":!0,className:y.asterisk,children:[" ","*"]})]}))}),l0e=a0e,u0e=me.createContext(),zH=u0e;function c0e(n){return Po("MuiGrid",n)}const h0e=[0,1,2,3,4,5,6,7,8,9,10],d0e=["column-reverse","column","row-reverse","row"],f0e=["nowrap","wrap-reverse","wrap"],nx=["auto",!0,1,2,3,4,5,6,7,8,9,10,11,12],N$=Xo("MuiGrid",["root","container","item","zeroMinWidth",...h0e.map(n=>`spacing-xs-${n}`),...d0e.map(n=>`direction-xs-${n}`),...f0e.map(n=>`wrap-xs-${n}`),...nx.map(n=>`grid-xs-${n}`),...nx.map(n=>`grid-sm-${n}`),...nx.map(n=>`grid-md-${n}`),...nx.map(n=>`grid-lg-${n}`),...nx.map(n=>`grid-xl-${n}`)]),p0e=["className","columns","columnSpacing","component","container","direction","item","rowSpacing","spacing","wrap","zeroMinWidth"];function gw(n){const e=parseFloat(n);return`${e}${String(n).replace(String(e),"")||"px"}`}function m0e({theme:n,ownerState:e}){let t;return n.breakpoints.keys.reduce((r,s)=>{let o={};if(e[s]&&(t=e[s]),!t)return r;if(t===!0)o={flexBasis:0,flexGrow:1,maxWidth:"100%"};else if(t==="auto")o={flexBasis:"auto",flexGrow:0,flexShrink:0,maxWidth:"none",width:"auto"};else{const l=L1({values:e.columns,breakpoints:n.breakpoints.values}),u=typeof l=="object"?l[s]:l;if(u==null)return r;const h=`${Math.round(t/u*1e8)/1e6}%`;let f={};if(e.container&&e.item&&e.columnSpacing!==0){const g=n.spacing(e.columnSpacing);if(g!=="0px"){const y=`calc(${h} + ${gw(g)})`;f={flexBasis:y,maxWidth:y}}}o=Qe({flexBasis:h,flexGrow:0,maxWidth:h},f)}return n.breakpoints.values[s]===0?Object.assign(r,o):r[n.breakpoints.up(s)]=o,r},{})}function g0e({theme:n,ownerState:e}){const t=L1({values:e.direction,breakpoints:n.breakpoints.values});return Zp({theme:n},t,r=>{const s={flexDirection:r};return r.indexOf("column")===0&&(s[`& > .${N$.item}`]={maxWidth:"none"}),s})}function NK({breakpoints:n,values:e}){let t="";Object.keys(e).forEach(s=>{t===""&&e[s]!==0&&(t=s)});const r=Object.keys(n).sort((s,o)=>n[s]-n[o]);return r.slice(0,r.indexOf(t))}function _0e({theme:n,ownerState:e}){const{container:t,rowSpacing:r}=e;let s={};if(t&&r!==0){const o=L1({values:r,breakpoints:n.breakpoints.values});let l;typeof o=="object"&&(l=NK({breakpoints:n.breakpoints.values,values:o})),s=Zp({theme:n},o,(u,h)=>{var f;const g=n.spacing(u);return g!=="0px"?{marginTop:`-${gw(g)}`,[`& > .${N$.item}`]:{paddingTop:gw(g)}}:(f=l)!=null&&f.includes(h)?{}:{marginTop:0,[`& > .${N$.item}`]:{paddingTop:0}}})}return s}function v0e({theme:n,ownerState:e}){const{container:t,columnSpacing:r}=e;let s={};if(t&&r!==0){const o=L1({values:r,breakpoints:n.breakpoints.values});let l;typeof o=="object"&&(l=NK({breakpoints:n.breakpoints.values,values:o})),s=Zp({theme:n},o,(u,h)=>{var f;const g=n.spacing(u);return g!=="0px"?{width:`calc(100% + ${gw(g)})`,marginLeft:`-${gw(g)}`,[`& > .${N$.item}`]:{paddingLeft:gw(g)}}:(f=l)!=null&&f.includes(h)?{}:{width:"100%",marginLeft:0,[`& > .${N$.item}`]:{paddingLeft:0}}})}return s}function y0e(n,e,t={}){if(!n||n<=0)return[];if(typeof n=="string"&&!Number.isNaN(Number(n))||typeof n=="number")return[t[`spacing-xs-${String(n)}`]];const r=[];return e.forEach(s=>{const o=n[s];Number(o)>0&&r.push(t[`spacing-${s}-${String(o)}`])}),r}const b0e=pr("div",{name:"MuiGrid",slot:"Root",overridesResolver:(n,e)=>{const{ownerState:t}=n,{container:r,direction:s,item:o,spacing:l,wrap:u,zeroMinWidth:h,breakpoints:f}=t;let g=[];r&&(g=y0e(l,f,e));const y=[];return f.forEach(b=>{const w=t[b];w&&y.push(e[`grid-${b}-${String(w)}`])}),[e.root,r&&e.container,o&&e.item,h&&e.zeroMinWidth,...g,s!=="row"&&e[`direction-xs-${String(s)}`],u!=="wrap"&&e[`wrap-xs-${String(u)}`],...y]}})(({ownerState:n})=>Qe({boxSizing:"border-box"},n.container&&{display:"flex",flexWrap:"wrap",width:"100%"},n.item&&{margin:0},n.zeroMinWidth&&{minWidth:0},n.wrap!=="wrap"&&{flexWrap:n.wrap}),g0e,_0e,v0e,m0e);function T0e(n,e){if(!n||n<=0)return[];if(typeof n=="string"&&!Number.isNaN(Number(n))||typeof n=="number")return[`spacing-xs-${String(n)}`];const t=[];return e.forEach(r=>{const s=n[r];if(Number(s)>0){const o=`spacing-${r}-${String(s)}`;t.push(o)}}),t}const S0e=n=>{const{classes:e,container:t,direction:r,item:s,spacing:o,wrap:l,zeroMinWidth:u,breakpoints:h}=n;let f=[];t&&(f=T0e(o,h));const g=[];h.forEach(b=>{const w=n[b];w&&g.push(`grid-${b}-${String(w)}`)});const y={root:["root",t&&"container",s&&"item",u&&"zeroMinWidth",...f,r!=="row"&&`direction-xs-${String(r)}`,l!=="wrap"&&`wrap-xs-${String(l)}`,...g]};return Ko(y,c0e,e)},w0e=me.forwardRef(function(e,t){const r=ua({props:e,name:"MuiGrid"}),{breakpoints:s}=jk(),o=xC(r),{className:l,columns:u,columnSpacing:h,component:f="div",container:g=!1,direction:y="row",item:b=!1,rowSpacing:w,spacing:C=0,wrap:M="wrap",zeroMinWidth:A=!1}=o,k=Ar(o,p0e),L=w||C,P=h||C,D=me.useContext(zH),z=g?u||12:D,U={},V=Qe({},k);s.keys.forEach(le=>{k[le]!=null&&(U[le]=k[le],delete V[le])});const H=Qe({},o,{columns:z,container:g,direction:y,item:b,rowSpacing:L,columnSpacing:P,wrap:M,zeroMinWidth:A,spacing:C},U,{breakpoints:s.keys}),oe=S0e(H);return Ne.jsx(zH.Provider,{value:z,children:Ne.jsx(b0e,Qe({ownerState:H,className:ai(oe.root,l),as:f,ref:t},V))})}),oc=w0e,E0e=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function jD(n){return`scale(${n}, ${n**2})`}const x0e={entering:{opacity:1,transform:jD(1)},entered:{opacity:1,transform:"none"}},ZO=typeof navigator<"u"&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),DK=me.forwardRef(function(e,t){const{addEndListener:r,appear:s=!0,children:o,easing:l,in:u,onEnter:h,onEntered:f,onEntering:g,onExit:y,onExited:b,onExiting:w,style:C,timeout:M="auto",TransitionComponent:A=wK}=e,k=Ar(e,E0e),L=lK(),P=me.useRef(),D=jk(),z=me.useRef(null),U=gp(z,o.ref,t),V=ue=>ge=>{if(ue){const we=z.current;ge===void 0?ue(we):ue(we,ge)}},H=V(g),oe=V((ue,ge)=>{EK(ue);const{duration:we,delay:J,easing:re}=hR({style:C,timeout:M,easing:l},{mode:"enter"});let se;M==="auto"?(se=D.transitions.getAutoHeightDuration(ue.clientHeight),P.current=se):se=we,ue.style.transition=[D.transitions.create("opacity",{duration:se,delay:J}),D.transitions.create("transform",{duration:ZO?se:se*.666,delay:J,easing:re})].join(","),h&&h(ue,ge)}),le=V(f),Z=V(w),q=V(ue=>{const{duration:ge,delay:we,easing:J}=hR({style:C,timeout:M,easing:l},{mode:"exit"});let re;M==="auto"?(re=D.transitions.getAutoHeightDuration(ue.clientHeight),P.current=re):re=ge,ue.style.transition=[D.transitions.create("opacity",{duration:re,delay:we}),D.transitions.create("transform",{duration:ZO?re:re*.666,delay:ZO?we:we||re*.333,easing:J})].join(","),ue.style.opacity=0,ue.style.transform=jD(.75),y&&y(ue)}),he=V(b),ae=ue=>{M==="auto"&&L.start(P.current||0,ue),r&&r(z.current,ue)};return Ne.jsx(A,Qe({appear:s,in:u,nodeRef:z,onEnter:oe,onEntered:le,onEntering:H,onExit:q,onExited:he,onExiting:Z,addEndListener:ae,timeout:M==="auto"?null:M},k,{children:(ue,ge)=>me.cloneElement(o,Qe({style:Qe({opacity:0,transform:jD(.75),visibility:ue==="exited"&&!u?"hidden":void 0},x0e[ue],C,o.props.style),ref:U},ge))}))});DK.muiSupportAuto=!0;const $0e=DK,C0e=["disableUnderline","components","componentsProps","fullWidth","inputComponent","multiline","slotProps","slots","type"],M0e=n=>{const{classes:e,disableUnderline:t}=n,s=Ko({root:["root",!t&&"underline"],input:["input"]},cme,e);return Qe({},e,s)},A0e=pr(Jk,{shouldForwardProp:n=>Vm(n)||n==="classes",name:"MuiInput",slot:"Root",overridesResolver:(n,e)=>{const{ownerState:t}=n;return[...Xk(n,e),!t.disableUnderline&&e.underline]}})(({theme:n,ownerState:e})=>{let r=n.palette.mode==="light"?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return n.vars&&(r=`rgba(${n.vars.palette.common.onBackgroundChannel} / ${n.vars.opacity.inputUnderline})`),Qe({position:"relative"},e.formControl&&{"label + &":{marginTop:16}},!e.disableUnderline&&{"&::after":{borderBottom:`2px solid ${(n.vars||n).palette[e.color].main}`,left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:n.transitions.create("transform",{duration:n.transitions.duration.shorter,easing:n.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${tx.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${tx.error}`]:{"&::before, &::after":{borderBottomColor:(n.vars||n).palette.error.main}},"&::before":{borderBottom:`1px solid ${r}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:n.transitions.create("border-bottom-color",{duration:n.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${tx.disabled}, .${tx.error}):before`]:{borderBottom:`2px solid ${(n.vars||n).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${r}`}},[`&.${tx.disabled}:before`]:{borderBottomStyle:"dotted"}})}),I0e=pr(qk,{name:"MuiInput",slot:"Input",overridesResolver:Kk})({}),PK=me.forwardRef(function(e,t){var r,s,o,l;const u=ua({props:e,name:"MuiInput"}),{disableUnderline:h,components:f={},componentsProps:g,fullWidth:y=!1,inputComponent:b="input",multiline:w=!1,slotProps:C,slots:M={},type:A="text"}=u,k=Ar(u,C0e),L=M0e(u),D={root:{ownerState:{disableUnderline:h}}},z=C??g?fp(C??g,D):D,U=(r=(s=M.root)!=null?s:f.Root)!=null?r:A0e,V=(o=(l=M.input)!=null?l:f.Input)!=null?o:I0e;return Ne.jsx(kF,Qe({slots:{root:U,input:V},slotProps:z,fullWidth:y,inputComponent:b,multiline:w,ref:t,type:A},k,{classes:L}))});PK.muiName="Input";const LF=PK;function R0e(n){return Po("MuiInputLabel",n)}Xo("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);const k0e=["disableAnimation","margin","shrink","variant","className"],O0e=n=>{const{classes:e,formControl:t,size:r,shrink:s,disableAnimation:o,variant:l,required:u}=n,h={root:["root",t&&"formControl",!o&&"animated",s&&"shrink",r&&r!=="normal"&&`size${gr(r)}`,l],asterisk:[u&&"asterisk"]},f=Ko(h,R0e,e);return Qe({},e,f)},L0e=pr(l0e,{shouldForwardProp:n=>Vm(n)||n==="classes",name:"MuiInputLabel",slot:"Root",overridesResolver:(n,e)=>{const{ownerState:t}=n;return[{[`& .${Qx.asterisk}`]:e.asterisk},e.root,t.formControl&&e.formControl,t.size==="small"&&e.sizeSmall,t.shrink&&e.shrink,!t.disableAnimation&&e.animated,t.focused&&e.focused,e[t.variant]]}})(({theme:n,ownerState:e})=>Qe({display:"block",transformOrigin:"top left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"},e.formControl&&{position:"absolute",left:0,top:0,transform:"translate(0, 20px) scale(1)"},e.size==="small"&&{transform:"translate(0, 17px) scale(1)"},e.shrink&&{transform:"translate(0, -1.5px) scale(0.75)",transformOrigin:"top left",maxWidth:"133%"},!e.disableAnimation&&{transition:n.transitions.create(["color","transform","max-width"],{duration:n.transitions.duration.shorter,easing:n.transitions.easing.easeOut})},e.variant==="filled"&&Qe({zIndex:1,pointerEvents:"none",transform:"translate(12px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},e.size==="small"&&{transform:"translate(12px, 13px) scale(1)"},e.shrink&&Qe({userSelect:"none",pointerEvents:"auto",transform:"translate(12px, 7px) scale(0.75)",maxWidth:"calc(133% - 24px)"},e.size==="small"&&{transform:"translate(12px, 4px) scale(0.75)"})),e.variant==="outlined"&&Qe({zIndex:1,pointerEvents:"none",transform:"translate(14px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},e.size==="small"&&{transform:"translate(14px, 9px) scale(1)"},e.shrink&&{userSelect:"none",pointerEvents:"auto",maxWidth:"calc(133% - 32px)",transform:"translate(14px, -9px) scale(0.75)"}))),N0e=me.forwardRef(function(e,t){const r=ua({name:"MuiInputLabel",props:e}),{disableAnimation:s=!1,shrink:o,className:l}=r,u=Ar(r,k0e),h=Av();let f=o;typeof f>"u"&&h&&(f=h.filled||h.focused||h.adornedStart);const g=tb({props:r,muiFormControl:h,states:["size","variant","required","focused"]}),y=Qe({},r,{disableAnimation:s,formControl:h,shrink:f,size:g.size,variant:g.variant,required:g.required,focused:g.focused}),b=O0e(y);return Ne.jsx(L0e,Qe({"data-shrink":f,ownerState:y,ref:t,className:ai(b.root,l)},u,{classes:b}))}),D0e=N0e,P0e=me.createContext({}),B0e=P0e;function F0e(n){return Po("MuiList",n)}Xo("MuiList",["root","padding","dense","subheader"]);const z0e=["children","className","component","dense","disablePadding","subheader"],U0e=n=>{const{classes:e,disablePadding:t,dense:r,subheader:s}=n;return Ko({root:["root",!t&&"padding",r&&"dense",s&&"subheader"]},F0e,e)},H0e=pr("ul",{name:"MuiList",slot:"Root",overridesResolver:(n,e)=>{const{ownerState:t}=n;return[e.root,!t.disablePadding&&e.padding,t.dense&&e.dense,t.subheader&&e.subheader]}})(({ownerState:n})=>Qe({listStyle:"none",margin:0,padding:0,position:"relative"},!n.disablePadding&&{paddingTop:8,paddingBottom:8},n.subheader&&{paddingTop:0})),G0e=me.forwardRef(function(e,t){const r=ua({props:e,name:"MuiList"}),{children:s,className:o,component:l="ul",dense:u=!1,disablePadding:h=!1,subheader:f}=r,g=Ar(r,z0e),y=me.useMemo(()=>({dense:u}),[u]),b=Qe({},r,{component:l,dense:u,disablePadding:h}),w=U0e(b);return Ne.jsx(B0e.Provider,{value:y,children:Ne.jsxs(H0e,Qe({as:l,className:ai(w.root,o),ref:t,ownerState:b},g,{children:[f,s]}))})}),W0e=G0e,V0e=["actions","autoFocus","autoFocusItem","children","className","disabledItemsFocusable","disableListWrap","onKeyDown","variant"];function eL(n,e,t){return n===e?n.firstChild:e&&e.nextElementSibling?e.nextElementSibling:t?null:n.firstChild}function UH(n,e,t){return n===e?t?n.firstChild:n.lastChild:e&&e.previousElementSibling?e.previousElementSibling:t?null:n.lastChild}function BK(n,e){if(e===void 0)return!0;let t=n.innerText;return t===void 0&&(t=n.textContent),t=t.trim().toLowerCase(),t.length===0?!1:e.repeating?t[0]===e.keys[0]:t.indexOf(e.keys.join(""))===0}function rx(n,e,t,r,s,o){let l=!1,u=s(n,e,e?t:!1);for(;u;){if(u===n.firstChild){if(l)return!1;l=!0}const h=r?!1:u.disabled||u.getAttribute("aria-disabled")==="true";if(!u.hasAttribute("tabindex")||!BK(u,o)||h)u=s(n,u,t);else return u.focus(),!0}return!1}const j0e=me.forwardRef(function(e,t){const{actions:r,autoFocus:s=!1,autoFocusItem:o=!1,children:l,className:u,disabledItemsFocusable:h=!1,disableListWrap:f=!1,onKeyDown:g,variant:y="selectedMenu"}=e,b=Ar(e,V0e),w=me.useRef(null),C=me.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});Uy(()=>{s&&w.current.focus()},[s]),me.useImperativeHandle(r,()=>({adjustStyleForScrollbar:(P,{direction:D})=>{const z=!w.current.style.width;if(P.clientHeight{const D=w.current,z=P.key,U=Jp(D).activeElement;if(z==="ArrowDown")P.preventDefault(),rx(D,U,f,h,eL);else if(z==="ArrowUp")P.preventDefault(),rx(D,U,f,h,UH);else if(z==="Home")P.preventDefault(),rx(D,null,f,h,eL);else if(z==="End")P.preventDefault(),rx(D,null,f,h,UH);else if(z.length===1){const V=C.current,H=z.toLowerCase(),oe=performance.now();V.keys.length>0&&(oe-V.lastTime>500?(V.keys=[],V.repeating=!0,V.previousKeyMatched=!0):V.repeating&&H!==V.keys[0]&&(V.repeating=!1)),V.lastTime=oe,V.keys.push(H);const le=U&&!V.repeating&&BK(U,V);V.previousKeyMatched&&(le||rx(D,U,!1,h,eL,V))?P.preventDefault():V.previousKeyMatched=!1}g&&g(P)},A=gp(w,t);let k=-1;me.Children.forEach(l,(P,D)=>{if(!me.isValidElement(P)){k===D&&(k+=1,k>=l.length&&(k=-1));return}P.props.disabled||(y==="selectedMenu"&&P.props.selected||k===-1)&&(k=D),k===D&&(P.props.disabled||P.props.muiSkipListHighlight||P.type.muiSkipListHighlight)&&(k+=1,k>=l.length&&(k=-1))});const L=me.Children.map(l,(P,D)=>{if(D===k){const z={};return o&&(z.autoFocus=!0),P.props.tabIndex===void 0&&y==="selectedMenu"&&(z.tabIndex=0),me.cloneElement(P,z)}return P});return Ne.jsx(W0e,Qe({role:"menu",ref:A,className:u,onKeyDown:M,tabIndex:s?0:-1},b,{children:L}))}),Y0e=j0e;function X0e(n){return Po("MuiPopover",n)}Xo("MuiPopover",["root","paper"]);const K0e=["onEntering"],J0e=["action","anchorEl","anchorOrigin","anchorPosition","anchorReference","children","className","container","elevation","marginThreshold","open","PaperProps","slots","slotProps","transformOrigin","TransitionComponent","transitionDuration","TransitionProps","disableScrollLock"],q0e=["slotProps"];function HH(n,e){let t=0;return typeof e=="number"?t=e:e==="center"?t=n.height/2:e==="bottom"&&(t=n.height),t}function GH(n,e){let t=0;return typeof e=="number"?t=e:e==="center"?t=n.width/2:e==="right"&&(t=n.width),t}function WH(n){return[n.horizontal,n.vertical].map(e=>typeof e=="number"?`${e}px`:e).join(" ")}function tL(n){return typeof n=="function"?n():n}const Q0e=n=>{const{classes:e}=n;return Ko({root:["root"],paper:["paper"]},X0e,e)},Z0e=pr(AK,{name:"MuiPopover",slot:"Root",overridesResolver:(n,e)=>e.root})({}),FK=pr(AF,{name:"MuiPopover",slot:"Paper",overridesResolver:(n,e)=>e.paper})({position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}),e_e=me.forwardRef(function(e,t){var r,s,o;const l=ua({props:e,name:"MuiPopover"}),{action:u,anchorEl:h,anchorOrigin:f={vertical:"top",horizontal:"left"},anchorPosition:g,anchorReference:y="anchorEl",children:b,className:w,container:C,elevation:M=8,marginThreshold:A=16,open:k,PaperProps:L={},slots:P,slotProps:D,transformOrigin:z={vertical:"top",horizontal:"left"},TransitionComponent:U=$0e,transitionDuration:V="auto",TransitionProps:{onEntering:H}={},disableScrollLock:oe=!1}=l,le=Ar(l.TransitionProps,K0e),Z=Ar(l,J0e),q=(r=D==null?void 0:D.paper)!=null?r:L,he=me.useRef(),ae=gp(he,q.ref),ue=Qe({},l,{anchorOrigin:f,anchorReference:y,elevation:M,marginThreshold:A,externalPaperSlotProps:q,transformOrigin:z,TransitionComponent:U,transitionDuration:V,TransitionProps:le}),ge=Q0e(ue),we=me.useCallback(()=>{if(y==="anchorPosition")return g;const He=tL(h),st=(He&&He.nodeType===1?He:Jp(he.current).body).getBoundingClientRect();return{top:st.top+HH(st,f.vertical),left:st.left+GH(st,f.horizontal)}},[h,f.horizontal,f.vertical,g,y]),J=me.useCallback(He=>({vertical:HH(He,z.vertical),horizontal:GH(He,z.horizontal)}),[z.horizontal,z.vertical]),re=me.useCallback(He=>{const it={width:He.offsetWidth,height:He.offsetHeight},st=J(it);if(y==="none")return{top:null,left:null,transformOrigin:WH(st)};const Nt=we();let kt=Nt.top-st.vertical,vt=Nt.left-st.horizontal;const Ct=kt+it.height,At=vt+it.width,gt=Hy(tL(h)),xe=gt.innerHeight-A,ie=gt.innerWidth-A;if(A!==null&&ktxe){const Pe=Ct-xe;kt-=Pe,st.vertical+=Pe}if(A!==null&&vtie){const Pe=At-ie;vt-=Pe,st.horizontal+=Pe}return{top:`${Math.round(kt)}px`,left:`${Math.round(vt)}px`,transformOrigin:WH(st)}},[h,y,we,J,A]),[se,fe]=me.useState(k),Te=me.useCallback(()=>{const He=he.current;if(!He)return;const it=re(He);it.top!==null&&(He.style.top=it.top),it.left!==null&&(He.style.left=it.left),He.style.transformOrigin=it.transformOrigin,fe(!0)},[re]);me.useEffect(()=>(oe&&window.addEventListener("scroll",Te),()=>window.removeEventListener("scroll",Te)),[h,oe,Te]);const Fe=(He,it)=>{H&&H(He,it),Te()},Ie=()=>{fe(!1)};me.useEffect(()=>{k&&Te()}),me.useImperativeHandle(u,()=>k?{updatePosition:()=>{Te()}}:null,[k,Te]),me.useEffect(()=>{if(!k)return;const He=SF(()=>{Te()}),it=Hy(h);return it.addEventListener("resize",He),()=>{He.clear(),it.removeEventListener("resize",He)}},[h,k,Te]);let qe=V;V==="auto"&&!U.muiSupportAuto&&(qe=void 0);const Re=C||(h?Jp(tL(h)).body:void 0),Ze=(s=P==null?void 0:P.root)!=null?s:Z0e,rt=(o=P==null?void 0:P.paper)!=null?o:FK,ft=Rw({elementType:rt,externalSlotProps:Qe({},q,{style:se?q.style:Qe({},q.style,{opacity:0})}),additionalProps:{elevation:M,ref:ae},ownerState:ue,className:ai(ge.paper,q==null?void 0:q.className)}),ut=Rw({elementType:Ze,externalSlotProps:(D==null?void 0:D.root)||{},externalForwardedProps:Z,additionalProps:{ref:t,slotProps:{backdrop:{invisible:!0}},container:Re,open:k},ownerState:ue,className:ai(ge.root,w)}),{slotProps:ze}=ut,$e=Ar(ut,q0e);return Ne.jsx(Ze,Qe({},$e,!dR(Ze)&&{slotProps:ze,disableScrollLock:oe},{children:Ne.jsx(U,Qe({appear:!0,in:k,onEntering:Fe,onExited:Ie,timeout:qe},le,{children:Ne.jsx(rt,Qe({},ft,{children:b}))}))}))}),t_e=e_e;function n_e(n){return Po("MuiMenu",n)}Xo("MuiMenu",["root","paper","list"]);const r_e=["onEntering"],i_e=["autoFocus","children","className","disableAutoFocusItem","MenuListProps","onClose","open","PaperProps","PopoverClasses","transitionDuration","TransitionProps","variant","slots","slotProps"],s_e={vertical:"top",horizontal:"right"},o_e={vertical:"top",horizontal:"left"},a_e=n=>{const{classes:e}=n;return Ko({root:["root"],paper:["paper"],list:["list"]},n_e,e)},l_e=pr(t_e,{shouldForwardProp:n=>Vm(n)||n==="classes",name:"MuiMenu",slot:"Root",overridesResolver:(n,e)=>e.root})({}),u_e=pr(FK,{name:"MuiMenu",slot:"Paper",overridesResolver:(n,e)=>e.paper})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),c_e=pr(Y0e,{name:"MuiMenu",slot:"List",overridesResolver:(n,e)=>e.list})({outline:0}),h_e=me.forwardRef(function(e,t){var r,s;const o=ua({props:e,name:"MuiMenu"}),{autoFocus:l=!0,children:u,className:h,disableAutoFocusItem:f=!1,MenuListProps:g={},onClose:y,open:b,PaperProps:w={},PopoverClasses:C,transitionDuration:M="auto",TransitionProps:{onEntering:A}={},variant:k="selectedMenu",slots:L={},slotProps:P={}}=o,D=Ar(o.TransitionProps,r_e),z=Ar(o,i_e),U=cde(),V=Qe({},o,{autoFocus:l,disableAutoFocusItem:f,MenuListProps:g,onEntering:A,PaperProps:w,transitionDuration:M,TransitionProps:D,variant:k}),H=a_e(V),oe=l&&!f&&b,le=me.useRef(null),Z=(J,re)=>{le.current&&le.current.adjustStyleForScrollbar(J,{direction:U?"rtl":"ltr"}),A&&A(J,re)},q=J=>{J.key==="Tab"&&(J.preventDefault(),y&&y(J,"tabKeyDown"))};let he=-1;me.Children.map(u,(J,re)=>{me.isValidElement(J)&&(J.props.disabled||(k==="selectedMenu"&&J.props.selected||he===-1)&&(he=re))});const ae=(r=L.paper)!=null?r:u_e,ue=(s=P.paper)!=null?s:w,ge=Rw({elementType:L.root,externalSlotProps:P.root,ownerState:V,className:[H.root,h]}),we=Rw({elementType:ae,externalSlotProps:ue,ownerState:V,className:H.paper});return Ne.jsx(l_e,Qe({onClose:y,anchorOrigin:{vertical:"bottom",horizontal:U?"right":"left"},transformOrigin:U?s_e:o_e,slots:{paper:ae,root:L.root},slotProps:{root:ge,paper:we},open:b,ref:t,transitionDuration:M,TransitionProps:Qe({onEntering:Z},D),ownerState:V},z,{classes:C,children:Ne.jsx(c_e,Qe({onKeyDown:q,actions:le,autoFocus:l&&(he===-1||f),autoFocusItem:oe,variant:k},g,{className:ai(H.list,g.className),children:u}))}))}),d_e=h_e;function f_e(n){return Po("MuiNativeSelect",n)}const p_e=Xo("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),NF=p_e,m_e=["className","disabled","error","IconComponent","inputRef","variant"],g_e=n=>{const{classes:e,variant:t,disabled:r,multiple:s,open:o,error:l}=n,u={select:["select",t,r&&"disabled",s&&"multiple",l&&"error"],icon:["icon",`icon${gr(t)}`,o&&"iconOpen",r&&"disabled"]};return Ko(u,f_e,e)},zK=({ownerState:n,theme:e})=>Qe({MozAppearance:"none",WebkitAppearance:"none",userSelect:"none",borderRadius:0,cursor:"pointer","&:focus":Qe({},e.vars?{backgroundColor:`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.05)`}:{backgroundColor:e.palette.mode==="light"?"rgba(0, 0, 0, 0.05)":"rgba(255, 255, 255, 0.05)"},{borderRadius:0}),"&::-ms-expand":{display:"none"},[`&.${NF.disabled}`]:{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:(e.vars||e).palette.background.paper},"&&&":{paddingRight:24,minWidth:16}},n.variant==="filled"&&{"&&&":{paddingRight:32}},n.variant==="outlined"&&{borderRadius:(e.vars||e).shape.borderRadius,"&:focus":{borderRadius:(e.vars||e).shape.borderRadius},"&&&":{paddingRight:32}}),__e=pr("select",{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:Vm,overridesResolver:(n,e)=>{const{ownerState:t}=n;return[e.select,e[t.variant],t.error&&e.error,{[`&.${NF.multiple}`]:e.multiple}]}})(zK),UK=({ownerState:n,theme:e})=>Qe({position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(e.vars||e).palette.action.active,[`&.${NF.disabled}`]:{color:(e.vars||e).palette.action.disabled}},n.open&&{transform:"rotate(180deg)"},n.variant==="filled"&&{right:7},n.variant==="outlined"&&{right:7}),v_e=pr("svg",{name:"MuiNativeSelect",slot:"Icon",overridesResolver:(n,e)=>{const{ownerState:t}=n;return[e.icon,t.variant&&e[`icon${gr(t.variant)}`],t.open&&e.iconOpen]}})(UK),y_e=me.forwardRef(function(e,t){const{className:r,disabled:s,error:o,IconComponent:l,inputRef:u,variant:h="standard"}=e,f=Ar(e,m_e),g=Qe({},e,{disabled:s,variant:h,error:o}),y=g_e(g);return Ne.jsxs(me.Fragment,{children:[Ne.jsx(__e,Qe({ownerState:g,className:ai(y.select,r),disabled:s,ref:u||t},f)),e.multiple?null:Ne.jsx(v_e,{as:l,ownerState:g,className:y.icon})]})}),b_e=y_e;var VH;const T_e=["children","classes","className","label","notched"],S_e=pr("fieldset",{shouldForwardProp:Vm})({textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%"}),w_e=pr("legend",{shouldForwardProp:Vm})(({ownerState:n,theme:e})=>Qe({float:"unset",width:"auto",overflow:"hidden"},!n.withLabel&&{padding:0,lineHeight:"11px",transition:e.transitions.create("width",{duration:150,easing:e.transitions.easing.easeOut})},n.withLabel&&Qe({display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:e.transitions.create("max-width",{duration:50,easing:e.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}},n.notched&&{maxWidth:"100%",transition:e.transitions.create("max-width",{duration:100,easing:e.transitions.easing.easeOut,delay:50})})));function E_e(n){const{className:e,label:t,notched:r}=n,s=Ar(n,T_e),o=t!=null&&t!=="",l=Qe({},n,{notched:r,withLabel:o});return Ne.jsx(S_e,Qe({"aria-hidden":!0,className:e,ownerState:l},s,{children:Ne.jsx(w_e,{ownerState:l,children:o?Ne.jsx("span",{children:t}):VH||(VH=Ne.jsx("span",{className:"notranslate",children:"​"}))})}))}const x_e=["components","fullWidth","inputComponent","label","multiline","notched","slots","type"],$_e=n=>{const{classes:e}=n,r=Ko({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},dme,e);return Qe({},e,r)},C_e=pr(Jk,{shouldForwardProp:n=>Vm(n)||n==="classes",name:"MuiOutlinedInput",slot:"Root",overridesResolver:Xk})(({theme:n,ownerState:e})=>{const t=n.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return Qe({position:"relative",borderRadius:(n.vars||n).shape.borderRadius,[`&:hover .${ny.notchedOutline}`]:{borderColor:(n.vars||n).palette.text.primary},"@media (hover: none)":{[`&:hover .${ny.notchedOutline}`]:{borderColor:n.vars?`rgba(${n.vars.palette.common.onBackgroundChannel} / 0.23)`:t}},[`&.${ny.focused} .${ny.notchedOutline}`]:{borderColor:(n.vars||n).palette[e.color].main,borderWidth:2},[`&.${ny.error} .${ny.notchedOutline}`]:{borderColor:(n.vars||n).palette.error.main},[`&.${ny.disabled} .${ny.notchedOutline}`]:{borderColor:(n.vars||n).palette.action.disabled}},e.startAdornment&&{paddingLeft:14},e.endAdornment&&{paddingRight:14},e.multiline&&Qe({padding:"16.5px 14px"},e.size==="small"&&{padding:"8.5px 14px"}))}),M_e=pr(E_e,{name:"MuiOutlinedInput",slot:"NotchedOutline",overridesResolver:(n,e)=>e.notchedOutline})(({theme:n})=>{const e=n.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{borderColor:n.vars?`rgba(${n.vars.palette.common.onBackgroundChannel} / 0.23)`:e}}),A_e=pr(qk,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:Kk})(({theme:n,ownerState:e})=>Qe({padding:"16.5px 14px"},!n.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:n.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:n.palette.mode==="light"?null:"#fff",caretColor:n.palette.mode==="light"?null:"#fff",borderRadius:"inherit"}},n.vars&&{"&:-webkit-autofill":{borderRadius:"inherit"},[n.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},e.size==="small"&&{padding:"8.5px 14px"},e.multiline&&{padding:0},e.startAdornment&&{paddingLeft:0},e.endAdornment&&{paddingRight:0})),HK=me.forwardRef(function(e,t){var r,s,o,l,u;const h=ua({props:e,name:"MuiOutlinedInput"}),{components:f={},fullWidth:g=!1,inputComponent:y="input",label:b,multiline:w=!1,notched:C,slots:M={},type:A="text"}=h,k=Ar(h,x_e),L=$_e(h),P=Av(),D=tb({props:h,muiFormControl:P,states:["color","disabled","error","focused","hiddenLabel","size","required"]}),z=Qe({},h,{color:D.color||"primary",disabled:D.disabled,error:D.error,focused:D.focused,formControl:P,fullWidth:g,hiddenLabel:D.hiddenLabel,multiline:w,size:D.size,type:A}),U=(r=(s=M.root)!=null?s:f.Root)!=null?r:C_e,V=(o=(l=M.input)!=null?l:f.Input)!=null?o:A_e;return Ne.jsx(kF,Qe({slots:{root:U,input:V},renderSuffix:H=>Ne.jsx(M_e,{ownerState:z,className:L.notchedOutline,label:b!=null&&b!==""&&D.required?u||(u=Ne.jsxs(me.Fragment,{children:[b," ","*"]})):b,notched:typeof C<"u"?C:!!(H.startAdornment||H.filled||H.focused)}),fullWidth:g,inputComponent:y,multiline:w,ref:t,type:A},k,{classes:Qe({},L,{notchedOutline:null})}))});HK.muiName="Input";const GK=HK;function I_e(n){return Po("MuiSelect",n)}const ix=Xo("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]);var jH;const R_e=["aria-describedby","aria-label","autoFocus","autoWidth","children","className","defaultOpen","defaultValue","disabled","displayEmpty","error","IconComponent","inputRef","labelId","MenuProps","multiple","name","onBlur","onChange","onClose","onFocus","onOpen","open","readOnly","renderValue","SelectDisplayProps","tabIndex","type","value","variant"],k_e=pr("div",{name:"MuiSelect",slot:"Select",overridesResolver:(n,e)=>{const{ownerState:t}=n;return[{[`&.${ix.select}`]:e.select},{[`&.${ix.select}`]:e[t.variant]},{[`&.${ix.error}`]:e.error},{[`&.${ix.multiple}`]:e.multiple}]}})(zK,{[`&.${ix.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),O_e=pr("svg",{name:"MuiSelect",slot:"Icon",overridesResolver:(n,e)=>{const{ownerState:t}=n;return[e.icon,t.variant&&e[`icon${gr(t.variant)}`],t.open&&e.iconOpen]}})(UK),L_e=pr("input",{shouldForwardProp:n=>SK(n)&&n!=="classes",name:"MuiSelect",slot:"NativeInput",overridesResolver:(n,e)=>e.nativeInput})({bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%",boxSizing:"border-box"});function YH(n,e){return typeof e=="object"&&e!==null?n===e:String(n)===String(e)}function N_e(n){return n==null||typeof n=="string"&&!n.trim()}const D_e=n=>{const{classes:e,variant:t,disabled:r,multiple:s,open:o,error:l}=n,u={select:["select",t,r&&"disabled",s&&"multiple",l&&"error"],icon:["icon",`icon${gr(t)}`,o&&"iconOpen",r&&"disabled"],nativeInput:["nativeInput"]};return Ko(u,I_e,e)},P_e=me.forwardRef(function(e,t){var r;const{"aria-describedby":s,"aria-label":o,autoFocus:l,autoWidth:u,children:h,className:f,defaultOpen:g,defaultValue:y,disabled:b,displayEmpty:w,error:C=!1,IconComponent:M,inputRef:A,labelId:k,MenuProps:L={},multiple:P,name:D,onBlur:z,onChange:U,onClose:V,onFocus:H,onOpen:oe,open:le,readOnly:Z,renderValue:q,SelectDisplayProps:he={},tabIndex:ae,value:ue,variant:ge="standard"}=e,we=Ar(e,R_e),[J,re]=lR({controlled:ue,default:y,name:"Select"}),[se,fe]=lR({controlled:le,default:g,name:"Select"}),Te=me.useRef(null),Fe=me.useRef(null),[Ie,qe]=me.useState(null),{current:Re}=me.useRef(le!=null),[Ze,rt]=me.useState(),ft=gp(t,A),ut=me.useCallback(pe=>{Fe.current=pe,pe&&qe(pe)},[]),ze=Ie==null?void 0:Ie.parentNode;me.useImperativeHandle(ft,()=>({focus:()=>{Fe.current.focus()},node:Te.current,value:J}),[J]),me.useEffect(()=>{g&&se&&Ie&&!Re&&(rt(u?null:ze.clientWidth),Fe.current.focus())},[Ie,u]),me.useEffect(()=>{l&&Fe.current.focus()},[l]),me.useEffect(()=>{if(!k)return;const pe=Jp(Fe.current).getElementById(k);if(pe){const Ae=()=>{getSelection().isCollapsed&&Fe.current.focus()};return pe.addEventListener("click",Ae),()=>{pe.removeEventListener("click",Ae)}}},[k]);const $e=(pe,Ae)=>{pe?oe&&oe(Ae):V&&V(Ae),Re||(rt(u?null:ze.clientWidth),fe(pe))},He=pe=>{pe.button===0&&(pe.preventDefault(),Fe.current.focus(),$e(!0,pe))},it=pe=>{$e(!1,pe)},st=me.Children.toArray(h),Nt=pe=>{const Ae=st.find(Je=>Je.props.value===pe.target.value);Ae!==void 0&&(re(Ae.props.value),U&&U(pe,Ae))},kt=pe=>Ae=>{let Je;if(Ae.currentTarget.hasAttribute("tabindex")){if(P){Je=Array.isArray(J)?J.slice():[];const jt=J.indexOf(pe.props.value);jt===-1?Je.push(pe.props.value):Je.splice(jt,1)}else Je=pe.props.value;if(pe.props.onClick&&pe.props.onClick(Ae),J!==Je&&(re(Je),U)){const jt=Ae.nativeEvent||Ae,Ge=new jt.constructor(jt.type,jt);Object.defineProperty(Ge,"target",{writable:!0,value:{value:Je,name:D}}),U(Ge,pe)}P||$e(!1,Ae)}},vt=pe=>{Z||[" ","ArrowUp","ArrowDown","Enter"].indexOf(pe.key)!==-1&&(pe.preventDefault(),$e(!0,pe))},Ct=Ie!==null&&se,At=pe=>{!Ct&&z&&(Object.defineProperty(pe,"target",{writable:!0,value:{value:J,name:D}}),z(pe))};delete we["aria-invalid"];let gt,xe;const ie=[];let Pe=!1;(fR({value:J})||w)&&(q?gt=q(J):Pe=!0);const Ye=st.map(pe=>{if(!me.isValidElement(pe))return null;let Ae;if(P){if(!Array.isArray(J))throw new Error(q1(2));Ae=J.some(Je=>YH(Je,pe.props.value)),Ae&&Pe&&ie.push(pe.props.children)}else Ae=YH(J,pe.props.value),Ae&&Pe&&(xe=pe.props.children);return me.cloneElement(pe,{"aria-selected":Ae?"true":"false",onClick:kt(pe),onKeyUp:Je=>{Je.key===" "&&Je.preventDefault(),pe.props.onKeyUp&&pe.props.onKeyUp(Je)},role:"option",selected:Ae,value:void 0,"data-value":pe.props.value})});Pe&&(P?ie.length===0?gt=null:gt=ie.reduce((pe,Ae,Je)=>(pe.push(Ae),Je{const{classes:e}=n;return e},DF={name:"MuiSelect",overridesResolver:(n,e)=>e.root,shouldForwardProp:n=>Vm(n)&&n!=="variant",slot:"Root"},H_e=pr(LF,DF)(""),G_e=pr(GK,DF)(""),W_e=pr(kK,DF)(""),WK=me.forwardRef(function(e,t){const r=ua({name:"MuiSelect",props:e}),{autoWidth:s=!1,children:o,classes:l={},className:u,defaultOpen:h=!1,displayEmpty:f=!1,IconComponent:g=gme,id:y,input:b,inputProps:w,label:C,labelId:M,MenuProps:A,multiple:k=!1,native:L=!1,onClose:P,onOpen:D,open:z,renderValue:U,SelectDisplayProps:V,variant:H="outlined"}=r,oe=Ar(r,F_e),le=L?b_e:B_e,Z=Av(),q=tb({props:r,muiFormControl:Z,states:["variant","error"]}),he=q.variant||H,ae=Qe({},r,{variant:he,classes:l}),ue=U_e(ae),ge=Ar(ue,z_e),we=b||{standard:Ne.jsx(H_e,{ownerState:ae}),outlined:Ne.jsx(G_e,{label:C,ownerState:ae}),filled:Ne.jsx(W_e,{ownerState:ae})}[he],J=gp(t,we.ref);return Ne.jsx(me.Fragment,{children:me.cloneElement(we,Qe({inputComponent:le,inputProps:Qe({children:o,error:q.error,IconComponent:g,variant:he,type:void 0,multiple:k},L?{id:y}:{autoWidth:s,defaultOpen:h,displayEmpty:f,labelId:M,MenuProps:A,onClose:P,onOpen:D,open:z,renderValue:U,SelectDisplayProps:Qe({id:y},V)},w,{classes:w?fp(ge,w.classes):ge},b?b.props.inputProps:{})},(k&&L||f)&&he==="outlined"?{notched:!0}:{},{ref:J,className:ai(we.props.className,u,ue.root)},!b&&{variant:he},oe))})});WK.muiName="Select";const V_e=WK;function j_e(n){return Po("MuiSwitch",n)}const rp=Xo("MuiSwitch",["root","edgeStart","edgeEnd","switchBase","colorPrimary","colorSecondary","sizeSmall","sizeMedium","checked","disabled","input","thumb","track"]),Y_e=["className","color","edge","size","sx"],X_e=zfe(),K_e=n=>{const{classes:e,edge:t,size:r,color:s,checked:o,disabled:l}=n,u={root:["root",t&&`edge${gr(t)}`,`size${gr(r)}`],switchBase:["switchBase",`color${gr(s)}`,o&&"checked",l&&"disabled"],thumb:["thumb"],track:["track"],input:["input"]},h=Ko(u,j_e,e);return Qe({},e,h)},J_e=pr("span",{name:"MuiSwitch",slot:"Root",overridesResolver:(n,e)=>{const{ownerState:t}=n;return[e.root,t.edge&&e[`edge${gr(t.edge)}`],e[`size${gr(t.size)}`]]}})({display:"inline-flex",width:34+12*2,height:14+12*2,overflow:"hidden",padding:12,boxSizing:"border-box",position:"relative",flexShrink:0,zIndex:0,verticalAlign:"middle","@media print":{colorAdjust:"exact"},variants:[{props:{edge:"start"},style:{marginLeft:-8}},{props:{edge:"end"},style:{marginRight:-8}},{props:{size:"small"},style:{width:40,height:24,padding:7,[`& .${rp.thumb}`]:{width:16,height:16},[`& .${rp.switchBase}`]:{padding:4,[`&.${rp.checked}`]:{transform:"translateX(16px)"}}}}]}),q_e=pr(MK,{name:"MuiSwitch",slot:"SwitchBase",overridesResolver:(n,e)=>{const{ownerState:t}=n;return[e.switchBase,{[`& .${rp.input}`]:e.input},t.color!=="default"&&e[`color${gr(t.color)}`]]}})(({theme:n})=>({position:"absolute",top:0,left:0,zIndex:1,color:n.vars?n.vars.palette.Switch.defaultColor:`${n.palette.mode==="light"?n.palette.common.white:n.palette.grey[300]}`,transition:n.transitions.create(["left","transform"],{duration:n.transitions.duration.shortest}),[`&.${rp.checked}`]:{transform:"translateX(20px)"},[`&.${rp.disabled}`]:{color:n.vars?n.vars.palette.Switch.defaultDisabledColor:`${n.palette.mode==="light"?n.palette.grey[100]:n.palette.grey[600]}`},[`&.${rp.checked} + .${rp.track}`]:{opacity:.5},[`&.${rp.disabled} + .${rp.track}`]:{opacity:n.vars?n.vars.opacity.switchTrackDisabled:`${n.palette.mode==="light"?.12:.2}`},[`& .${rp.input}`]:{left:"-100%",width:"300%"}}),({theme:n})=>({"&:hover":{backgroundColor:n.vars?`rgba(${n.vars.palette.action.activeChannel} / ${n.vars.palette.action.hoverOpacity})`:r0(n.palette.action.active,n.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},variants:[...Object.entries(n.palette).filter(([,e])=>e.main&&e.light).map(([e])=>({props:{color:e},style:{[`&.${rp.checked}`]:{color:(n.vars||n).palette[e].main,"&:hover":{backgroundColor:n.vars?`rgba(${n.vars.palette[e].mainChannel} / ${n.vars.palette.action.hoverOpacity})`:r0(n.palette[e].main,n.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${rp.disabled}`]:{color:n.vars?n.vars.palette.Switch[`${e}DisabledColor`]:`${n.palette.mode==="light"?pK(n.palette[e].main,.62):fK(n.palette[e].main,.55)}`}},[`&.${rp.checked} + .${rp.track}`]:{backgroundColor:(n.vars||n).palette[e].main}}}))]})),Q_e=pr("span",{name:"MuiSwitch",slot:"Track",overridesResolver:(n,e)=>e.track})(({theme:n})=>({height:"100%",width:"100%",borderRadius:14/2,zIndex:-1,transition:n.transitions.create(["opacity","background-color"],{duration:n.transitions.duration.shortest}),backgroundColor:n.vars?n.vars.palette.common.onBackground:`${n.palette.mode==="light"?n.palette.common.black:n.palette.common.white}`,opacity:n.vars?n.vars.opacity.switchTrack:`${n.palette.mode==="light"?.38:.3}`})),Z_e=pr("span",{name:"MuiSwitch",slot:"Thumb",overridesResolver:(n,e)=>e.thumb})(({theme:n})=>({boxShadow:(n.vars||n).shadows[1],backgroundColor:"currentColor",width:20,height:20,borderRadius:"50%"})),eve=me.forwardRef(function(e,t){const r=X_e({props:e,name:"MuiSwitch"}),{className:s,color:o="primary",edge:l=!1,size:u="medium",sx:h}=r,f=Ar(r,Y_e),g=Qe({},r,{color:o,edge:l,size:u}),y=K_e(g),b=Ne.jsx(Z_e,{className:y.thumb,ownerState:g});return Ne.jsxs(J_e,{className:ai(y.root,s),sx:h,ownerState:g,children:[Ne.jsx(q_e,Qe({type:"checkbox",icon:b,checkedIcon:b,ref:t,ownerState:g},f,{classes:Qe({},y,{root:y.switchBase})})),Ne.jsx(Q_e,{className:y.track,ownerState:g})]})}),tve=eve;function nve(n){return Po("MuiTextField",n)}Xo("MuiTextField",["root"]);const rve=["autoComplete","autoFocus","children","className","color","defaultValue","disabled","error","FormHelperTextProps","fullWidth","helperText","id","InputLabelProps","inputProps","InputProps","inputRef","label","maxRows","minRows","multiline","name","onBlur","onChange","onFocus","placeholder","required","rows","select","SelectProps","type","value","variant"],ive={standard:LF,filled:kK,outlined:GK},sve=n=>{const{classes:e}=n;return Ko({root:["root"]},nve,e)},ove=pr(Lge,{name:"MuiTextField",slot:"Root",overridesResolver:(n,e)=>e.root})({}),ave=me.forwardRef(function(e,t){const r=ua({props:e,name:"MuiTextField"}),{autoComplete:s,autoFocus:o=!1,children:l,className:u,color:h="primary",defaultValue:f,disabled:g=!1,error:y=!1,FormHelperTextProps:b,fullWidth:w=!1,helperText:C,id:M,InputLabelProps:A,inputProps:k,InputProps:L,inputRef:P,label:D,maxRows:z,minRows:U,multiline:V=!1,name:H,onBlur:oe,onChange:le,onFocus:Z,placeholder:q,required:he=!1,rows:ae,select:ue=!1,SelectProps:ge,type:we,value:J,variant:re="outlined"}=r,se=Ar(r,rve),fe=Qe({},r,{autoFocus:o,color:h,disabled:g,error:y,fullWidth:w,multiline:V,required:he,select:ue,variant:re}),Te=sve(fe),Fe={};re==="outlined"&&(A&&typeof A.shrink<"u"&&(Fe.notched=A.shrink),Fe.label=D),ue&&((!ge||!ge.native)&&(Fe.id=void 0),Fe["aria-describedby"]=void 0);const Ie=Hk(M),qe=C&&Ie?`${Ie}-helper-text`:void 0,Re=D&&Ie?`${Ie}-label`:void 0,Ze=ive[re],rt=Ne.jsx(Ze,Qe({"aria-describedby":qe,autoComplete:s,autoFocus:o,defaultValue:f,fullWidth:w,multiline:V,name:H,rows:ae,maxRows:z,minRows:U,type:we,value:J,id:Ie,inputRef:P,onBlur:oe,onChange:le,onFocus:Z,placeholder:q,inputProps:k},Fe,L));return Ne.jsxs(ove,Qe({className:ai(Te.root,u),disabled:g,error:y,fullWidth:w,ref:t,required:he,color:h,variant:re,ownerState:fe},se,{children:[D!=null&&D!==""&&Ne.jsx(D0e,Qe({htmlFor:Ie,id:Re},A,{children:D})),ue?Ne.jsx(V_e,Qe({"aria-describedby":qe,id:Ie,labelId:Re,value:J,input:rt},ge,{children:l})):rt,C&&Ne.jsx(e0e,Qe({id:qe},b,{children:C}))]}))}),PF=ave,VK="/gpu-programming/assets/misty-Q0vWeXcA.svg",lve="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20width='100%25'%20height='100%25'%20viewBox='0%200%20400%20400'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20xml:space='preserve'%20xmlns:serif='http://www.serif.com/'%20style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;'%3e%3cg%20transform='matrix(1,0,0,1,-54.8776,-69.2073)'%3e%3cg%20transform='matrix(1.02822,0,0,1.03479,-55.9535,52.2937)'%3e%3cg%20transform='matrix(-0.423317,-0.423317,0.614768,-0.614768,286.809,459.697)'%3e%3cpath%20d='M470.009,231.909C470.009,241.104%20459.167,248.57%20445.813,248.57L104.238,248.57C90.884,248.57%2080.042,241.104%2080.042,231.909C80.042,222.713%2090.884,215.247%20104.238,215.247L445.813,215.247C459.167,215.247%20470.009,222.713%20470.009,231.909Z'/%3e%3c/g%3e%3cg%20transform='matrix(0.440957,0.440957,-0.704461,0.704461,267.224,-50.5009)'%3e%3cpath%20d='M451.221,155.518L212.117,155.518C200.001,141.06%20193.623,124.66%20193.623,107.966C193.623,55.476%20255.479,12.861%20331.669,12.861C407.859,12.861%20469.715,55.476%20469.715,107.966C469.715,124.66%20463.337,141.06%20451.221,155.518Z'%20style='fill:rgb(12,0,0);'/%3e%3c/g%3e%3cg%20transform='matrix(-0.249775,0.249775,-0.614768,-0.614768,655.131,143.162)'%3e%3cpath%20d='M470.009,231.909C470.009,241.104%20451.634,248.57%20429.001,248.57L121.05,248.57C98.417,248.57%2080.042,241.104%2080.042,231.909C80.042,222.713%2098.417,215.247%20121.05,215.247L429.001,215.247C451.634,215.247%20470.009,222.713%20470.009,231.909Z'%20style='fill:rgb(12,0,0);'/%3e%3c/g%3e%3c/g%3e%3cg%20transform='matrix(1.02822,0,0,1.03479,44.3939,-48.6949)'%3e%3cg%20transform='matrix(-0.423317,-0.423317,0.614768,-0.614768,171.204,575.302)'%3e%3cpath%20d='M470.009,231.909C470.009,241.104%20459.167,248.57%20445.813,248.57L104.238,248.57C90.884,248.57%2080.042,241.104%2080.042,231.909C80.042,222.713%2090.884,215.247%20104.238,215.247L445.813,215.247C459.167,215.247%20470.009,222.713%20470.009,231.909Z'%20style='fill:rgb(12,0,0);'/%3e%3c/g%3e%3cg%20transform='matrix(-0.216719,0.216719,-0.614768,-0.614768,453.376,402.183)'%3e%3cpath%20d='M470.009,231.909C470.009,241.104%20448.831,248.57%20422.746,248.57L127.305,248.57C101.22,248.57%2080.042,241.104%2080.042,231.909C80.042,222.713%20101.22,215.247%20127.305,215.247L422.746,215.247C448.831,215.247%20470.009,222.713%20470.009,231.909Z'%20style='fill:rgb(12,0,0);'/%3e%3c/g%3e%3cg%20transform='matrix(-0.249775,0.249775,-0.614768,-0.614768,274.402,521.42)'%3e%3cpath%20d='M470.009,231.909C470.009,241.104%20451.634,248.57%20429.001,248.57L121.05,248.57C98.417,248.57%2080.042,241.104%2080.042,231.909C80.042,222.713%2098.417,215.247%20121.05,215.247L429.001,215.247C451.634,215.247%20470.009,222.713%20470.009,231.909Z'%20style='fill:rgb(12,0,0);'/%3e%3c/g%3e%3cg%20transform='matrix(-0.440957,-0.440957,0.704461,-0.704461,241.43,564.525)'%3e%3cpath%20d='M451.221,155.518L212.117,155.518C200.001,141.06%20193.623,124.66%20193.623,107.966C193.623,55.476%20255.479,12.861%20331.669,12.861C407.859,12.861%20469.715,55.476%20469.715,107.966C469.715,124.66%20463.337,141.06%20451.221,155.518Z'%20style='fill:rgb(12,0,0);'/%3e%3c/g%3e%3cg%20transform='matrix(-0.216719,0.216719,-0.614768,-0.614768,395.716,343.809)'%3e%3cpath%20d='M470.009,231.909C470.009,241.104%20448.831,248.57%20422.746,248.57L127.305,248.57C101.22,248.57%2080.042,241.104%2080.042,231.909C80.042,222.713%20101.22,215.247%20127.305,215.247L422.746,215.247C448.831,215.247%20470.009,222.713%20470.009,231.909Z'%20style='fill:rgb(12,0,0);'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e",uve="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20width='100%25'%20height='100%25'%20viewBox='0%200%20401%20400'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20xml:space='preserve'%20xmlns:serif='http://www.serif.com/'%20style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;'%3e%3cg%20transform='matrix(1,0,0,1,-53.2986,-56.7857)'%3e%3cg%20transform='matrix(0.992184,0,0,0.998302,0.416603,0.0964004)'%3e%3cg%20transform='matrix(-0.423317,-0.423317,0.614768,-0.614768,286.809,459.697)'%3e%3cpath%20d='M470.009,231.909C470.009,241.104%20459.167,248.57%20445.813,248.57L104.238,248.57C90.884,248.57%2080.042,241.104%2080.042,231.909C80.042,222.713%2090.884,215.247%20104.238,215.247L445.813,215.247C459.167,215.247%20470.009,222.713%20470.009,231.909Z'/%3e%3c/g%3e%3cg%20transform='matrix(0.440957,0.440957,-0.704461,0.704461,267.224,-50.5009)'%3e%3cpath%20d='M451.221,155.518L212.117,155.518C200.001,141.06%20193.623,124.66%20193.623,107.966C193.623,55.476%20255.479,12.861%20331.669,12.861C407.859,12.861%20469.715,55.476%20469.715,107.966C469.715,124.66%20463.337,141.06%20451.221,155.518Z'%20style='fill:rgb(12,0,0);'/%3e%3c/g%3e%3cg%20transform='matrix(-0.237219,0.237219,-0.614768,-0.614768,613.767,184.608)'%3e%3cpath%20d='M470.009,231.909C470.009,241.104%20450.661,248.57%20426.831,248.57L123.22,248.57C99.39,248.57%2080.042,241.104%2080.042,231.909C80.042,222.713%2099.39,215.247%20123.22,215.247L426.831,215.247C450.661,215.247%20470.009,222.713%20470.009,231.909Z'%20style='fill:rgb(12,0,0);'/%3e%3c/g%3e%3c/g%3e%3cg%20transform='matrix(0.992184,0,0,0.998302,0.416603,0.0964004)'%3e%3cg%20transform='matrix(-0.423317,-0.423317,0.614768,-0.614768,171.204,575.302)'%3e%3cpath%20d='M470.009,231.909C470.009,241.104%20459.167,248.57%20445.813,248.57L104.238,248.57C90.884,248.57%2080.042,241.104%2080.042,231.909C80.042,222.713%2090.884,215.247%20104.238,215.247L445.813,215.247C459.167,215.247%20470.009,222.713%20470.009,231.909Z'%20style='fill:rgb(12,0,0);'/%3e%3c/g%3e%3cg%20transform='matrix(-0.216719,0.216719,-0.614768,-0.614768,453.376,402.183)'%3e%3cpath%20d='M470.009,231.909C470.009,241.104%20448.831,248.57%20422.746,248.57L127.305,248.57C101.22,248.57%2080.042,241.104%2080.042,231.909C80.042,222.713%20101.22,215.247%20127.305,215.247L422.746,215.247C448.831,215.247%20470.009,222.713%20470.009,231.909Z'%20style='fill:rgb(12,0,0);'/%3e%3c/g%3e%3cg%20transform='matrix(-0.237219,0.237219,-0.614768,-0.614768,311.603,484.301)'%3e%3cpath%20d='M470.009,231.909C470.009,241.104%20450.661,248.57%20426.831,248.57L123.22,248.57C99.39,248.57%2080.042,241.104%2080.042,231.909C80.042,222.713%2099.39,215.247%20123.22,215.247L426.831,215.247C450.661,215.247%20470.009,222.713%20470.009,231.909Z'%20style='fill:rgb(12,0,0);'/%3e%3c/g%3e%3cg%20transform='matrix(-0.440957,-0.440957,0.704461,-0.704461,241.43,564.525)'%3e%3cpath%20d='M451.221,155.518L212.117,155.518C200.001,141.06%20193.623,124.66%20193.623,107.966C193.623,55.476%20255.479,12.861%20331.669,12.861C407.859,12.861%20469.715,55.476%20469.715,107.966C469.715,124.66%20463.337,141.06%20451.221,155.518Z'%20style='fill:rgb(12,0,0);'/%3e%3c/g%3e%3cg%20transform='matrix(-0.216719,0.216719,-0.614768,-0.614768,395.716,343.809)'%3e%3cpath%20d='M470.009,231.909C470.009,241.104%20448.831,248.57%20422.746,248.57L127.305,248.57C101.22,248.57%2080.042,241.104%2080.042,231.909C80.042,222.713%20101.22,215.247%20127.305,215.247L422.746,215.247C448.831,215.247%20470.009,222.713%20470.009,231.909Z'%20style='fill:rgb(12,0,0);'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e";function qp({icon:n,text:e,clickFunction:t,disabled:r,style:s}){return Ne.jsx(Ume,{onClick:t,startIcon:n,disabled:r,classes:{disabled:"disabledDropShadowButton"},style:{margin:"5px",color:"black",backgroundColor:"#FAFAFA",borderRadius:"10px",filter:"drop-shadow(0px 10px 4px rgba(0,0,0,0.25))",...s},children:e})}var BF={},nL={};const cve=__(Ffe);var XH;function MC(){return XH||(XH=1,function(n){"use client";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"default",{enumerable:!0,get:function(){return e.createSvgIcon}});var e=cve}(nL)),nL}var hve=lT;Object.defineProperty(BF,"__esModule",{value:!0});var jK=BF.default=void 0,dve=hve(MC()),fve=Ne;jK=BF.default=(0,dve.default)((0,fve.jsx)("path",{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6"}),"Settings");function pve(n){const[e,t]=me.useState(""),r=Bn(qi(M=>M.setIp)),s=Bn(qi(M=>M.setImageList)),o=Bn(qi(M=>M.setAudioList)),l=Bn(qi(M=>M.setIsConnected)),u=Bn(qi(M=>M.isConnected)),h=Bn(qi(M=>M.disconnect)),f=Bn(M=>M.setActiveModal),g=Bn(M=>M.setHeaderDimensions),y=Bn(qi(M=>M.screenToShow)),b=Bn(M=>M.updateScreen);me.useEffect(()=>{const M=document.getElementById("website-header");new ResizeObserver(k=>{for(let L of k)g(M.offsetHeight,M.offsetWidth)}).observe(M)},[]);const w=()=>{r(e),fetch(`http://${e}/api/battery`,{method:"GET"}).then(M=>{if(!M.ok)throw new Error(`Request failed with status ${M.status}`);return M.json()}).then(M=>(console.log(`Successfully sent a GET request, the response is: ${M}`),l(!0),fetch(`http://${e}/api/audio/list`))).then(M=>{if(!M.ok)throw new Error(`Request failed with status ${M.status}`);return M.json()}).then(M=>(o(M.result),fetch(`http://${e}/api/images/list`))).then(M=>{if(!M.ok)throw new Error(`Request failed with status ${M.status}`);return M.json()}).then(M=>{s(M.result)}).catch(M=>{console.error("Error during fetch operation:",M.message),alert(`Error fetching data: ${M.message}`)}),uh("Hit Confirm IP Address Button")},C={backgroundColor:"#585D92",color:"#FFFFFF",filter:"drop-shadow(0px 10px 4px rgba(0,0,0,0.25))",zIndex:101,position:"relative",paddingLeft:"20px",paddingTop:"5px",paddingBottom:"5px"};return Ne.jsxs(oc,{id:"website-header",container:!0,direction:"row",justifyContent:"space-between",alignItems:"center",style:C,children:[Ne.jsx(oc,{item:!0,xs:12,sm:4,md:4,lg:3,xl:3,children:Ne.jsxs(L$,{direction:"row",alignItems:"center",children:[Ne.jsx("img",{style:{maxHeight:"35px",paddingRight:"5px"},src:VK}),Ne.jsx(f_,{display:"inline",variant:"h5",children:"Robo-Blocks"})]})}),Ne.jsx(oc,{item:!0,xs:12,sm:8,md:8,lg:9,xl:9,children:Ne.jsxs(oc,{container:!0,direction:"row",justifyContent:"space-between",alignItems:"center",children:[Ne.jsx(oc,{item:!0,xs:3,sm:3,md:3,lg:3,xl:3,style:{justifyContent:"right",display:"flex"},children:y!==nF&&Ne.jsx(qp,{text:y===fw?bX:TX,clickFunction:()=>b(y===fw?rF:fw)})}),Ne.jsx(oc,{item:!0,xs:9,sm:9,md:9,lg:9,xl:9,style:{justifyContent:"right",display:"flex"},children:Ne.jsxs(L$,{direction:"row",alignItems:"center",children:[!u&&Ne.jsx("div",{style:{backgroundColor:"#FF7E7E",width:"45px",height:"45px",borderRadius:"25px",marginRight:"10px",filter:"drop-shadow(0px 10px 4px rgba(0,0,0,0.25))"},children:Ne.jsx("img",{style:{height:"34px",position:"absolute",top:"5px",left:"5px"},src:uve})}),u&&Ne.jsx("div",{style:{backgroundColor:"#A0FF7E",width:"45px",height:"45px",borderRadius:"25px",marginRight:"10px",filter:"drop-shadow(0px 10px 4px rgba(0,0,0,0.25))"},children:Ne.jsx("img",{style:{height:"34px",position:"absolute",top:"5px",left:"5px"},src:lve})}),Ne.jsx(PF,{id:"robotIpAddress",disabled:u,label:"IP",variant:"filled",style:{backgroundColor:"#FFFFFF50",borderRadius:"5px",filter:"drop-shadow(0px 10px 4px rgba(0,0,0,0.25))",marginRight:"5px"},defaultValue:"",onChange:M=>t(M.target.value)}),!u&&Ne.jsx(qp,{text:"Connect",clickFunction:w}),u&&Ne.jsx(qp,{text:"Disconnect",clickFunction:h}),Ne.jsx(pI,{style:{margin:"5px",marginRight:"10px",color:"black",backgroundColor:"#FAFAFA",borderRadius:"10px",filter:"drop-shadow(0px 10px 4px rgba(0,0,0,0.25))"},onClick:()=>{f(yX)},children:Ne.jsx(jK,{})})]})})]})})]})}/** * @license * Copyright 2023 Google LLC * SPDX-License-Identifier: Apache-2.0 - */const mve={kind:"categoryToolbox",contents:[{kind:"category",name:"Functions",categorystyle:"procedure_category",custom:"PROCEDURE"},{kind:"category",name:"Triggers",categorystyle:"trigger_category",contents:[{kind:"block",type:"FrontLeftBumperPress"},{kind:"block",type:"FrontRightBumperPress"},{kind:"block",type:"RearLeftBumperPress"},{kind:"block",type:"RearRightBumperPress"}]},{kind:"category",name:"Control",categorystyle:"logic_category",contents:[{kind:"block",type:"controls_if"},{kind:"block",type:"controls_repeat_ext",inputs:{TIMES:{shadow:{type:"math_number",fields:{NUM:10}}}}},{kind:"block",type:"logic_compare"},{kind:"block",type:"logic_operation"},{kind:"block",type:"logic_negate"},{kind:"block",type:"logic_boolean"},{kind:"block",type:"logic_null"},{kind:"block",type:"logic_ternary"}]},{kind:"category",name:"Math",categorystyle:"math_category",contents:[{kind:"block",type:"math_number",fields:{NUM:123}},{kind:"block",type:"BasicSlider"},{kind:"block",type:"math_number_property",inputs:{NUMBER_TO_CHECK:{shadow:{type:"math_number",fields:{NUM:0}}}}},{kind:"block",type:"math_random_int",inputs:{FROM:{shadow:{type:"math_number",fields:{NUM:1}}},TO:{shadow:{type:"math_number",fields:{NUM:100}}}}}]},{kind:"category",name:"Movement",categorystyle:"movement_category",contents:[{kind:"block",type:"WaitForSeconds"},{kind:"block",type:"DriveTime"},{kind:"block",type:"DriveTime2"},{kind:"block",type:"Turn"},{kind:"block",type:"Turn2"},{kind:"block",type:"MoveHead"},{kind:"block",type:"MoveHead3"},{kind:"block",type:"MoveArm"},{kind:"block",type:"MoveArm2"},{kind:"block",type:"MoveArms2"},{kind:"block",type:"MoveArm3"}]},{kind:"category",name:"Light",categorystyle:"light_category",contents:[{kind:"block",type:"ChangeLED"},{kind:"block",type:"TransitionLED"},{kind:"block",type:"colour_picker"},{kind:"block",type:"colour_random"},{kind:"block",type:"colour_rgb",inputs:{RED:{shadow:{type:"math_number",fields:{NUM:100}}},GREEN:{shadow:{type:"math_number",fields:{NUM:50}}},BLUE:{shadow:{type:"math_number",fields:{NUM:0}}}}},{kind:"block",type:"colour_blend",inputs:{COLOUR1:{shadow:{type:"colour_picker",fields:{COLOUR:"#ff0000"}}},COLOUR2:{shadow:{type:"colour_picker",fields:{COLOUR:"#3333ff"}}},RATIO:{shadow:{type:"math_number",fields:{NUM:.5}}}}},{kind:"block",type:"TurnOnFlashlight"},{kind:"block",type:"TurnOffFlashlight"}]},{kind:"category",name:"Speech",categorystyle:"speech_category",contents:[{kind:"block",type:"Speak"},{kind:"block",type:"SpeakDefault"},{kind:"block",type:"text"}]},{kind:"category",name:"Face",categorystyle:"face_category",contents:[{kind:"block",type:"DisplayText"},{kind:"block",type:"ClearText"},{kind:"block",type:"DisplayImage"},{kind:"block",type:"eyes_acceptance"},{kind:"block",type:"eyes_admiration"},{kind:"block",type:"eyes_amazement"},{kind:"block",type:"eyes_anger"},{kind:"block",type:"eyes_annoyed"},{kind:"block",type:"eyes_anticipation"},{kind:"block",type:"eyes_apprehension"},{kind:"block",type:"eyes_boredom"},{kind:"block",type:"eyes_default"},{kind:"block",type:"eyes_disgust"},{kind:"block",type:"eyes_distraction"},{kind:"block",type:"eyes_ecstasy_frame_1"},{kind:"block",type:"eyes_ecstasy_frame_2"},{kind:"block",type:"eyes_fear"},{kind:"block",type:"eyes_grief"},{kind:"block",type:"eyes_interest"},{kind:"block",type:"eyes_joy"},{kind:"block",type:"eyes_loathing"},{kind:"block",type:"eyes_pensiveness"},{kind:"block",type:"eyes_rage"},{kind:"block",type:"eyes_sad"},{kind:"block",type:"eyes_serenity"},{kind:"block",type:"eyes_surprise"},{kind:"block",type:"eyes_terror"},{kind:"block",type:"eyes_trust"},{kind:"block",type:"eyes_vigilance"},{kind:"block",type:"e_Sleeping"},{kind:"block",type:"e_SleepingZZZ"},{kind:"block",type:"e_Contempt"},{kind:"block",type:"e_ContentLeft"},{kind:"block",type:"e_ContentRight"},{kind:"block",type:"e_Disoriented"},{kind:"block",type:"e_EcstacyHilarious"},{kind:"block",type:"e_EcstacyStarryEyed"},{kind:"block",type:"e_JoyGoofy"},{kind:"block",type:"e_JoyGoofy2"},{kind:"block",type:"e_JoyGoofy3"},{kind:"block",type:"e_Love"},{kind:"block",type:"e_Rage"},{kind:"block",type:"e_Rage2"},{kind:"block",type:"e_Rage3"},{kind:"block",type:"e_Rage4"},{kind:"block",type:"e_RemorseShame"}]},{kind:"category",name:"Audio",categorystyle:"audio_category",contents:[{kind:"block",type:"SetVolume"},{kind:"block",type:"PlayAudio"},{kind:"block",type:"s_Acceptance"},{kind:"block",type:"s_Amazement"},{kind:"block",type:"s_Amazement2"},{kind:"block",type:"s_Anger"},{kind:"block",type:"s_Anger2"},{kind:"block",type:"s_Anger3"},{kind:"block",type:"s_Anger4"},{kind:"block",type:"s_Annoyance"},{kind:"block",type:"s_Annoyance2"},{kind:"block",type:"s_Annoyance3"},{kind:"block",type:"s_Annoyance4"},{kind:"block",type:"s_Awe"},{kind:"block",type:"s_Awe2"},{kind:"block",type:"s_Awe3"},{kind:"block",type:"s_Boredom"},{kind:"block",type:"s_Disapproval"},{kind:"block",type:"s_Disgust"},{kind:"block",type:"s_Disgust2"},{kind:"block",type:"s_Disgust3"},{kind:"block",type:"s_DisorientedConfused"},{kind:"block",type:"s_DisorientedConfused2"},{kind:"block",type:"s_DisorientedConfused3"},{kind:"block",type:"s_DisorientedConfused4"},{kind:"block",type:"s_DisorientedConfused5"},{kind:"block",type:"s_DisorientedConfused6"},{kind:"block",type:"s_Distraction"},{kind:"block",type:"s_Ecstacy"},{kind:"block",type:"s_Ecstacy2"},{kind:"block",type:"s_Fear"},{kind:"block",type:"s_Grief"},{kind:"block",type:"s_Grief2"},{kind:"block",type:"s_Grief3"},{kind:"block",type:"s_Grief4"},{kind:"block",type:"s_Joy"},{kind:"block",type:"s_Joy2"},{kind:"block",type:"s_Joy3"},{kind:"block",type:"s_Joy4"},{kind:"block",type:"s_Loathing"},{kind:"block",type:"s_Love"},{kind:"block",type:"s_PhraseByeBye"},{kind:"block",type:"s_PhraseEvilAhHa"},{kind:"block",type:"s_PhraseHello"},{kind:"block",type:"s_PhraseNoNoNo"},{kind:"block",type:"s_PhraseOopsy"},{kind:"block",type:"s_PhraseOwOwOw"},{kind:"block",type:"s_PhraseOwwww"},{kind:"block",type:"s_PhraseUhOh"},{kind:"block",type:"s_Rage"},{kind:"block",type:"s_Sadness"},{kind:"block",type:"s_Sadness2"},{kind:"block",type:"s_Sadness3"},{kind:"block",type:"s_Sadness4"},{kind:"block",type:"s_Sadness5"},{kind:"block",type:"s_Sadness6"},{kind:"block",type:"s_Sadness7"},{kind:"block",type:"s_Sleepy"},{kind:"block",type:"s_Sleepy2"},{kind:"block",type:"s_Sleepy3"},{kind:"block",type:"s_Sleepy4"},{kind:"block",type:"s_SleepySnore"},{kind:"block",type:"s_SystemCameraShutter"}]}]},gve="/gpu-programming/assets/uw-crest-color-web-digital-CjofXveo.svg",_ve="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20width='100%25'%20height='100%25'%20viewBox='0%200%20194%20209'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20xml:space='preserve'%20xmlns:serif='http://www.serif.com/'%20style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;'%3e%3cg%20transform='matrix(1,0,0,1,-67.3413,-198.983)'%3e%3cg%20transform='matrix(4.16667,0,0,4.16667,0,0)'%3e%3cg%20transform='matrix(0,-1,-1,0,37.529,47.7569)'%3e%3cpath%20d='M-4.263,-4.263C-1.908,-4.263%200.001,-2.353%200.001,0.002C0.001,2.356%20-1.908,4.263%20-4.263,4.263C-6.617,4.263%20-8.527,2.356%20-8.527,0.002C-8.527,-2.353%20-6.617,-4.263%20-4.263,-4.263'%20style='fill:rgb(64,63,65);fill-rule:nonzero;'/%3e%3c/g%3e%3c/g%3e%3cg%20transform='matrix(4.16667,0,0,4.16667,0,0)'%3e%3cg%20transform='matrix(0,-1,-1,0,59.9955,60.1716)'%3e%3cpath%20d='M-2.673,-2.671C-1.196,-2.671%20-0.001,-1.477%20-0.001,0.001C-0.001,1.477%20-1.196,2.673%20-2.673,2.673C-4.148,2.673%20-5.342,1.477%20-5.342,0.001C-5.342,-1.477%20-4.148,-2.671%20-2.673,-2.671'%20style='fill:rgb(64,63,65);fill-rule:nonzero;'/%3e%3c/g%3e%3c/g%3e%3cg%20transform='matrix(4.16667,0,0,4.16667,0,0)'%3e%3cg%20transform='matrix(0,-1,-1,0,18.8329,65.7474)'%3e%3cpath%20d='M-2.671,-2.671C-1.196,-2.671%200.001,-1.476%200.001,0C0.001,1.475%20-1.196,2.671%20-2.671,2.671C-4.146,2.671%20-5.343,1.475%20-5.343,0C-5.343,-1.476%20-4.146,-2.671%20-2.671,-2.671'%20style='fill:rgb(64,63,65);fill-rule:nonzero;'/%3e%3c/g%3e%3c/g%3e%3cg%20transform='matrix(4.16667,0,0,4.16667,0,0)'%3e%3cg%20transform='matrix(0,-1,-1,0,34.0834,92.4773)'%3e%3cpath%20d='M-2.672,-2.672C-1.197,-2.672%200,-1.477%200,-0.001C0,1.475%20-1.197,2.672%20-2.672,2.672C-4.149,2.672%20-5.344,1.475%20-5.344,-0.001C-5.344,-1.477%20-4.149,-2.672%20-2.672,-2.672'%20style='fill:rgb(64,63,65);fill-rule:nonzero;'/%3e%3c/g%3e%3c/g%3e%3cg%20transform='matrix(4.16667,0,0,4.16667,0,0)'%3e%3cg%20transform='matrix(0,-1,-1,0,47.2036,90.0173)'%3e%3cpath%20d='M-2.673,-2.671C-1.198,-2.671%20-0.001,-1.477%20-0.001,0C-0.001,1.476%20-1.198,2.673%20-2.673,2.673C-4.148,2.673%20-5.342,1.476%20-5.342,0C-5.342,-1.477%20-4.148,-2.671%20-2.673,-2.671'%20style='fill:rgb(64,63,65);fill-rule:nonzero;'/%3e%3c/g%3e%3c/g%3e%3cg%20transform='matrix(4.16667,0,0,4.16667,0,0)'%3e%3cg%20transform='matrix(1,0,0,1,31.4239,88.2618)'%3e%3cpath%20d='M0,-31.486L-7.343,-31.486L-7.343,-24.621L-2.62,-27.134C-2.62,-27.134%20-1.885,-30.033%200,-31.486M-2.667,-21.8L-7.343,-19.427L-7.343,0L0.218,0C0.652,-4.687%201.012,-14.334%200.385,-17.054C-1.978,-18.859%20-2.667,-21.8%20-2.667,-21.8M16.67,-22.279C16.05,-19.824%2014.854,-18.168%2013.521,-16.972C16.087,-15.06%2018.567,-11.369%2018.567,-7.484L18.567,0L23.979,0L23.979,-22.367C22.277,-21.923%2019.538,-21.203%2016.67,-22.279M8.317,-13.886C7.15,-14.439%205.715,-14.459%205.715,-14.459L5.715,0L13.318,0L13.318,-6.519C13.318,-11.601%209.419,-13.365%208.317,-13.886M13.92,-31.486C15.038,-30.308%2015.911,-29.021%2016.417,-27.457C18.939,-25.75%2022.22,-26.601%2023.979,-26.855L23.979,-31.486L13.92,-31.486Z'%20style='fill:rgb(205,20,66);fill-rule:nonzero;'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e";function vve(n){return De.jsxs(oc,{container:!0,style:{position:"absolute",left:"20px",bottom:"20px",zIndex:"101",width:"70px"},children:[De.jsx(oc,{item:!0,xs:6,sm:6,md:12,lg:12,xl:12,alignContent:"center",children:De.jsx("img",{src:_ve})}),De.jsx(oc,{item:!0,xs:6,sm:6,md:12,lg:12,xl:12,children:De.jsx("img",{src:gve})})]})}function XH(){const{innerWidth:n,innerHeight:e}=window;return{width:n,height:e}}function FF(){const[n,e]=pe.useState(XH());return pe.useEffect(()=>{function t(){e(XH())}return window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)},[]),n}function yve({leftChildren:n,rightChildren:e}){return De.jsxs(oc,{container:!0,direction:"row",justifyContent:"center",spacing:2,style:{padding:"20px 30px 0px 30px",height:"100%",width:"100%"},children:[De.jsx(oc,{item:!0,xs:6,style:{overflowY:"scroll",height:"100%"},children:n}),De.jsx(oc,{item:!0,xs:6,style:{overflowY:"scroll",height:"100%"},children:e})]})}function jK({style:n,maxVH:e=0}){const t=Bn(qi(w=>w.userPrompt)),r=Bn(w=>w.setUserPrompt),s=Bn(w=>w.generateProgramOutline),o=Bn(w=>w.generateProgram),l=Bn(qi(w=>w.llmProcessing)),u=Bn(qi(w=>w.displayLLMBlockPrompt)),{height:h,_:f}=FF();function g(w){var C=Math.max(document.documentElement.clientHeight,window.innerHeight||0);return w*C/100}let y=e>0?g(e)/23:(h-190)/23;const b=w=>{r(w.target.value)};return De.jsxs("div",{style:{...n},children:[De.jsx(PF,{label:"What do you want the robot to do?",multiline:!0,disabled:l,fullWidth:!0,minRows:y,maxRows:y,onChange:b,value:t}),De.jsx(qp,{text:"Generate Program Goals",clickFunction:s,disabled:l,style:{float:"right"}}),u&&De.jsx(qp,{text:"Generate Block Program",clickFunction:o,disabled:l,style:{float:"right"}})]})}const bve=({title:n,subtext:e,hints:t,isPlanningScreen:r})=>{let s=Bn(b=>b.addMessageToHistory);const[o,l]=pe.useState(null),[u,h]=pe.useState(!1),f=()=>{l(null)},g=()=>{h(!u)},y=b=>{l(o===b?null:b)};return De.jsxs("div",{className:"subtask-card",children:[De.jsx("div",{className:"subtask-checkbox-container",children:De.jsx("input",{type:"checkbox",className:`subtask-checkbox ${u?"checked":""}`,onChange:g})}),De.jsxs("div",{className:"subtask-content",children:[De.jsx(f_,{variant:"h6",align:"left",sx:{marginBottom:"8px"},children:n}),De.jsx(f_,{variant:"subtitle1",align:"left",sx:{color:"#666"},children:e}),De.jsxs("div",{className:"hints-container",children:[!r&&t&&t.map((b,w)=>De.jsx(qp,{text:`Hint ${w+1}`,clickFunction:()=>y(b)},w)),r&&t&&t.map((b,w)=>De.jsx(qp,{text:b.text,clickFunction:()=>s("[Need Help]")},w))]}),o&&De.jsxs("div",{className:"hint-expansion",children:[De.jsx("p",{children:o.text}),De.jsx("div",{className:"close-button-container",children:De.jsx("button",{className:"close-button",onClick:f,children:"Close"})})]})]})]},n)},Tve=({hasNextTask:n,onNextTask:e,allTasks:t,subtasks:r,isPlanningScreen:s})=>De.jsxs("div",{className:"task-tab-container",children:[r&&r.map(o=>De.jsx(bve,{title:o.title,subtext:o.subtext,hints:o.hints.map(l=>t[l]),isPlanningScreen:s},o.title)),n&&De.jsxs("div",{className:"completion-card",children:[De.jsx("p",{children:"All steps are complete."}),De.jsx("button",{className:"next-task-button",onClick:e,children:"Go To Next Task"})]})]}),zF=({isPlanningScreen:n=!1})=>{var g,y;const[e,t]=pe.useState(0),r=Bn(qi(b=>b.getAllTasks)),s=Bn(qi(b=>b.getMainTasks)),o=r(n),l=s(n),u=b=>{t(b)},h=()=>{eDe.jsx("div",{className:`tab ${w===e?"active":""}`,onClick:()=>u(w),children:l[b].name},b))}),De.jsx("div",{className:"task-tab-container",children:De.jsx(Tve,{subtasks:(y=(g=l[f[e]])==null?void 0:g.subtasks)==null?void 0:y.map(b=>o[b]),allTasks:o,onNextTask:h,hasNextTask:e+1l.fullScreenPanel),t=Bn(l=>l.setFullScreenPanel),{height:r,_:s}=FF();let o=r-155;return De.jsxs("div",{style:{zIndex:20,height:"100%"},children:[De.jsx(yve,{leftChildren:De.jsx(jK,{}),rightChildren:De.jsxs("div",{style:{width:"100%"},children:[De.jsx("div",{style:{height:o,overflowY:"scroll"},children:De.jsx(zF,{})}),De.jsx("div",{style:{position:"absolute",right:20},children:De.jsx(qp,{text:"Done",clickFunction:()=>t(!e),style:{backgroundColor:"#A0FF7E"}})})]})}),De.jsx("button",{onClick:()=>t(!e),style:{position:"absolute",top:"75px",right:"10px",backgroundColor:"rgba(255, 0, 0, 0.8)",color:"#fff",padding:"5px 10px",borderRadius:"5px",border:"none",cursor:"pointer"},children:"✖"})]})}function Sve(n){pe.useState(!1),pe.useState(!1),Bn(qi(o=>o.llmProcessing));const e=Bn(qi(o=>o.setFullScreenPanel)),t=Bn(o=>o.setShowGPTConsole),r=Bn(o=>o.showGPTConsole),s=Bn(o=>o.userPrompt);return De.jsxs("div",{style:{position:"absolute",bottom:"0px",left:"114.7px",width:"93%",zIndex:10,backgroundColor:"#222",color:"#fff",height:"25vh"},children:[De.jsx("button",{onClick:()=>{e(!0),t(!r)},style:{position:"relative",left:"5vw"},children:"Expand to Full Screen"}),De.jsx("div",{style:{position:"absolute",zIndex:20,top:"40px",left:"50px"},children:De.jsxs("p",{children:["User prompt: ",s]})}),De.jsx("button",{onClick:()=>t(!r),style:{position:"absolute",top:"5px",left:"5px",backgroundColor:"rgba(255, 0, 0, 0.8)",color:"#fff",padding:"5px 10px",borderRadius:"5px",border:"none",cursor:"pointer"},children:"✖"})]})}var UF={},wve=aT;Object.defineProperty(UF,"__esModule",{value:!0});var YK=UF.default=void 0,Eve=wve(MC()),xve=De;YK=UF.default=(0,Eve.default)((0,xve.jsx)("path",{d:"M21 11V3h-8l3.29 3.29-10 10L3 13v8h8l-3.29-3.29 10-10z"}),"OpenInFull");function $ve(n){const e=Bn(z=>z.addBlock),t=Bn(z=>z.blocks),r=Bn(z=>z.removeBlock),s=Bn(z=>z.getBlock),o=Bn(z=>z.updateBlock),l=Bn(z=>z.getBlockType),u=Bn(z=>z.setBlocklyWorkspace),h=Bn(z=>z.getBlocklyWorkspace),f=Bn(z=>z.loadBlocks),g=Bn(z=>z.blocklyWorkspace),y=Bn(z=>z.highlightBlocks);Bn(z=>z.setShowGPTConsole);const b=Bn(z=>z.showGPTConsole),w=Bn(z=>z.fullScreenPanel);Bn(z=>z.ip);const C=Bn(z=>z.setFullScreenPanel),{height:M,_:A}=FF(),k=(z,U)=>{z.push(U);let V=s(U);for(;V.next;)V=V.next,z.push(V)},L=(z,U)=>{uh(U?z?`switch toolbox category from ${U} to ${z}`:`unselect toolbox category: ${U}`:`select toolbox category: ${z}`)},P=()=>{C(!0)};Zg.common.defineBlocks(t),Object.assign(Cw.javascriptGenerator.forBlock,ik),pe.useEffect(()=>{var U,V,H;let z=null;if(!document.querySelector(".blocklySvg")){const oe=document.getElementById("pageContainer"),le=document.getElementById("blocklyDiv");if(z=Zg.inject(le,{toolbox:mve,grid:{spacing:20,length:3,colour:"#ccc",snap:!0},theme:Zg.Theme.defineTheme("gpuTheme",{componentStyles:{toolboxBackgroundColour:"#E4E5F1",flyoutBackgroundColour:"#d2d3db"},categoryStyles:{...Pt},blockStyles:{logic_blocks:{colourPrimary:Pt.logic_category.colour},loop_blocks:{colourPrimary:Pt.loop_category.colour},math_blocks:{colourPrimary:Pt.math_category.colour},procedure_blocks:{colourPrimary:Pt.procedure_category.colour},text_blocks:{colourPrimary:Pt.speech_category.colour},colour_blocks:{colourPrimary:Pt.light_category.colour},hat_blocks:{hat:"cap"}}})}),!g&&z.getAllBlocks().filter(he=>he.type==="Start").length===0){const he=z.newBlock("Start");he.setDeletable(!1),he.moveBy(50,50),he.initSvg(),he.render()}if(g){let q={data:[]},he=Object.keys(t),ae=he.length;for(let ue=0;ue{for(let he of q){let ae=oe,ue=0,ge=0;do ue+=ae.offsetLeft,ge+=ae.offsetTop,ae=ae.offsetParent;while(ae);le.style.left=ue+"px",le.style.top=ge+"px",le.style.width=oe.offsetWidth+"px",le.style.height=oe.offsetHeight+"px",Zg.svgResize(z),z.scrollbar.setVisible(!1)}}).observe(oe),z.render(),u(z),z.addChangeListener(q=>{if(q.isUiEvent){if(q.type==="toolbox_item_select")L(q.newItem,q.oldItem);else if(q.type==="click"){if(q.targetType==="block"){const he=l(q.blockId);uh(`click on ${he} block`)}q.targetType==="workspace"&&uh("click on workspace")}else if(q.type==="selected"){if(q.oldElementId){const he=l(q.oldElementId);uh(`unselect and un-highlight ${he} `)}if(q.newElementId){const he=l(q.newElementId);uh(`select and highlight ${he} `)}}else if(q.type==="drag"){const he=l(q.blockId);q.isStart?uh(`drag block ${he} start `):uh(`drag block ${he} end `)}return}if(q.type===Zg.Events.BLOCK_DELETE){let he=q.blockId,ae=[he],ue=s(he).inputs;if(ue)for(let[J,re]of Object.entries(ue))typeof re!="string"?ae.push(re.id):k(ae,re);let ge=s(q.blockId).next;ge&&k(ae,ge);const we=ae.map(J=>l(J));r(ae),uh(`block ${he} is deleted, total delete blocks: ${we}`)}if(q.type===Zg.Events.BLOCK_CHANGE){const he=l(q.blockId);let ae=q.blockId,ue=s(ae);ue.fields[q.name]=q.newValue,o(ae,ue),uh(`field ${q.name} of ${he} change from ${q.oldValue} to ${q.newValue} `)}if(q.type==="create"){let he={id:q.json.id,type:q.json.type,prev:"",next:"",isShadow:!1};if(q.json.type==="Start"&&(q.json.id,he={id:q.json.id,type:q.json.type,next:""}),q.json.fields&&(he.fields=q.json.fields),q.json.inputs){he.inputs=q.json.inputs;for(let[ae,ue]of Object.entries(q.json.inputs))if(ue.shadow){let ge={id:ue.shadow.id,type:ue.shadow.type,fields:ue.shadow.fields,isShadow:!0,initialParent:q.ids[0],initialInput:ae};"shadows"in he||(he.shadows={}),he.shadows[ae]=ue.shadow.id,e(ue.shadow.id,ge),uh(`create a instance of type ${ge.type}`)}}e(q.json.id,he),uh(`create a instance of type ${he.type}`)}if(q.type==="move"){const he=l(q.blockId),ae=q.reason;if(ae&&(typeof ae!="string"&&ae[1]==="drag"||ae[0]==="drag")&&q.newCoordinate&&uh(`drag ${he} from coordinate: {x: ${q.oldCoordinate.x}, y: ${q.oldCoordinate.y}} to {x: ${q.newCoordinate.x},y: ${q.newCoordinate.y}}`),q.reason&&q.reason.includes("connect")){let ue=q.newParentId,ge=s(q.newParentId);const we=ge.type,J=s(q.blockId);q.newInputName?("inputs"in ge||(ge.inputs={}),ge.inputs[q.newInputName]=q.blockId,o(ue,ge),uh(`connect ${J.type} as input of ${we}`)):(ge.next=q.blockId,o(ue,ge),J.prev=ue,o(q.blockId,J),uh(`Placed ${J.type} after ${we}`))}if(q.reason&&q.reason.includes("disconnect")){let ue=q.oldParentId,ge=s(q.oldParentId);const we=ge.type,J=s(q.blockId);if(!q.oldInputName)ge.next="",o(ue,ge),J.prev="",o(q.blockId,J),uh(`disconnect ${we} from ${ge.type}`);else{if(ge.inputs[q.oldInputName]="",ge.shadows&&ge.shadows[q.oldInputName]){let re=ge.shadows[q.oldInputName];ge.inputs[q.oldInputName]=re}o(ue,ge),uh(`remove ${we} from input of ${ge.type}`)}}}})}},[]),pe.useEffect(()=>{console.log(y);let z=h();z&&y?D(z,y,"#FF0000"):console.log("Workspace or block ID not defined.")},[y]);function D(z,U,V,H=500,oe=5){var le=z.getBlockById(U);if(le){var Z=le.getSvgRoot();if(Z){var q=Z.querySelectorAll(".blocklyPath");if(q.length>0){let he=q[0].style.fill,ae=0,ue=!1;const ge=()=>{q.forEach(function(we){we.style.fill=ue?V:he}),ue=!ue,ae++=460&&!w&&De.jsx(vve,{}),De.jsxs("div",{id:"pageContainer",style:{width:"100%",height:"100%"},children:[De.jsx("div",{id:"blocklyDiv",style:{width:"100%",height:"100%"}}),!w&&De.jsx("div",{style:{position:"absolute",bottom:"10px",left:"170px",transform:"translateX(-50%)",zIndex:10,backgroundColor:"rgba(51, 51, 51, 0.8)",color:"#fff",padding:"10px 20px",borderRadius:"10px",border:"none",cursor:"pointer"},onClick:P,children:De.jsxs("div",{style:{display:"flex",alignItems:"center",flexWrap:"wrap"},children:[De.jsx(YK,{}),De.jsx("span",{children:"Goals"})]})}),b&&De.jsx("div",{children:De.jsx(Sve,{})}),De.jsx("xml",{id:"toolbox",style:{display:"none"}})]})]})}const Cve="/gpu-programming/assets/misty_loading_combined-BxYfE45A.gif";function ac(n,e,t){return e=dde(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function pv(n){for(var e=1;e=0)}static isFirefox(){return Oo.isBrowser()&&typeof InstallTrigger<"u"}static isSafari(){return Oo.isBrowser()?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}static isIE(){return Oo.isBrowser()&&!!document.documentMode}static isEdge(){return Oo.isBrowser()&&!Oo.isIE()&&!!window.StyleMedia}static isChrome(){return Oo.isBrowser()&&!!window.chrome&&!!window.chrome.webstore}static isBlink(){return Oo.isBrowser()&&(Oo.isChrome()||Oo.isOpera())&&!!window.CSS}static getUserAgent(){return typeof navigator>"u"?"":navigator.userAgent}static isAndroid(){return Oo.isBrowser()&&Oo.getUserAgent().match(/Android/i)}static isBlackBerry(){return Oo.isBrowser()&&Oo.getUserAgent().match(/BlackBerry/i)}static isIOS(){return Oo.isBrowser()&&Oo.getUserAgent().match(/iPhone|iPad|iPod/i)}static isOpera(){return Oo.isBrowser()&&Oo.getUserAgent().match(/Opera Mini/i)}static isWindows(){return Oo.isBrowser()&&Oo.isWindowsDesktop()||Oo.isWindowsMobile()}static isWindowsMobile(){return Oo.isBrowser()&&Oo.getUserAgent().match(/IEMobile/i)}static isWindowsDesktop(){return Oo.isBrowser()&&Oo.getUserAgent().match(/WPDesktop/i)}static isMobile(){return Oo.isBrowser()&&(Oo.isWindowsMobile()||Oo.isBlackBerry()||Oo.isAndroid()||Oo.isIOS())}}const Qk=n=>Object.keys(n).reduce((e,t)=>t.substr(0,5)==="data-"?pv({},e,{[t]:n[t]}):e,{});class kf extends yt.Component{static isA(e){return e?e.type===yt.createElement(kf,null).type:!1}constructor(e){super(e),ac(this,"ref",yt.createRef()),ac(this,"onMouseMove",t=>{if(this.state.active){const r=this.ref.current;this.props.events.emit("resize",{index:this.props.index,domElement:r,event:t}),this.props.onResize&&this.props.onResize({component:this,domElement:r}),t.stopPropagation(),t.preventDefault()}}),ac(this,"onMouseDown",t=>{this.setState({active:!0}),!(this.props.onStartResize&&this.props.onStartResize({domElement:this.ref.current,component:this}))&&this.props.events.emit("startResize",{index:this.props.index,event:t})}),ac(this,"onMouseUp",t=>{this.state.active&&(this.setState({active:!1}),this.props.onStopResize&&this.props.onStopResize({domElement:this.ref.current,component:this}),this.props.events.emit("stopResize",{index:this.props.index,event:t}))}),this.state={active:!1},this.document=e.document}componentDidMount(){this.document&&(this.document.addEventListener("touchend",this.onMouseUp),this.document.addEventListener("mouseup",this.onMouseUp),this.document.addEventListener("mousemove",this.onMouseMove,{passive:!1}),this.document.addEventListener("touchmove",this.onMouseMove,{passive:!1}))}componentWillUnmount(){this.document&&(this.document.removeEventListener("mouseup",this.onMouseUp),this.document.removeEventListener("touchend",this.onMouseUp),this.document.removeEventListener("mousemove",this.onMouseMove),this.document.removeEventListener("touchmove",this.onMouseMove),this.state.active&&this.props.events.emit("stopResize",{index:this.props.index,event:null}))}render(){const e=[Oo.isMobile()?"reflex-thin":"",...this.props.className.split(" "),this.state.active?"active":"","reflex-splitter"].join(" ").trim();return yt.createElement("div",qe({},Qk(this.props),{onTouchStart:this.onMouseDown,onMouseDown:this.onMouseDown,style:this.props.style,className:e,id:this.props.id,ref:this.ref}),this.props.children)}}ac(kf,"propTypes",{children:qt.oneOfType([qt.arrayOf(qt.node),qt.node]),onStartResize:qt.func,onStopResize:qt.func,className:qt.string,propagate:qt.bool,onResize:qt.func,style:qt.object});ac(kf,"defaultProps",{document:typeof document<"u"?document:null,onStartResize:null,onStopResize:null,propagate:!1,onResize:null,className:"",style:{}});class Mve{constructor(){this._events={}}on(e,t){return e.split(" ").forEach(r=>{this._events[r]=this._events[r]||[],this._events[r].push(t)}),this}off(e,t){if(e==null){this._events={};return}return e.split(" ").forEach(r=>{r in this._events&&(t?this._events[r].splice(this._events[r].indexOf(t),1):this._events[r]=[])}),this}emit(e){if(this._events[e]!==void 0)for(var t=this._events[e].slice(),r=0;r>>0;if(r===0)return!1;var s=e|0,o=Math.max(s>=0?s:r-Math.abs(s),0);function l(u,h){return u===h||typeof u=="number"&&typeof h=="number"&&isNaN(u)&&isNaN(h)}for(;o0)-(n<0)||+n});class L1 extends yt.Component{constructor(e){super(e),ac(this,"onWindowResize",()=>{this.setState({flexData:this.computeFlexData()})}),ac(this,"onStartResize",t=>{const r=t.event.changedTouches?t.event.changedTouches[0]:t.event;switch(this.props.orientation){case"horizontal":document.body.classList.add("reflex-row-resize"),this.previousPos=r.clientY;break;case"vertical":default:document.body.classList.add("reflex-col-resize"),this.previousPos=r.clientX;break}this.elements=[this.children[t.index-1],this.children[t.index+1]],this.emitElementsEvent(this.elements,"onStartResize")}),ac(this,"onResize",t=>{const r=t.event.changedTouches?t.event.changedTouches[0]:t.event,s=this.getOffset(r,t.domElement);switch(this.props.orientation){case"horizontal":this.previousPos=r.clientY;break;case"vertical":default:this.previousPos=r.clientX;break}if(s){const o=this.computeAvailableOffset(t.index,s);o&&(this.elements=this.dispatchOffset(t.index,o),this.adjustFlex(this.elements),this.setState({resizing:!0},()=>{this.emitElementsEvent(this.elements,"onResize")}))}}),ac(this,"onStopResize",t=>{document.body.classList.remove("reflex-row-resize"),document.body.classList.remove("reflex-col-resize");const r=this.elements?this.elements.map(o=>o.ref):[],s=this.children.filter(o=>!kf.isA(o)&&r.includes(o.ref));this.emitElementsEvent(s,"onStopResize"),this.setState({resizing:!1})}),ac(this,"onElementSize",t=>new Promise(r=>{try{const s=t.index,o=this.getSize(this.children[s]),l=t.size-o,u=t.direction,h=s+u,f=this.computeAvailableOffset(h,u*l);this.elements=null,f&&(this.elements=this.dispatchOffset(h,f),this.adjustFlex(this.elements)),this.setState(this.state,()=>{this.emitElementsEvent(this.elements,"onResize"),r()})}catch(s){console.log(s)}})),this.events=new Mve,this.children=[],this.state={flexData:[]},this.ref=yt.createRef()}componentDidMount(){const e=this.computeFlexData(),{windowResizeAware:t}=this.props;t&&window.addEventListener("resize",this.onWindowResize),this.setState({windowResizeAware:t,flexData:e}),this.events.on("element.size",this.onElementSize),this.events.on("startResize",this.onStartResize),this.events.on("stopResize",this.onStopResize),this.events.on("resize",this.onResize)}componentWillUnmount(){this.events.off(),window.removeEventListener("resize",this.onWindowResize)}getValidChildren(e=this.props){return this.toArray(e.children).filter(t=>!!t)}componentDidUpdate(e,t){const r=this.getValidChildren(this.props);if(r.length!==this.state.flexData.length||e.orientation!==this.props.orientation||this.flexHasChanged(e)){const s=this.computeFlexData(r,this.props);this.setState({flexData:s})}this.props.windowResizeAware!==this.state.windowResizeAware&&(this.props.windowResizeAware?window.addEventListener("resize",this.onWindowResize):window.removeEventListener("resize",this.onWindowResize),this.setState({windowResizeAware:this.props.windowResizeAware}))}flexHasChanged(e){const t=this.getValidChildren(e).map(s=>s.props.flex||0);return!this.getValidChildren().map(s=>s.props.flex||0).every((s,o)=>s===t[o])}getSize(e){var t,r,s;const o=e==null||(t=e.ref)===null||t===void 0?void 0:t.current;switch(this.props.orientation){case"horizontal":return(r=o==null?void 0:o.offsetHeight)!==null&&r!==void 0?r:0;case"vertical":default:return(s=o==null?void 0:o.offsetWidth)!==null&&s!==void 0?s:0}}getOffset(e,t){const{top:r,bottom:s,left:o,right:l}=t.getBoundingClientRect();switch(this.props.orientation){case"horizontal":{const u=e.clientY-this.previousPos;if(u>0){if(e.clientY>=r)return u}else if(e.clientY<=s)return u;break}case"vertical":default:{const u=e.clientX-this.previousPos;if(u>0){if(e.clientX>o)return u}else if(e.clientX{const o=s.props.index,l=s.props.flex,u=this.state.flexData[o].flex;return r+(l-u)/e.length},0);e.forEach(r=>{this.state.flexData[r.props.index].flex+=t})}computeAvailableOffset(e,t){const r=this.computeAvailableStretch(e,t),s=this.computeAvailableShrink(e,t);return Math.min(r,s)*Math.sign(t)}checkPropagate(e,t){if(t>0){if(e2){const r=this.children[e-2];return kf.isA(r)&&r.props.propagate}return!1}computeAvailableStretch(e,t){var r;const s=t<0?e+1:e-1,o=this.children[s],l=this.getSize(o),h=((r=o==null?void 0:o.props.maxSize)!==null&&r!==void 0?r:0)-l;if(h0?e+1:e-1,o=this.children[s],l=this.getSize(o),u=Math.max((r=o==null?void 0:o.props.minSize)!==null&&r!==void 0?r:0,0),h=l-u;if(h0?e+2:e-2,f)}return Math.min(h,Math.abs(t))}computePixelFlex(e=this.props.orientation){if(!this.ref.current)return console.warn("Unable to locate ReflexContainer dom node"),0;switch(e){case"horizontal":return this.ref.current.offsetHeight===0?(console.warn("Found ReflexContainer with height=0, this will cause invalid behavior..."),console.warn(this.ref.current),0):1/this.ref.current.offsetHeight;case"vertical":default:return this.ref.current.offsetWidth===0?(console.warn("Found ReflexContainer with width=0, this will cause invalid behavior..."),console.warn(this.ref.current),0):1/this.ref.current.offsetWidth}}addOffset(e,t){const r=this.getSize(e),s=e.props.index,o=Math.max(r+t,0),l=this.state.flexData[s].flex,u=l>0?l*o/r:this.computePixelFlex()*o;this.state.flexData[s].flex=!isFinite(u)||isNaN(u)?0:u}dispatchStretch(e,t){const r=t<0?e+1:e-1;if(r<0||r>this.children.length-1)return[];const s=this.children[r],o=this.getSize(s),u=Math.min(s.props.maxSize,o+Math.abs(t))-o;if(this.addOffset(s,u),u0?e+1:e-1;if(r<0||r>this.children.length-1)return[];const s=this.children[r],o=this.getSize(s),u=Math.max(s.props.minSize,o-Math.abs(t))-o;if(this.addOffset(s,u),Math.abs(u){r.props[t]&&r.props[t]({domElement:r.ref.current,component:r})})}computeFlexData(e=this.getValidChildren(),t=this.props){const r=this.computePixelFlex(t.orientation),s=f=>f.reduce((g,y)=>!kf.isA(y)&&y.constrained?g-y.flex:g,1),o=f=>f.reduce((g,y)=>!kf.isA(y)&&!y.constrained?g+1:g,0),l=e.map(f=>{const g=f.props;return{maxFlex:(g.maxSize||Number.MAX_VALUE)*r,sizeFlex:(g.size||Number.MAX_VALUE)*r,minFlex:(g.minSize||1)*r,constrained:g.flex!==void 0,flex:g.flex||0,type:f.type}}),u=(f,g=0)=>{let y=!1;const b=o(f),w=s(f),C=f.map(M=>{if(kf.isA(M))return M;const A=M.constrained?M.flex:w/b,k=Math.min(M.sizeFlex,Math.min(M.maxFlex,Math.max(M.minFlex,A))),L=M.constrained||k!==A;return y=y||L,pv({},M,{flex:k,constrained:L})});return y&&g({flex:kf.isA(f)?0:f.flex,ref:yt.createRef()}))}toArray(e){return e?Array.isArray(e)?e:[e]:[]}render(){const e=[this.state.resizing?"reflex-resizing":"",...this.props.className.split(" "),this.props.orientation,"reflex-container"].join(" ").trim();return this.children=yt.Children.map(this.getValidChildren(),(t,r)=>{if(r>this.state.flexData.length-1)return yt.createElement("div",null);const s=this.state.flexData[r],o=pv({},t.props,{maxSize:t.props.maxSize||Number.MAX_VALUE,orientation:this.props.orientation,minSize:t.props.minSize||1,events:this.events,flex:s.flex,ref:s.ref,index:r});return yt.cloneElement(t,o)}),yt.createElement("div",qe({},Qk(this.props),{style:this.props.style,className:e,ref:this.ref}),this.children)}}ac(L1,"propTypes",{windowResizeAware:qt.bool,orientation:qt.oneOf(["horizontal","vertical"]),maxRecDepth:qt.number,className:qt.string,style:qt.object});ac(L1,"defaultProps",{orientation:"horizontal",windowResizeAware:!1,maxRecDepth:100,className:"",style:{}});class cE extends yt.Component{static isA(e){return e?e.type===cE:!1}constructor(e){super(e),ac(this,"ref",yt.createRef()),ac(this,"onMouseMove",t=>{if(this.state.active){const r=this.ref.current;this.props.events.emit("resize",{index:this.props.index,domElement:r,event:t}),this.props.onResize&&this.props.onResize({component:this,domElement:r}),t.stopPropagation(),t.preventDefault()}}),ac(this,"onMouseDown",t=>{this.setState({active:!0}),!(this.props.onStartResize&&this.props.onStartResize({domElement:this.ref.current,component:this}))&&this.props.events.emit("startResize",{index:this.props.index,event:t})}),ac(this,"onMouseUp",t=>{this.state.active&&(this.setState({active:!1}),this.props.onStopResize&&this.props.onStopResize({domElement:this.ref.current,component:this}),this.props.events.emit("stopResize",{index:this.props.index,event:t}))}),this.state={active:!1},this.document=e.document}componentDidMount(){this.document&&(this.document.addEventListener("touchend",this.onMouseUp),this.document.addEventListener("mouseup",this.onMouseUp),this.document.addEventListener("mousemove",this.onMouseMove,{passive:!1}),this.document.addEventListener("touchmove",this.onMouseMove,{passive:!1}))}componentWillUnmount(){this.document&&(this.document.removeEventListener("mouseup",this.onMouseUp),this.document.removeEventListener("touchend",this.onMouseUp),this.document.removeEventListener("mousemove",this.onMouseMove),this.document.removeEventListener("touchmove",this.onMouseMove),this.state.active&&this.props.events.emit("stopResize",{index:this.props.index,event:null}))}render(){const e=[...this.props.className.split(" "),this.state.active?"active":"","reflex-handle"].join(" ").trim();return yt.createElement("div",qe({},Qk(this.props),{onTouchStart:this.onMouseDown,onMouseDown:this.onMouseDown,style:this.props.style,className:e,id:this.props.id,ref:this.ref}),this.props.children)}}ac(cE,"propTypes",{children:qt.oneOfType([qt.arrayOf(qt.node),qt.node]),onStartResize:qt.func,onStopResize:qt.func,className:qt.string,propagate:qt.bool,onResize:qt.func,style:qt.object});ac(cE,"defaultProps",{document:typeof document>"u"?null:document,onStartResize:null,onStopResize:null,propagate:!1,onResize:null,className:"",style:{}});var XK="Expected a function",JH=NaN,Ave="[object Symbol]",Ive=/^\s+|\s+$/g,Rve=/^[-+]0x[0-9a-f]+$/i,kve=/^0b[01]+$/i,Ove=/^0o[0-7]+$/i,Lve=parseInt,Nve=typeof Vl=="object"&&Vl&&Vl.Object===Object&&Vl,Dve=typeof self=="object"&&self&&self.Object===Object&&self,Pve=Nve||Dve||Function("return this")(),Bve=Object.prototype,Fve=Bve.toString,zve=Math.max,Uve=Math.min,rL=function(){return Pve.Date.now()};function Hve(n,e,t){var r,s,o,l,u,h,f=0,g=!1,y=!1,b=!0;if(typeof n!="function")throw new TypeError(XK);e=qH(e)||0,pR(t)&&(g=!!t.leading,y="maxWait"in t,o=y?zve(qH(t.maxWait)||0,e):o,b="trailing"in t?!!t.trailing:b);function w(U){var V=r,H=s;return r=s=void 0,f=U,l=n.apply(H,V),l}function C(U){return f=U,u=setTimeout(k,e),g?w(U):l}function M(U){var V=U-h,H=U-f,oe=e-V;return y?Uve(oe,o-H):oe}function A(U){var V=U-h,H=U-f;return h===void 0||V>=e||V<0||y&&H>=o}function k(){var U=rL();if(A(U))return L(U);u=setTimeout(k,M(U))}function L(U){return u=void 0,b&&r?w(U):(r=s=void 0,l)}function P(){u!==void 0&&clearTimeout(u),f=0,r=h=s=u=void 0}function D(){return u===void 0?l:L(rL())}function z(){var U=rL(),V=A(U);if(r=arguments,s=this,h=U,V){if(u===void 0)return C(h);if(y)return u=setTimeout(k,e),w(h)}return u===void 0&&(u=setTimeout(k,e)),l}return z.cancel=P,z.flush=D,z}function Gve(n,e,t){var r=!0,s=!0;if(typeof n!="function")throw new TypeError(XK);return pR(t)&&(r="leading"in t?!!t.leading:r,s="trailing"in t?!!t.trailing:s),Hve(n,e,{leading:r,maxWait:e,trailing:s})}function pR(n){var e=typeof n;return!!n&&(e=="object"||e=="function")}function Wve(n){return!!n&&typeof n=="object"}function Vve(n){return typeof n=="symbol"||Wve(n)&&Fve.call(n)==Ave}function qH(n){if(typeof n=="number")return n;if(Vve(n))return JH;if(pR(n)){var e=typeof n.valueOf=="function"?n.valueOf():n;n=pR(e)?e+"":e}if(typeof n!="string")return n===0?n:+n;n=n.replace(Ive,"");var t=kve.test(n);return t||Ove.test(n)?Lve(n.slice(2),t?2:8):Rve.test(n)?JH:+n}var jve=Gve;const Yve=Xy(jve);var KK=function(){if(typeof Map<"u")return Map;function n(e,t){var r=-1;return e.some(function(s,o){return s[0]===t?(r=o,!0):!1}),r}return function(){function e(){this.__entries__=[]}return Object.defineProperty(e.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),e.prototype.get=function(t){var r=n(this.__entries__,t),s=this.__entries__[r];return s&&s[1]},e.prototype.set=function(t,r){var s=n(this.__entries__,t);~s?this.__entries__[s][1]=r:this.__entries__.push([t,r])},e.prototype.delete=function(t){var r=this.__entries__,s=n(r,t);~s&&r.splice(s,1)},e.prototype.has=function(t){return!!~n(this.__entries__,t)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(t,r){r===void 0&&(r=null);for(var s=0,o=this.__entries__;s0},n.prototype.connect_=function(){!YD||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Zve?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},n.prototype.disconnect_=function(){!YD||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},n.prototype.onTransitionEnd_=function(e){var t=e.propertyName,r=t===void 0?"":t,s=Qve.some(function(o){return!!~r.indexOf(o)});s&&this.refresh()},n.getInstance=function(){return this.instance_||(this.instance_=new n),this.instance_},n.instance_=null,n}(),JK=function(n,e){for(var t=0,r=Object.keys(e);t"u"||!(Element instanceof Object))){if(!(e instanceof Ow(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new lye(e)),this.controller_.addObserver(this),this.controller_.refresh())}},n.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(e instanceof Ow(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this))}},n.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},n.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach(function(t){t.isActive()&&e.activeObservations_.push(t)})},n.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map(function(r){return new uye(r.target,r.broadcastRect())});this.callback_.call(e,t,e),this.clearActive()}},n.prototype.clearActive=function(){this.activeObservations_.splice(0)},n.prototype.hasActive=function(){return this.activeObservations_.length>0},n}(),QK=typeof WeakMap<"u"?new WeakMap:new KK,ZK=function(){function n(e){if(!(this instanceof n))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var t=eye.getInstance(),r=new cye(e,t,this);QK.set(this,r)}return n}();["observe","unobserve","disconnect"].forEach(function(n){ZK.prototype[n]=function(){var e;return(e=QK.get(this))[n].apply(e,arguments)}});var hye=function(){return typeof mR.ResizeObserver<"u"?mR.ResizeObserver:ZK}(),dye=["client","offset","scroll","bounds","margin"];function ZH(n){var e=[];return dye.forEach(function(t){n[t]&&e.push(t)}),e}function eG(n,e){var t={};if(e.indexOf("client")>-1&&(t.client={top:n.clientTop,left:n.clientLeft,width:n.clientWidth,height:n.clientHeight}),e.indexOf("offset")>-1&&(t.offset={top:n.offsetTop,left:n.offsetLeft,width:n.offsetWidth,height:n.offsetHeight}),e.indexOf("scroll")>-1&&(t.scroll={top:n.scrollTop,left:n.scrollLeft,width:n.scrollWidth,height:n.scrollHeight}),e.indexOf("bounds")>-1){var r=n.getBoundingClientRect();t.bounds={top:r.top,right:r.right,bottom:r.bottom,left:r.left,width:r.width,height:r.height}}if(e.indexOf("margin")>-1){var s=getComputedStyle(n);t.margin={top:s?parseInt(s.marginTop):0,right:s?parseInt(s.marginRight):0,bottom:s?parseInt(s.marginBottom):0,left:s?parseInt(s.marginLeft):0}}return t}function fye(n){var e=n&&n.ownerDocument&&n.ownerDocument.defaultView;return e||window}function pye(n){return function(e){var t,r;return r=t=function(s){$F(o,s);function o(){for(var u,h=arguments.length,f=new Array(h),g=0;gn?Array.isArray(n)?n:[n]:[];class mye extends yt.Component{constructor(e){super(e),ac(this,"onResize",t=>{const{resizeHeight:r,resizeWidth:s}=this.props,{height:o,width:l}=t.bounds;this.setDimensions(pv({},r&&{height:o},s&&{width:l}))}),this.setDimensions=Yve(t=>{this.setState(t)},this.props.propagateDimensionsRate/1e3),this.state={height:"100%",width:"100%"}}renderChildren(){const{propagateDimensions:e}=this.props,t=XD(this.props.children).filter(r=>!!r);return yt.Children.map(t,r=>this.props.withHandle||cE.isA(r)?yt.cloneElement(r,pv({dimensions:e&&this.state},r.props,{index:this.props.index-1,events:this.props.events})):e?yt.cloneElement(r,pv({},r.props,{dimensions:this.state})):r)}render(){return yt.createElement(HF,{bounds:!0,onResize:this.onResize},({measureRef:e})=>yt.createElement("div",{ref:e,className:"reflex-size-aware"},yt.createElement("div",{style:this.state},this.renderChildren())))}}class GF extends yt.Component{constructor(e){super(e),this.state={size:e.size}}static getDerivedStateFromProps(e,t){return e.size!==t.size?pv({},t,{size:e.size}):null}async componentDidUpdate(e,t,r){if(t.size!==this.state.size){const s=XD(this.props.direction);for(let o of s)await this.props.events.emit("element.size",{index:this.props.index,size:this.props.size,direction:o})}}renderChildren(){const e=XD(this.props.children).filter(t=>!!t);return yt.Children.map(e,t=>this.props.withHandle||cE.isA(t)?yt.cloneElement(t,pv({},t.props,{index:this.props.index-1,events:this.props.events})):t)}render(){const e=[...this.props.className.split(" "),this.props.orientation,"reflex-element"].join(" ").trim(),t=pv({},this.props.style,{flexGrow:this.props.flex,flexShrink:1,flexBasis:"0%"});return yt.createElement("div",qe({},Qk(this.props),{ref:this.props.innerRef,className:e,style:t}),this.props.propagateDimensions?yt.createElement(mye,this.props):this.renderChildren())}}ac(GF,"propTypes",{propagateDimensions:qt.bool,resizeHeight:qt.bool,resizeWidth:qt.bool,className:qt.string,size:qt.number});ac(GF,"defaultProps",{propagateDimensionsRate:100,propagateDimensions:!1,resizeHeight:!0,resizeWidth:!0,direction:[1],className:""});const Z0=yt.forwardRef((n,e)=>yt.createElement(GF,qe({innerRef:e},n))),eJ="/gpu-programming/assets/BASE_FRONT_GRILL_1-b5goAhwv.glb";var tJ={exports:{}},lT={};/** + */const mve={kind:"categoryToolbox",contents:[{kind:"category",name:"Functions",categorystyle:"procedure_category",custom:"PROCEDURE"},{kind:"category",name:"Triggers",categorystyle:"trigger_category",contents:[{kind:"block",type:"FrontLeftBumperPress"},{kind:"block",type:"FrontRightBumperPress"},{kind:"block",type:"RearLeftBumperPress"},{kind:"block",type:"RearRightBumperPress"}]},{kind:"category",name:"Control",categorystyle:"logic_category",contents:[{kind:"block",type:"controls_if"},{kind:"block",type:"controls_repeat_ext",inputs:{TIMES:{shadow:{type:"math_number",fields:{NUM:10}}}}},{kind:"block",type:"logic_compare"},{kind:"block",type:"logic_operation"},{kind:"block",type:"logic_negate"},{kind:"block",type:"logic_boolean"},{kind:"block",type:"logic_null"},{kind:"block",type:"logic_ternary"}]},{kind:"category",name:"Math",categorystyle:"math_category",contents:[{kind:"block",type:"math_number",fields:{NUM:123}},{kind:"block",type:"BasicSlider"},{kind:"block",type:"math_number_property",inputs:{NUMBER_TO_CHECK:{shadow:{type:"math_number",fields:{NUM:0}}}}},{kind:"block",type:"math_random_int",inputs:{FROM:{shadow:{type:"math_number",fields:{NUM:1}}},TO:{shadow:{type:"math_number",fields:{NUM:100}}}}}]},{kind:"category",name:"Movement",categorystyle:"movement_category",contents:[{kind:"block",type:"WaitForSeconds"},{kind:"block",type:"DriveTime"},{kind:"block",type:"DriveTime2"},{kind:"block",type:"Turn"},{kind:"block",type:"Turn2"},{kind:"block",type:"MoveHead"},{kind:"block",type:"MoveHead3"},{kind:"block",type:"MoveArm"},{kind:"block",type:"MoveArm2"},{kind:"block",type:"MoveArms2"},{kind:"block",type:"MoveArm3"}]},{kind:"category",name:"Light",categorystyle:"light_category",contents:[{kind:"block",type:"ChangeLED"},{kind:"block",type:"TransitionLED"},{kind:"block",type:"colour_picker"},{kind:"block",type:"colour_random"},{kind:"block",type:"colour_rgb",inputs:{RED:{shadow:{type:"math_number",fields:{NUM:100}}},GREEN:{shadow:{type:"math_number",fields:{NUM:50}}},BLUE:{shadow:{type:"math_number",fields:{NUM:0}}}}},{kind:"block",type:"colour_blend",inputs:{COLOUR1:{shadow:{type:"colour_picker",fields:{COLOUR:"#ff0000"}}},COLOUR2:{shadow:{type:"colour_picker",fields:{COLOUR:"#3333ff"}}},RATIO:{shadow:{type:"math_number",fields:{NUM:.5}}}}},{kind:"block",type:"TurnOnFlashlight"},{kind:"block",type:"TurnOffFlashlight"}]},{kind:"category",name:"Speech",categorystyle:"speech_category",contents:[{kind:"block",type:"Speak"},{kind:"block",type:"SpeakDefault"},{kind:"block",type:"text"}]},{kind:"category",name:"Face",categorystyle:"face_category",contents:[{kind:"block",type:"DisplayText"},{kind:"block",type:"ClearText"},{kind:"block",type:"DisplayImage"},{kind:"block",type:"eyes_acceptance"},{kind:"block",type:"eyes_admiration"},{kind:"block",type:"eyes_amazement"},{kind:"block",type:"eyes_anger"},{kind:"block",type:"eyes_annoyed"},{kind:"block",type:"eyes_anticipation"},{kind:"block",type:"eyes_apprehension"},{kind:"block",type:"eyes_boredom"},{kind:"block",type:"eyes_default"},{kind:"block",type:"eyes_disgust"},{kind:"block",type:"eyes_distraction"},{kind:"block",type:"eyes_ecstasy_frame_1"},{kind:"block",type:"eyes_ecstasy_frame_2"},{kind:"block",type:"eyes_fear"},{kind:"block",type:"eyes_grief"},{kind:"block",type:"eyes_interest"},{kind:"block",type:"eyes_joy"},{kind:"block",type:"eyes_loathing"},{kind:"block",type:"eyes_pensiveness"},{kind:"block",type:"eyes_rage"},{kind:"block",type:"eyes_sad"},{kind:"block",type:"eyes_serenity"},{kind:"block",type:"eyes_surprise"},{kind:"block",type:"eyes_terror"},{kind:"block",type:"eyes_trust"},{kind:"block",type:"eyes_vigilance"},{kind:"block",type:"e_Sleeping"},{kind:"block",type:"e_SleepingZZZ"},{kind:"block",type:"e_Contempt"},{kind:"block",type:"e_ContentLeft"},{kind:"block",type:"e_ContentRight"},{kind:"block",type:"e_Disoriented"},{kind:"block",type:"e_EcstacyHilarious"},{kind:"block",type:"e_EcstacyStarryEyed"},{kind:"block",type:"e_JoyGoofy"},{kind:"block",type:"e_JoyGoofy2"},{kind:"block",type:"e_JoyGoofy3"},{kind:"block",type:"e_Love"},{kind:"block",type:"e_Rage"},{kind:"block",type:"e_Rage2"},{kind:"block",type:"e_Rage3"},{kind:"block",type:"e_Rage4"},{kind:"block",type:"e_RemorseShame"}]},{kind:"category",name:"Audio",categorystyle:"audio_category",contents:[{kind:"block",type:"SetVolume"},{kind:"block",type:"PlayAudio"},{kind:"block",type:"s_Acceptance"},{kind:"block",type:"s_Amazement"},{kind:"block",type:"s_Amazement2"},{kind:"block",type:"s_Anger"},{kind:"block",type:"s_Anger2"},{kind:"block",type:"s_Anger3"},{kind:"block",type:"s_Anger4"},{kind:"block",type:"s_Annoyance"},{kind:"block",type:"s_Annoyance2"},{kind:"block",type:"s_Annoyance3"},{kind:"block",type:"s_Annoyance4"},{kind:"block",type:"s_Awe"},{kind:"block",type:"s_Awe2"},{kind:"block",type:"s_Awe3"},{kind:"block",type:"s_Boredom"},{kind:"block",type:"s_Disapproval"},{kind:"block",type:"s_Disgust"},{kind:"block",type:"s_Disgust2"},{kind:"block",type:"s_Disgust3"},{kind:"block",type:"s_DisorientedConfused"},{kind:"block",type:"s_DisorientedConfused2"},{kind:"block",type:"s_DisorientedConfused3"},{kind:"block",type:"s_DisorientedConfused4"},{kind:"block",type:"s_DisorientedConfused5"},{kind:"block",type:"s_DisorientedConfused6"},{kind:"block",type:"s_Distraction"},{kind:"block",type:"s_Ecstacy"},{kind:"block",type:"s_Ecstacy2"},{kind:"block",type:"s_Fear"},{kind:"block",type:"s_Grief"},{kind:"block",type:"s_Grief2"},{kind:"block",type:"s_Grief3"},{kind:"block",type:"s_Grief4"},{kind:"block",type:"s_Joy"},{kind:"block",type:"s_Joy2"},{kind:"block",type:"s_Joy3"},{kind:"block",type:"s_Joy4"},{kind:"block",type:"s_Loathing"},{kind:"block",type:"s_Love"},{kind:"block",type:"s_PhraseByeBye"},{kind:"block",type:"s_PhraseEvilAhHa"},{kind:"block",type:"s_PhraseHello"},{kind:"block",type:"s_PhraseNoNoNo"},{kind:"block",type:"s_PhraseOopsy"},{kind:"block",type:"s_PhraseOwOwOw"},{kind:"block",type:"s_PhraseOwwww"},{kind:"block",type:"s_PhraseUhOh"},{kind:"block",type:"s_Rage"},{kind:"block",type:"s_Sadness"},{kind:"block",type:"s_Sadness2"},{kind:"block",type:"s_Sadness3"},{kind:"block",type:"s_Sadness4"},{kind:"block",type:"s_Sadness5"},{kind:"block",type:"s_Sadness6"},{kind:"block",type:"s_Sadness7"},{kind:"block",type:"s_Sleepy"},{kind:"block",type:"s_Sleepy2"},{kind:"block",type:"s_Sleepy3"},{kind:"block",type:"s_Sleepy4"},{kind:"block",type:"s_SleepySnore"},{kind:"block",type:"s_SystemCameraShutter"}]}]},gve="/gpu-programming/assets/uw-crest-color-web-digital-CjofXveo.svg",_ve="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20width='100%25'%20height='100%25'%20viewBox='0%200%20194%20209'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20xml:space='preserve'%20xmlns:serif='http://www.serif.com/'%20style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;'%3e%3cg%20transform='matrix(1,0,0,1,-67.3413,-198.983)'%3e%3cg%20transform='matrix(4.16667,0,0,4.16667,0,0)'%3e%3cg%20transform='matrix(0,-1,-1,0,37.529,47.7569)'%3e%3cpath%20d='M-4.263,-4.263C-1.908,-4.263%200.001,-2.353%200.001,0.002C0.001,2.356%20-1.908,4.263%20-4.263,4.263C-6.617,4.263%20-8.527,2.356%20-8.527,0.002C-8.527,-2.353%20-6.617,-4.263%20-4.263,-4.263'%20style='fill:rgb(64,63,65);fill-rule:nonzero;'/%3e%3c/g%3e%3c/g%3e%3cg%20transform='matrix(4.16667,0,0,4.16667,0,0)'%3e%3cg%20transform='matrix(0,-1,-1,0,59.9955,60.1716)'%3e%3cpath%20d='M-2.673,-2.671C-1.196,-2.671%20-0.001,-1.477%20-0.001,0.001C-0.001,1.477%20-1.196,2.673%20-2.673,2.673C-4.148,2.673%20-5.342,1.477%20-5.342,0.001C-5.342,-1.477%20-4.148,-2.671%20-2.673,-2.671'%20style='fill:rgb(64,63,65);fill-rule:nonzero;'/%3e%3c/g%3e%3c/g%3e%3cg%20transform='matrix(4.16667,0,0,4.16667,0,0)'%3e%3cg%20transform='matrix(0,-1,-1,0,18.8329,65.7474)'%3e%3cpath%20d='M-2.671,-2.671C-1.196,-2.671%200.001,-1.476%200.001,0C0.001,1.475%20-1.196,2.671%20-2.671,2.671C-4.146,2.671%20-5.343,1.475%20-5.343,0C-5.343,-1.476%20-4.146,-2.671%20-2.671,-2.671'%20style='fill:rgb(64,63,65);fill-rule:nonzero;'/%3e%3c/g%3e%3c/g%3e%3cg%20transform='matrix(4.16667,0,0,4.16667,0,0)'%3e%3cg%20transform='matrix(0,-1,-1,0,34.0834,92.4773)'%3e%3cpath%20d='M-2.672,-2.672C-1.197,-2.672%200,-1.477%200,-0.001C0,1.475%20-1.197,2.672%20-2.672,2.672C-4.149,2.672%20-5.344,1.475%20-5.344,-0.001C-5.344,-1.477%20-4.149,-2.672%20-2.672,-2.672'%20style='fill:rgb(64,63,65);fill-rule:nonzero;'/%3e%3c/g%3e%3c/g%3e%3cg%20transform='matrix(4.16667,0,0,4.16667,0,0)'%3e%3cg%20transform='matrix(0,-1,-1,0,47.2036,90.0173)'%3e%3cpath%20d='M-2.673,-2.671C-1.198,-2.671%20-0.001,-1.477%20-0.001,0C-0.001,1.476%20-1.198,2.673%20-2.673,2.673C-4.148,2.673%20-5.342,1.476%20-5.342,0C-5.342,-1.477%20-4.148,-2.671%20-2.673,-2.671'%20style='fill:rgb(64,63,65);fill-rule:nonzero;'/%3e%3c/g%3e%3c/g%3e%3cg%20transform='matrix(4.16667,0,0,4.16667,0,0)'%3e%3cg%20transform='matrix(1,0,0,1,31.4239,88.2618)'%3e%3cpath%20d='M0,-31.486L-7.343,-31.486L-7.343,-24.621L-2.62,-27.134C-2.62,-27.134%20-1.885,-30.033%200,-31.486M-2.667,-21.8L-7.343,-19.427L-7.343,0L0.218,0C0.652,-4.687%201.012,-14.334%200.385,-17.054C-1.978,-18.859%20-2.667,-21.8%20-2.667,-21.8M16.67,-22.279C16.05,-19.824%2014.854,-18.168%2013.521,-16.972C16.087,-15.06%2018.567,-11.369%2018.567,-7.484L18.567,0L23.979,0L23.979,-22.367C22.277,-21.923%2019.538,-21.203%2016.67,-22.279M8.317,-13.886C7.15,-14.439%205.715,-14.459%205.715,-14.459L5.715,0L13.318,0L13.318,-6.519C13.318,-11.601%209.419,-13.365%208.317,-13.886M13.92,-31.486C15.038,-30.308%2015.911,-29.021%2016.417,-27.457C18.939,-25.75%2022.22,-26.601%2023.979,-26.855L23.979,-31.486L13.92,-31.486Z'%20style='fill:rgb(205,20,66);fill-rule:nonzero;'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e";function vve(n){return Ne.jsxs(oc,{container:!0,style:{position:"absolute",left:"20px",bottom:"20px",zIndex:"101",width:"70px"},children:[Ne.jsx(oc,{item:!0,xs:6,sm:6,md:12,lg:12,xl:12,alignContent:"center",children:Ne.jsx("img",{src:_ve})}),Ne.jsx(oc,{item:!0,xs:6,sm:6,md:12,lg:12,xl:12,children:Ne.jsx("img",{src:gve})})]})}function KH(){const{innerWidth:n,innerHeight:e}=window;return{width:n,height:e}}function FF(){const[n,e]=me.useState(KH());return me.useEffect(()=>{function t(){e(KH())}return window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)},[]),n}function yve({leftChildren:n,rightChildren:e}){return Ne.jsxs(oc,{container:!0,direction:"row",justifyContent:"center",spacing:2,style:{padding:"20px 30px 0px 30px",height:"100%",width:"100%"},children:[Ne.jsx(oc,{item:!0,xs:6,style:{overflowY:"scroll",height:"100%"},children:n}),Ne.jsx(oc,{item:!0,xs:6,style:{overflowY:"scroll",height:"100%"},children:e})]})}function YK({style:n,maxVH:e=0}){const t=Bn(qi(w=>w.userPrompt)),r=Bn(w=>w.setUserPrompt),s=Bn(w=>w.generateProgramOutline),o=Bn(w=>w.generateProgram),l=Bn(qi(w=>w.llmProcessing)),u=Bn(qi(w=>w.displayLLMBlockPrompt)),{height:h,_:f}=FF();function g(w){var C=Math.max(document.documentElement.clientHeight,window.innerHeight||0);return w*C/100}let y=e>0?g(e)/23:(h-190)/23;const b=w=>{r(w.target.value)};return Ne.jsxs("div",{style:{...n},children:[Ne.jsx(PF,{label:"What do you want the robot to do?",multiline:!0,disabled:l,fullWidth:!0,minRows:y,maxRows:y,onChange:b,value:t}),Ne.jsx(qp,{text:"Generate Program Goals",clickFunction:s,disabled:l,style:{float:"right"}}),u&&Ne.jsx(qp,{text:"Generate Block Program",clickFunction:o,disabled:l,style:{float:"right"}})]})}const bve=({title:n,subtext:e,hints:t,isPlanningScreen:r})=>{let s=Bn(b=>b.addMessageToHistory);const[o,l]=me.useState(null),[u,h]=me.useState(!1),f=()=>{l(null)},g=()=>{h(!u)},y=b=>{l(o===b?null:b)};return Ne.jsxs("div",{className:"subtask-card",children:[Ne.jsx("div",{className:"subtask-checkbox-container",children:Ne.jsx("input",{type:"checkbox",className:`subtask-checkbox ${u?"checked":""}`,onChange:g})}),Ne.jsxs("div",{className:"subtask-content",children:[Ne.jsx(f_,{variant:"h6",align:"left",sx:{marginBottom:"8px"},children:n}),Ne.jsx(f_,{variant:"subtitle1",align:"left",sx:{color:"#666"},children:e}),Ne.jsxs("div",{className:"hints-container",children:[!r&&t&&t.map((b,w)=>Ne.jsx(qp,{text:`Hint ${w+1}`,clickFunction:()=>y(b)},w)),r&&t&&t.map((b,w)=>Ne.jsx(qp,{text:b.text,clickFunction:()=>s("[Need Help]")},w))]}),o&&Ne.jsxs("div",{className:"hint-expansion",children:[Ne.jsx("p",{children:o.text}),Ne.jsx("div",{className:"close-button-container",children:Ne.jsx("button",{className:"close-button",onClick:f,children:"Close"})})]})]})]},n)},Tve=({hasNextTask:n,onNextTask:e,allTasks:t,subtasks:r,isPlanningScreen:s})=>Ne.jsxs("div",{className:"task-tab-container",children:[r&&r.map(o=>Ne.jsx(bve,{title:o.title,subtext:o.subtext,hints:o.hints.map(l=>t[l]),isPlanningScreen:s},o.title)),n&&Ne.jsxs("div",{className:"completion-card",children:[Ne.jsx("p",{children:"All steps are complete."}),Ne.jsx("button",{className:"next-task-button",onClick:e,children:"Go To Next Task"})]})]}),zF=({isPlanningScreen:n=!1})=>{var g,y;const[e,t]=me.useState(0),r=Bn(qi(b=>b.getAllTasks)),s=Bn(qi(b=>b.getMainTasks)),o=r(n),l=s(n),u=b=>{t(b)},h=()=>{eNe.jsx("div",{className:`tab ${w===e?"active":""}`,onClick:()=>u(w),children:l[b].name},b))}),Ne.jsx("div",{className:"task-tab-container",children:Ne.jsx(Tve,{subtasks:(y=(g=l[f[e]])==null?void 0:g.subtasks)==null?void 0:y.map(b=>o[b]),allTasks:o,onNextTask:h,hasNextTask:e+1l.fullScreenPanel),t=Bn(l=>l.setFullScreenPanel),{height:r,_:s}=FF();let o=r-155;return Ne.jsxs("div",{style:{zIndex:20,height:"100%"},children:[Ne.jsx(yve,{leftChildren:Ne.jsx(YK,{}),rightChildren:Ne.jsxs("div",{style:{width:"100%"},children:[Ne.jsx("div",{style:{height:o,overflowY:"scroll"},children:Ne.jsx(zF,{})}),Ne.jsx("div",{style:{position:"absolute",right:20},children:Ne.jsx(qp,{text:"Done",clickFunction:()=>t(!e),style:{backgroundColor:"#A0FF7E"}})})]})}),Ne.jsx("button",{onClick:()=>t(!e),style:{position:"absolute",top:"75px",right:"10px",backgroundColor:"rgba(255, 0, 0, 0.8)",color:"#fff",padding:"5px 10px",borderRadius:"5px",border:"none",cursor:"pointer"},children:"✖"})]})}function Sve(n){me.useState(!1),me.useState(!1),Bn(qi(o=>o.llmProcessing));const e=Bn(qi(o=>o.setFullScreenPanel)),t=Bn(o=>o.setShowGPTConsole),r=Bn(o=>o.showGPTConsole),s=Bn(o=>o.userPrompt);return Ne.jsxs("div",{style:{position:"absolute",bottom:"0px",left:"114.7px",width:"93%",zIndex:10,backgroundColor:"#222",color:"#fff",height:"25vh"},children:[Ne.jsx("button",{onClick:()=>{e(!0),t(!r)},style:{position:"relative",left:"5vw"},children:"Expand to Full Screen"}),Ne.jsx("div",{style:{position:"absolute",zIndex:20,top:"40px",left:"50px"},children:Ne.jsxs("p",{children:["User prompt: ",s]})}),Ne.jsx("button",{onClick:()=>t(!r),style:{position:"absolute",top:"5px",left:"5px",backgroundColor:"rgba(255, 0, 0, 0.8)",color:"#fff",padding:"5px 10px",borderRadius:"5px",border:"none",cursor:"pointer"},children:"✖"})]})}var UF={},wve=lT;Object.defineProperty(UF,"__esModule",{value:!0});var XK=UF.default=void 0,Eve=wve(MC()),xve=Ne;XK=UF.default=(0,Eve.default)((0,xve.jsx)("path",{d:"M21 11V3h-8l3.29 3.29-10 10L3 13v8h8l-3.29-3.29 10-10z"}),"OpenInFull");function $ve(n){const e=Bn(z=>z.addBlock),t=Bn(z=>z.blocks),r=Bn(z=>z.removeBlock),s=Bn(z=>z.getBlock),o=Bn(z=>z.updateBlock),l=Bn(z=>z.getBlockType),u=Bn(z=>z.setBlocklyWorkspace),h=Bn(z=>z.getBlocklyWorkspace),f=Bn(z=>z.loadBlocks),g=Bn(z=>z.blocklyWorkspace),y=Bn(z=>z.highlightBlocks);Bn(z=>z.setShowGPTConsole);const b=Bn(z=>z.showGPTConsole),w=Bn(z=>z.fullScreenPanel);Bn(z=>z.ip);const C=Bn(z=>z.setFullScreenPanel),{height:M,_:A}=FF(),k=(z,U)=>{z.push(U);let V=s(U);for(;V.next;)V=V.next,z.push(V)},L=(z,U)=>{uh(U?z?`switch toolbox category from ${U} to ${z}`:`unselect toolbox category: ${U}`:`select toolbox category: ${z}`)},P=()=>{C(!0)};Zg.common.defineBlocks(t),Object.assign(Cw.javascriptGenerator.forBlock,ik),me.useEffect(()=>{var U,V,H;let z=null;if(!document.querySelector(".blocklySvg")){const oe=document.getElementById("pageContainer"),le=document.getElementById("blocklyDiv");if(z=Zg.inject(le,{toolbox:mve,grid:{spacing:20,length:3,colour:"#ccc",snap:!0},theme:Zg.Theme.defineTheme("gpuTheme",{componentStyles:{toolboxBackgroundColour:"#E4E5F1",flyoutBackgroundColour:"#d2d3db"},categoryStyles:{...Bt},blockStyles:{logic_blocks:{colourPrimary:Bt.logic_category.colour},loop_blocks:{colourPrimary:Bt.loop_category.colour},math_blocks:{colourPrimary:Bt.math_category.colour},procedure_blocks:{colourPrimary:Bt.procedure_category.colour},text_blocks:{colourPrimary:Bt.speech_category.colour},colour_blocks:{colourPrimary:Bt.light_category.colour},hat_blocks:{hat:"cap"}}})}),!g&&z.getAllBlocks().filter(he=>he.type==="Start").length===0){const he=z.newBlock("Start");he.setDeletable(!1),he.moveBy(50,50),he.initSvg(),he.render()}if(g){let q={data:[]},he=Object.keys(t),ae=he.length;for(let ue=0;ue{for(let he of q){let ae=oe,ue=0,ge=0;do ue+=ae.offsetLeft,ge+=ae.offsetTop,ae=ae.offsetParent;while(ae);le.style.left=ue+"px",le.style.top=ge+"px",le.style.width=oe.offsetWidth+"px",le.style.height=oe.offsetHeight+"px",Zg.svgResize(z),z.scrollbar.setVisible(!1)}}).observe(oe),z.render(),u(z),z.addChangeListener(q=>{if(q.isUiEvent){if(q.type==="toolbox_item_select")L(q.newItem,q.oldItem);else if(q.type==="click"){if(q.targetType==="block"){const he=l(q.blockId);uh(`click on ${he} block`)}q.targetType==="workspace"&&uh("click on workspace")}else if(q.type==="selected"){if(q.oldElementId){const he=l(q.oldElementId);uh(`unselect and un-highlight ${he} `)}if(q.newElementId){const he=l(q.newElementId);uh(`select and highlight ${he} `)}}else if(q.type==="drag"){const he=l(q.blockId);q.isStart?uh(`drag block ${he} start `):uh(`drag block ${he} end `)}return}if(q.type===Zg.Events.BLOCK_DELETE){let he=q.blockId,ae=[he],ue=s(he).inputs;if(ue)for(let[J,re]of Object.entries(ue))typeof re!="string"?ae.push(re.id):k(ae,re);let ge=s(q.blockId).next;ge&&k(ae,ge);const we=ae.map(J=>l(J));r(ae),uh(`block ${he} is deleted, total delete blocks: ${we}`)}if(q.type===Zg.Events.BLOCK_CHANGE){const he=l(q.blockId);let ae=q.blockId,ue=s(ae);ue.fields[q.name]=q.newValue,o(ae,ue),uh(`field ${q.name} of ${he} change from ${q.oldValue} to ${q.newValue} `)}if(q.type==="create"){let he={id:q.json.id,type:q.json.type,prev:"",next:"",isShadow:!1};if(q.json.type==="Start"&&(q.json.id,he={id:q.json.id,type:q.json.type,next:""}),q.json.fields&&(he.fields=q.json.fields),q.json.inputs){he.inputs=q.json.inputs;for(let[ae,ue]of Object.entries(q.json.inputs))if(ue.shadow){let ge={id:ue.shadow.id,type:ue.shadow.type,fields:ue.shadow.fields,isShadow:!0,initialParent:q.ids[0],initialInput:ae};"shadows"in he||(he.shadows={}),he.shadows[ae]=ue.shadow.id,e(ue.shadow.id,ge),uh(`create a instance of type ${ge.type}`)}}e(q.json.id,he),uh(`create a instance of type ${he.type}`)}if(q.type==="move"){const he=l(q.blockId),ae=q.reason;if(ae&&(typeof ae!="string"&&ae[1]==="drag"||ae[0]==="drag")&&q.newCoordinate&&uh(`drag ${he} from coordinate: {x: ${q.oldCoordinate.x}, y: ${q.oldCoordinate.y}} to {x: ${q.newCoordinate.x},y: ${q.newCoordinate.y}}`),q.reason&&q.reason.includes("connect")){let ue=q.newParentId,ge=s(q.newParentId);const we=ge.type,J=s(q.blockId);q.newInputName?("inputs"in ge||(ge.inputs={}),ge.inputs[q.newInputName]=q.blockId,o(ue,ge),uh(`connect ${J.type} as input of ${we}`)):(ge.next=q.blockId,o(ue,ge),J.prev=ue,o(q.blockId,J),uh(`Placed ${J.type} after ${we}`))}if(q.reason&&q.reason.includes("disconnect")){let ue=q.oldParentId,ge=s(q.oldParentId);const we=ge.type,J=s(q.blockId);if(!q.oldInputName)ge.next="",o(ue,ge),J.prev="",o(q.blockId,J),uh(`disconnect ${we} from ${ge.type}`);else{if(ge.inputs[q.oldInputName]="",ge.shadows&&ge.shadows[q.oldInputName]){let re=ge.shadows[q.oldInputName];ge.inputs[q.oldInputName]=re}o(ue,ge),uh(`remove ${we} from input of ${ge.type}`)}}}})}},[]),me.useEffect(()=>{console.log(y);let z=h();z&&y?D(z,y,"#FF0000"):console.log("Workspace or block ID not defined.")},[y]);function D(z,U,V,H=500,oe=5){var le=z.getBlockById(U);if(le){var Z=le.getSvgRoot();if(Z){var q=Z.querySelectorAll(".blocklyPath");if(q.length>0){let he=q[0].style.fill,ae=0,ue=!1;const ge=()=>{q.forEach(function(we){we.style.fill=ue?V:he}),ue=!ue,ae++=460&&!w&&Ne.jsx(vve,{}),Ne.jsxs("div",{id:"pageContainer",style:{width:"100%",height:"100%"},children:[Ne.jsx("div",{id:"blocklyDiv",style:{width:"100%",height:"100%"}}),!w&&Ne.jsx("div",{style:{position:"absolute",bottom:"10px",left:"170px",transform:"translateX(-50%)",zIndex:10,backgroundColor:"rgba(51, 51, 51, 0.8)",color:"#fff",padding:"10px 20px",borderRadius:"10px",border:"none",cursor:"pointer"},onClick:P,children:Ne.jsxs("div",{style:{display:"flex",alignItems:"center",flexWrap:"wrap"},children:[Ne.jsx(XK,{}),Ne.jsx("span",{children:"Goals"})]})}),b&&Ne.jsx("div",{children:Ne.jsx(Sve,{})}),Ne.jsx("xml",{id:"toolbox",style:{display:"none"}})]})]})}const Cve="/gpu-programming/assets/misty_loading_combined-BxYfE45A.gif";function ac(n,e,t){return e=dde(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function pv(n){for(var e=1;e=0)}static isFirefox(){return Oo.isBrowser()&&typeof InstallTrigger<"u"}static isSafari(){return Oo.isBrowser()?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}static isIE(){return Oo.isBrowser()&&!!document.documentMode}static isEdge(){return Oo.isBrowser()&&!Oo.isIE()&&!!window.StyleMedia}static isChrome(){return Oo.isBrowser()&&!!window.chrome&&!!window.chrome.webstore}static isBlink(){return Oo.isBrowser()&&(Oo.isChrome()||Oo.isOpera())&&!!window.CSS}static getUserAgent(){return typeof navigator>"u"?"":navigator.userAgent}static isAndroid(){return Oo.isBrowser()&&Oo.getUserAgent().match(/Android/i)}static isBlackBerry(){return Oo.isBrowser()&&Oo.getUserAgent().match(/BlackBerry/i)}static isIOS(){return Oo.isBrowser()&&Oo.getUserAgent().match(/iPhone|iPad|iPod/i)}static isOpera(){return Oo.isBrowser()&&Oo.getUserAgent().match(/Opera Mini/i)}static isWindows(){return Oo.isBrowser()&&Oo.isWindowsDesktop()||Oo.isWindowsMobile()}static isWindowsMobile(){return Oo.isBrowser()&&Oo.getUserAgent().match(/IEMobile/i)}static isWindowsDesktop(){return Oo.isBrowser()&&Oo.getUserAgent().match(/WPDesktop/i)}static isMobile(){return Oo.isBrowser()&&(Oo.isWindowsMobile()||Oo.isBlackBerry()||Oo.isAndroid()||Oo.isIOS())}}const Qk=n=>Object.keys(n).reduce((e,t)=>t.substr(0,5)==="data-"?pv({},e,{[t]:n[t]}):e,{});class kf extends yt.Component{static isA(e){return e?e.type===yt.createElement(kf,null).type:!1}constructor(e){super(e),ac(this,"ref",yt.createRef()),ac(this,"onMouseMove",t=>{if(this.state.active){const r=this.ref.current;this.props.events.emit("resize",{index:this.props.index,domElement:r,event:t}),this.props.onResize&&this.props.onResize({component:this,domElement:r}),t.stopPropagation(),t.preventDefault()}}),ac(this,"onMouseDown",t=>{this.setState({active:!0}),!(this.props.onStartResize&&this.props.onStartResize({domElement:this.ref.current,component:this}))&&this.props.events.emit("startResize",{index:this.props.index,event:t})}),ac(this,"onMouseUp",t=>{this.state.active&&(this.setState({active:!1}),this.props.onStopResize&&this.props.onStopResize({domElement:this.ref.current,component:this}),this.props.events.emit("stopResize",{index:this.props.index,event:t}))}),this.state={active:!1},this.document=e.document}componentDidMount(){this.document&&(this.document.addEventListener("touchend",this.onMouseUp),this.document.addEventListener("mouseup",this.onMouseUp),this.document.addEventListener("mousemove",this.onMouseMove,{passive:!1}),this.document.addEventListener("touchmove",this.onMouseMove,{passive:!1}))}componentWillUnmount(){this.document&&(this.document.removeEventListener("mouseup",this.onMouseUp),this.document.removeEventListener("touchend",this.onMouseUp),this.document.removeEventListener("mousemove",this.onMouseMove),this.document.removeEventListener("touchmove",this.onMouseMove),this.state.active&&this.props.events.emit("stopResize",{index:this.props.index,event:null}))}render(){const e=[Oo.isMobile()?"reflex-thin":"",...this.props.className.split(" "),this.state.active?"active":"","reflex-splitter"].join(" ").trim();return yt.createElement("div",Qe({},Qk(this.props),{onTouchStart:this.onMouseDown,onMouseDown:this.onMouseDown,style:this.props.style,className:e,id:this.props.id,ref:this.ref}),this.props.children)}}ac(kf,"propTypes",{children:Qt.oneOfType([Qt.arrayOf(Qt.node),Qt.node]),onStartResize:Qt.func,onStopResize:Qt.func,className:Qt.string,propagate:Qt.bool,onResize:Qt.func,style:Qt.object});ac(kf,"defaultProps",{document:typeof document<"u"?document:null,onStartResize:null,onStopResize:null,propagate:!1,onResize:null,className:"",style:{}});class Mve{constructor(){this._events={}}on(e,t){return e.split(" ").forEach(r=>{this._events[r]=this._events[r]||[],this._events[r].push(t)}),this}off(e,t){if(e==null){this._events={};return}return e.split(" ").forEach(r=>{r in this._events&&(t?this._events[r].splice(this._events[r].indexOf(t),1):this._events[r]=[])}),this}emit(e){if(this._events[e]!==void 0)for(var t=this._events[e].slice(),r=0;r>>0;if(r===0)return!1;var s=e|0,o=Math.max(s>=0?s:r-Math.abs(s),0);function l(u,h){return u===h||typeof u=="number"&&typeof h=="number"&&isNaN(u)&&isNaN(h)}for(;o0)-(n<0)||+n});class N1 extends yt.Component{constructor(e){super(e),ac(this,"onWindowResize",()=>{this.setState({flexData:this.computeFlexData()})}),ac(this,"onStartResize",t=>{const r=t.event.changedTouches?t.event.changedTouches[0]:t.event;switch(this.props.orientation){case"horizontal":document.body.classList.add("reflex-row-resize"),this.previousPos=r.clientY;break;case"vertical":default:document.body.classList.add("reflex-col-resize"),this.previousPos=r.clientX;break}this.elements=[this.children[t.index-1],this.children[t.index+1]],this.emitElementsEvent(this.elements,"onStartResize")}),ac(this,"onResize",t=>{const r=t.event.changedTouches?t.event.changedTouches[0]:t.event,s=this.getOffset(r,t.domElement);switch(this.props.orientation){case"horizontal":this.previousPos=r.clientY;break;case"vertical":default:this.previousPos=r.clientX;break}if(s){const o=this.computeAvailableOffset(t.index,s);o&&(this.elements=this.dispatchOffset(t.index,o),this.adjustFlex(this.elements),this.setState({resizing:!0},()=>{this.emitElementsEvent(this.elements,"onResize")}))}}),ac(this,"onStopResize",t=>{document.body.classList.remove("reflex-row-resize"),document.body.classList.remove("reflex-col-resize");const r=this.elements?this.elements.map(o=>o.ref):[],s=this.children.filter(o=>!kf.isA(o)&&r.includes(o.ref));this.emitElementsEvent(s,"onStopResize"),this.setState({resizing:!1})}),ac(this,"onElementSize",t=>new Promise(r=>{try{const s=t.index,o=this.getSize(this.children[s]),l=t.size-o,u=t.direction,h=s+u,f=this.computeAvailableOffset(h,u*l);this.elements=null,f&&(this.elements=this.dispatchOffset(h,f),this.adjustFlex(this.elements)),this.setState(this.state,()=>{this.emitElementsEvent(this.elements,"onResize"),r()})}catch(s){console.log(s)}})),this.events=new Mve,this.children=[],this.state={flexData:[]},this.ref=yt.createRef()}componentDidMount(){const e=this.computeFlexData(),{windowResizeAware:t}=this.props;t&&window.addEventListener("resize",this.onWindowResize),this.setState({windowResizeAware:t,flexData:e}),this.events.on("element.size",this.onElementSize),this.events.on("startResize",this.onStartResize),this.events.on("stopResize",this.onStopResize),this.events.on("resize",this.onResize)}componentWillUnmount(){this.events.off(),window.removeEventListener("resize",this.onWindowResize)}getValidChildren(e=this.props){return this.toArray(e.children).filter(t=>!!t)}componentDidUpdate(e,t){const r=this.getValidChildren(this.props);if(r.length!==this.state.flexData.length||e.orientation!==this.props.orientation||this.flexHasChanged(e)){const s=this.computeFlexData(r,this.props);this.setState({flexData:s})}this.props.windowResizeAware!==this.state.windowResizeAware&&(this.props.windowResizeAware?window.addEventListener("resize",this.onWindowResize):window.removeEventListener("resize",this.onWindowResize),this.setState({windowResizeAware:this.props.windowResizeAware}))}flexHasChanged(e){const t=this.getValidChildren(e).map(s=>s.props.flex||0);return!this.getValidChildren().map(s=>s.props.flex||0).every((s,o)=>s===t[o])}getSize(e){var t,r,s;const o=e==null||(t=e.ref)===null||t===void 0?void 0:t.current;switch(this.props.orientation){case"horizontal":return(r=o==null?void 0:o.offsetHeight)!==null&&r!==void 0?r:0;case"vertical":default:return(s=o==null?void 0:o.offsetWidth)!==null&&s!==void 0?s:0}}getOffset(e,t){const{top:r,bottom:s,left:o,right:l}=t.getBoundingClientRect();switch(this.props.orientation){case"horizontal":{const u=e.clientY-this.previousPos;if(u>0){if(e.clientY>=r)return u}else if(e.clientY<=s)return u;break}case"vertical":default:{const u=e.clientX-this.previousPos;if(u>0){if(e.clientX>o)return u}else if(e.clientX{const o=s.props.index,l=s.props.flex,u=this.state.flexData[o].flex;return r+(l-u)/e.length},0);e.forEach(r=>{this.state.flexData[r.props.index].flex+=t})}computeAvailableOffset(e,t){const r=this.computeAvailableStretch(e,t),s=this.computeAvailableShrink(e,t);return Math.min(r,s)*Math.sign(t)}checkPropagate(e,t){if(t>0){if(e2){const r=this.children[e-2];return kf.isA(r)&&r.props.propagate}return!1}computeAvailableStretch(e,t){var r;const s=t<0?e+1:e-1,o=this.children[s],l=this.getSize(o),h=((r=o==null?void 0:o.props.maxSize)!==null&&r!==void 0?r:0)-l;if(h0?e+1:e-1,o=this.children[s],l=this.getSize(o),u=Math.max((r=o==null?void 0:o.props.minSize)!==null&&r!==void 0?r:0,0),h=l-u;if(h0?e+2:e-2,f)}return Math.min(h,Math.abs(t))}computePixelFlex(e=this.props.orientation){if(!this.ref.current)return console.warn("Unable to locate ReflexContainer dom node"),0;switch(e){case"horizontal":return this.ref.current.offsetHeight===0?(console.warn("Found ReflexContainer with height=0, this will cause invalid behavior..."),console.warn(this.ref.current),0):1/this.ref.current.offsetHeight;case"vertical":default:return this.ref.current.offsetWidth===0?(console.warn("Found ReflexContainer with width=0, this will cause invalid behavior..."),console.warn(this.ref.current),0):1/this.ref.current.offsetWidth}}addOffset(e,t){const r=this.getSize(e),s=e.props.index,o=Math.max(r+t,0),l=this.state.flexData[s].flex,u=l>0?l*o/r:this.computePixelFlex()*o;this.state.flexData[s].flex=!isFinite(u)||isNaN(u)?0:u}dispatchStretch(e,t){const r=t<0?e+1:e-1;if(r<0||r>this.children.length-1)return[];const s=this.children[r],o=this.getSize(s),u=Math.min(s.props.maxSize,o+Math.abs(t))-o;if(this.addOffset(s,u),u0?e+1:e-1;if(r<0||r>this.children.length-1)return[];const s=this.children[r],o=this.getSize(s),u=Math.max(s.props.minSize,o-Math.abs(t))-o;if(this.addOffset(s,u),Math.abs(u){r.props[t]&&r.props[t]({domElement:r.ref.current,component:r})})}computeFlexData(e=this.getValidChildren(),t=this.props){const r=this.computePixelFlex(t.orientation),s=f=>f.reduce((g,y)=>!kf.isA(y)&&y.constrained?g-y.flex:g,1),o=f=>f.reduce((g,y)=>!kf.isA(y)&&!y.constrained?g+1:g,0),l=e.map(f=>{const g=f.props;return{maxFlex:(g.maxSize||Number.MAX_VALUE)*r,sizeFlex:(g.size||Number.MAX_VALUE)*r,minFlex:(g.minSize||1)*r,constrained:g.flex!==void 0,flex:g.flex||0,type:f.type}}),u=(f,g=0)=>{let y=!1;const b=o(f),w=s(f),C=f.map(M=>{if(kf.isA(M))return M;const A=M.constrained?M.flex:w/b,k=Math.min(M.sizeFlex,Math.min(M.maxFlex,Math.max(M.minFlex,A))),L=M.constrained||k!==A;return y=y||L,pv({},M,{flex:k,constrained:L})});return y&&g({flex:kf.isA(f)?0:f.flex,ref:yt.createRef()}))}toArray(e){return e?Array.isArray(e)?e:[e]:[]}render(){const e=[this.state.resizing?"reflex-resizing":"",...this.props.className.split(" "),this.props.orientation,"reflex-container"].join(" ").trim();return this.children=yt.Children.map(this.getValidChildren(),(t,r)=>{if(r>this.state.flexData.length-1)return yt.createElement("div",null);const s=this.state.flexData[r],o=pv({},t.props,{maxSize:t.props.maxSize||Number.MAX_VALUE,orientation:this.props.orientation,minSize:t.props.minSize||1,events:this.events,flex:s.flex,ref:s.ref,index:r});return yt.cloneElement(t,o)}),yt.createElement("div",Qe({},Qk(this.props),{style:this.props.style,className:e,ref:this.ref}),this.children)}}ac(N1,"propTypes",{windowResizeAware:Qt.bool,orientation:Qt.oneOf(["horizontal","vertical"]),maxRecDepth:Qt.number,className:Qt.string,style:Qt.object});ac(N1,"defaultProps",{orientation:"horizontal",windowResizeAware:!1,maxRecDepth:100,className:"",style:{}});class cE extends yt.Component{static isA(e){return e?e.type===cE:!1}constructor(e){super(e),ac(this,"ref",yt.createRef()),ac(this,"onMouseMove",t=>{if(this.state.active){const r=this.ref.current;this.props.events.emit("resize",{index:this.props.index,domElement:r,event:t}),this.props.onResize&&this.props.onResize({component:this,domElement:r}),t.stopPropagation(),t.preventDefault()}}),ac(this,"onMouseDown",t=>{this.setState({active:!0}),!(this.props.onStartResize&&this.props.onStartResize({domElement:this.ref.current,component:this}))&&this.props.events.emit("startResize",{index:this.props.index,event:t})}),ac(this,"onMouseUp",t=>{this.state.active&&(this.setState({active:!1}),this.props.onStopResize&&this.props.onStopResize({domElement:this.ref.current,component:this}),this.props.events.emit("stopResize",{index:this.props.index,event:t}))}),this.state={active:!1},this.document=e.document}componentDidMount(){this.document&&(this.document.addEventListener("touchend",this.onMouseUp),this.document.addEventListener("mouseup",this.onMouseUp),this.document.addEventListener("mousemove",this.onMouseMove,{passive:!1}),this.document.addEventListener("touchmove",this.onMouseMove,{passive:!1}))}componentWillUnmount(){this.document&&(this.document.removeEventListener("mouseup",this.onMouseUp),this.document.removeEventListener("touchend",this.onMouseUp),this.document.removeEventListener("mousemove",this.onMouseMove),this.document.removeEventListener("touchmove",this.onMouseMove),this.state.active&&this.props.events.emit("stopResize",{index:this.props.index,event:null}))}render(){const e=[...this.props.className.split(" "),this.state.active?"active":"","reflex-handle"].join(" ").trim();return yt.createElement("div",Qe({},Qk(this.props),{onTouchStart:this.onMouseDown,onMouseDown:this.onMouseDown,style:this.props.style,className:e,id:this.props.id,ref:this.ref}),this.props.children)}}ac(cE,"propTypes",{children:Qt.oneOfType([Qt.arrayOf(Qt.node),Qt.node]),onStartResize:Qt.func,onStopResize:Qt.func,className:Qt.string,propagate:Qt.bool,onResize:Qt.func,style:Qt.object});ac(cE,"defaultProps",{document:typeof document>"u"?null:document,onStartResize:null,onStopResize:null,propagate:!1,onResize:null,className:"",style:{}});var KK="Expected a function",qH=NaN,Ave="[object Symbol]",Ive=/^\s+|\s+$/g,Rve=/^[-+]0x[0-9a-f]+$/i,kve=/^0b[01]+$/i,Ove=/^0o[0-7]+$/i,Lve=parseInt,Nve=typeof Vl=="object"&&Vl&&Vl.Object===Object&&Vl,Dve=typeof self=="object"&&self&&self.Object===Object&&self,Pve=Nve||Dve||Function("return this")(),Bve=Object.prototype,Fve=Bve.toString,zve=Math.max,Uve=Math.min,rL=function(){return Pve.Date.now()};function Hve(n,e,t){var r,s,o,l,u,h,f=0,g=!1,y=!1,b=!0;if(typeof n!="function")throw new TypeError(KK);e=QH(e)||0,pR(t)&&(g=!!t.leading,y="maxWait"in t,o=y?zve(QH(t.maxWait)||0,e):o,b="trailing"in t?!!t.trailing:b);function w(U){var V=r,H=s;return r=s=void 0,f=U,l=n.apply(H,V),l}function C(U){return f=U,u=setTimeout(k,e),g?w(U):l}function M(U){var V=U-h,H=U-f,oe=e-V;return y?Uve(oe,o-H):oe}function A(U){var V=U-h,H=U-f;return h===void 0||V>=e||V<0||y&&H>=o}function k(){var U=rL();if(A(U))return L(U);u=setTimeout(k,M(U))}function L(U){return u=void 0,b&&r?w(U):(r=s=void 0,l)}function P(){u!==void 0&&clearTimeout(u),f=0,r=h=s=u=void 0}function D(){return u===void 0?l:L(rL())}function z(){var U=rL(),V=A(U);if(r=arguments,s=this,h=U,V){if(u===void 0)return C(h);if(y)return u=setTimeout(k,e),w(h)}return u===void 0&&(u=setTimeout(k,e)),l}return z.cancel=P,z.flush=D,z}function Gve(n,e,t){var r=!0,s=!0;if(typeof n!="function")throw new TypeError(KK);return pR(t)&&(r="leading"in t?!!t.leading:r,s="trailing"in t?!!t.trailing:s),Hve(n,e,{leading:r,maxWait:e,trailing:s})}function pR(n){var e=typeof n;return!!n&&(e=="object"||e=="function")}function Wve(n){return!!n&&typeof n=="object"}function Vve(n){return typeof n=="symbol"||Wve(n)&&Fve.call(n)==Ave}function QH(n){if(typeof n=="number")return n;if(Vve(n))return qH;if(pR(n)){var e=typeof n.valueOf=="function"?n.valueOf():n;n=pR(e)?e+"":e}if(typeof n!="string")return n===0?n:+n;n=n.replace(Ive,"");var t=kve.test(n);return t||Ove.test(n)?Lve(n.slice(2),t?2:8):Rve.test(n)?qH:+n}var jve=Gve;const Yve=Xy(jve);var JK=function(){if(typeof Map<"u")return Map;function n(e,t){var r=-1;return e.some(function(s,o){return s[0]===t?(r=o,!0):!1}),r}return function(){function e(){this.__entries__=[]}return Object.defineProperty(e.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),e.prototype.get=function(t){var r=n(this.__entries__,t),s=this.__entries__[r];return s&&s[1]},e.prototype.set=function(t,r){var s=n(this.__entries__,t);~s?this.__entries__[s][1]=r:this.__entries__.push([t,r])},e.prototype.delete=function(t){var r=this.__entries__,s=n(r,t);~s&&r.splice(s,1)},e.prototype.has=function(t){return!!~n(this.__entries__,t)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(t,r){r===void 0&&(r=null);for(var s=0,o=this.__entries__;s0},n.prototype.connect_=function(){!YD||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Zve?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},n.prototype.disconnect_=function(){!YD||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},n.prototype.onTransitionEnd_=function(e){var t=e.propertyName,r=t===void 0?"":t,s=Qve.some(function(o){return!!~r.indexOf(o)});s&&this.refresh()},n.getInstance=function(){return this.instance_||(this.instance_=new n),this.instance_},n.instance_=null,n}(),qK=function(n,e){for(var t=0,r=Object.keys(e);t"u"||!(Element instanceof Object))){if(!(e instanceof Ow(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new lye(e)),this.controller_.addObserver(this),this.controller_.refresh())}},n.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(e instanceof Ow(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this))}},n.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},n.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach(function(t){t.isActive()&&e.activeObservations_.push(t)})},n.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map(function(r){return new uye(r.target,r.broadcastRect())});this.callback_.call(e,t,e),this.clearActive()}},n.prototype.clearActive=function(){this.activeObservations_.splice(0)},n.prototype.hasActive=function(){return this.activeObservations_.length>0},n}(),ZK=typeof WeakMap<"u"?new WeakMap:new JK,eJ=function(){function n(e){if(!(this instanceof n))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var t=eye.getInstance(),r=new cye(e,t,this);ZK.set(this,r)}return n}();["observe","unobserve","disconnect"].forEach(function(n){eJ.prototype[n]=function(){var e;return(e=ZK.get(this))[n].apply(e,arguments)}});var hye=function(){return typeof mR.ResizeObserver<"u"?mR.ResizeObserver:eJ}(),dye=["client","offset","scroll","bounds","margin"];function eG(n){var e=[];return dye.forEach(function(t){n[t]&&e.push(t)}),e}function tG(n,e){var t={};if(e.indexOf("client")>-1&&(t.client={top:n.clientTop,left:n.clientLeft,width:n.clientWidth,height:n.clientHeight}),e.indexOf("offset")>-1&&(t.offset={top:n.offsetTop,left:n.offsetLeft,width:n.offsetWidth,height:n.offsetHeight}),e.indexOf("scroll")>-1&&(t.scroll={top:n.scrollTop,left:n.scrollLeft,width:n.scrollWidth,height:n.scrollHeight}),e.indexOf("bounds")>-1){var r=n.getBoundingClientRect();t.bounds={top:r.top,right:r.right,bottom:r.bottom,left:r.left,width:r.width,height:r.height}}if(e.indexOf("margin")>-1){var s=getComputedStyle(n);t.margin={top:s?parseInt(s.marginTop):0,right:s?parseInt(s.marginRight):0,bottom:s?parseInt(s.marginBottom):0,left:s?parseInt(s.marginLeft):0}}return t}function fye(n){var e=n&&n.ownerDocument&&n.ownerDocument.defaultView;return e||window}function pye(n){return function(e){var t,r;return r=t=function(s){$F(o,s);function o(){for(var u,h=arguments.length,f=new Array(h),g=0;gn?Array.isArray(n)?n:[n]:[];class mye extends yt.Component{constructor(e){super(e),ac(this,"onResize",t=>{const{resizeHeight:r,resizeWidth:s}=this.props,{height:o,width:l}=t.bounds;this.setDimensions(pv({},r&&{height:o},s&&{width:l}))}),this.setDimensions=Yve(t=>{this.setState(t)},this.props.propagateDimensionsRate/1e3),this.state={height:"100%",width:"100%"}}renderChildren(){const{propagateDimensions:e}=this.props,t=XD(this.props.children).filter(r=>!!r);return yt.Children.map(t,r=>this.props.withHandle||cE.isA(r)?yt.cloneElement(r,pv({dimensions:e&&this.state},r.props,{index:this.props.index-1,events:this.props.events})):e?yt.cloneElement(r,pv({},r.props,{dimensions:this.state})):r)}render(){return yt.createElement(HF,{bounds:!0,onResize:this.onResize},({measureRef:e})=>yt.createElement("div",{ref:e,className:"reflex-size-aware"},yt.createElement("div",{style:this.state},this.renderChildren())))}}class GF extends yt.Component{constructor(e){super(e),this.state={size:e.size}}static getDerivedStateFromProps(e,t){return e.size!==t.size?pv({},t,{size:e.size}):null}async componentDidUpdate(e,t,r){if(t.size!==this.state.size){const s=XD(this.props.direction);for(let o of s)await this.props.events.emit("element.size",{index:this.props.index,size:this.props.size,direction:o})}}renderChildren(){const e=XD(this.props.children).filter(t=>!!t);return yt.Children.map(e,t=>this.props.withHandle||cE.isA(t)?yt.cloneElement(t,pv({},t.props,{index:this.props.index-1,events:this.props.events})):t)}render(){const e=[...this.props.className.split(" "),this.props.orientation,"reflex-element"].join(" ").trim(),t=pv({},this.props.style,{flexGrow:this.props.flex,flexShrink:1,flexBasis:"0%"});return yt.createElement("div",Qe({},Qk(this.props),{ref:this.props.innerRef,className:e,style:t}),this.props.propagateDimensions?yt.createElement(mye,this.props):this.renderChildren())}}ac(GF,"propTypes",{propagateDimensions:Qt.bool,resizeHeight:Qt.bool,resizeWidth:Qt.bool,className:Qt.string,size:Qt.number});ac(GF,"defaultProps",{propagateDimensionsRate:100,propagateDimensions:!1,resizeHeight:!0,resizeWidth:!0,direction:[1],className:""});const Z0=yt.forwardRef((n,e)=>yt.createElement(GF,Qe({innerRef:e},n))),tJ="/gpu-programming/assets/BASE_FRONT_GRILL_1-b5goAhwv.glb";var nJ={exports:{}},uT={};/** * @license React * react-reconciler-constants.production.min.js * @@ -1704,7 +1704,7 @@ function print() { __p += __j.call(arguments, '') } * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */lT.ConcurrentRoot=1;lT.ContinuousEventPriority=4;lT.DefaultEventPriority=16;lT.DiscreteEventPriority=1;lT.IdleEventPriority=536870912;lT.LegacyRoot=0;tJ.exports=lT;var Rx=tJ.exports,nJ={exports:{}},iL={exports:{}},sL={};/** + */uT.ConcurrentRoot=1;uT.ContinuousEventPriority=4;uT.DefaultEventPriority=16;uT.DiscreteEventPriority=1;uT.IdleEventPriority=536870912;uT.LegacyRoot=0;nJ.exports=uT;var Rx=nJ.exports,rJ={exports:{}},iL={exports:{}},sL={};/** * @license React * scheduler.production.min.js * @@ -1712,7 +1712,7 @@ function print() { __p += __j.call(arguments, '') } * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var tG;function gye(){return tG||(tG=1,function(n){function e(J,re){var ie=J.length;J.push(re);e:for(;0>>1,Te=J[fe];if(0>>1;fes(Je,ie))Res(Qe,Je)?(J[fe]=Qe,J[Re]=ie,fe=Re):(J[fe]=Je,J[Ie]=ie,fe=Ie);else if(Res(Qe,ie))J[fe]=Qe,J[Re]=ie,fe=Re;else break e}}return re}function s(J,re){var ie=J.sortIndex-re.sortIndex;return ie!==0?ie:J.id-re.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;n.unstable_now=function(){return o.now()}}else{var l=Date,u=l.now();n.unstable_now=function(){return l.now()-u}}var h=[],f=[],g=1,y=null,b=3,w=!1,C=!1,M=!1,A=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,L=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function P(J){for(var re=t(f);re!==null;){if(re.callback===null)r(f);else if(re.startTime<=J)r(f),re.sortIndex=re.expirationTime,e(h,re);else break;re=t(f)}}function D(J){if(M=!1,P(J),!C)if(t(h)!==null)C=!0,ge(z);else{var re=t(f);re!==null&&we(D,re.startTime-J)}}function z(J,re){C=!1,M&&(M=!1,k(H),H=-1),w=!0;var ie=b;try{for(P(re),y=t(h);y!==null&&(!(y.expirationTime>re)||J&&!Z());){var fe=y.callback;if(typeof fe=="function"){y.callback=null,b=y.priorityLevel;var Te=fe(y.expirationTime<=re);re=n.unstable_now(),typeof Te=="function"?y.callback=Te:y===t(h)&&r(h),P(re)}else r(h);y=t(h)}if(y!==null)var Fe=!0;else{var Ie=t(f);Ie!==null&&we(D,Ie.startTime-re),Fe=!1}return Fe}finally{y=null,b=ie,w=!1}}var U=!1,V=null,H=-1,oe=5,le=-1;function Z(){return!(n.unstable_now()-leJ||125fe?(J.sortIndex=ie,e(f,J),t(h)===null&&J===t(f)&&(M?(k(H),H=-1):M=!0,we(D,ie-fe))):(J.sortIndex=Te,e(h,J),C||w||(C=!0,ge(z))),J},n.unstable_shouldYield=Z,n.unstable_wrapCallback=function(J){var re=b;return function(){var ie=b;b=re;try{return J.apply(this,arguments)}finally{b=ie}}}}(sL)),sL}var nG;function _ye(){return nG||(nG=1,iL.exports=gye()),iL.exports}/** + */var nG;function gye(){return nG||(nG=1,function(n){function e(J,re){var se=J.length;J.push(re);e:for(;0>>1,Te=J[fe];if(0>>1;fes(qe,se))Res(Ze,qe)?(J[fe]=Ze,J[Re]=se,fe=Re):(J[fe]=qe,J[Ie]=se,fe=Ie);else if(Res(Ze,se))J[fe]=Ze,J[Re]=se,fe=Re;else break e}}return re}function s(J,re){var se=J.sortIndex-re.sortIndex;return se!==0?se:J.id-re.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;n.unstable_now=function(){return o.now()}}else{var l=Date,u=l.now();n.unstable_now=function(){return l.now()-u}}var h=[],f=[],g=1,y=null,b=3,w=!1,C=!1,M=!1,A=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,L=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function P(J){for(var re=t(f);re!==null;){if(re.callback===null)r(f);else if(re.startTime<=J)r(f),re.sortIndex=re.expirationTime,e(h,re);else break;re=t(f)}}function D(J){if(M=!1,P(J),!C)if(t(h)!==null)C=!0,ge(z);else{var re=t(f);re!==null&&we(D,re.startTime-J)}}function z(J,re){C=!1,M&&(M=!1,k(H),H=-1),w=!0;var se=b;try{for(P(re),y=t(h);y!==null&&(!(y.expirationTime>re)||J&&!Z());){var fe=y.callback;if(typeof fe=="function"){y.callback=null,b=y.priorityLevel;var Te=fe(y.expirationTime<=re);re=n.unstable_now(),typeof Te=="function"?y.callback=Te:y===t(h)&&r(h),P(re)}else r(h);y=t(h)}if(y!==null)var Fe=!0;else{var Ie=t(f);Ie!==null&&we(D,Ie.startTime-re),Fe=!1}return Fe}finally{y=null,b=se,w=!1}}var U=!1,V=null,H=-1,oe=5,le=-1;function Z(){return!(n.unstable_now()-leJ||125fe?(J.sortIndex=se,e(f,J),t(h)===null&&J===t(f)&&(M?(k(H),H=-1):M=!0,we(D,se-fe))):(J.sortIndex=Te,e(h,J),C||w||(C=!0,ge(z))),J},n.unstable_shouldYield=Z,n.unstable_wrapCallback=function(J){var re=b;return function(){var se=b;b=re;try{return J.apply(this,arguments)}finally{b=se}}}}(sL)),sL}var rG;function _ye(){return rG||(rG=1,iL.exports=gye()),iL.exports}/** * @license React * react-reconciler.production.min.js * @@ -1720,17 +1720,17 @@ function print() { __p += __j.call(arguments, '') } * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var vye=function(e){var t={},r=pe,s=_ye(),o=Object.assign;function l(d){for(var _="https://reactjs.org/docs/error-decoder.html?invariant="+d,$=1;$Oe||B[de]!==W[Oe]){var Ze=` -`+B[de].replace(" at new "," at ");return d.displayName&&Ze.includes("")&&(Ze=Ze.replace("",d.displayName)),Ze}while(1<=de&&0<=Oe);break}}}finally{el=!1,Error.prepareStackTrace=$}return(d=d?d.displayName||d.name:"")?Rr(d):""}var Fs=Object.prototype.hasOwnProperty,zs=[],Di=-1;function kr(d){return{current:d}}function An(d){0>Di||(d.current=zs[Di],zs[Di]=null,Di--)}function Ir(d,_){Di++,zs[Di]=d.current,d.current=_}var Gr={},yr=kr(Gr),Pi=kr(!1),ws=Gr;function fi(d,_){var $=d.type.contextTypes;if(!$)return Gr;var I=d.stateNode;if(I&&I.__reactInternalMemoizedUnmaskedChildContext===_)return I.__reactInternalMemoizedMaskedChildContext;var B={},W;for(W in $)B[W]=_[W];return I&&(d=d.stateNode,d.__reactInternalMemoizedUnmaskedChildContext=_,d.__reactInternalMemoizedMaskedChildContext=B),B}function gs(d){return d=d.childContextTypes,d!=null}function tl(){An(Pi),An(yr)}function Na(d,_,$){if(yr.current!==Gr)throw Error(l(168));Ir(yr,_),Ir(Pi,$)}function fc(d,_,$){var I=d.stateNode;if(_=_.childContextTypes,typeof I.getChildContext!="function")return $;I=I.getChildContext();for(var B in I)if(!(B in _))throw Error(l(108,H(d)||"Unknown",B));return o({},$,I)}function pc(d){return d=(d=d.stateNode)&&d.__reactInternalMemoizedMergedChildContext||Gr,ws=yr.current,Ir(yr,d),Ir(Pi,Pi.current),!0}function Xs(d,_,$){var I=d.stateNode;if(!I)throw Error(l(169));$?(d=fc(d,_,ws),I.__reactInternalMemoizedMergedChildContext=d,An(Pi),An(yr),Ir(yr,d)):An(Pi),Ir(Pi,$)}var Jo=Math.clz32?Math.clz32:mh,Xl=Math.log,gu=Math.LN2;function mh(d){return d>>>=0,d===0?32:31-(Xl(d)/gu|0)|0}var qo=64,vr=4194304;function xi(d){switch(d&-d){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 d&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return d&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return d}}function Dc(d,_){var $=d.pendingLanes;if($===0)return 0;var I=0,B=d.suspendedLanes,W=d.pingedLanes,de=$&268435455;if(de!==0){var Oe=de&~B;Oe!==0?I=xi(Oe):(W&=de,W!==0&&(I=xi(W)))}else de=$&~B,de!==0?I=xi(de):W!==0&&(I=xi(W));if(I===0)return 0;if(_!==0&&_!==I&&!(_&B)&&(B=I&-I,W=_&-_,B>=W||B===16&&(W&4194240)!==0))return _;if(I&4&&(I|=$&16),_=d.entangledLanes,_!==0)for(d=d.entanglements,_&=I;0<_;)$=31-Jo(_),B=1<<$,I|=d[$],_&=~B;return I}function gh(d,_){switch(d){case 1:case 2:case 4:return _+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 _+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Pc(d,_){for(var $=d.suspendedLanes,I=d.pingedLanes,B=d.expirationTimes,W=d.pendingLanes;0$;$++)_.push(d);return _}function xl(d,_,$){d.pendingLanes|=_,_!==536870912&&(d.suspendedLanes=0,d.pingedLanes=0),d=d.eventTimes,_=31-Jo(_),d[_]=$}function $l(d,_){var $=d.pendingLanes&~_;d.pendingLanes=_,d.suspendedLanes=0,d.pingedLanes=0,d.expiredLanes&=_,d.mutableReadLanes&=_,d.entangledLanes&=_,_=d.entanglements;var I=d.eventTimes;for(d=d.expirationTimes;0<$;){var B=31-Jo($),W=1<>=de,B-=de,Fa=1<<32-Jo(_)+B|$<zn?(cr=Rn,Rn=null):cr=Rn.sibling;var Mr=bn(Me,Rn,st[zn],Ht);if(Mr===null){Rn===null&&(Rn=cr);break}d&&Rn&&Mr.alternate===null&&_(Me,Rn),Ne=W(Mr,Ne,zn),En===null?on=Mr:En.sibling=Mr,En=Mr,Rn=cr}if(zn===st.length)return $(Me,Rn),ji&&ql(Me,zn),on;if(Rn===null){for(;znzn?(cr=Rn,Rn=null):cr=Rn.sibling;var Bl=bn(Me,Rn,Mr.value,Ht);if(Bl===null){Rn===null&&(Rn=cr);break}d&&Rn&&Bl.alternate===null&&_(Me,Rn),Ne=W(Bl,Ne,zn),En===null?on=Bl:En.sibling=Bl,En=Bl,Rn=cr}if(Mr.done)return $(Me,Rn),ji&&ql(Me,zn),on;if(Rn===null){for(;!Mr.done;zn++,Mr=st.next())Mr=cn(Me,Mr.value,Ht),Mr!==null&&(Ne=W(Mr,Ne,zn),En===null?on=Mr:En.sibling=Mr,En=Mr);return ji&&ql(Me,zn),on}for(Rn=I(Me,Rn);!Mr.done;zn++,Mr=st.next())Mr=Tn(Rn,Me,zn,Mr.value,Ht),Mr!==null&&(d&&Mr.alternate!==null&&Rn.delete(Mr.key===null?zn:Mr.key),Ne=W(Mr,Ne,zn),En===null?on=Mr:En.sibling=Mr,En=Mr);return d&&Rn.forEach(function(pf){return _(Me,pf)}),ji&&ql(Me,zn),on}function Tt(Me,Ne,st,Ht){if(typeof st=="object"&&st!==null&&st.type===g&&st.key===null&&(st=st.props.children),typeof st=="object"&&st!==null){switch(st.$$typeof){case h:e:{for(var on=st.key,En=Ne;En!==null;){if(En.key===on){if(on=st.type,on===g){if(En.tag===7){$(Me,En.sibling),Ne=B(En,st.props.children),Ne.return=Me,Me=Ne;break e}}else if(En.elementType===on||typeof on=="object"&&on!==null&&on.$$typeof===P&&eu(on)===En.type){$(Me,En.sibling),Ne=B(En,st.props),Ne.ref=Zl(Me,En,st),Ne.return=Me,Me=Ne;break e}$(Me,En);break}else _(Me,En);En=En.sibling}st.type===g?(Ne=Xa(st.props.children,Me.mode,Ht,st.key),Ne.return=Me,Me=Ne):(Ht=Pl(st.type,st.key,st.props,null,Me.mode,Ht),Ht.ref=Zl(Me,Ne,st),Ht.return=Me,Me=Ht)}return de(Me);case f:e:{for(En=st.key;Ne!==null;){if(Ne.key===En)if(Ne.tag===4&&Ne.stateNode.containerInfo===st.containerInfo&&Ne.stateNode.implementation===st.implementation){$(Me,Ne.sibling),Ne=B(Ne,st.children||[]),Ne.return=Me,Me=Ne;break e}else{$(Me,Ne);break}else _(Me,Ne);Ne=Ne.sibling}Ne=cs(st,Me.mode,Ht),Ne.return=Me,Me=Ne}return de(Me);case P:return En=st._init,Tt(Me,Ne,En(st._payload),Ht)}if(ue(st))return gn(Me,Ne,st,Ht);if(U(st))return Dr(Me,Ne,st,Ht);Us(Me,st)}return typeof st=="string"&&st!==""||typeof st=="number"?(st=""+st,Ne!==null&&Ne.tag===6?($(Me,Ne.sibling),Ne=B(Ne,st),Ne.return=Me,Me=Ne):($(Me,Ne),Ne=ni(st,Me.mode,Ht),Ne.return=Me,Me=Ne),de(Me)):$(Me,Ne)}return Tt}var zc=Uh(!0),Uc=Uh(!1),is={},Fr=kr(is),Cl=kr(is),za=kr(is);function tu(d){if(d===is)throw Error(l(174));return d}function xu(d,_){Ir(za,_),Ir(Cl,d),Ir(Fr,is),d=we(_),An(Fr),Ir(Fr,d)}function bh(){An(Fr),An(Cl),An(za)}function Ad(d){var _=tu(za.current),$=tu(Fr.current);_=J($,d.type,_),$!==_&&(Ir(Cl,d),Ir(Fr,_))}function pi(d){Cl.current===d&&(An(Fr),An(Cl))}var ye=kr(0);function je(d){for(var _=d;_!==null;){if(_.tag===13){var $=_.memoizedState;if($!==null&&($=$.dehydrated,$===null||sn($)||Nn($)))return _}else if(_.tag===19&&_.memoizedProps.revealOrder!==void 0){if(_.flags&128)return _}else if(_.child!==null){_.child.return=_,_=_.child;continue}if(_===d)break;for(;_.sibling===null;){if(_.return===null||_.return===d)return null;_=_.return}_.sibling.return=_.return,_=_.sibling}return null}var Be=[];function Ot(){for(var d=0;d$?$:4,d(!0);var I=In.transition;In.transition={};try{d(!1),_()}finally{Tr=$,In.transition=I}}function jh(){return Hs().memoizedState}function ei(d,_,$){var I=Os(d);$={lane:I,action:$,hasEagerState:!1,eagerState:null,next:null},Sp(d)?Ff(_,$):(Il(d,_,$),$=bs(),d=Ya(d,I,$),d!==null&&ru(d,_,I))}function Ii(d,_,$){var I=Os(d),B={lane:I,action:$,hasEagerState:!1,eagerState:null,next:null};if(Sp(d))Ff(_,B);else{Il(d,_,B);var W=d.alternate;if(d.lanes===0&&(W===null||W.lanes===0)&&(W=_.lastRenderedReducer,W!==null))try{var de=_.lastRenderedState,Oe=W(de,$);if(B.hasEagerState=!0,B.eagerState=Oe,Es(Oe,de))return}catch{}finally{}$=bs(),d=Ya(d,I,$),d!==null&&ru(d,_,I)}}function Sp(d){var _=d.alternate;return d===vn||_!==null&&_===vn}function Ff(d,_){lo=Ti=!0;var $=d.pending;$===null?_.next=_:(_.next=$.next,$.next=_),d.pending=_}function Il(d,_,$){Nr!==null&&d.mode&1&&!(tr&2)?(d=_.interleaved,d===null?($.next=$,Mi===null?Mi=[_]:Mi.push(_)):($.next=d.next,d.next=$),_.interleaved=$):(d=_.pending,d===null?$.next=$:($.next=d.next,d.next=$),_.pending=$)}function ru(d,_,$){if($&4194240){var I=_.lanes;I&=d.pendingLanes,$|=I,_.lanes=$,br(d,$)}}var Xu={readContext:Vn,useCallback:vs,useContext:vs,useEffect:vs,useImperativeHandle:vs,useInsertionEffect:vs,useLayoutEffect:vs,useMemo:vs,useReducer:vs,useRef:vs,useState:vs,useDebugValue:vs,useDeferredValue:vs,useTransition:vs,useMutableSource:vs,useSyncExternalStore:vs,useId:vs,unstable_isNewReconciler:!1},Ku={readContext:Vn,useCallback:function(d,_){return Ks().memoizedState=[d,_===void 0?null:_],d},useContext:Vn,useEffect:Ml,useImperativeHandle:function(d,_,$){return $=$!=null?$.concat([d]):null,ea(4194308,4,Yu.bind(null,_,d),$)},useLayoutEffect:function(d,_){return ea(4194308,4,d,_)},useInsertionEffect:function(d,_){return ea(4,2,d,_)},useMemo:function(d,_){var $=Ks();return _=_===void 0?null:_,d=d(),$.memoizedState=[d,_],d},useReducer:function(d,_,$){var I=Ks();return _=$!==void 0?$(_):_,I.memoizedState=I.baseState=_,d={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:d,lastRenderedState:_},I.queue=d,d=d.dispatch=ei.bind(null,vn,d),[I.memoizedState,d]},useRef:function(d){var _=Ks();return d={current:d},_.memoizedState=d},useState:gc,useDebugValue:Gc,useDeferredValue:function(d){var _=gc(d),$=_[0],I=_[1];return Ml(function(){var B=In.transition;In.transition={};try{I(d)}finally{In.transition=B}},[d]),$},useTransition:function(){var d=gc(!1),_=d[0];return d=Rd.bind(null,d[1]),Ks().memoizedState=d,[_,d]},useMutableSource:function(){},useSyncExternalStore:function(d,_,$){var I=vn,B=Ks();if(ji){if($===void 0)throw Error(l(407));$=$()}else{if($=_(),Nr===null)throw Error(l(349));Jn&30||Hc(I,_,$)}B.memoizedState=$;var W={value:$,getSnapshot:_};return B.queue=W,Ml(Ha.bind(null,I,W,d),[d]),I.flags|=2048,ju(9,Gh.bind(null,I,W,$,_),void 0,null),$},useId:function(){var d=Ks(),_=Nr.identifierPrefix;if(ji){var $=Bo,I=Fa;$=(I&~(1<<32-Jo(I)-1)).toString(32)+$,_=":"+_+"R"+$,$=al++,0<$&&(_+="H"+$.toString(32)),_+=":"}else $=Fi++,_=":"+_+"r"+$.toString(32)+":";return d.memoizedState=_},unstable_isNewReconciler:!1},Sh={readContext:Vn,useCallback:Id,useContext:Vn,useEffect:Vh,useImperativeHandle:nu,useInsertionEffect:zi,useLayoutEffect:gd,useMemo:Al,useReducer:Hh,useRef:md,useState:function(){return Hh(Ua)},useDebugValue:Gc,useDeferredValue:function(d){var _=Hh(Ua),$=_[0],I=_[1];return Vh(function(){var B=In.transition;In.transition={};try{I(d)}finally{In.transition=B}},[d]),$},useTransition:function(){var d=Hh(Ua)[0],_=Hs().memoizedState;return[d,_]},useMutableSource:mc,useSyncExternalStore:Zo,useId:jh,unstable_isNewReconciler:!1},ll={readContext:Vn,useCallback:Id,useContext:Vn,useEffect:Vh,useImperativeHandle:nu,useInsertionEffect:zi,useLayoutEffect:gd,useMemo:Al,useReducer:Th,useRef:md,useState:function(){return Th(Ua)},useDebugValue:Gc,useDeferredValue:function(d){var _=Th(Ua),$=_[0],I=_[1];return Vh(function(){var B=In.transition;In.transition={};try{I(d)}finally{In.transition=B}},[d]),$},useTransition:function(){var d=Th(Ua)[0],_=Hs().memoizedState;return[d,_]},useMutableSource:mc,useSyncExternalStore:Zo,useId:jh,unstable_isNewReconciler:!1};function ta(d,_){try{var $="",I=_;do $+=Rs(I),I=I.return;while(I);var B=$}catch(W){B=` +`),de=B.length-1,ke=W.length-1;1<=de&&0<=ke&&B[de]!==W[ke];)ke--;for(;1<=de&&0<=ke;de--,ke--)if(B[de]!==W[ke]){if(de!==1||ke!==1)do if(de--,ke--,0>ke||B[de]!==W[ke]){var et=` +`+B[de].replace(" at new "," at ");return d.displayName&&et.includes("")&&(et=et.replace("",d.displayName)),et}while(1<=de&&0<=ke);break}}}finally{el=!1,Error.prepareStackTrace=$}return(d=d?d.displayName||d.name:"")?Rr(d):""}var Fs=Object.prototype.hasOwnProperty,zs=[],Di=-1;function kr(d){return{current:d}}function In(d){0>Di||(d.current=zs[Di],zs[Di]=null,Di--)}function Ir(d,_){Di++,zs[Di]=d.current,d.current=_}var Gr={},yr=kr(Gr),Pi=kr(!1),ws=Gr;function fi(d,_){var $=d.type.contextTypes;if(!$)return Gr;var I=d.stateNode;if(I&&I.__reactInternalMemoizedUnmaskedChildContext===_)return I.__reactInternalMemoizedMaskedChildContext;var B={},W;for(W in $)B[W]=_[W];return I&&(d=d.stateNode,d.__reactInternalMemoizedUnmaskedChildContext=_,d.__reactInternalMemoizedMaskedChildContext=B),B}function gs(d){return d=d.childContextTypes,d!=null}function tl(){In(Pi),In(yr)}function Na(d,_,$){if(yr.current!==Gr)throw Error(l(168));Ir(yr,_),Ir(Pi,$)}function fc(d,_,$){var I=d.stateNode;if(_=_.childContextTypes,typeof I.getChildContext!="function")return $;I=I.getChildContext();for(var B in I)if(!(B in _))throw Error(l(108,H(d)||"Unknown",B));return o({},$,I)}function pc(d){return d=(d=d.stateNode)&&d.__reactInternalMemoizedMergedChildContext||Gr,ws=yr.current,Ir(yr,d),Ir(Pi,Pi.current),!0}function Xs(d,_,$){var I=d.stateNode;if(!I)throw Error(l(169));$?(d=fc(d,_,ws),I.__reactInternalMemoizedMergedChildContext=d,In(Pi),In(yr),Ir(yr,d)):In(Pi),Ir(Pi,$)}var Jo=Math.clz32?Math.clz32:mh,Xl=Math.log,gu=Math.LN2;function mh(d){return d>>>=0,d===0?32:31-(Xl(d)/gu|0)|0}var qo=64,vr=4194304;function xi(d){switch(d&-d){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 d&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return d&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return d}}function Dc(d,_){var $=d.pendingLanes;if($===0)return 0;var I=0,B=d.suspendedLanes,W=d.pingedLanes,de=$&268435455;if(de!==0){var ke=de&~B;ke!==0?I=xi(ke):(W&=de,W!==0&&(I=xi(W)))}else de=$&~B,de!==0?I=xi(de):W!==0&&(I=xi(W));if(I===0)return 0;if(_!==0&&_!==I&&!(_&B)&&(B=I&-I,W=_&-_,B>=W||B===16&&(W&4194240)!==0))return _;if(I&4&&(I|=$&16),_=d.entangledLanes,_!==0)for(d=d.entanglements,_&=I;0<_;)$=31-Jo(_),B=1<<$,I|=d[$],_&=~B;return I}function gh(d,_){switch(d){case 1:case 2:case 4:return _+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 _+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Pc(d,_){for(var $=d.suspendedLanes,I=d.pingedLanes,B=d.expirationTimes,W=d.pendingLanes;0$;$++)_.push(d);return _}function xl(d,_,$){d.pendingLanes|=_,_!==536870912&&(d.suspendedLanes=0,d.pingedLanes=0),d=d.eventTimes,_=31-Jo(_),d[_]=$}function $l(d,_){var $=d.pendingLanes&~_;d.pendingLanes=_,d.suspendedLanes=0,d.pingedLanes=0,d.expiredLanes&=_,d.mutableReadLanes&=_,d.entangledLanes&=_,_=d.entanglements;var I=d.eventTimes;for(d=d.expirationTimes;0<$;){var B=31-Jo($),W=1<>=de,B-=de,Fa=1<<32-Jo(_)+B|$<zn?(cr=kn,kn=null):cr=kn.sibling;var Mr=bn(Ce,kn,ot[zn],Ht);if(Mr===null){kn===null&&(kn=cr);break}d&&kn&&Mr.alternate===null&&_(Ce,kn),Le=W(Mr,Le,zn),En===null?on=Mr:En.sibling=Mr,En=Mr,kn=cr}if(zn===ot.length)return $(Ce,kn),ji&&ql(Ce,zn),on;if(kn===null){for(;znzn?(cr=kn,kn=null):cr=kn.sibling;var Bl=bn(Ce,kn,Mr.value,Ht);if(Bl===null){kn===null&&(kn=cr);break}d&&kn&&Bl.alternate===null&&_(Ce,kn),Le=W(Bl,Le,zn),En===null?on=Bl:En.sibling=Bl,En=Bl,kn=cr}if(Mr.done)return $(Ce,kn),ji&&ql(Ce,zn),on;if(kn===null){for(;!Mr.done;zn++,Mr=ot.next())Mr=cn(Ce,Mr.value,Ht),Mr!==null&&(Le=W(Mr,Le,zn),En===null?on=Mr:En.sibling=Mr,En=Mr);return ji&&ql(Ce,zn),on}for(kn=I(Ce,kn);!Mr.done;zn++,Mr=ot.next())Mr=Tn(kn,Ce,zn,Mr.value,Ht),Mr!==null&&(d&&Mr.alternate!==null&&kn.delete(Mr.key===null?zn:Mr.key),Le=W(Mr,Le,zn),En===null?on=Mr:En.sibling=Mr,En=Mr);return d&&kn.forEach(function(pf){return _(Ce,pf)}),ji&&ql(Ce,zn),on}function Tt(Ce,Le,ot,Ht){if(typeof ot=="object"&&ot!==null&&ot.type===g&&ot.key===null&&(ot=ot.props.children),typeof ot=="object"&&ot!==null){switch(ot.$$typeof){case h:e:{for(var on=ot.key,En=Le;En!==null;){if(En.key===on){if(on=ot.type,on===g){if(En.tag===7){$(Ce,En.sibling),Le=B(En,ot.props.children),Le.return=Ce,Ce=Le;break e}}else if(En.elementType===on||typeof on=="object"&&on!==null&&on.$$typeof===P&&eu(on)===En.type){$(Ce,En.sibling),Le=B(En,ot.props),Le.ref=Zl(Ce,En,ot),Le.return=Ce,Ce=Le;break e}$(Ce,En);break}else _(Ce,En);En=En.sibling}ot.type===g?(Le=Xa(ot.props.children,Ce.mode,Ht,ot.key),Le.return=Ce,Ce=Le):(Ht=Pl(ot.type,ot.key,ot.props,null,Ce.mode,Ht),Ht.ref=Zl(Ce,Le,ot),Ht.return=Ce,Ce=Ht)}return de(Ce);case f:e:{for(En=ot.key;Le!==null;){if(Le.key===En)if(Le.tag===4&&Le.stateNode.containerInfo===ot.containerInfo&&Le.stateNode.implementation===ot.implementation){$(Ce,Le.sibling),Le=B(Le,ot.children||[]),Le.return=Ce,Ce=Le;break e}else{$(Ce,Le);break}else _(Ce,Le);Le=Le.sibling}Le=cs(ot,Ce.mode,Ht),Le.return=Ce,Ce=Le}return de(Ce);case P:return En=ot._init,Tt(Ce,Le,En(ot._payload),Ht)}if(ue(ot))return gn(Ce,Le,ot,Ht);if(U(ot))return Dr(Ce,Le,ot,Ht);Us(Ce,ot)}return typeof ot=="string"&&ot!==""||typeof ot=="number"?(ot=""+ot,Le!==null&&Le.tag===6?($(Ce,Le.sibling),Le=B(Le,ot),Le.return=Ce,Ce=Le):($(Ce,Le),Le=ni(ot,Ce.mode,Ht),Le.return=Ce,Ce=Le),de(Ce)):$(Ce,Le)}return Tt}var zc=Uh(!0),Uc=Uh(!1),is={},Fr=kr(is),Cl=kr(is),za=kr(is);function tu(d){if(d===is)throw Error(l(174));return d}function xu(d,_){Ir(za,_),Ir(Cl,d),Ir(Fr,is),d=we(_),In(Fr),Ir(Fr,d)}function bh(){In(Fr),In(Cl),In(za)}function Ad(d){var _=tu(za.current),$=tu(Fr.current);_=J($,d.type,_),$!==_&&(Ir(Cl,d),Ir(Fr,_))}function pi(d){Cl.current===d&&(In(Fr),In(Cl))}var ye=kr(0);function je(d){for(var _=d;_!==null;){if(_.tag===13){var $=_.memoizedState;if($!==null&&($=$.dehydrated,$===null||sn($)||Nn($)))return _}else if(_.tag===19&&_.memoizedProps.revealOrder!==void 0){if(_.flags&128)return _}else if(_.child!==null){_.child.return=_,_=_.child;continue}if(_===d)break;for(;_.sibling===null;){if(_.return===null||_.return===d)return null;_=_.return}_.sibling.return=_.return,_=_.sibling}return null}var Be=[];function Ot(){for(var d=0;d$?$:4,d(!0);var I=Rn.transition;Rn.transition={};try{d(!1),_()}finally{Tr=$,Rn.transition=I}}function jh(){return Hs().memoizedState}function ei(d,_,$){var I=Os(d);$={lane:I,action:$,hasEagerState:!1,eagerState:null,next:null},Sp(d)?Ff(_,$):(Il(d,_,$),$=bs(),d=Ya(d,I,$),d!==null&&ru(d,_,I))}function Ii(d,_,$){var I=Os(d),B={lane:I,action:$,hasEagerState:!1,eagerState:null,next:null};if(Sp(d))Ff(_,B);else{Il(d,_,B);var W=d.alternate;if(d.lanes===0&&(W===null||W.lanes===0)&&(W=_.lastRenderedReducer,W!==null))try{var de=_.lastRenderedState,ke=W(de,$);if(B.hasEagerState=!0,B.eagerState=ke,Es(ke,de))return}catch{}finally{}$=bs(),d=Ya(d,I,$),d!==null&&ru(d,_,I)}}function Sp(d){var _=d.alternate;return d===vn||_!==null&&_===vn}function Ff(d,_){lo=Ti=!0;var $=d.pending;$===null?_.next=_:(_.next=$.next,$.next=_),d.pending=_}function Il(d,_,$){Nr!==null&&d.mode&1&&!(tr&2)?(d=_.interleaved,d===null?($.next=$,Mi===null?Mi=[_]:Mi.push(_)):($.next=d.next,d.next=$),_.interleaved=$):(d=_.pending,d===null?$.next=$:($.next=d.next,d.next=$),_.pending=$)}function ru(d,_,$){if($&4194240){var I=_.lanes;I&=d.pendingLanes,$|=I,_.lanes=$,br(d,$)}}var Xu={readContext:Vn,useCallback:vs,useContext:vs,useEffect:vs,useImperativeHandle:vs,useInsertionEffect:vs,useLayoutEffect:vs,useMemo:vs,useReducer:vs,useRef:vs,useState:vs,useDebugValue:vs,useDeferredValue:vs,useTransition:vs,useMutableSource:vs,useSyncExternalStore:vs,useId:vs,unstable_isNewReconciler:!1},Ku={readContext:Vn,useCallback:function(d,_){return Ks().memoizedState=[d,_===void 0?null:_],d},useContext:Vn,useEffect:Ml,useImperativeHandle:function(d,_,$){return $=$!=null?$.concat([d]):null,ea(4194308,4,Yu.bind(null,_,d),$)},useLayoutEffect:function(d,_){return ea(4194308,4,d,_)},useInsertionEffect:function(d,_){return ea(4,2,d,_)},useMemo:function(d,_){var $=Ks();return _=_===void 0?null:_,d=d(),$.memoizedState=[d,_],d},useReducer:function(d,_,$){var I=Ks();return _=$!==void 0?$(_):_,I.memoizedState=I.baseState=_,d={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:d,lastRenderedState:_},I.queue=d,d=d.dispatch=ei.bind(null,vn,d),[I.memoizedState,d]},useRef:function(d){var _=Ks();return d={current:d},_.memoizedState=d},useState:gc,useDebugValue:Gc,useDeferredValue:function(d){var _=gc(d),$=_[0],I=_[1];return Ml(function(){var B=Rn.transition;Rn.transition={};try{I(d)}finally{Rn.transition=B}},[d]),$},useTransition:function(){var d=gc(!1),_=d[0];return d=Rd.bind(null,d[1]),Ks().memoizedState=d,[_,d]},useMutableSource:function(){},useSyncExternalStore:function(d,_,$){var I=vn,B=Ks();if(ji){if($===void 0)throw Error(l(407));$=$()}else{if($=_(),Nr===null)throw Error(l(349));Jn&30||Hc(I,_,$)}B.memoizedState=$;var W={value:$,getSnapshot:_};return B.queue=W,Ml(Ha.bind(null,I,W,d),[d]),I.flags|=2048,ju(9,Gh.bind(null,I,W,$,_),void 0,null),$},useId:function(){var d=Ks(),_=Nr.identifierPrefix;if(ji){var $=Bo,I=Fa;$=(I&~(1<<32-Jo(I)-1)).toString(32)+$,_=":"+_+"R"+$,$=al++,0<$&&(_+="H"+$.toString(32)),_+=":"}else $=Fi++,_=":"+_+"r"+$.toString(32)+":";return d.memoizedState=_},unstable_isNewReconciler:!1},Sh={readContext:Vn,useCallback:Id,useContext:Vn,useEffect:Vh,useImperativeHandle:nu,useInsertionEffect:zi,useLayoutEffect:gd,useMemo:Al,useReducer:Hh,useRef:md,useState:function(){return Hh(Ua)},useDebugValue:Gc,useDeferredValue:function(d){var _=Hh(Ua),$=_[0],I=_[1];return Vh(function(){var B=Rn.transition;Rn.transition={};try{I(d)}finally{Rn.transition=B}},[d]),$},useTransition:function(){var d=Hh(Ua)[0],_=Hs().memoizedState;return[d,_]},useMutableSource:mc,useSyncExternalStore:Zo,useId:jh,unstable_isNewReconciler:!1},ll={readContext:Vn,useCallback:Id,useContext:Vn,useEffect:Vh,useImperativeHandle:nu,useInsertionEffect:zi,useLayoutEffect:gd,useMemo:Al,useReducer:Th,useRef:md,useState:function(){return Th(Ua)},useDebugValue:Gc,useDeferredValue:function(d){var _=Th(Ua),$=_[0],I=_[1];return Vh(function(){var B=Rn.transition;Rn.transition={};try{I(d)}finally{Rn.transition=B}},[d]),$},useTransition:function(){var d=Th(Ua)[0],_=Hs().memoizedState;return[d,_]},useMutableSource:mc,useSyncExternalStore:Zo,useId:jh,unstable_isNewReconciler:!1};function ta(d,_){try{var $="",I=_;do $+=Rs(I),I=I.return;while(I);var B=$}catch(W){B=` Error generating stack: `+W.message+` -`+W.stack}return{value:d,source:_,stack:B}}function Rl(d,_){try{console.error(_.value)}catch($){setTimeout(function(){throw $})}}var Wc=typeof WeakMap=="function"?WeakMap:Map;function kl(d,_,$){$=Vi(-1,$),$.tag=3,$.payload={element:null};var I=_.value;return $.callback=function(){Au||(Au=!0,fo=I),Rl(d,_)},$}function Vc(d,_,$){$=Vi(-1,$),$.tag=3;var I=d.type.getDerivedStateFromError;if(typeof I=="function"){var B=_.value;$.payload=function(){return I(B)},$.callback=function(){Rl(d,_)}}var W=d.stateNode;return W!==null&&typeof W.componentDidCatch=="function"&&($.callback=function(){Rl(d,_),typeof I!="function"&&(po===null?po=new Set([this]):po.add(this));var de=_.stack;this.componentDidCatch(_.value,{componentStack:de!==null?de:""})}),$}function _c(d,_,$){var I=d.pingCache;if(I===null){I=d.pingCache=new Wc;var B=new Set;I.set(_,B)}else B=I.get(_),B===void 0&&(B=new Set,I.set(_,B));B.has($)||(B.add($),d=ia.bind(null,d,_,$),_.then(d,d))}function kd(d){do{var _;if((_=d.tag===13)&&(_=d.memoizedState,_=_!==null?_.dehydrated!==null:!0),_)return d;d=d.return}while(d!==null);return null}function Ga(d,_,$,I,B){return d.mode&1?(d.flags|=65536,d.lanes=B,d):(d===_?d.flags|=65536:(d.flags|=128,$.flags|=131072,$.flags&=-52805,$.tag===1&&($.alternate===null?$.tag=17:(_=Vi(-1,1),_.tag=2,Pa($,_))),$.lanes|=1),d)}function Vr(d){d.flags|=4}function ul(d,_){if(d!==null&&d.child===_.child)return!0;if(_.flags&16)return!1;for(d=_.child;d!==null;){if(d.flags&12854||d.subtreeFlags&12854)return!1;d=d.sibling}return!0}var Zi,ma,X,xs;if(ze)Zi=function(d,_){for(var $=_.child;$!==null;){if($.tag===5||$.tag===6)Te(d,$.stateNode);else if($.tag!==4&&$.child!==null){$.child.return=$,$=$.child;continue}if($===_)break;for(;$.sibling===null;){if($.return===null||$.return===_)return;$=$.return}$.sibling.return=$.return,$=$.sibling}},ma=function(){},X=function(d,_,$,I,B){if(d=d.memoizedProps,d!==I){var W=_.stateNode,de=tu(Fr.current);$=Ie(W,$,d,I,B,de),(_.updateQueue=$)&&Vr(_)}},xs=function(d,_,$,I){$!==I&&Vr(_)};else if(Ce){Zi=function(d,_,$,I){for(var B=_.child;B!==null;){if(B.tag===5){var W=B.stateNode;$&&I&&(W=ne(W,B.type,B.memoizedProps,B)),Te(d,W)}else if(B.tag===6)W=B.stateNode,$&&I&&(W=Se(W,B.memoizedProps,B)),Te(d,W);else if(B.tag!==4){if(B.tag===22&&B.memoizedState!==null)W=B.child,W!==null&&(W.return=B),Zi(d,B,!0,!0);else if(B.child!==null){B.child.return=B,B=B.child;continue}}if(B===_)break;for(;B.sibling===null;){if(B.return===null||B.return===_)return;B=B.return}B.sibling.return=B.return,B=B.sibling}};var ga=function(d,_,$,I){for(var B=_.child;B!==null;){if(B.tag===5){var W=B.stateNode;$&&I&&(W=ne(W,B.type,B.memoizedProps,B)),Ei(d,W)}else if(B.tag===6)W=B.stateNode,$&&I&&(W=Se(W,B.memoizedProps,B)),Ei(d,W);else if(B.tag!==4){if(B.tag===22&&B.memoizedState!==null)W=B.child,W!==null&&(W.return=B),ga(d,B,!0,!0);else if(B.child!==null){B.child.return=B,B=B.child;continue}}if(B===_)break;for(;B.sibling===null;){if(B.return===null||B.return===_)return;B=B.return}B.sibling.return=B.return,B=B.sibling}};ma=function(d,_){var $=_.stateNode;if(!ul(d,_)){d=$.containerInfo;var I=Pr(d);ga(I,_,!1,!1),$.pendingChildren=I,Vr(_),xr(d,I)}},X=function(d,_,$,I,B){var W=d.stateNode,de=d.memoizedProps;if((d=ul(d,_))&&de===I)_.stateNode=W;else{var Oe=_.stateNode,Ze=tu(Fr.current),wt=null;de!==I&&(wt=Ie(Oe,$,de,I,B,Ze)),d&&wt===null?_.stateNode=W:(W=ii(W,wt,$,de,I,_,d,Oe),Fe(W,$,I,B,Ze)&&Vr(_),_.stateNode=W,d?Vr(_):Zi(W,_,!1,!1))}},xs=function(d,_,$,I){$!==I?(d=tu(za.current),$=tu(Fr.current),_.stateNode=Re(I,d,$,_),Vr(_)):_.stateNode=d.stateNode}}else ma=function(){},X=function(){},xs=function(){};function Cr(d,_){if(!ji)switch(d.tailMode){case"hidden":_=d.tail;for(var $=null;_!==null;)_.alternate!==null&&($=_),_=_.sibling;$===null?d.tail=null:$.sibling=null;break;case"collapsed":$=d.tail;for(var I=null;$!==null;)$.alternate!==null&&(I=$),$=$.sibling;I===null?_||d.tail===null?d.tail=null:d.tail.sibling=null:I.sibling=null}}function mn(d){var _=d.alternate!==null&&d.alternate.child===d.child,$=0,I=0;if(_)for(var B=d.child;B!==null;)$|=B.lanes|B.childLanes,I|=B.subtreeFlags&14680064,I|=B.flags&14680064,B.return=d,B=B.sibling;else for(B=d.child;B!==null;)$|=B.lanes|B.childLanes,I|=B.subtreeFlags,I|=B.flags,B.return=d,B=B.sibling;return d.subtreeFlags|=I,d.childLanes=$,_}function zf(d,_,$){var I=_.pendingProps;switch(Wr(_),_.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return mn(_),null;case 1:return gs(_.type)&&tl(),mn(_),null;case 3:return I=_.stateNode,bh(),An(Pi),An(yr),Ot(),I.pendingContext&&(I.context=I.pendingContext,I.pendingContext=null),(d===null||d.child===null)&&(Fc(_)?Vr(_):d===null||d.memoizedState.isDehydrated&&!(_.flags&256)||(_.flags|=1024,Eu!==null&&(vi(Eu),Eu=null))),ma(d,_),mn(_),null;case 5:pi(_),$=tu(za.current);var B=_.type;if(d!==null&&_.stateNode!=null)X(d,_,B,I,$),d.ref!==_.ref&&(_.flags|=512,_.flags|=2097152);else{if(!I){if(_.stateNode===null)throw Error(l(166));return mn(_),null}if(d=tu(Fr.current),Fc(_)){if(!He)throw Error(l(175));d=Wn(_.stateNode,_.type,_.memoizedProps,$,d,_,!fa),_.updateQueue=d,d!==null&&Vr(_)}else{var W=fe(B,I,$,d,_);Zi(W,_,!1,!1),_.stateNode=W,Fe(W,B,I,$,d)&&Vr(_)}_.ref!==null&&(_.flags|=512,_.flags|=2097152)}return mn(_),null;case 6:if(d&&_.stateNode!=null)xs(d,_,d.memoizedProps,I);else{if(typeof I!="string"&&_.stateNode===null)throw Error(l(166));if(d=tu(za.current),$=tu(Fr.current),Fc(_)){if(!He)throw Error(l(176));if(d=_.stateNode,I=_.memoizedProps,($=rr(d,I,_,!fa))&&(B=Ai,B!==null))switch(W=(B.mode&1)!==0,B.tag){case 3:Eo(B.stateNode.containerInfo,d,I,W);break;case 5:Yl(B.type,B.memoizedProps,B.stateNode,d,I,W)}$&&Vr(_)}else _.stateNode=Re(I,d,$,_)}return mn(_),null;case 13:if(An(ye),I=_.memoizedState,ji&&Sr!==null&&_.mode&1&&!(_.flags&128)){for(d=Sr;d;)d=gt(d);return zh(),_.flags|=98560,_}if(I!==null&&I.dehydrated!==null){if(I=Fc(_),d===null){if(!I)throw Error(l(318));if(!He)throw Error(l(344));if(d=_.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(l(317));_r(d,_)}else zh(),!(_.flags&128)&&(_.memoizedState=null),_.flags|=4;return mn(_),null}return Eu!==null&&(vi(Eu),Eu=null),_.flags&128?(_.lanes=$,_):(I=I!==null,$=!1,d===null?Fc(_):$=d.memoizedState!==null,I&&!$&&(_.child.flags|=8192,_.mode&1&&(d===null||ye.current&1?ts===0&&(ts=3):qc())),_.updateQueue!==null&&(_.flags|=4),mn(_),null);case 4:return bh(),ma(d,_),d===null&&it(_.stateNode.containerInfo),mn(_),null;case 10:return sl(_.type._context),mn(_),null;case 17:return gs(_.type)&&tl(),mn(_),null;case 19:if(An(ye),B=_.memoizedState,B===null)return mn(_),null;if(I=(_.flags&128)!==0,W=B.rendering,W===null)if(I)Cr(B,!1);else{if(ts!==0||d!==null&&d.flags&128)for(d=_.child;d!==null;){if(W=je(d),W!==null){for(_.flags|=128,Cr(B,!1),d=W.updateQueue,d!==null&&(_.updateQueue=d,_.flags|=4),_.subtreeFlags=0,d=$,I=_.child;I!==null;)$=I,B=d,$.flags&=14680066,W=$.alternate,W===null?($.childLanes=0,$.lanes=B,$.child=null,$.subtreeFlags=0,$.memoizedProps=null,$.memoizedState=null,$.updateQueue=null,$.dependencies=null,$.stateNode=null):($.childLanes=W.childLanes,$.lanes=W.lanes,$.child=W.child,$.subtreeFlags=0,$.deletions=null,$.memoizedProps=W.memoizedProps,$.memoizedState=W.memoizedState,$.updateQueue=W.updateQueue,$.type=W.type,B=W.dependencies,$.dependencies=B===null?null:{lanes:B.lanes,firstContext:B.firstContext}),I=I.sibling;return Ir(ye,ye.current&1|2),_.child}d=d.sibling}B.tail!==null&&_s()>ba&&(_.flags|=128,I=!0,Cr(B,!1),_.lanes=4194304)}else{if(!I)if(d=je(W),d!==null){if(_.flags|=128,I=!0,d=d.updateQueue,d!==null&&(_.updateQueue=d,_.flags|=4),Cr(B,!0),B.tail===null&&B.tailMode==="hidden"&&!W.alternate&&!ji)return mn(_),null}else 2*_s()-B.renderingStartTime>ba&&$!==1073741824&&(_.flags|=128,I=!0,Cr(B,!1),_.lanes=4194304);B.isBackwards?(W.sibling=_.child,_.child=W):(d=B.last,d!==null?d.sibling=W:_.child=W,B.last=W)}return B.tail!==null?(_=B.tail,B.rendering=_,B.tail=_.sibling,B.renderingStartTime=_s(),_.sibling=null,d=ye.current,Ir(ye,I?d&1|2:d&1),_):(mn(_),null);case 22:case 23:return pl(),I=_.memoizedState!==null,d!==null&&d.memoizedState!==null!==I&&(_.flags|=8192),I&&_.mode&1?Mo&1073741824&&(mn(_),ze&&_.subtreeFlags&6&&(_.flags|=8192)):mn(_),null;case 24:return null;case 25:return null}throw Error(l(156,_.tag))}var cl=u.ReactCurrentOwner,Ri=!1;function hi(d,_,$,I){_.child=d===null?Uc(_,null,$,I):zc(_,d.child,$,I)}function es(d,_,$,I,B){$=$.render;var W=_.ref;return Ci(_,B),I=qn(d,_,$,I,W,B),$=pa(),d!==null&&!Ri?(_.updateQueue=d.updateQueue,_.flags&=-2053,d.lanes&=~B,gi(d,_,B)):(ji&&$&&Fh(_),_.flags|=1,hi(d,_,I,B),_.child)}function ss(d,_,$,I,B){if(d===null){var W=$.type;return typeof W=="function"&&!rc(W)&&W.defaultProps===void 0&&$.compare===null&&$.defaultProps===void 0?(_.tag=15,_.type=W,jc(d,_,W,I,B)):(d=Pl($.type,null,I,_,_.mode,B),d.ref=_.ref,d.return=_,_.child=d)}if(W=d.child,!(d.lanes&B)){var de=W.memoizedProps;if($=$.compare,$=$!==null?$:wr,$(de,I)&&d.ref===_.ref)return gi(d,_,B)}return _.flags|=1,d=vo(W,I),d.ref=_.ref,d.return=_,_.child=d}function jc(d,_,$,I,B){if(d!==null&&wr(d.memoizedProps,I)&&d.ref===_.ref)if(Ri=!1,(d.lanes&B)!==0)d.flags&131072&&(Ri=!0);else return _.lanes=d.lanes,gi(d,_,B);return os(d,_,$,I,B)}function _a(d,_,$){var I=_.pendingProps,B=I.children,W=d!==null?d.memoizedState:null;if(I.mode==="hidden")if(!(_.mode&1))_.memoizedState={baseLanes:0,cachePool:null},Ir(us,Mo),Mo|=$;else if($&1073741824)_.memoizedState={baseLanes:0,cachePool:null},I=W!==null?W.baseLanes:$,Ir(us,Mo),Mo|=I;else return d=W!==null?W.baseLanes|$:$,_.lanes=_.childLanes=1073741824,_.memoizedState={baseLanes:d,cachePool:null},_.updateQueue=null,Ir(us,Mo),Mo|=d,null;else W!==null?(I=W.baseLanes|$,_.memoizedState=null):I=$,Ir(us,Mo),Mo|=I;return hi(d,_,B,$),_.child}function va(d,_){var $=_.ref;(d===null&&$!==null||d!==null&&d.ref!==$)&&(_.flags|=512,_.flags|=2097152)}function os(d,_,$,I,B){var W=gs($)?ws:yr.current;return W=fi(_,W),Ci(_,B),$=qn(d,_,$,I,W,B),I=pa(),d!==null&&!Ri?(_.updateQueue=d.updateQueue,_.flags&=-2053,d.lanes&=~B,gi(d,_,B)):(ji&&I&&Fh(_),_.flags|=1,hi(d,_,$,B),_.child)}function Yc(d,_,$,I,B){if(gs($)){var W=!0;pc(_)}else W=!1;if(Ci(_,B),_.stateNode===null)d!==null&&(d.alternate=null,_.alternate=null,_.flags|=2),Tp(_,$,I),Jl(_,$,I,B),I=!0;else if(d===null){var de=_.stateNode,Oe=_.memoizedProps;de.props=Oe;var Ze=de.context,wt=$.contextType;typeof wt=="object"&&wt!==null?wt=Vn(wt):(wt=gs($)?ws:yr.current,wt=fi(_,wt));var Qt=$.getDerivedStateFromProps,cn=typeof Qt=="function"||typeof de.getSnapshotBeforeUpdate=="function";cn||typeof de.UNSAFE_componentWillReceiveProps!="function"&&typeof de.componentWillReceiveProps!="function"||(Oe!==I||Ze!==wt)&&Md(_,de,I,wt),Xr=!1;var bn=_.memoizedState;de.state=bn,Qo(_,I,de,B),Ze=_.memoizedState,Oe!==I||bn!==Ze||Pi.current||Xr?(typeof Qt=="function"&&(Bc(_,$,Qt,I),Ze=_.memoizedState),(Oe=Xr||Bf(_,$,Oe,I,bn,Ze,wt))?(cn||typeof de.UNSAFE_componentWillMount!="function"&&typeof de.componentWillMount!="function"||(typeof de.componentWillMount=="function"&&de.componentWillMount(),typeof de.UNSAFE_componentWillMount=="function"&&de.UNSAFE_componentWillMount()),typeof de.componentDidMount=="function"&&(_.flags|=4194308)):(typeof de.componentDidMount=="function"&&(_.flags|=4194308),_.memoizedProps=I,_.memoizedState=Ze),de.props=I,de.state=Ze,de.context=wt,I=Oe):(typeof de.componentDidMount=="function"&&(_.flags|=4194308),I=!1)}else{de=_.stateNode,wu(d,_),Oe=_.memoizedProps,wt=_.type===_.elementType?Oe:bi(_.type,Oe),de.props=wt,cn=_.pendingProps,bn=de.context,Ze=$.contextType,typeof Ze=="object"&&Ze!==null?Ze=Vn(Ze):(Ze=gs($)?ws:yr.current,Ze=fi(_,Ze));var Tn=$.getDerivedStateFromProps;(Qt=typeof Tn=="function"||typeof de.getSnapshotBeforeUpdate=="function")||typeof de.UNSAFE_componentWillReceiveProps!="function"&&typeof de.componentWillReceiveProps!="function"||(Oe!==cn||bn!==Ze)&&Md(_,de,I,Ze),Xr=!1,bn=_.memoizedState,de.state=bn,Qo(_,I,de,B);var gn=_.memoizedState;Oe!==cn||bn!==gn||Pi.current||Xr?(typeof Tn=="function"&&(Bc(_,$,Tn,I),gn=_.memoizedState),(wt=Xr||Bf(_,$,wt,I,bn,gn,Ze)||!1)?(Qt||typeof de.UNSAFE_componentWillUpdate!="function"&&typeof de.componentWillUpdate!="function"||(typeof de.componentWillUpdate=="function"&&de.componentWillUpdate(I,gn,Ze),typeof de.UNSAFE_componentWillUpdate=="function"&&de.UNSAFE_componentWillUpdate(I,gn,Ze)),typeof de.componentDidUpdate=="function"&&(_.flags|=4),typeof de.getSnapshotBeforeUpdate=="function"&&(_.flags|=1024)):(typeof de.componentDidUpdate!="function"||Oe===d.memoizedProps&&bn===d.memoizedState||(_.flags|=4),typeof de.getSnapshotBeforeUpdate!="function"||Oe===d.memoizedProps&&bn===d.memoizedState||(_.flags|=1024),_.memoizedProps=I,_.memoizedState=gn),de.props=I,de.state=gn,de.context=Ze,I=wt):(typeof de.componentDidUpdate!="function"||Oe===d.memoizedProps&&bn===d.memoizedState||(_.flags|=4),typeof de.getSnapshotBeforeUpdate!="function"||Oe===d.memoizedProps&&bn===d.memoizedState||(_.flags|=1024),I=!1)}return na(d,_,$,I,W,B)}function na(d,_,$,I,B,W){va(d,_);var de=(_.flags&128)!==0;if(!I&&!de)return B&&Xs(_,$,!1),gi(d,_,W);I=_.stateNode,cl.current=_;var Oe=de&&typeof $.getDerivedStateFromError!="function"?null:I.render();return _.flags|=1,d!==null&&de?(_.child=zc(_,d.child,null,W),_.child=zc(_,null,Oe,W)):hi(d,_,Oe,W),_.memoizedState=I.state,B&&Xs(_,$,!0),_.child}function Od(d){var _=d.stateNode;_.pendingContext?Na(d,_.pendingContext,_.pendingContext!==_.context):_.context&&Na(d,_.context,!1),xu(d,_.containerInfo)}function Ld(d,_,$,I,B){return zh(),Vu(B),_.flags|=256,hi(d,_,$,I),_.child}var Yh={dehydrated:null,treeContext:null,retryLane:0};function Gs(d){return{baseLanes:d,cachePool:null}}function Kn(d,_,$){var I=_.pendingProps,B=ye.current,W=!1,de=(_.flags&128)!==0,Oe;if((Oe=de)||(Oe=d!==null&&d.memoizedState===null?!1:(B&2)!==0),Oe?(W=!0,_.flags&=-129):(d===null||d.memoizedState!==null)&&(B|=1),Ir(ye,B&1),d===null)return Wu(_),d=_.memoizedState,d!==null&&(d=d.dehydrated,d!==null)?(_.mode&1?Nn(d)?_.lanes=8:_.lanes=1073741824:_.lanes=1,null):(B=I.children,d=I.fallback,W?(I=_.mode,W=_.child,B={mode:"hidden",children:B},!(I&1)&&W!==null?(W.childLanes=0,W.pendingProps=B):W=uu(B,I,0,null),d=Xa(d,I,$,null),W.return=_,d.return=_,W.sibling=d,_.child=W,_.child.memoizedState=Gs($),_.memoizedState=Yh,d):Ws(_,B));if(B=d.memoizedState,B!==null){if(Oe=B.dehydrated,Oe!==null){if(de)return _.flags&256?(_.flags&=-257,iu(d,_,$,Error(l(422)))):_.memoizedState!==null?(_.child=d.child,_.flags|=128,null):(W=I.fallback,B=_.mode,I=uu({mode:"visible",children:I.children},B,0,null),W=Xa(W,B,$,null),W.flags|=2,I.return=_,W.return=_,I.sibling=W,_.child=I,_.mode&1&&zc(_,d.child,null,$),_.child.memoizedState=Gs($),_.memoizedState=Yh,W);if(!(_.mode&1))_=iu(d,_,$,null);else if(Nn(Oe))_=iu(d,_,$,Error(l(419)));else if(I=($&d.childLanes)!==0,Ri||I){if(I=Nr,I!==null){switch($&-$){case 4:W=2;break;case 16:W=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:W=32;break;case 536870912:W=268435456;break;default:W=0}I=W&(I.suspendedLanes|$)?0:W,I!==0&&I!==B.retryLane&&(B.retryLane=I,Ya(d,I,-1))}qc(),_=iu(d,_,$,Error(l(421)))}else sn(Oe)?(_.flags|=128,_.child=d.child,_=go.bind(null,d),Pe(Oe,_),_=null):($=B.treeContext,He&&(Sr=Vt(Oe),Ai=_,ji=!0,Eu=null,fa=!1,$!==null&&(ci[Er++]=Fa,ci[Er++]=Bo,ci[Er++]=oo,Fa=$.id,Bo=$.overflow,oo=_)),_=Ws(_,_.pendingProps.children),_.flags|=4096);return _}return W?(I=Ui(d,_,I.children,I.fallback,$),W=_.child,B=d.child.memoizedState,W.memoizedState=B===null?Gs($):{baseLanes:B.baseLanes|$,cachePool:null},W.childLanes=d.childLanes&~$,_.memoizedState=Yh,I):($=Js(d,_,I.children,$),_.memoizedState=null,$)}return W?(I=Ui(d,_,I.children,I.fallback,$),W=_.child,B=d.child.memoizedState,W.memoizedState=B===null?Gs($):{baseLanes:B.baseLanes|$,cachePool:null},W.childLanes=d.childLanes&~$,_.memoizedState=Yh,I):($=Js(d,_,I.children,$),_.memoizedState=null,$)}function Ws(d,_){return _=uu({mode:"visible",children:_},d.mode,0,null),_.return=d,d.child=_}function Js(d,_,$,I){var B=d.child;return d=B.sibling,$=vo(B,{mode:"visible",children:$}),!(_.mode&1)&&($.lanes=I),$.return=_,$.sibling=null,d!==null&&(I=_.deletions,I===null?(_.deletions=[d],_.flags|=16):I.push(d)),_.child=$}function Ui(d,_,$,I,B){var W=_.mode;d=d.child;var de=d.sibling,Oe={mode:"hidden",children:$};return!(W&1)&&_.child!==d?($=_.child,$.childLanes=0,$.pendingProps=Oe,_.deletions=null):($=vo(d,Oe),$.subtreeFlags=d.subtreeFlags&14680064),de!==null?I=vo(de,I):(I=Xa(I,W,B,null),I.flags|=2),I.return=_,$.return=_,$.sibling=I,_.child=$,I}function iu(d,_,$,I){return I!==null&&Vu(I),zc(_,d.child,null,$),d=Ws(_,_.pendingProps.children),d.flags|=2,_.memoizedState=null,d}function Fo(d,_,$){d.lanes|=_;var I=d.alternate;I!==null&&(I.lanes|=_),Bi(d.return,_,$)}function xn(d,_,$,I,B){var W=d.memoizedState;W===null?d.memoizedState={isBackwards:_,rendering:null,renderingStartTime:0,last:I,tail:$,tailMode:B}:(W.isBackwards=_,W.rendering=null,W.renderingStartTime=0,W.last=I,W.tail=$,W.tailMode=B)}function mi(d,_,$){var I=_.pendingProps,B=I.revealOrder,W=I.tail;if(hi(d,_,I.children,$),I=ye.current,I&2)I=I&1|2,_.flags|=128;else{if(d!==null&&d.flags&128)e:for(d=_.child;d!==null;){if(d.tag===13)d.memoizedState!==null&&Fo(d,$,_);else if(d.tag===19)Fo(d,$,_);else if(d.child!==null){d.child.return=d,d=d.child;continue}if(d===_)break e;for(;d.sibling===null;){if(d.return===null||d.return===_)break e;d=d.return}d.sibling.return=d.return,d=d.sibling}I&=1}if(Ir(ye,I),!(_.mode&1))_.memoizedState=null;else switch(B){case"forwards":for($=_.child,B=null;$!==null;)d=$.alternate,d!==null&&je(d)===null&&(B=$),$=$.sibling;$=B,$===null?(B=_.child,_.child=null):(B=$.sibling,$.sibling=null),xn(_,!1,B,$,W);break;case"backwards":for($=null,B=_.child,_.child=null;B!==null;){if(d=B.alternate,d!==null&&je(d)===null){_.child=B;break}d=B.sibling,B.sibling=$,$=B,B=d}xn(_,!0,$,null,W);break;case"together":xn(_,!1,null,null,void 0);break;default:_.memoizedState=null}return _.child}function gi(d,_,$){if(d!==null&&(_.dependencies=d.dependencies),qu|=_.lanes,!($&_.childLanes))return null;if(d!==null&&_.child!==d.child)throw Error(l(153));if(_.child!==null){for(d=_.child,$=vo(d,d.pendingProps),_.child=$,$.return=_;d.sibling!==null;)d=d.sibling,$=$.sibling=vo(d,d.pendingProps),$.return=_;$.sibling=null}return _.child}function Uf(d,_,$){switch(_.tag){case 3:Od(_),zh();break;case 5:Ad(_);break;case 1:gs(_.type)&&pc(_);break;case 4:xu(_,_.stateNode.containerInfo);break;case 10:Su(_,_.type._context,_.memoizedProps.value);break;case 13:var I=_.memoizedState;if(I!==null)return I.dehydrated!==null?(Ir(ye,ye.current&1),_.flags|=128,null):$&_.child.childLanes?Kn(d,_,$):(Ir(ye,ye.current&1),d=gi(d,_,$),d!==null?d.sibling:null);Ir(ye,ye.current&1);break;case 19:if(I=($&_.childLanes)!==0,d.flags&128){if(I)return mi(d,_,$);_.flags|=128}var B=_.memoizedState;if(B!==null&&(B.rendering=null,B.tail=null,B.lastEffect=null),Ir(ye,ye.current),I)break;return null;case 22:case 23:return _.lanes=0,_a(d,_,$)}return gi(d,_,$)}function wh(d,_){switch(Wr(_),_.tag){case 1:return gs(_.type)&&tl(),d=_.flags,d&65536?(_.flags=d&-65537|128,_):null;case 3:return bh(),An(Pi),An(yr),Ot(),d=_.flags,d&65536&&!(d&128)?(_.flags=d&-65537|128,_):null;case 5:return pi(_),null;case 13:if(An(ye),d=_.memoizedState,d!==null&&d.dehydrated!==null){if(_.alternate===null)throw Error(l(340));zh()}return d=_.flags,d&65536?(_.flags=d&-65537|128,_):null;case 19:return An(ye),null;case 4:return bh(),null;case 10:return sl(_.type._context),null;case 22:case 23:return pl(),null;case 24:return null;default:return null}}var co=!1,ya=!1,Cn=typeof WeakSet=="function"?WeakSet:Set,yn=null;function hl(d,_){var $=d.ref;if($!==null)if(typeof $=="function")try{$(null)}catch(I){Qs(d,_,I)}else $.current=null}function vc(d,_,$){try{$()}catch(I){Qs(d,_,I)}}var wp=!1;function su(d,_){for(re(d.containerInfo),yn=_;yn!==null;)if(d=yn,_=d.child,(d.subtreeFlags&1028)!==0&&_!==null)_.return=d,yn=_;else for(;yn!==null;){d=yn;try{var $=d.alternate;if(d.flags&1024)switch(d.tag){case 0:case 11:case 15:break;case 1:if($!==null){var I=$.memoizedProps,B=$.memoizedState,W=d.stateNode,de=W.getSnapshotBeforeUpdate(d.elementType===d.type?I:bi(d.type,I),B);W.__reactInternalSnapshotBeforeUpdate=de}break;case 3:ze&&On(d.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(l(163))}}catch(Oe){Qs(d,d.return,Oe)}if(_=d.sibling,_!==null){_.return=d.return,yn=_;break}yn=d.return}return $=wp,wp=!1,$}function $o(d,_,$){var I=_.updateQueue;if(I=I!==null?I.lastEffect:null,I!==null){var B=I=I.next;do{if((B.tag&d)===d){var W=B.destroy;B.destroy=void 0,W!==void 0&&vc(_,$,W)}B=B.next}while(B!==I)}}function ys(d,_){if(_=_.updateQueue,_=_!==null?_.lastEffect:null,_!==null){var $=_=_.next;do{if(($.tag&d)===d){var I=$.create;$.destroy=I()}$=$.next}while($!==_)}}function dl(d){var _=d.ref;if(_!==null){var $=d.stateNode;switch(d.tag){case 5:d=ge($);break;default:d=$}typeof _=="function"?_(d):_.current=d}}function as(d,_,$){if(yu&&typeof yu.onCommitFiberUnmount=="function")try{yu.onCommitFiberUnmount(ca,_)}catch{}switch(_.tag){case 0:case 11:case 14:case 15:if(d=_.updateQueue,d!==null&&(d=d.lastEffect,d!==null)){var I=d=d.next;do{var B=I,W=B.destroy;B=B.tag,W!==void 0&&(B&2||B&4)&&vc(_,$,W),I=I.next}while(I!==d)}break;case 1:if(hl(_,$),d=_.stateNode,typeof d.componentWillUnmount=="function")try{d.props=_.memoizedProps,d.state=_.memoizedState,d.componentWillUnmount()}catch(de){Qs(_,$,de)}break;case 5:hl(_,$);break;case 4:ze?Kh(d,_,$):Ce&&Ce&&(_=_.stateNode.containerInfo,$=Pr(_),mr(_,$))}}function fl(d,_,$){for(var I=_;;)if(as(d,I,$),I.child===null||ze&&I.tag===4){if(I===_)break;for(;I.sibling===null;){if(I.return===null||I.return===_)return;I=I.return}I.sibling.return=I.return,I=I.sibling}else I.child.return=I,I=I.child}function zo(d){var _=d.alternate;_!==null&&(d.alternate=null,zo(_)),d.child=null,d.deletions=null,d.sibling=null,d.tag===5&&(_=d.stateNode,_!==null&&kt(_)),d.stateNode=null,d.return=null,d.dependencies=null,d.memoizedProps=null,d.memoizedState=null,d.pendingProps=null,d.stateNode=null,d.updateQueue=null}function Xh(d){return d.tag===5||d.tag===3||d.tag===4}function Wa(d){e:for(;;){for(;d.sibling===null;){if(d.return===null||Xh(d.return))return null;d=d.return}for(d.sibling.return=d.return,d=d.sibling;d.tag!==5&&d.tag!==6&&d.tag!==18;){if(d.flags&2||d.child===null||d.tag===4)continue e;d.child.return=d,d=d.child}if(!(d.flags&2))return d.stateNode}}function ki(d){if(ze){e:{for(var _=d.return;_!==null;){if(Xh(_))break e;_=_.return}throw Error(l(160))}var $=_;switch($.tag){case 5:_=$.stateNode,$.flags&32&&(Ge(_),$.flags&=-33),$=Wa(d),Xc(d,$,_);break;case 3:case 4:_=$.stateNode.containerInfo,$=Wa(d),Nd(d,$,_);break;default:throw Error(l(161))}}}function Nd(d,_,$){var I=d.tag;if(I===5||I===6)d=d.stateNode,_?ke($,d,_):Ke($,d);else if(I!==4&&(d=d.child,d!==null))for(Nd(d,_,$),d=d.sibling;d!==null;)Nd(d,_,$),d=d.sibling}function Xc(d,_,$){var I=d.tag;if(I===5||I===6)d=d.stateNode,_?me($,d,_):pt($,d);else if(I!==4&&(d=d.child,d!==null))for(Xc(d,_,$),d=d.sibling;d!==null;)Xc(d,_,$),d=d.sibling}function Kh(d,_,$){for(var I=_,B=!1,W,de;;){if(!B){B=I.return;e:for(;;){if(B===null)throw Error(l(160));switch(W=B.stateNode,B.tag){case 5:de=!1;break e;case 3:W=W.containerInfo,de=!0;break e;case 4:W=W.containerInfo,de=!0;break e}B=B.return}B=!0}if(I.tag===5||I.tag===6)fl(d,I,$),de?Wt(W,I.stateNode):Xe(W,I.stateNode);else if(I.tag===18)de?Ss(W,I.stateNode):Yr(W,I.stateNode);else if(I.tag===4){if(I.child!==null){W=I.stateNode.containerInfo,de=!0,I.child.return=I,I=I.child;continue}}else if(as(d,I,$),I.child!==null){I.child.return=I,I=I.child;continue}if(I===_)break;for(;I.sibling===null;){if(I.return===null||I.return===_)return;I=I.return,I.tag===4&&(B=!1)}I.sibling.return=I.return,I=I.sibling}}function Uo(d,_){if(ze){switch(_.tag){case 0:case 11:case 14:case 15:$o(3,_,_.return),ys(3,_),$o(5,_,_.return);return;case 1:return;case 5:var $=_.stateNode;if($!=null){var I=_.memoizedProps;d=d!==null?d.memoizedProps:I;var B=_.type,W=_.updateQueue;_.updateQueue=null,W!==null&&te($,W,B,d,I,_)}return;case 6:if(_.stateNode===null)throw Error(l(162));$=_.memoizedProps,Le(_.stateNode,d!==null?d.memoizedProps:$,$);return;case 3:He&&d!==null&&d.memoizedState.isDehydrated&&si(_.stateNode.containerInfo);return;case 12:return;case 13:Co(_);return;case 19:Co(_);return;case 17:return}throw Error(l(163))}switch(_.tag){case 0:case 11:case 14:case 15:$o(3,_,_.return),ys(3,_),$o(5,_,_.return);return;case 12:return;case 13:Co(_);return;case 19:Co(_);return;case 3:He&&d!==null&&d.memoizedState.isDehydrated&&si(_.stateNode.containerInfo);break;case 22:case 23:return}e:if(Ce){switch(_.tag){case 1:case 5:case 6:break e;case 3:case 4:_=_.stateNode,mr(_.containerInfo,_.pendingChildren);break e}throw Error(l(163))}}function Co(d){var _=d.updateQueue;if(_!==null){d.updateQueue=null;var $=d.stateNode;$===null&&($=d.stateNode=new Cn),_.forEach(function(I){var B=Iu.bind(null,d,I);$.has(I)||($.add(I),I.then(B,B))})}}function df(d,_){for(yn=_;yn!==null;){_=yn;var $=_.deletions;if($!==null)for(var I=0;I<$.length;I++){var B=$[I];try{var W=d;ze?Kh(W,B,_):fl(W,B,_);var de=B.alternate;de!==null&&(de.return=null),B.return=null}catch(on){Qs(B,_,on)}}if($=_.child,_.subtreeFlags&12854&&$!==null)$.return=_,yn=$;else for(;yn!==null;){_=yn;try{var Oe=_.flags;if(Oe&32&&ze&&Ge(_.stateNode),Oe&512){var Ze=_.alternate;if(Ze!==null){var wt=Ze.ref;wt!==null&&(typeof wt=="function"?wt(null):wt.current=null)}}if(Oe&8192)switch(_.tag){case 13:if(_.memoizedState!==null){var Qt=_.alternate;(Qt===null||Qt.memoizedState===null)&&(vd=_s())}break;case 22:var cn=_.memoizedState!==null,bn=_.alternate,Tn=bn!==null&&bn.memoizedState!==null;if($=_,ze){e:if(I=$,B=cn,W=null,ze)for(var gn=I;;){if(gn.tag===5){if(W===null){W=gn;var Dr=gn.stateNode;B?tn(Dr):Jt(gn.stateNode,gn.memoizedProps)}}else if(gn.tag===6){if(W===null){var Tt=gn.stateNode;B?_t(Tt):Kt(Tt,gn.memoizedProps)}}else if((gn.tag!==22&&gn.tag!==23||gn.memoizedState===null||gn===I)&&gn.child!==null){gn.child.return=gn,gn=gn.child;continue}if(gn===I)break;for(;gn.sibling===null;){if(gn.return===null||gn.return===I)break e;W===gn&&(W=null),gn=gn.return}W===gn&&(W=null),gn.sibling.return=gn.return,gn=gn.sibling}}if(cn&&!Tn&&$.mode&1){yn=$;for(var Me=$.child;Me!==null;){for($=yn=Me;yn!==null;){I=yn;var Ne=I.child;switch(I.tag){case 0:case 11:case 14:case 15:$o(4,I,I.return);break;case 1:hl(I,I.return);var st=I.stateNode;if(typeof st.componentWillUnmount=="function"){var Ht=I.return;try{st.props=I.memoizedProps,st.state=I.memoizedState,st.componentWillUnmount()}catch(on){Qs(I,Ht,on)}}break;case 5:hl(I,I.return);break;case 22:if(I.memoizedState!==null){yc($);continue}}Ne!==null?(Ne.return=I,yn=Ne):yc($)}Me=Me.sibling}}}switch(Oe&4102){case 2:ki(_),_.flags&=-3;break;case 6:ki(_),_.flags&=-3,Uo(_.alternate,_);break;case 4096:_.flags&=-4097;break;case 4100:_.flags&=-4097,Uo(_.alternate,_);break;case 4:Uo(_.alternate,_)}}catch(on){Qs(_,_.return,on)}if($=_.sibling,$!==null){$.return=_.return,yn=$;break}yn=_.return}}}function Cu(d,_,$){yn=d,Ol(d)}function Ol(d,_,$){for(var I=(d.mode&1)!==0;yn!==null;){var B=yn,W=B.child;if(B.tag===22&&I){var de=B.memoizedState!==null||co;if(!de){var Oe=B.alternate,Ze=Oe!==null&&Oe.memoizedState!==null||ya;Oe=co;var wt=ya;if(co=de,(ya=Ze)&&!wt)for(yn=B;yn!==null;)de=yn,Ze=de.child,de.tag===22&&de.memoizedState!==null?Kr(B):Ze!==null?(Ze.return=de,yn=Ze):Kr(B);for(;W!==null;)yn=W,Ol(W),W=W.sibling;yn=B,co=Oe,ya=wt}_d(d)}else B.subtreeFlags&8772&&W!==null?(W.return=B,yn=W):_d(d)}}function _d(d){for(;yn!==null;){var _=yn;if(_.flags&8772){var $=_.alternate;try{if(_.flags&8772)switch(_.tag){case 0:case 11:case 15:ya||ys(5,_);break;case 1:var I=_.stateNode;if(_.flags&4&&!ya)if($===null)I.componentDidMount();else{var B=_.elementType===_.type?$.memoizedProps:bi(_.type,$.memoizedProps);I.componentDidUpdate(B,$.memoizedState,I.__reactInternalSnapshotBeforeUpdate)}var W=_.updateQueue;W!==null&&fd(_,W,I);break;case 3:var de=_.updateQueue;if(de!==null){if($=null,_.child!==null)switch(_.child.tag){case 5:$=ge(_.child.stateNode);break;case 1:$=_.child.stateNode}fd(_,de,$)}break;case 5:var Oe=_.stateNode;$===null&&_.flags&4&&Q(Oe,_.type,_.memoizedProps,_);break;case 6:break;case 4:break;case 12:break;case 13:if(He&&_.memoizedState===null){var Ze=_.alternate;if(Ze!==null){var wt=Ze.memoizedState;if(wt!==null){var Qt=wt.dehydrated;Qt!==null&&Br(Qt)}}}break;case 19:case 17:case 21:case 22:case 23:break;default:throw Error(l(163))}ya||_.flags&512&&dl(_)}catch(cn){Qs(_,_.return,cn)}}if(_===d){yn=null;break}if($=_.sibling,$!==null){$.return=_.return,yn=$;break}yn=_.return}}function yc(d){for(;yn!==null;){var _=yn;if(_===d){yn=null;break}var $=_.sibling;if($!==null){$.return=_.return,yn=$;break}yn=_.return}}function Kr(d){for(;yn!==null;){var _=yn;try{switch(_.tag){case 0:case 11:case 15:var $=_.return;try{ys(4,_)}catch(Ze){Qs(_,$,Ze)}break;case 1:var I=_.stateNode;if(typeof I.componentDidMount=="function"){var B=_.return;try{I.componentDidMount()}catch(Ze){Qs(_,B,Ze)}}var W=_.return;try{dl(_)}catch(Ze){Qs(_,W,Ze)}break;case 5:var de=_.return;try{dl(_)}catch(Ze){Qs(_,de,Ze)}}}catch(Ze){Qs(_,_.return,Ze)}if(_===d){yn=null;break}var Oe=_.sibling;if(Oe!==null){Oe.return=_.return,yn=Oe;break}yn=_.return}}var ou=0,Ju=1,ls=2,Va=3,$s=4;if(typeof Symbol=="function"&&Symbol.for){var Cs=Symbol.for;ou=Cs("selector.component"),Ju=Cs("selector.has_pseudo_class"),ls=Cs("selector.role"),Va=Cs("selector.test_id"),$s=Cs("selector.text")}function Kc(d){var _=rt(d);if(_!=null){if(typeof _.memoizedProps["data-testname"]!="string")throw Error(l(364));return _}if(d=mt(d),d===null)throw Error(l(362));return d.stateNode.current}function _i(d,_){switch(_.$$typeof){case ou:if(d.type===_.value)return!0;break;case Ju:e:{_=_.value,d=[d,0];for(var $=0;$";case Ju:return":has("+(ja(d)||"")+")";case ls:return'[role="'+d.value+'"]';case $s:return'"'+d.value+'"';case Va:return'[data-testname="'+d.value+'"]';default:throw Error(l(365))}}function bc(d,_){var $=[];d=[d,0];for(var I=0;IB&&(B=de),I&=~W}if(I=B,I=_s()-I,I=(120>I?120:480>I?480:1080>I?1080:1920>I?1920:3e3>I?3e3:4320>I?4320:1960*Eh(I/1960))-I,10d?16:d,Ho===null)var I=!1;else{if(d=Ho,Ho=null,Zu=0,tr&6)throw Error(l(331));var B=tr;for(tr|=4,yn=d.current;yn!==null;){var W=yn,de=W.child;if(yn.flags&16){var Oe=W.deletions;if(Oe!==null){for(var Ze=0;Ze_s()-vd?jr(d,0):Qu|=$),fn(d,_)}function Ch(d,_){_===0&&(d.mode&1?(_=vr,vr<<=1,!(vr&130023424)&&(vr=4194304)):_=1);var $=bs();d=Vs(d,_),d!==null&&(xl(d,_,$),fn(d,$))}function go(d){var _=d.memoizedState,$=0;_!==null&&($=_.retryLane),Ch(d,$)}function Iu(d,_){var $=0;switch(d.tag){case 13:var I=d.stateNode,B=d.memoizedState;B!==null&&($=B.retryLane);break;case 19:I=d.stateNode;break;default:throw Error(l(314))}I!==null&&I.delete(_),Ch(d,$)}var eh;eh=function(d,_,$){if(d!==null)if(d.memoizedProps!==_.pendingProps||Pi.current)Ri=!0;else{if(!(d.lanes&$)&&!(_.flags&128))return Ri=!1,Uf(d,_,$);Ri=!!(d.flags&131072)}else Ri=!1,ji&&_.flags&1048576&&Ql(_,Ba,_.index);switch(_.lanes=0,_.tag){case 2:var I=_.type;d!==null&&(d.alternate=null,_.alternate=null,_.flags|=2),d=_.pendingProps;var B=fi(_,yr.current);Ci(_,$),B=qn(null,_,I,d,B,$);var W=pa();return _.flags|=1,typeof B=="object"&&B!==null&&typeof B.render=="function"&&B.$$typeof===void 0?(_.tag=1,_.memoizedState=null,_.updateQueue=null,gs(I)?(W=!0,pc(_)):W=!1,_.memoizedState=B.state!==null&&B.state!==void 0?B.state:null,dd(_),B.updater=uf,_.stateNode=B,B._reactInternals=_,Jl(_,I,d,$),_=na(null,_,I,!0,W,$)):(_.tag=0,ji&&W&&Fh(_),hi(null,_,B,$),_=_.child),_;case 16:I=_.elementType;e:{switch(d!==null&&(d.alternate=null,_.alternate=null,_.flags|=2),d=_.pendingProps,B=I._init,I=B(I._payload),_.type=I,B=_.tag=Dl(I),d=bi(I,d),B){case 0:_=os(null,_,I,d,$);break e;case 1:_=Yc(null,_,I,d,$);break e;case 11:_=es(null,_,I,d,$);break e;case 14:_=ss(null,_,I,bi(I.type,d),$);break e}throw Error(l(306,I,""))}return _;case 0:return I=_.type,B=_.pendingProps,B=_.elementType===I?B:bi(I,B),os(d,_,I,B,$);case 1:return I=_.type,B=_.pendingProps,B=_.elementType===I?B:bi(I,B),Yc(d,_,I,B,$);case 3:e:{if(Od(_),d===null)throw Error(l(387));I=_.pendingProps,W=_.memoizedState,B=W.element,wu(d,_),Qo(_,I,null,$);var de=_.memoizedState;if(I=de.element,He&&W.isDehydrated)if(W={element:I,isDehydrated:!1,cache:de.cache,transitions:de.transitions},_.updateQueue.baseState=W,_.memoizedState=W,_.flags&256){B=Error(l(423)),_=Ld(d,_,I,$,B);break e}else if(I!==B){B=Error(l(424)),_=Ld(d,_,I,$,B);break e}else for(He&&(Sr=bt(_.stateNode.containerInfo),Ai=_,ji=!0,Eu=null,fa=!1),$=Uc(_,null,I,$),_.child=$;$;)$.flags=$.flags&-3|4096,$=$.sibling;else{if(zh(),I===B){_=gi(d,_,$);break e}hi(d,_,I,$)}_=_.child}return _;case 5:return Ad(_),d===null&&Wu(_),I=_.type,B=_.pendingProps,W=d!==null?d.memoizedProps:null,de=B.children,Je(I,B)?de=null:W!==null&&Je(I,W)&&(_.flags|=32),va(d,_),hi(d,_,de,$),_.child;case 6:return d===null&&Wu(_),null;case 13:return Kn(d,_,$);case 4:return xu(_,_.stateNode.containerInfo),I=_.pendingProps,d===null?_.child=zc(_,null,I,$):hi(d,_,I,$),_.child;case 11:return I=_.type,B=_.pendingProps,B=_.elementType===I?B:bi(I,B),es(d,_,I,B,$);case 7:return hi(d,_,_.pendingProps,$),_.child;case 8:return hi(d,_,_.pendingProps.children,$),_.child;case 12:return hi(d,_,_.pendingProps.children,$),_.child;case 10:e:{if(I=_.type._context,B=_.pendingProps,W=_.memoizedProps,de=B.value,Su(_,I,de),W!==null)if(Es(W.value,de)){if(W.children===B.children&&!Pi.current){_=gi(d,_,$);break e}}else for(W=_.child,W!==null&&(W.return=_);W!==null;){var Oe=W.dependencies;if(Oe!==null){de=W.child;for(var Ze=Oe.firstContext;Ze!==null;){if(Ze.context===I){if(W.tag===1){Ze=Vi(-1,$&-$),Ze.tag=2;var wt=W.updateQueue;if(wt!==null){wt=wt.shared;var Qt=wt.pending;Qt===null?Ze.next=Ze:(Ze.next=Qt.next,Qt.next=Ze),wt.pending=Ze}}W.lanes|=$,Ze=W.alternate,Ze!==null&&(Ze.lanes|=$),Bi(W.return,$,_),Oe.lanes|=$;break}Ze=Ze.next}}else if(W.tag===10)de=W.type===_.type?null:W.child;else if(W.tag===18){if(de=W.return,de===null)throw Error(l(341));de.lanes|=$,Oe=de.alternate,Oe!==null&&(Oe.lanes|=$),Bi(de,$,_),de=W.sibling}else de=W.child;if(de!==null)de.return=W;else for(de=W;de!==null;){if(de===_){de=null;break}if(W=de.sibling,W!==null){W.return=de.return,de=W;break}de=de.return}W=de}hi(d,_,B.children,$),_=_.child}return _;case 9:return B=_.type,I=_.pendingProps.children,Ci(_,$),B=Vn(B),I=I(B),_.flags|=1,hi(d,_,I,$),_.child;case 14:return I=_.type,B=bi(I,_.pendingProps),B=bi(I.type,B),ss(d,_,I,B,$);case 15:return jc(d,_,_.type,_.pendingProps,$);case 17:return I=_.type,B=_.pendingProps,B=_.elementType===I?B:bi(I,B),d!==null&&(d.alternate=null,_.alternate=null,_.flags|=2),_.tag=1,gs(I)?(d=!0,pc(_)):d=!1,Ci(_,$),Tp(_,I,B),Jl(_,I,B,$),na(null,_,I,!0,d,$);case 19:return mi(d,_,$);case 22:return _a(d,_,$)}throw Error(l(156,_.tag))};function wc(d,_){return nl(d,_)}function Go(d,_,$,I){this.tag=d,this.key=$,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=_,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=I,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function _o(d,_,$,I){return new Go(d,_,$,I)}function rc(d){return d=d.prototype,!(!d||!d.isReactComponent)}function Dl(d){if(typeof d=="function")return rc(d)?1:0;if(d!=null){if(d=d.$$typeof,d===M)return 11;if(d===L)return 14}return 2}function vo(d,_){var $=d.alternate;return $===null?($=_o(d.tag,_,d.key,d.mode),$.elementType=d.elementType,$.type=d.type,$.stateNode=d.stateNode,$.alternate=d,d.alternate=$):($.pendingProps=_,$.type=d.type,$.flags=0,$.subtreeFlags=0,$.deletions=null),$.flags=d.flags&14680064,$.childLanes=d.childLanes,$.lanes=d.lanes,$.child=d.child,$.memoizedProps=d.memoizedProps,$.memoizedState=d.memoizedState,$.updateQueue=d.updateQueue,_=d.dependencies,$.dependencies=_===null?null:{lanes:_.lanes,firstContext:_.firstContext},$.sibling=d.sibling,$.index=d.index,$.ref=d.ref,$}function Pl(d,_,$,I,B,W){var de=2;if(I=d,typeof d=="function")rc(d)&&(de=1);else if(typeof d=="string")de=5;else e:switch(d){case g:return Xa($.children,B,W,_);case y:de=8,B|=8;break;case b:return d=_o(12,$,_,B|2),d.elementType=b,d.lanes=W,d;case A:return d=_o(13,$,_,B),d.elementType=A,d.lanes=W,d;case k:return d=_o(19,$,_,B),d.elementType=k,d.lanes=W,d;case D:return uu($,B,W,_);default:if(typeof d=="object"&&d!==null)switch(d.$$typeof){case w:de=10;break e;case C:de=9;break e;case M:de=11;break e;case L:de=14;break e;case P:de=16,I=null;break e}throw Error(l(130,d==null?d:typeof d,""))}return _=_o(de,$,_,B),_.elementType=d,_.type=I,_.lanes=W,_}function Xa(d,_,$,I){return d=_o(7,d,I,_),d.lanes=$,d}function uu(d,_,$,I){return d=_o(22,d,I,_),d.elementType=D,d.lanes=$,d.stateNode={},d}function ni(d,_,$){return d=_o(6,d,null,_),d.lanes=$,d}function cs(d,_,$){return _=_o(4,d.children!==null?d.children:[],d.key,_),_.lanes=$,_.stateNode={containerInfo:d.containerInfo,pendingChildren:null,implementation:d.implementation},_}function qh(d,_,$,I,B){this.tag=_,this.containerInfo=d,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=ft,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=_u(0),this.expirationTimes=_u(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=_u(0),this.identifierPrefix=I,this.onRecoverableError=B,He&&(this.mutableSourceEagerHydrationData=null)}function yd(d,_,$,I,B,W,de,Oe,Ze){return d=new qh(d,_,$,Oe,Ze),_===1?(_=1,W===!0&&(_|=8)):_=0,W=_o(3,null,null,_),d.current=W,W.stateNode=d,W.memoizedState={element:I,isDehydrated:$,cache:null,transitions:null},dd(W),d}function Ta(d){if(!d)return Gr;d=d._reactInternals;e:{if(oe(d)!==d||d.tag!==1)throw Error(l(170));var _=d;do{switch(_.tag){case 3:_=_.stateNode.context;break e;case 1:if(gs(_.type)){_=_.stateNode.__reactInternalMemoizedMergedChildContext;break e}}_=_.return}while(_!==null);throw Error(l(171))}if(d.tag===1){var $=d.type;if(gs($))return fc(d,$,_)}return _}function Sa(d){var _=d._reactInternals;if(_===void 0)throw typeof d.render=="function"?Error(l(188)):(d=Object.keys(d).join(","),Error(l(268,d)));return d=q(_),d===null?null:d.stateNode}function Qh(d,_){if(d=d.memoizedState,d!==null&&d.dehydrated!==null){var $=d.retryLane;d.retryLane=$!==0&&$<_?$:_}}function Ec(d,_){Qh(d,_),(d=d.alternate)&&Qh(d,_)}function Hf(d){return d=q(d),d===null?null:d.stateNode}function x(){return null}return t.attemptContinuousHydration=function(d){if(d.tag===13){var _=bs();Ya(d,134217728,_),Ec(d,134217728)}},t.attemptHydrationAtCurrentPriority=function(d){if(d.tag===13){var _=bs(),$=Os(d);Ya(d,$,_),Ec(d,$)}},t.attemptSynchronousHydration=function(d){switch(d.tag){case 3:var _=d.stateNode;if(_.current.memoizedState.isDehydrated){var $=xi(_.pendingLanes);$!==0&&(br(_,$|1),fn(_,_s()),!(tr&6)&&(Mu(),ha()))}break;case 13:var I=bs();Ft(function(){return Ya(d,1,I)}),Ec(d,1)}},t.batchedUpdates=function(d,_){var $=tr;tr|=1;try{return d(_)}finally{tr=$,tr===0&&(Mu(),Uu&&ha())}},t.createComponentSelector=function(d){return{$$typeof:ou,value:d}},t.createContainer=function(d,_,$,I,B,W,de){return yd(d,_,!1,null,$,I,B,W,de)},t.createHasPseudoClassSelector=function(d){return{$$typeof:Ju,value:d}},t.createHydrationContainer=function(d,_,$,I,B,W,de,Oe,Ze){return d=yd($,I,!0,d,B,W,de,Oe,Ze),d.context=Ta(null),$=d.current,I=bs(),B=Os($),W=Vi(I,B),W.callback=_??null,Pa($,W),d.current.lanes=B,xl(d,B,I),fn(d,I),d},t.createPortal=function(d,_,$){var I=3=wt&&W>=cn&&B<=Qt&&de<=bn){d.splice(_,1);break}else if(I!==wt||$.width!==Ze.width||bnde){if(!(W!==cn||$.height!==Ze.height||QtB)){wt>I&&(Ze.width+=wt-I,Ze.x=I),QtW&&(Ze.height+=cn-W,Ze.y=W),bn$&&($=de)),de<_.length))for(W=W.child;W!==null;)d.push(W,de),W=W.sibling}if($<_.length){for(d=[];$<_.length;$++)d.push(ja(_[$]));return`findAllNodes was able to match part of the selector: +`+W.stack}return{value:d,source:_,stack:B}}function Rl(d,_){try{console.error(_.value)}catch($){setTimeout(function(){throw $})}}var Wc=typeof WeakMap=="function"?WeakMap:Map;function kl(d,_,$){$=Vi(-1,$),$.tag=3,$.payload={element:null};var I=_.value;return $.callback=function(){Au||(Au=!0,fo=I),Rl(d,_)},$}function Vc(d,_,$){$=Vi(-1,$),$.tag=3;var I=d.type.getDerivedStateFromError;if(typeof I=="function"){var B=_.value;$.payload=function(){return I(B)},$.callback=function(){Rl(d,_)}}var W=d.stateNode;return W!==null&&typeof W.componentDidCatch=="function"&&($.callback=function(){Rl(d,_),typeof I!="function"&&(po===null?po=new Set([this]):po.add(this));var de=_.stack;this.componentDidCatch(_.value,{componentStack:de!==null?de:""})}),$}function _c(d,_,$){var I=d.pingCache;if(I===null){I=d.pingCache=new Wc;var B=new Set;I.set(_,B)}else B=I.get(_),B===void 0&&(B=new Set,I.set(_,B));B.has($)||(B.add($),d=ia.bind(null,d,_,$),_.then(d,d))}function kd(d){do{var _;if((_=d.tag===13)&&(_=d.memoizedState,_=_!==null?_.dehydrated!==null:!0),_)return d;d=d.return}while(d!==null);return null}function Ga(d,_,$,I,B){return d.mode&1?(d.flags|=65536,d.lanes=B,d):(d===_?d.flags|=65536:(d.flags|=128,$.flags|=131072,$.flags&=-52805,$.tag===1&&($.alternate===null?$.tag=17:(_=Vi(-1,1),_.tag=2,Pa($,_))),$.lanes|=1),d)}function Vr(d){d.flags|=4}function ul(d,_){if(d!==null&&d.child===_.child)return!0;if(_.flags&16)return!1;for(d=_.child;d!==null;){if(d.flags&12854||d.subtreeFlags&12854)return!1;d=d.sibling}return!0}var Zi,ma,X,xs;if(ze)Zi=function(d,_){for(var $=_.child;$!==null;){if($.tag===5||$.tag===6)Te(d,$.stateNode);else if($.tag!==4&&$.child!==null){$.child.return=$,$=$.child;continue}if($===_)break;for(;$.sibling===null;){if($.return===null||$.return===_)return;$=$.return}$.sibling.return=$.return,$=$.sibling}},ma=function(){},X=function(d,_,$,I,B){if(d=d.memoizedProps,d!==I){var W=_.stateNode,de=tu(Fr.current);$=Ie(W,$,d,I,B,de),(_.updateQueue=$)&&Vr(_)}},xs=function(d,_,$,I){$!==I&&Vr(_)};else if($e){Zi=function(d,_,$,I){for(var B=_.child;B!==null;){if(B.tag===5){var W=B.stateNode;$&&I&&(W=ne(W,B.type,B.memoizedProps,B)),Te(d,W)}else if(B.tag===6)W=B.stateNode,$&&I&&(W=Se(W,B.memoizedProps,B)),Te(d,W);else if(B.tag!==4){if(B.tag===22&&B.memoizedState!==null)W=B.child,W!==null&&(W.return=B),Zi(d,B,!0,!0);else if(B.child!==null){B.child.return=B,B=B.child;continue}}if(B===_)break;for(;B.sibling===null;){if(B.return===null||B.return===_)return;B=B.return}B.sibling.return=B.return,B=B.sibling}};var ga=function(d,_,$,I){for(var B=_.child;B!==null;){if(B.tag===5){var W=B.stateNode;$&&I&&(W=ne(W,B.type,B.memoizedProps,B)),Ei(d,W)}else if(B.tag===6)W=B.stateNode,$&&I&&(W=Se(W,B.memoizedProps,B)),Ei(d,W);else if(B.tag!==4){if(B.tag===22&&B.memoizedState!==null)W=B.child,W!==null&&(W.return=B),ga(d,B,!0,!0);else if(B.child!==null){B.child.return=B,B=B.child;continue}}if(B===_)break;for(;B.sibling===null;){if(B.return===null||B.return===_)return;B=B.return}B.sibling.return=B.return,B=B.sibling}};ma=function(d,_){var $=_.stateNode;if(!ul(d,_)){d=$.containerInfo;var I=Pr(d);ga(I,_,!1,!1),$.pendingChildren=I,Vr(_),xr(d,I)}},X=function(d,_,$,I,B){var W=d.stateNode,de=d.memoizedProps;if((d=ul(d,_))&&de===I)_.stateNode=W;else{var ke=_.stateNode,et=tu(Fr.current),wt=null;de!==I&&(wt=Ie(ke,$,de,I,B,et)),d&&wt===null?_.stateNode=W:(W=ii(W,wt,$,de,I,_,d,ke),Fe(W,$,I,B,et)&&Vr(_),_.stateNode=W,d?Vr(_):Zi(W,_,!1,!1))}},xs=function(d,_,$,I){$!==I?(d=tu(za.current),$=tu(Fr.current),_.stateNode=Re(I,d,$,_),Vr(_)):_.stateNode=d.stateNode}}else ma=function(){},X=function(){},xs=function(){};function Cr(d,_){if(!ji)switch(d.tailMode){case"hidden":_=d.tail;for(var $=null;_!==null;)_.alternate!==null&&($=_),_=_.sibling;$===null?d.tail=null:$.sibling=null;break;case"collapsed":$=d.tail;for(var I=null;$!==null;)$.alternate!==null&&(I=$),$=$.sibling;I===null?_||d.tail===null?d.tail=null:d.tail.sibling=null:I.sibling=null}}function mn(d){var _=d.alternate!==null&&d.alternate.child===d.child,$=0,I=0;if(_)for(var B=d.child;B!==null;)$|=B.lanes|B.childLanes,I|=B.subtreeFlags&14680064,I|=B.flags&14680064,B.return=d,B=B.sibling;else for(B=d.child;B!==null;)$|=B.lanes|B.childLanes,I|=B.subtreeFlags,I|=B.flags,B.return=d,B=B.sibling;return d.subtreeFlags|=I,d.childLanes=$,_}function zf(d,_,$){var I=_.pendingProps;switch(Wr(_),_.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return mn(_),null;case 1:return gs(_.type)&&tl(),mn(_),null;case 3:return I=_.stateNode,bh(),In(Pi),In(yr),Ot(),I.pendingContext&&(I.context=I.pendingContext,I.pendingContext=null),(d===null||d.child===null)&&(Fc(_)?Vr(_):d===null||d.memoizedState.isDehydrated&&!(_.flags&256)||(_.flags|=1024,Eu!==null&&(vi(Eu),Eu=null))),ma(d,_),mn(_),null;case 5:pi(_),$=tu(za.current);var B=_.type;if(d!==null&&_.stateNode!=null)X(d,_,B,I,$),d.ref!==_.ref&&(_.flags|=512,_.flags|=2097152);else{if(!I){if(_.stateNode===null)throw Error(l(166));return mn(_),null}if(d=tu(Fr.current),Fc(_)){if(!He)throw Error(l(175));d=Wn(_.stateNode,_.type,_.memoizedProps,$,d,_,!fa),_.updateQueue=d,d!==null&&Vr(_)}else{var W=fe(B,I,$,d,_);Zi(W,_,!1,!1),_.stateNode=W,Fe(W,B,I,$,d)&&Vr(_)}_.ref!==null&&(_.flags|=512,_.flags|=2097152)}return mn(_),null;case 6:if(d&&_.stateNode!=null)xs(d,_,d.memoizedProps,I);else{if(typeof I!="string"&&_.stateNode===null)throw Error(l(166));if(d=tu(za.current),$=tu(Fr.current),Fc(_)){if(!He)throw Error(l(176));if(d=_.stateNode,I=_.memoizedProps,($=rr(d,I,_,!fa))&&(B=Ai,B!==null))switch(W=(B.mode&1)!==0,B.tag){case 3:Eo(B.stateNode.containerInfo,d,I,W);break;case 5:Yl(B.type,B.memoizedProps,B.stateNode,d,I,W)}$&&Vr(_)}else _.stateNode=Re(I,d,$,_)}return mn(_),null;case 13:if(In(ye),I=_.memoizedState,ji&&Sr!==null&&_.mode&1&&!(_.flags&128)){for(d=Sr;d;)d=_t(d);return zh(),_.flags|=98560,_}if(I!==null&&I.dehydrated!==null){if(I=Fc(_),d===null){if(!I)throw Error(l(318));if(!He)throw Error(l(344));if(d=_.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(l(317));_r(d,_)}else zh(),!(_.flags&128)&&(_.memoizedState=null),_.flags|=4;return mn(_),null}return Eu!==null&&(vi(Eu),Eu=null),_.flags&128?(_.lanes=$,_):(I=I!==null,$=!1,d===null?Fc(_):$=d.memoizedState!==null,I&&!$&&(_.child.flags|=8192,_.mode&1&&(d===null||ye.current&1?ts===0&&(ts=3):qc())),_.updateQueue!==null&&(_.flags|=4),mn(_),null);case 4:return bh(),ma(d,_),d===null&&st(_.stateNode.containerInfo),mn(_),null;case 10:return sl(_.type._context),mn(_),null;case 17:return gs(_.type)&&tl(),mn(_),null;case 19:if(In(ye),B=_.memoizedState,B===null)return mn(_),null;if(I=(_.flags&128)!==0,W=B.rendering,W===null)if(I)Cr(B,!1);else{if(ts!==0||d!==null&&d.flags&128)for(d=_.child;d!==null;){if(W=je(d),W!==null){for(_.flags|=128,Cr(B,!1),d=W.updateQueue,d!==null&&(_.updateQueue=d,_.flags|=4),_.subtreeFlags=0,d=$,I=_.child;I!==null;)$=I,B=d,$.flags&=14680066,W=$.alternate,W===null?($.childLanes=0,$.lanes=B,$.child=null,$.subtreeFlags=0,$.memoizedProps=null,$.memoizedState=null,$.updateQueue=null,$.dependencies=null,$.stateNode=null):($.childLanes=W.childLanes,$.lanes=W.lanes,$.child=W.child,$.subtreeFlags=0,$.deletions=null,$.memoizedProps=W.memoizedProps,$.memoizedState=W.memoizedState,$.updateQueue=W.updateQueue,$.type=W.type,B=W.dependencies,$.dependencies=B===null?null:{lanes:B.lanes,firstContext:B.firstContext}),I=I.sibling;return Ir(ye,ye.current&1|2),_.child}d=d.sibling}B.tail!==null&&_s()>ba&&(_.flags|=128,I=!0,Cr(B,!1),_.lanes=4194304)}else{if(!I)if(d=je(W),d!==null){if(_.flags|=128,I=!0,d=d.updateQueue,d!==null&&(_.updateQueue=d,_.flags|=4),Cr(B,!0),B.tail===null&&B.tailMode==="hidden"&&!W.alternate&&!ji)return mn(_),null}else 2*_s()-B.renderingStartTime>ba&&$!==1073741824&&(_.flags|=128,I=!0,Cr(B,!1),_.lanes=4194304);B.isBackwards?(W.sibling=_.child,_.child=W):(d=B.last,d!==null?d.sibling=W:_.child=W,B.last=W)}return B.tail!==null?(_=B.tail,B.rendering=_,B.tail=_.sibling,B.renderingStartTime=_s(),_.sibling=null,d=ye.current,Ir(ye,I?d&1|2:d&1),_):(mn(_),null);case 22:case 23:return pl(),I=_.memoizedState!==null,d!==null&&d.memoizedState!==null!==I&&(_.flags|=8192),I&&_.mode&1?Mo&1073741824&&(mn(_),ze&&_.subtreeFlags&6&&(_.flags|=8192)):mn(_),null;case 24:return null;case 25:return null}throw Error(l(156,_.tag))}var cl=u.ReactCurrentOwner,Ri=!1;function hi(d,_,$,I){_.child=d===null?Uc(_,null,$,I):zc(_,d.child,$,I)}function es(d,_,$,I,B){$=$.render;var W=_.ref;return Ci(_,B),I=qn(d,_,$,I,W,B),$=pa(),d!==null&&!Ri?(_.updateQueue=d.updateQueue,_.flags&=-2053,d.lanes&=~B,gi(d,_,B)):(ji&&$&&Fh(_),_.flags|=1,hi(d,_,I,B),_.child)}function ss(d,_,$,I,B){if(d===null){var W=$.type;return typeof W=="function"&&!rc(W)&&W.defaultProps===void 0&&$.compare===null&&$.defaultProps===void 0?(_.tag=15,_.type=W,jc(d,_,W,I,B)):(d=Pl($.type,null,I,_,_.mode,B),d.ref=_.ref,d.return=_,_.child=d)}if(W=d.child,!(d.lanes&B)){var de=W.memoizedProps;if($=$.compare,$=$!==null?$:wr,$(de,I)&&d.ref===_.ref)return gi(d,_,B)}return _.flags|=1,d=vo(W,I),d.ref=_.ref,d.return=_,_.child=d}function jc(d,_,$,I,B){if(d!==null&&wr(d.memoizedProps,I)&&d.ref===_.ref)if(Ri=!1,(d.lanes&B)!==0)d.flags&131072&&(Ri=!0);else return _.lanes=d.lanes,gi(d,_,B);return os(d,_,$,I,B)}function _a(d,_,$){var I=_.pendingProps,B=I.children,W=d!==null?d.memoizedState:null;if(I.mode==="hidden")if(!(_.mode&1))_.memoizedState={baseLanes:0,cachePool:null},Ir(us,Mo),Mo|=$;else if($&1073741824)_.memoizedState={baseLanes:0,cachePool:null},I=W!==null?W.baseLanes:$,Ir(us,Mo),Mo|=I;else return d=W!==null?W.baseLanes|$:$,_.lanes=_.childLanes=1073741824,_.memoizedState={baseLanes:d,cachePool:null},_.updateQueue=null,Ir(us,Mo),Mo|=d,null;else W!==null?(I=W.baseLanes|$,_.memoizedState=null):I=$,Ir(us,Mo),Mo|=I;return hi(d,_,B,$),_.child}function va(d,_){var $=_.ref;(d===null&&$!==null||d!==null&&d.ref!==$)&&(_.flags|=512,_.flags|=2097152)}function os(d,_,$,I,B){var W=gs($)?ws:yr.current;return W=fi(_,W),Ci(_,B),$=qn(d,_,$,I,W,B),I=pa(),d!==null&&!Ri?(_.updateQueue=d.updateQueue,_.flags&=-2053,d.lanes&=~B,gi(d,_,B)):(ji&&I&&Fh(_),_.flags|=1,hi(d,_,$,B),_.child)}function Yc(d,_,$,I,B){if(gs($)){var W=!0;pc(_)}else W=!1;if(Ci(_,B),_.stateNode===null)d!==null&&(d.alternate=null,_.alternate=null,_.flags|=2),Tp(_,$,I),Jl(_,$,I,B),I=!0;else if(d===null){var de=_.stateNode,ke=_.memoizedProps;de.props=ke;var et=de.context,wt=$.contextType;typeof wt=="object"&&wt!==null?wt=Vn(wt):(wt=gs($)?ws:yr.current,wt=fi(_,wt));var Zt=$.getDerivedStateFromProps,cn=typeof Zt=="function"||typeof de.getSnapshotBeforeUpdate=="function";cn||typeof de.UNSAFE_componentWillReceiveProps!="function"&&typeof de.componentWillReceiveProps!="function"||(ke!==I||et!==wt)&&Md(_,de,I,wt),Xr=!1;var bn=_.memoizedState;de.state=bn,Qo(_,I,de,B),et=_.memoizedState,ke!==I||bn!==et||Pi.current||Xr?(typeof Zt=="function"&&(Bc(_,$,Zt,I),et=_.memoizedState),(ke=Xr||Bf(_,$,ke,I,bn,et,wt))?(cn||typeof de.UNSAFE_componentWillMount!="function"&&typeof de.componentWillMount!="function"||(typeof de.componentWillMount=="function"&&de.componentWillMount(),typeof de.UNSAFE_componentWillMount=="function"&&de.UNSAFE_componentWillMount()),typeof de.componentDidMount=="function"&&(_.flags|=4194308)):(typeof de.componentDidMount=="function"&&(_.flags|=4194308),_.memoizedProps=I,_.memoizedState=et),de.props=I,de.state=et,de.context=wt,I=ke):(typeof de.componentDidMount=="function"&&(_.flags|=4194308),I=!1)}else{de=_.stateNode,wu(d,_),ke=_.memoizedProps,wt=_.type===_.elementType?ke:bi(_.type,ke),de.props=wt,cn=_.pendingProps,bn=de.context,et=$.contextType,typeof et=="object"&&et!==null?et=Vn(et):(et=gs($)?ws:yr.current,et=fi(_,et));var Tn=$.getDerivedStateFromProps;(Zt=typeof Tn=="function"||typeof de.getSnapshotBeforeUpdate=="function")||typeof de.UNSAFE_componentWillReceiveProps!="function"&&typeof de.componentWillReceiveProps!="function"||(ke!==cn||bn!==et)&&Md(_,de,I,et),Xr=!1,bn=_.memoizedState,de.state=bn,Qo(_,I,de,B);var gn=_.memoizedState;ke!==cn||bn!==gn||Pi.current||Xr?(typeof Tn=="function"&&(Bc(_,$,Tn,I),gn=_.memoizedState),(wt=Xr||Bf(_,$,wt,I,bn,gn,et)||!1)?(Zt||typeof de.UNSAFE_componentWillUpdate!="function"&&typeof de.componentWillUpdate!="function"||(typeof de.componentWillUpdate=="function"&&de.componentWillUpdate(I,gn,et),typeof de.UNSAFE_componentWillUpdate=="function"&&de.UNSAFE_componentWillUpdate(I,gn,et)),typeof de.componentDidUpdate=="function"&&(_.flags|=4),typeof de.getSnapshotBeforeUpdate=="function"&&(_.flags|=1024)):(typeof de.componentDidUpdate!="function"||ke===d.memoizedProps&&bn===d.memoizedState||(_.flags|=4),typeof de.getSnapshotBeforeUpdate!="function"||ke===d.memoizedProps&&bn===d.memoizedState||(_.flags|=1024),_.memoizedProps=I,_.memoizedState=gn),de.props=I,de.state=gn,de.context=et,I=wt):(typeof de.componentDidUpdate!="function"||ke===d.memoizedProps&&bn===d.memoizedState||(_.flags|=4),typeof de.getSnapshotBeforeUpdate!="function"||ke===d.memoizedProps&&bn===d.memoizedState||(_.flags|=1024),I=!1)}return na(d,_,$,I,W,B)}function na(d,_,$,I,B,W){va(d,_);var de=(_.flags&128)!==0;if(!I&&!de)return B&&Xs(_,$,!1),gi(d,_,W);I=_.stateNode,cl.current=_;var ke=de&&typeof $.getDerivedStateFromError!="function"?null:I.render();return _.flags|=1,d!==null&&de?(_.child=zc(_,d.child,null,W),_.child=zc(_,null,ke,W)):hi(d,_,ke,W),_.memoizedState=I.state,B&&Xs(_,$,!0),_.child}function Od(d){var _=d.stateNode;_.pendingContext?Na(d,_.pendingContext,_.pendingContext!==_.context):_.context&&Na(d,_.context,!1),xu(d,_.containerInfo)}function Ld(d,_,$,I,B){return zh(),Vu(B),_.flags|=256,hi(d,_,$,I),_.child}var Yh={dehydrated:null,treeContext:null,retryLane:0};function Gs(d){return{baseLanes:d,cachePool:null}}function Kn(d,_,$){var I=_.pendingProps,B=ye.current,W=!1,de=(_.flags&128)!==0,ke;if((ke=de)||(ke=d!==null&&d.memoizedState===null?!1:(B&2)!==0),ke?(W=!0,_.flags&=-129):(d===null||d.memoizedState!==null)&&(B|=1),Ir(ye,B&1),d===null)return Wu(_),d=_.memoizedState,d!==null&&(d=d.dehydrated,d!==null)?(_.mode&1?Nn(d)?_.lanes=8:_.lanes=1073741824:_.lanes=1,null):(B=I.children,d=I.fallback,W?(I=_.mode,W=_.child,B={mode:"hidden",children:B},!(I&1)&&W!==null?(W.childLanes=0,W.pendingProps=B):W=uu(B,I,0,null),d=Xa(d,I,$,null),W.return=_,d.return=_,W.sibling=d,_.child=W,_.child.memoizedState=Gs($),_.memoizedState=Yh,d):Ws(_,B));if(B=d.memoizedState,B!==null){if(ke=B.dehydrated,ke!==null){if(de)return _.flags&256?(_.flags&=-257,iu(d,_,$,Error(l(422)))):_.memoizedState!==null?(_.child=d.child,_.flags|=128,null):(W=I.fallback,B=_.mode,I=uu({mode:"visible",children:I.children},B,0,null),W=Xa(W,B,$,null),W.flags|=2,I.return=_,W.return=_,I.sibling=W,_.child=I,_.mode&1&&zc(_,d.child,null,$),_.child.memoizedState=Gs($),_.memoizedState=Yh,W);if(!(_.mode&1))_=iu(d,_,$,null);else if(Nn(ke))_=iu(d,_,$,Error(l(419)));else if(I=($&d.childLanes)!==0,Ri||I){if(I=Nr,I!==null){switch($&-$){case 4:W=2;break;case 16:W=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:W=32;break;case 536870912:W=268435456;break;default:W=0}I=W&(I.suspendedLanes|$)?0:W,I!==0&&I!==B.retryLane&&(B.retryLane=I,Ya(d,I,-1))}qc(),_=iu(d,_,$,Error(l(421)))}else sn(ke)?(_.flags|=128,_.child=d.child,_=go.bind(null,d),De(ke,_),_=null):($=B.treeContext,He&&(Sr=Wt(ke),Ai=_,ji=!0,Eu=null,fa=!1,$!==null&&(ci[Er++]=Fa,ci[Er++]=Bo,ci[Er++]=oo,Fa=$.id,Bo=$.overflow,oo=_)),_=Ws(_,_.pendingProps.children),_.flags|=4096);return _}return W?(I=Ui(d,_,I.children,I.fallback,$),W=_.child,B=d.child.memoizedState,W.memoizedState=B===null?Gs($):{baseLanes:B.baseLanes|$,cachePool:null},W.childLanes=d.childLanes&~$,_.memoizedState=Yh,I):($=Js(d,_,I.children,$),_.memoizedState=null,$)}return W?(I=Ui(d,_,I.children,I.fallback,$),W=_.child,B=d.child.memoizedState,W.memoizedState=B===null?Gs($):{baseLanes:B.baseLanes|$,cachePool:null},W.childLanes=d.childLanes&~$,_.memoizedState=Yh,I):($=Js(d,_,I.children,$),_.memoizedState=null,$)}function Ws(d,_){return _=uu({mode:"visible",children:_},d.mode,0,null),_.return=d,d.child=_}function Js(d,_,$,I){var B=d.child;return d=B.sibling,$=vo(B,{mode:"visible",children:$}),!(_.mode&1)&&($.lanes=I),$.return=_,$.sibling=null,d!==null&&(I=_.deletions,I===null?(_.deletions=[d],_.flags|=16):I.push(d)),_.child=$}function Ui(d,_,$,I,B){var W=_.mode;d=d.child;var de=d.sibling,ke={mode:"hidden",children:$};return!(W&1)&&_.child!==d?($=_.child,$.childLanes=0,$.pendingProps=ke,_.deletions=null):($=vo(d,ke),$.subtreeFlags=d.subtreeFlags&14680064),de!==null?I=vo(de,I):(I=Xa(I,W,B,null),I.flags|=2),I.return=_,$.return=_,$.sibling=I,_.child=$,I}function iu(d,_,$,I){return I!==null&&Vu(I),zc(_,d.child,null,$),d=Ws(_,_.pendingProps.children),d.flags|=2,_.memoizedState=null,d}function Fo(d,_,$){d.lanes|=_;var I=d.alternate;I!==null&&(I.lanes|=_),Bi(d.return,_,$)}function $n(d,_,$,I,B){var W=d.memoizedState;W===null?d.memoizedState={isBackwards:_,rendering:null,renderingStartTime:0,last:I,tail:$,tailMode:B}:(W.isBackwards=_,W.rendering=null,W.renderingStartTime=0,W.last=I,W.tail=$,W.tailMode=B)}function mi(d,_,$){var I=_.pendingProps,B=I.revealOrder,W=I.tail;if(hi(d,_,I.children,$),I=ye.current,I&2)I=I&1|2,_.flags|=128;else{if(d!==null&&d.flags&128)e:for(d=_.child;d!==null;){if(d.tag===13)d.memoizedState!==null&&Fo(d,$,_);else if(d.tag===19)Fo(d,$,_);else if(d.child!==null){d.child.return=d,d=d.child;continue}if(d===_)break e;for(;d.sibling===null;){if(d.return===null||d.return===_)break e;d=d.return}d.sibling.return=d.return,d=d.sibling}I&=1}if(Ir(ye,I),!(_.mode&1))_.memoizedState=null;else switch(B){case"forwards":for($=_.child,B=null;$!==null;)d=$.alternate,d!==null&&je(d)===null&&(B=$),$=$.sibling;$=B,$===null?(B=_.child,_.child=null):(B=$.sibling,$.sibling=null),$n(_,!1,B,$,W);break;case"backwards":for($=null,B=_.child,_.child=null;B!==null;){if(d=B.alternate,d!==null&&je(d)===null){_.child=B;break}d=B.sibling,B.sibling=$,$=B,B=d}$n(_,!0,$,null,W);break;case"together":$n(_,!1,null,null,void 0);break;default:_.memoizedState=null}return _.child}function gi(d,_,$){if(d!==null&&(_.dependencies=d.dependencies),qu|=_.lanes,!($&_.childLanes))return null;if(d!==null&&_.child!==d.child)throw Error(l(153));if(_.child!==null){for(d=_.child,$=vo(d,d.pendingProps),_.child=$,$.return=_;d.sibling!==null;)d=d.sibling,$=$.sibling=vo(d,d.pendingProps),$.return=_;$.sibling=null}return _.child}function Uf(d,_,$){switch(_.tag){case 3:Od(_),zh();break;case 5:Ad(_);break;case 1:gs(_.type)&&pc(_);break;case 4:xu(_,_.stateNode.containerInfo);break;case 10:Su(_,_.type._context,_.memoizedProps.value);break;case 13:var I=_.memoizedState;if(I!==null)return I.dehydrated!==null?(Ir(ye,ye.current&1),_.flags|=128,null):$&_.child.childLanes?Kn(d,_,$):(Ir(ye,ye.current&1),d=gi(d,_,$),d!==null?d.sibling:null);Ir(ye,ye.current&1);break;case 19:if(I=($&_.childLanes)!==0,d.flags&128){if(I)return mi(d,_,$);_.flags|=128}var B=_.memoizedState;if(B!==null&&(B.rendering=null,B.tail=null,B.lastEffect=null),Ir(ye,ye.current),I)break;return null;case 22:case 23:return _.lanes=0,_a(d,_,$)}return gi(d,_,$)}function wh(d,_){switch(Wr(_),_.tag){case 1:return gs(_.type)&&tl(),d=_.flags,d&65536?(_.flags=d&-65537|128,_):null;case 3:return bh(),In(Pi),In(yr),Ot(),d=_.flags,d&65536&&!(d&128)?(_.flags=d&-65537|128,_):null;case 5:return pi(_),null;case 13:if(In(ye),d=_.memoizedState,d!==null&&d.dehydrated!==null){if(_.alternate===null)throw Error(l(340));zh()}return d=_.flags,d&65536?(_.flags=d&-65537|128,_):null;case 19:return In(ye),null;case 4:return bh(),null;case 10:return sl(_.type._context),null;case 22:case 23:return pl(),null;case 24:return null;default:return null}}var co=!1,ya=!1,Mn=typeof WeakSet=="function"?WeakSet:Set,yn=null;function hl(d,_){var $=d.ref;if($!==null)if(typeof $=="function")try{$(null)}catch(I){Qs(d,_,I)}else $.current=null}function vc(d,_,$){try{$()}catch(I){Qs(d,_,I)}}var wp=!1;function su(d,_){for(re(d.containerInfo),yn=_;yn!==null;)if(d=yn,_=d.child,(d.subtreeFlags&1028)!==0&&_!==null)_.return=d,yn=_;else for(;yn!==null;){d=yn;try{var $=d.alternate;if(d.flags&1024)switch(d.tag){case 0:case 11:case 15:break;case 1:if($!==null){var I=$.memoizedProps,B=$.memoizedState,W=d.stateNode,de=W.getSnapshotBeforeUpdate(d.elementType===d.type?I:bi(d.type,I),B);W.__reactInternalSnapshotBeforeUpdate=de}break;case 3:ze&&xn(d.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(l(163))}}catch(ke){Qs(d,d.return,ke)}if(_=d.sibling,_!==null){_.return=d.return,yn=_;break}yn=d.return}return $=wp,wp=!1,$}function $o(d,_,$){var I=_.updateQueue;if(I=I!==null?I.lastEffect:null,I!==null){var B=I=I.next;do{if((B.tag&d)===d){var W=B.destroy;B.destroy=void 0,W!==void 0&&vc(_,$,W)}B=B.next}while(B!==I)}}function ys(d,_){if(_=_.updateQueue,_=_!==null?_.lastEffect:null,_!==null){var $=_=_.next;do{if(($.tag&d)===d){var I=$.create;$.destroy=I()}$=$.next}while($!==_)}}function dl(d){var _=d.ref;if(_!==null){var $=d.stateNode;switch(d.tag){case 5:d=ge($);break;default:d=$}typeof _=="function"?_(d):_.current=d}}function as(d,_,$){if(yu&&typeof yu.onCommitFiberUnmount=="function")try{yu.onCommitFiberUnmount(ca,_)}catch{}switch(_.tag){case 0:case 11:case 14:case 15:if(d=_.updateQueue,d!==null&&(d=d.lastEffect,d!==null)){var I=d=d.next;do{var B=I,W=B.destroy;B=B.tag,W!==void 0&&(B&2||B&4)&&vc(_,$,W),I=I.next}while(I!==d)}break;case 1:if(hl(_,$),d=_.stateNode,typeof d.componentWillUnmount=="function")try{d.props=_.memoizedProps,d.state=_.memoizedState,d.componentWillUnmount()}catch(de){Qs(_,$,de)}break;case 5:hl(_,$);break;case 4:ze?Kh(d,_,$):$e&&$e&&(_=_.stateNode.containerInfo,$=Pr(_),mr(_,$))}}function fl(d,_,$){for(var I=_;;)if(as(d,I,$),I.child===null||ze&&I.tag===4){if(I===_)break;for(;I.sibling===null;){if(I.return===null||I.return===_)return;I=I.return}I.sibling.return=I.return,I=I.sibling}else I.child.return=I,I=I.child}function zo(d){var _=d.alternate;_!==null&&(d.alternate=null,zo(_)),d.child=null,d.deletions=null,d.sibling=null,d.tag===5&&(_=d.stateNode,_!==null&&kt(_)),d.stateNode=null,d.return=null,d.dependencies=null,d.memoizedProps=null,d.memoizedState=null,d.pendingProps=null,d.stateNode=null,d.updateQueue=null}function Xh(d){return d.tag===5||d.tag===3||d.tag===4}function Wa(d){e:for(;;){for(;d.sibling===null;){if(d.return===null||Xh(d.return))return null;d=d.return}for(d.sibling.return=d.return,d=d.sibling;d.tag!==5&&d.tag!==6&&d.tag!==18;){if(d.flags&2||d.child===null||d.tag===4)continue e;d.child.return=d,d=d.child}if(!(d.flags&2))return d.stateNode}}function ki(d){if(ze){e:{for(var _=d.return;_!==null;){if(Xh(_))break e;_=_.return}throw Error(l(160))}var $=_;switch($.tag){case 5:_=$.stateNode,$.flags&32&&(Ge(_),$.flags&=-33),$=Wa(d),Xc(d,$,_);break;case 3:case 4:_=$.stateNode.containerInfo,$=Wa(d),Nd(d,$,_);break;default:throw Error(l(161))}}}function Nd(d,_,$){var I=d.tag;if(I===5||I===6)d=d.stateNode,_?Ae($,d,_):Ke($,d);else if(I!==4&&(d=d.child,d!==null))for(Nd(d,_,$),d=d.sibling;d!==null;)Nd(d,_,$),d=d.sibling}function Xc(d,_,$){var I=d.tag;if(I===5||I===6)d=d.stateNode,_?pe($,d,_):mt($,d);else if(I!==4&&(d=d.child,d!==null))for(Xc(d,_,$),d=d.sibling;d!==null;)Xc(d,_,$),d=d.sibling}function Kh(d,_,$){for(var I=_,B=!1,W,de;;){if(!B){B=I.return;e:for(;;){if(B===null)throw Error(l(160));switch(W=B.stateNode,B.tag){case 5:de=!1;break e;case 3:W=W.containerInfo,de=!0;break e;case 4:W=W.containerInfo,de=!0;break e}B=B.return}B=!0}if(I.tag===5||I.tag===6)fl(d,I,$),de?jt(W,I.stateNode):Je(W,I.stateNode);else if(I.tag===18)de?Ss(W,I.stateNode):Yr(W,I.stateNode);else if(I.tag===4){if(I.child!==null){W=I.stateNode.containerInfo,de=!0,I.child.return=I,I=I.child;continue}}else if(as(d,I,$),I.child!==null){I.child.return=I,I=I.child;continue}if(I===_)break;for(;I.sibling===null;){if(I.return===null||I.return===_)return;I=I.return,I.tag===4&&(B=!1)}I.sibling.return=I.return,I=I.sibling}}function Uo(d,_){if(ze){switch(_.tag){case 0:case 11:case 14:case 15:$o(3,_,_.return),ys(3,_),$o(5,_,_.return);return;case 1:return;case 5:var $=_.stateNode;if($!=null){var I=_.memoizedProps;d=d!==null?d.memoizedProps:I;var B=_.type,W=_.updateQueue;_.updateQueue=null,W!==null&&te($,W,B,d,I,_)}return;case 6:if(_.stateNode===null)throw Error(l(162));$=_.memoizedProps,Oe(_.stateNode,d!==null?d.memoizedProps:$,$);return;case 3:He&&d!==null&&d.memoizedState.isDehydrated&&si(_.stateNode.containerInfo);return;case 12:return;case 13:Co(_);return;case 19:Co(_);return;case 17:return}throw Error(l(163))}switch(_.tag){case 0:case 11:case 14:case 15:$o(3,_,_.return),ys(3,_),$o(5,_,_.return);return;case 12:return;case 13:Co(_);return;case 19:Co(_);return;case 3:He&&d!==null&&d.memoizedState.isDehydrated&&si(_.stateNode.containerInfo);break;case 22:case 23:return}e:if($e){switch(_.tag){case 1:case 5:case 6:break e;case 3:case 4:_=_.stateNode,mr(_.containerInfo,_.pendingChildren);break e}throw Error(l(163))}}function Co(d){var _=d.updateQueue;if(_!==null){d.updateQueue=null;var $=d.stateNode;$===null&&($=d.stateNode=new Mn),_.forEach(function(I){var B=Iu.bind(null,d,I);$.has(I)||($.add(I),I.then(B,B))})}}function df(d,_){for(yn=_;yn!==null;){_=yn;var $=_.deletions;if($!==null)for(var I=0;I<$.length;I++){var B=$[I];try{var W=d;ze?Kh(W,B,_):fl(W,B,_);var de=B.alternate;de!==null&&(de.return=null),B.return=null}catch(on){Qs(B,_,on)}}if($=_.child,_.subtreeFlags&12854&&$!==null)$.return=_,yn=$;else for(;yn!==null;){_=yn;try{var ke=_.flags;if(ke&32&&ze&&Ge(_.stateNode),ke&512){var et=_.alternate;if(et!==null){var wt=et.ref;wt!==null&&(typeof wt=="function"?wt(null):wt.current=null)}}if(ke&8192)switch(_.tag){case 13:if(_.memoizedState!==null){var Zt=_.alternate;(Zt===null||Zt.memoizedState===null)&&(vd=_s())}break;case 22:var cn=_.memoizedState!==null,bn=_.alternate,Tn=bn!==null&&bn.memoizedState!==null;if($=_,ze){e:if(I=$,B=cn,W=null,ze)for(var gn=I;;){if(gn.tag===5){if(W===null){W=gn;var Dr=gn.stateNode;B?qt(Dr):Jt(gn.stateNode,gn.memoizedProps)}}else if(gn.tag===6){if(W===null){var Tt=gn.stateNode;B?pt(Tt):Xt(Tt,gn.memoizedProps)}}else if((gn.tag!==22&&gn.tag!==23||gn.memoizedState===null||gn===I)&&gn.child!==null){gn.child.return=gn,gn=gn.child;continue}if(gn===I)break;for(;gn.sibling===null;){if(gn.return===null||gn.return===I)break e;W===gn&&(W=null),gn=gn.return}W===gn&&(W=null),gn.sibling.return=gn.return,gn=gn.sibling}}if(cn&&!Tn&&$.mode&1){yn=$;for(var Ce=$.child;Ce!==null;){for($=yn=Ce;yn!==null;){I=yn;var Le=I.child;switch(I.tag){case 0:case 11:case 14:case 15:$o(4,I,I.return);break;case 1:hl(I,I.return);var ot=I.stateNode;if(typeof ot.componentWillUnmount=="function"){var Ht=I.return;try{ot.props=I.memoizedProps,ot.state=I.memoizedState,ot.componentWillUnmount()}catch(on){Qs(I,Ht,on)}}break;case 5:hl(I,I.return);break;case 22:if(I.memoizedState!==null){yc($);continue}}Le!==null?(Le.return=I,yn=Le):yc($)}Ce=Ce.sibling}}}switch(ke&4102){case 2:ki(_),_.flags&=-3;break;case 6:ki(_),_.flags&=-3,Uo(_.alternate,_);break;case 4096:_.flags&=-4097;break;case 4100:_.flags&=-4097,Uo(_.alternate,_);break;case 4:Uo(_.alternate,_)}}catch(on){Qs(_,_.return,on)}if($=_.sibling,$!==null){$.return=_.return,yn=$;break}yn=_.return}}}function Cu(d,_,$){yn=d,Ol(d)}function Ol(d,_,$){for(var I=(d.mode&1)!==0;yn!==null;){var B=yn,W=B.child;if(B.tag===22&&I){var de=B.memoizedState!==null||co;if(!de){var ke=B.alternate,et=ke!==null&&ke.memoizedState!==null||ya;ke=co;var wt=ya;if(co=de,(ya=et)&&!wt)for(yn=B;yn!==null;)de=yn,et=de.child,de.tag===22&&de.memoizedState!==null?Kr(B):et!==null?(et.return=de,yn=et):Kr(B);for(;W!==null;)yn=W,Ol(W),W=W.sibling;yn=B,co=ke,ya=wt}_d(d)}else B.subtreeFlags&8772&&W!==null?(W.return=B,yn=W):_d(d)}}function _d(d){for(;yn!==null;){var _=yn;if(_.flags&8772){var $=_.alternate;try{if(_.flags&8772)switch(_.tag){case 0:case 11:case 15:ya||ys(5,_);break;case 1:var I=_.stateNode;if(_.flags&4&&!ya)if($===null)I.componentDidMount();else{var B=_.elementType===_.type?$.memoizedProps:bi(_.type,$.memoizedProps);I.componentDidUpdate(B,$.memoizedState,I.__reactInternalSnapshotBeforeUpdate)}var W=_.updateQueue;W!==null&&fd(_,W,I);break;case 3:var de=_.updateQueue;if(de!==null){if($=null,_.child!==null)switch(_.child.tag){case 5:$=ge(_.child.stateNode);break;case 1:$=_.child.stateNode}fd(_,de,$)}break;case 5:var ke=_.stateNode;$===null&&_.flags&4&&Q(ke,_.type,_.memoizedProps,_);break;case 6:break;case 4:break;case 12:break;case 13:if(He&&_.memoizedState===null){var et=_.alternate;if(et!==null){var wt=et.memoizedState;if(wt!==null){var Zt=wt.dehydrated;Zt!==null&&Br(Zt)}}}break;case 19:case 17:case 21:case 22:case 23:break;default:throw Error(l(163))}ya||_.flags&512&&dl(_)}catch(cn){Qs(_,_.return,cn)}}if(_===d){yn=null;break}if($=_.sibling,$!==null){$.return=_.return,yn=$;break}yn=_.return}}function yc(d){for(;yn!==null;){var _=yn;if(_===d){yn=null;break}var $=_.sibling;if($!==null){$.return=_.return,yn=$;break}yn=_.return}}function Kr(d){for(;yn!==null;){var _=yn;try{switch(_.tag){case 0:case 11:case 15:var $=_.return;try{ys(4,_)}catch(et){Qs(_,$,et)}break;case 1:var I=_.stateNode;if(typeof I.componentDidMount=="function"){var B=_.return;try{I.componentDidMount()}catch(et){Qs(_,B,et)}}var W=_.return;try{dl(_)}catch(et){Qs(_,W,et)}break;case 5:var de=_.return;try{dl(_)}catch(et){Qs(_,de,et)}}}catch(et){Qs(_,_.return,et)}if(_===d){yn=null;break}var ke=_.sibling;if(ke!==null){ke.return=_.return,yn=ke;break}yn=_.return}}var ou=0,Ju=1,ls=2,Va=3,$s=4;if(typeof Symbol=="function"&&Symbol.for){var Cs=Symbol.for;ou=Cs("selector.component"),Ju=Cs("selector.has_pseudo_class"),ls=Cs("selector.role"),Va=Cs("selector.test_id"),$s=Cs("selector.text")}function Kc(d){var _=it(d);if(_!=null){if(typeof _.memoizedProps["data-testname"]!="string")throw Error(l(364));return _}if(d=gt(d),d===null)throw Error(l(362));return d.stateNode.current}function _i(d,_){switch(_.$$typeof){case ou:if(d.type===_.value)return!0;break;case Ju:e:{_=_.value,d=[d,0];for(var $=0;$";case Ju:return":has("+(ja(d)||"")+")";case ls:return'[role="'+d.value+'"]';case $s:return'"'+d.value+'"';case Va:return'[data-testname="'+d.value+'"]';default:throw Error(l(365))}}function bc(d,_){var $=[];d=[d,0];for(var I=0;IB&&(B=de),I&=~W}if(I=B,I=_s()-I,I=(120>I?120:480>I?480:1080>I?1080:1920>I?1920:3e3>I?3e3:4320>I?4320:1960*Eh(I/1960))-I,10d?16:d,Ho===null)var I=!1;else{if(d=Ho,Ho=null,Zu=0,tr&6)throw Error(l(331));var B=tr;for(tr|=4,yn=d.current;yn!==null;){var W=yn,de=W.child;if(yn.flags&16){var ke=W.deletions;if(ke!==null){for(var et=0;et_s()-vd?jr(d,0):Qu|=$),fn(d,_)}function Ch(d,_){_===0&&(d.mode&1?(_=vr,vr<<=1,!(vr&130023424)&&(vr=4194304)):_=1);var $=bs();d=Vs(d,_),d!==null&&(xl(d,_,$),fn(d,$))}function go(d){var _=d.memoizedState,$=0;_!==null&&($=_.retryLane),Ch(d,$)}function Iu(d,_){var $=0;switch(d.tag){case 13:var I=d.stateNode,B=d.memoizedState;B!==null&&($=B.retryLane);break;case 19:I=d.stateNode;break;default:throw Error(l(314))}I!==null&&I.delete(_),Ch(d,$)}var eh;eh=function(d,_,$){if(d!==null)if(d.memoizedProps!==_.pendingProps||Pi.current)Ri=!0;else{if(!(d.lanes&$)&&!(_.flags&128))return Ri=!1,Uf(d,_,$);Ri=!!(d.flags&131072)}else Ri=!1,ji&&_.flags&1048576&&Ql(_,Ba,_.index);switch(_.lanes=0,_.tag){case 2:var I=_.type;d!==null&&(d.alternate=null,_.alternate=null,_.flags|=2),d=_.pendingProps;var B=fi(_,yr.current);Ci(_,$),B=qn(null,_,I,d,B,$);var W=pa();return _.flags|=1,typeof B=="object"&&B!==null&&typeof B.render=="function"&&B.$$typeof===void 0?(_.tag=1,_.memoizedState=null,_.updateQueue=null,gs(I)?(W=!0,pc(_)):W=!1,_.memoizedState=B.state!==null&&B.state!==void 0?B.state:null,dd(_),B.updater=uf,_.stateNode=B,B._reactInternals=_,Jl(_,I,d,$),_=na(null,_,I,!0,W,$)):(_.tag=0,ji&&W&&Fh(_),hi(null,_,B,$),_=_.child),_;case 16:I=_.elementType;e:{switch(d!==null&&(d.alternate=null,_.alternate=null,_.flags|=2),d=_.pendingProps,B=I._init,I=B(I._payload),_.type=I,B=_.tag=Dl(I),d=bi(I,d),B){case 0:_=os(null,_,I,d,$);break e;case 1:_=Yc(null,_,I,d,$);break e;case 11:_=es(null,_,I,d,$);break e;case 14:_=ss(null,_,I,bi(I.type,d),$);break e}throw Error(l(306,I,""))}return _;case 0:return I=_.type,B=_.pendingProps,B=_.elementType===I?B:bi(I,B),os(d,_,I,B,$);case 1:return I=_.type,B=_.pendingProps,B=_.elementType===I?B:bi(I,B),Yc(d,_,I,B,$);case 3:e:{if(Od(_),d===null)throw Error(l(387));I=_.pendingProps,W=_.memoizedState,B=W.element,wu(d,_),Qo(_,I,null,$);var de=_.memoizedState;if(I=de.element,He&&W.isDehydrated)if(W={element:I,isDehydrated:!1,cache:de.cache,transitions:de.transitions},_.updateQueue.baseState=W,_.memoizedState=W,_.flags&256){B=Error(l(423)),_=Ld(d,_,I,$,B);break e}else if(I!==B){B=Error(l(424)),_=Ld(d,_,I,$,B);break e}else for(He&&(Sr=bt(_.stateNode.containerInfo),Ai=_,ji=!0,Eu=null,fa=!1),$=Uc(_,null,I,$),_.child=$;$;)$.flags=$.flags&-3|4096,$=$.sibling;else{if(zh(),I===B){_=gi(d,_,$);break e}hi(d,_,I,$)}_=_.child}return _;case 5:return Ad(_),d===null&&Wu(_),I=_.type,B=_.pendingProps,W=d!==null?d.memoizedProps:null,de=B.children,qe(I,B)?de=null:W!==null&&qe(I,W)&&(_.flags|=32),va(d,_),hi(d,_,de,$),_.child;case 6:return d===null&&Wu(_),null;case 13:return Kn(d,_,$);case 4:return xu(_,_.stateNode.containerInfo),I=_.pendingProps,d===null?_.child=zc(_,null,I,$):hi(d,_,I,$),_.child;case 11:return I=_.type,B=_.pendingProps,B=_.elementType===I?B:bi(I,B),es(d,_,I,B,$);case 7:return hi(d,_,_.pendingProps,$),_.child;case 8:return hi(d,_,_.pendingProps.children,$),_.child;case 12:return hi(d,_,_.pendingProps.children,$),_.child;case 10:e:{if(I=_.type._context,B=_.pendingProps,W=_.memoizedProps,de=B.value,Su(_,I,de),W!==null)if(Es(W.value,de)){if(W.children===B.children&&!Pi.current){_=gi(d,_,$);break e}}else for(W=_.child,W!==null&&(W.return=_);W!==null;){var ke=W.dependencies;if(ke!==null){de=W.child;for(var et=ke.firstContext;et!==null;){if(et.context===I){if(W.tag===1){et=Vi(-1,$&-$),et.tag=2;var wt=W.updateQueue;if(wt!==null){wt=wt.shared;var Zt=wt.pending;Zt===null?et.next=et:(et.next=Zt.next,Zt.next=et),wt.pending=et}}W.lanes|=$,et=W.alternate,et!==null&&(et.lanes|=$),Bi(W.return,$,_),ke.lanes|=$;break}et=et.next}}else if(W.tag===10)de=W.type===_.type?null:W.child;else if(W.tag===18){if(de=W.return,de===null)throw Error(l(341));de.lanes|=$,ke=de.alternate,ke!==null&&(ke.lanes|=$),Bi(de,$,_),de=W.sibling}else de=W.child;if(de!==null)de.return=W;else for(de=W;de!==null;){if(de===_){de=null;break}if(W=de.sibling,W!==null){W.return=de.return,de=W;break}de=de.return}W=de}hi(d,_,B.children,$),_=_.child}return _;case 9:return B=_.type,I=_.pendingProps.children,Ci(_,$),B=Vn(B),I=I(B),_.flags|=1,hi(d,_,I,$),_.child;case 14:return I=_.type,B=bi(I,_.pendingProps),B=bi(I.type,B),ss(d,_,I,B,$);case 15:return jc(d,_,_.type,_.pendingProps,$);case 17:return I=_.type,B=_.pendingProps,B=_.elementType===I?B:bi(I,B),d!==null&&(d.alternate=null,_.alternate=null,_.flags|=2),_.tag=1,gs(I)?(d=!0,pc(_)):d=!1,Ci(_,$),Tp(_,I,B),Jl(_,I,B,$),na(null,_,I,!0,d,$);case 19:return mi(d,_,$);case 22:return _a(d,_,$)}throw Error(l(156,_.tag))};function wc(d,_){return nl(d,_)}function Go(d,_,$,I){this.tag=d,this.key=$,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=_,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=I,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function _o(d,_,$,I){return new Go(d,_,$,I)}function rc(d){return d=d.prototype,!(!d||!d.isReactComponent)}function Dl(d){if(typeof d=="function")return rc(d)?1:0;if(d!=null){if(d=d.$$typeof,d===M)return 11;if(d===L)return 14}return 2}function vo(d,_){var $=d.alternate;return $===null?($=_o(d.tag,_,d.key,d.mode),$.elementType=d.elementType,$.type=d.type,$.stateNode=d.stateNode,$.alternate=d,d.alternate=$):($.pendingProps=_,$.type=d.type,$.flags=0,$.subtreeFlags=0,$.deletions=null),$.flags=d.flags&14680064,$.childLanes=d.childLanes,$.lanes=d.lanes,$.child=d.child,$.memoizedProps=d.memoizedProps,$.memoizedState=d.memoizedState,$.updateQueue=d.updateQueue,_=d.dependencies,$.dependencies=_===null?null:{lanes:_.lanes,firstContext:_.firstContext},$.sibling=d.sibling,$.index=d.index,$.ref=d.ref,$}function Pl(d,_,$,I,B,W){var de=2;if(I=d,typeof d=="function")rc(d)&&(de=1);else if(typeof d=="string")de=5;else e:switch(d){case g:return Xa($.children,B,W,_);case y:de=8,B|=8;break;case b:return d=_o(12,$,_,B|2),d.elementType=b,d.lanes=W,d;case A:return d=_o(13,$,_,B),d.elementType=A,d.lanes=W,d;case k:return d=_o(19,$,_,B),d.elementType=k,d.lanes=W,d;case D:return uu($,B,W,_);default:if(typeof d=="object"&&d!==null)switch(d.$$typeof){case w:de=10;break e;case C:de=9;break e;case M:de=11;break e;case L:de=14;break e;case P:de=16,I=null;break e}throw Error(l(130,d==null?d:typeof d,""))}return _=_o(de,$,_,B),_.elementType=d,_.type=I,_.lanes=W,_}function Xa(d,_,$,I){return d=_o(7,d,I,_),d.lanes=$,d}function uu(d,_,$,I){return d=_o(22,d,I,_),d.elementType=D,d.lanes=$,d.stateNode={},d}function ni(d,_,$){return d=_o(6,d,null,_),d.lanes=$,d}function cs(d,_,$){return _=_o(4,d.children!==null?d.children:[],d.key,_),_.lanes=$,_.stateNode={containerInfo:d.containerInfo,pendingChildren:null,implementation:d.implementation},_}function qh(d,_,$,I,B){this.tag=_,this.containerInfo=d,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=ft,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=_u(0),this.expirationTimes=_u(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=_u(0),this.identifierPrefix=I,this.onRecoverableError=B,He&&(this.mutableSourceEagerHydrationData=null)}function yd(d,_,$,I,B,W,de,ke,et){return d=new qh(d,_,$,ke,et),_===1?(_=1,W===!0&&(_|=8)):_=0,W=_o(3,null,null,_),d.current=W,W.stateNode=d,W.memoizedState={element:I,isDehydrated:$,cache:null,transitions:null},dd(W),d}function Ta(d){if(!d)return Gr;d=d._reactInternals;e:{if(oe(d)!==d||d.tag!==1)throw Error(l(170));var _=d;do{switch(_.tag){case 3:_=_.stateNode.context;break e;case 1:if(gs(_.type)){_=_.stateNode.__reactInternalMemoizedMergedChildContext;break e}}_=_.return}while(_!==null);throw Error(l(171))}if(d.tag===1){var $=d.type;if(gs($))return fc(d,$,_)}return _}function Sa(d){var _=d._reactInternals;if(_===void 0)throw typeof d.render=="function"?Error(l(188)):(d=Object.keys(d).join(","),Error(l(268,d)));return d=q(_),d===null?null:d.stateNode}function Qh(d,_){if(d=d.memoizedState,d!==null&&d.dehydrated!==null){var $=d.retryLane;d.retryLane=$!==0&&$<_?$:_}}function Ec(d,_){Qh(d,_),(d=d.alternate)&&Qh(d,_)}function Hf(d){return d=q(d),d===null?null:d.stateNode}function x(){return null}return t.attemptContinuousHydration=function(d){if(d.tag===13){var _=bs();Ya(d,134217728,_),Ec(d,134217728)}},t.attemptHydrationAtCurrentPriority=function(d){if(d.tag===13){var _=bs(),$=Os(d);Ya(d,$,_),Ec(d,$)}},t.attemptSynchronousHydration=function(d){switch(d.tag){case 3:var _=d.stateNode;if(_.current.memoizedState.isDehydrated){var $=xi(_.pendingLanes);$!==0&&(br(_,$|1),fn(_,_s()),!(tr&6)&&(Mu(),ha()))}break;case 13:var I=bs();Ft(function(){return Ya(d,1,I)}),Ec(d,1)}},t.batchedUpdates=function(d,_){var $=tr;tr|=1;try{return d(_)}finally{tr=$,tr===0&&(Mu(),Uu&&ha())}},t.createComponentSelector=function(d){return{$$typeof:ou,value:d}},t.createContainer=function(d,_,$,I,B,W,de){return yd(d,_,!1,null,$,I,B,W,de)},t.createHasPseudoClassSelector=function(d){return{$$typeof:Ju,value:d}},t.createHydrationContainer=function(d,_,$,I,B,W,de,ke,et){return d=yd($,I,!0,d,B,W,de,ke,et),d.context=Ta(null),$=d.current,I=bs(),B=Os($),W=Vi(I,B),W.callback=_??null,Pa($,W),d.current.lanes=B,xl(d,B,I),fn(d,I),d},t.createPortal=function(d,_,$){var I=3=wt&&W>=cn&&B<=Zt&&de<=bn){d.splice(_,1);break}else if(I!==wt||$.width!==et.width||bnde){if(!(W!==cn||$.height!==et.height||ZtB)){wt>I&&(et.width+=wt-I,et.x=I),ZtW&&(et.height+=cn-W,et.y=W),bn$&&($=de)),de<_.length))for(W=W.child;W!==null;)d.push(W,de),W=W.sibling}if($<_.length){for(d=[];$<_.length;$++)d.push(ja(_[$]));return`findAllNodes was able to match part of the selector: `+(I.join(" > ")+` No matching component was found for: - `)+d.join(" > ")}return null},t.getPublicRootInstance=function(d){if(d=d.current,!d.child)return null;switch(d.child.tag){case 5:return ge(d.child.stateNode);default:return d.child.stateNode}},t.injectIntoDevTools=function(d){if(d={bundleType:d.bundleType,version:d.version,rendererPackageName:d.rendererPackageName,rendererConfig:d.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:u.ReactCurrentDispatcher,findHostInstanceByFiber:Hf,findFiberByHostInstance:d.findFiberByHostInstance||x,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.0.0-fc46dba67-20220329"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")d=!1;else{var _=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(_.isDisabled||!_.supportsFiber)d=!0;else{try{ca=_.inject(d),yu=_}catch{}d=!!_.checkDCE}}return d},t.isAlreadyRendering=function(){return!1},t.observeVisibleRects=function(d,_,$,I){if(!At)throw Error(l(363));d=ff(d,_);var B=It(d,$,I).disconnect;return{disconnect:function(){B()}}},t.registerMutableSourceForHydration=function(d,_){var $=_._getVersion;$=$(_._source),d.mutableSourceEagerHydrationData==null?d.mutableSourceEagerHydrationData=[_,$]:d.mutableSourceEagerHydrationData.push(_,$)},t.runWithPriority=function(d,_){var $=Tr;try{return Tr=d,_()}finally{Tr=$}},t.shouldError=function(){return null},t.shouldSuspend=function(){return!1},t.updateContainer=function(d,_,$,I){var B=_.current,W=bs(),de=Os(B);return $=Ta($),_.context===null?_.context=$:_.pendingContext=$,_=Vi(W,de),_.payload={element:d},I=I===void 0?null:I,I!==null&&(_.callback=I),Pa(B,_),d=Ya(B,de,W),d!==null&&vh(d,B,de),de},t};nJ.exports=vye;var yye=nJ.exports;const bye=Xy(yye);var rJ={exports:{}},iJ={};/** + `)+d.join(" > ")}return null},t.getPublicRootInstance=function(d){if(d=d.current,!d.child)return null;switch(d.child.tag){case 5:return ge(d.child.stateNode);default:return d.child.stateNode}},t.injectIntoDevTools=function(d){if(d={bundleType:d.bundleType,version:d.version,rendererPackageName:d.rendererPackageName,rendererConfig:d.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:u.ReactCurrentDispatcher,findHostInstanceByFiber:Hf,findFiberByHostInstance:d.findFiberByHostInstance||x,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.0.0-fc46dba67-20220329"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")d=!1;else{var _=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(_.isDisabled||!_.supportsFiber)d=!0;else{try{ca=_.inject(d),yu=_}catch{}d=!!_.checkDCE}}return d},t.isAlreadyRendering=function(){return!1},t.observeVisibleRects=function(d,_,$,I){if(!At)throw Error(l(363));d=ff(d,_);var B=It(d,$,I).disconnect;return{disconnect:function(){B()}}},t.registerMutableSourceForHydration=function(d,_){var $=_._getVersion;$=$(_._source),d.mutableSourceEagerHydrationData==null?d.mutableSourceEagerHydrationData=[_,$]:d.mutableSourceEagerHydrationData.push(_,$)},t.runWithPriority=function(d,_){var $=Tr;try{return Tr=d,_()}finally{Tr=$}},t.shouldError=function(){return null},t.shouldSuspend=function(){return!1},t.updateContainer=function(d,_,$,I){var B=_.current,W=bs(),de=Os(B);return $=Ta($),_.context===null?_.context=$:_.pendingContext=$,_=Vi(W,de),_.payload={element:d},I=I===void 0?null:I,I!==null&&(_.callback=I),Pa(B,_),d=Ya(B,de,W),d!==null&&vh(d,B,de),de},t};rJ.exports=vye;var yye=rJ.exports;const bye=Xy(yye);var iJ={exports:{}},sJ={};/** * @license React * scheduler.production.min.js * @@ -1738,16 +1738,16 @@ No matching component was found for: * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */(function(n){function e(J,re){var ie=J.length;J.push(re);e:for(;0>>1,Te=J[fe];if(0>>1;fes(Je,ie))Res(Qe,Je)?(J[fe]=Qe,J[Re]=ie,fe=Re):(J[fe]=Je,J[Ie]=ie,fe=Ie);else if(Res(Qe,ie))J[fe]=Qe,J[Re]=ie,fe=Re;else break e}}return re}function s(J,re){var ie=J.sortIndex-re.sortIndex;return ie!==0?ie:J.id-re.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;n.unstable_now=function(){return o.now()}}else{var l=Date,u=l.now();n.unstable_now=function(){return l.now()-u}}var h=[],f=[],g=1,y=null,b=3,w=!1,C=!1,M=!1,A=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,L=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function P(J){for(var re=t(f);re!==null;){if(re.callback===null)r(f);else if(re.startTime<=J)r(f),re.sortIndex=re.expirationTime,e(h,re);else break;re=t(f)}}function D(J){if(M=!1,P(J),!C)if(t(h)!==null)C=!0,ge(z);else{var re=t(f);re!==null&&we(D,re.startTime-J)}}function z(J,re){C=!1,M&&(M=!1,k(H),H=-1),w=!0;var ie=b;try{for(P(re),y=t(h);y!==null&&(!(y.expirationTime>re)||J&&!Z());){var fe=y.callback;if(typeof fe=="function"){y.callback=null,b=y.priorityLevel;var Te=fe(y.expirationTime<=re);re=n.unstable_now(),typeof Te=="function"?y.callback=Te:y===t(h)&&r(h),P(re)}else r(h);y=t(h)}if(y!==null)var Fe=!0;else{var Ie=t(f);Ie!==null&&we(D,Ie.startTime-re),Fe=!1}return Fe}finally{y=null,b=ie,w=!1}}var U=!1,V=null,H=-1,oe=5,le=-1;function Z(){return!(n.unstable_now()-leJ||125fe?(J.sortIndex=ie,e(f,J),t(h)===null&&J===t(f)&&(M?(k(H),H=-1):M=!0,we(D,ie-fe))):(J.sortIndex=Te,e(h,J),C||w||(C=!0,ge(z))),J},n.unstable_shouldYield=Z,n.unstable_wrapCallback=function(J){var re=b;return function(){var ie=b;b=re;try{return J.apply(this,arguments)}finally{b=ie}}}})(iJ);rJ.exports=iJ;var rG=rJ.exports;const Tye=n=>typeof n=="object"&&typeof n.then=="function",w1=[];function sJ(n,e,t=(r,s)=>r===s){if(n===e)return!0;if(!n||!e)return!1;const r=n.length;if(e.length!==r)return!1;for(let s=0;s0&&(o.timeout&&clearTimeout(o.timeout),o.timeout=setTimeout(o.remove,r.lifespan)),o.response;if(!t)throw o.promise}const s={keys:e,equal:r.equal,remove:()=>{const o=w1.indexOf(s);o!==-1&&w1.splice(o,1)},promise:(Tye(n)?n:n(...e)).then(o=>{s.response=o,r.lifespan&&r.lifespan>0&&(s.timeout=setTimeout(s.remove,r.lifespan))}).catch(o=>s.error=o)};if(w1.push(s),!t)throw s.promise}const Sye=(n,e,t)=>oJ(n,e,!1,t),wye=(n,e,t)=>void oJ(n,e,!0,t),Eye=n=>{if(n===void 0||n.length===0)w1.splice(0,w1.length);else{const e=w1.find(t=>sJ(n,t.keys,t.equal));e&&e.remove()}},aJ={};function xye(n,e){function t(g,{args:y=[],attach:b,...w},C){let M=`${g[0].toUpperCase()}${g.slice(1)}`,A;if(g==="primitive"){if(w.object===void 0)throw new Error("R3F: Primitives without 'object' are invalid!");const k=w.object;A=sx(k,{type:g,root:C,attach:b,primitive:!0})}else{const k=aJ[M];if(!k)throw new Error(`R3F: ${M} is not part of the THREE namespace! Did you forget to extend? See: https://docs.pmnd.rs/react-three-fiber/api/objects#using-3rd-party-objects-declaratively`);if(!Array.isArray(y))throw new Error("R3F: The args prop must be an array!");A=sx(new k(...y),{type:g,root:C,attach:b,memoizedProps:{args:y}})}return A.__r3f.attach===void 0&&(A instanceof Zy?A.__r3f.attach="geometry":A instanceof Dy&&(A.__r3f.attach="material")),M!=="inject"&&lL(A,w),A}function r(g,y){let b=!1;if(y){var w,C;(w=y.__r3f)!=null&&w.attach?aL(g,y,y.__r3f.attach):y.isObject3D&&g.isObject3D&&(g.add(y),b=!0),b||(C=g.__r3f)==null||C.objects.push(y),y.__r3f||sx(y,{}),y.__r3f.parent=g,JD(y),NS(y)}}function s(g,y,b){let w=!1;if(y){var C,M;if((C=y.__r3f)!=null&&C.attach)aL(g,y,y.__r3f.attach);else if(y.isObject3D&&g.isObject3D){y.parent=g,y.dispatchEvent({type:"added"}),g.dispatchEvent({type:"childadded",child:y});const A=g.children.filter(L=>L!==y),k=A.indexOf(b);g.children=[...A.slice(0,k),y,...A.slice(k)],w=!0}w||(M=g.__r3f)==null||M.objects.push(y),y.__r3f||sx(y,{}),y.__r3f.parent=g,JD(y),NS(y)}}function o(g,y,b=!1){g&&[...g].forEach(w=>l(y,w,b))}function l(g,y,b){if(y){var w,C,M;if(y.__r3f&&(y.__r3f.parent=null),(w=g.__r3f)!=null&&w.objects&&(g.__r3f.objects=g.__r3f.objects.filter(D=>D!==y)),(C=y.__r3f)!=null&&C.attach)lG(g,y,y.__r3f.attach);else if(y.isObject3D&&g.isObject3D){var A;g.remove(y),(A=y.__r3f)!=null&&A.root&&Oye(mI(y),y)}const L=(M=y.__r3f)==null?void 0:M.primitive,P=!L&&(b===void 0?y.dispose!==null:b);if(!L){var k;o((k=y.__r3f)==null?void 0:k.objects,y,P),o(y.children,y,P)}if(delete y.__r3f,P&&y.dispose&&y.type!=="Scene"){const D=()=>{try{y.dispose()}catch{}};typeof IS_REACT_ACT_ENVIRONMENT>"u"?rG.unstable_scheduleCallback(rG.unstable_IdlePriority,D):D()}NS(g)}}function u(g,y,b,w){var C;const M=(C=g.__r3f)==null?void 0:C.parent;if(!M)return;const A=t(y,b,g.__r3f.root);if(g.children){for(const k of g.children)k.__r3f&&r(A,k);g.children=g.children.filter(k=>!k.__r3f)}g.__r3f.objects.forEach(k=>r(A,k)),g.__r3f.objects=[],g.__r3f.autoRemovedBeforeAppend||l(M,g),A.parent&&(A.__r3f.autoRemovedBeforeAppend=!0),r(M,A),A.raycast&&A.__r3f.eventCount&&mI(A).getState().internal.interaction.push(A),[w,w.alternate].forEach(k=>{k!==null&&(k.stateNode=A,k.ref&&(typeof k.ref=="function"?k.ref(A):k.ref.current=A))})}const h=()=>console.warn("Text is not allowed in the R3F tree! This could be stray whitespace or characters.");return{reconciler:bye({createInstance:t,removeChild:l,appendChild:r,appendInitialChild:r,insertBefore:s,supportsMutation:!0,isPrimaryRenderer:!1,supportsPersistence:!1,supportsHydration:!1,noTimeout:-1,appendChildToContainer:(g,y)=>{if(!y)return;const b=g.getState().scene;b.__r3f&&(b.__r3f.root=g,r(b,y))},removeChildFromContainer:(g,y)=>{y&&l(g.getState().scene,y)},insertInContainerBefore:(g,y,b)=>{if(!y||!b)return;const w=g.getState().scene;w.__r3f&&s(w,y,b)},getRootHostContext:()=>null,getChildHostContext:g=>g,finalizeInitialChildren(g){var y;return!!((y=g==null?void 0:g.__r3f)!=null?y:{}).handlers},prepareUpdate(g,y,b,w){var C;if(((C=g==null?void 0:g.__r3f)!=null?C:{}).primitive&&w.object&&w.object!==g)return[!0];{const{args:A=[],children:k,...L}=w,{args:P=[],children:D,...z}=b;if(!Array.isArray(A))throw new Error("R3F: the args prop must be an array!");if(A.some((V,H)=>V!==P[H]))return[!0];const U=uJ(g,L,z,!0);return U.changes.length?[!1,U]:null}},commitUpdate(g,[y,b],w,C,M,A){y?u(g,w,M,A):lL(g,b)},commitMount(g,y,b,w){var C;const M=(C=g.__r3f)!=null?C:{};g.raycast&&M.handlers&&M.eventCount&&mI(g).getState().internal.interaction.push(g)},getPublicInstance:g=>g,prepareForCommit:()=>null,preparePortalMount:g=>sx(g.getState().scene),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance(g){var y;const{attach:b,parent:w}=(y=g.__r3f)!=null?y:{};b&&w&&lG(w,g,b),g.isObject3D&&(g.visible=!1),NS(g)},unhideInstance(g,y){var b;const{attach:w,parent:C}=(b=g.__r3f)!=null?b:{};w&&C&&aL(C,g,w),(g.isObject3D&&y.visible==null||y.visible)&&(g.visible=!0),NS(g)},createTextInstance:h,hideTextInstance:h,unhideTextInstance:h,getCurrentEventPriority:()=>e?e():Rx.DefaultEventPriority,beforeActiveInstanceBlur:()=>{},afterActiveInstanceBlur:()=>{},detachDeletedInstance:()=>{},now:typeof performance<"u"&&sp.fun(performance.now)?performance.now:sp.fun(Date.now)?Date.now:()=>0,scheduleTimeout:sp.fun(setTimeout)?setTimeout:void 0,cancelTimeout:sp.fun(clearTimeout)?clearTimeout:void 0}),applyProps:lL}}var iG,sG;const oL=n=>"colorSpace"in n||"outputColorSpace"in n,$ye=()=>{var n;return(n=aJ.ColorManagement)!=null?n:null};typeof window<"u"&&((iG=window.document)!=null&&iG.createElement||((sG=window.navigator)==null?void 0:sG.product)==="ReactNative")?pe.useLayoutEffect:pe.useEffect;class Cye extends pe.Component{constructor(...e){super(...e),this.state={error:!1}}componentDidCatch(e){this.props.set(e)}render(){return this.state.error?null:this.props.children}}Cye.getDerivedStateFromError=()=>({error:!0});const lJ="__default",oG=new Map,Mye=n=>n&&!!n.memoized&&!!n.changes;function mI(n){let e=n.__r3f.root;for(;e.getState().previousRoot;)e=e.getState().previousRoot;return e}const sp={obj:n=>n===Object(n)&&!sp.arr(n)&&typeof n!="function",fun:n=>typeof n=="function",str:n=>typeof n=="string",num:n=>typeof n=="number",boo:n=>typeof n=="boolean",und:n=>n===void 0,arr:n=>Array.isArray(n),equ(n,e,{arrays:t="shallow",objects:r="reference",strict:s=!0}={}){if(typeof n!=typeof e||!!n!=!!e)return!1;if(sp.str(n)||sp.num(n))return n===e;const o=sp.obj(n);if(o&&r==="reference")return n===e;const l=sp.arr(n);if(l&&t==="reference")return n===e;if((l||o)&&n===e)return!0;let u;for(u in n)if(!(u in e))return!1;if(o&&t==="shallow"&&r==="shallow"){for(u in s?e:n)if(!sp.equ(n[u],e[u],{strict:s,objects:"reference"}))return!1}else for(u in s?e:n)if(n[u]!==e[u])return!1;if(sp.und(u)){if(l&&n.length===0&&e.length===0||o&&Object.keys(n).length===0&&Object.keys(e).length===0)return!0;if(n!==e)return!1}return!0}};function Aye(n){const e={nodes:{},materials:{}};return n&&n.traverse(t=>{t.name&&(e.nodes[t.name]=t),t.material&&!e.materials[t.material.name]&&(e.materials[t.material.name]=t.material)}),e}function sx(n,e){const t=n;return t.__r3f={type:"",root:null,previousAttach:null,memoizedProps:{},eventCount:0,handlers:{},objects:[],parent:null,...e},n}function KD(n,e){let t=n;if(e.includes("-")){const r=e.split("-"),s=r.pop();return t=r.reduce((o,l)=>o[l],n),{target:t,key:s}}else return{target:t,key:e}}const aG=/-\d+$/;function aL(n,e,t){if(sp.str(t)){if(aG.test(t)){const o=t.replace(aG,""),{target:l,key:u}=KD(n,o);Array.isArray(l[u])||(l[u]=[])}const{target:r,key:s}=KD(n,t);e.__r3f.previousAttach=r[s],r[s]=e}else e.__r3f.previousAttach=t(n,e)}function lG(n,e,t){var r,s;if(sp.str(t)){const{target:o,key:l}=KD(n,t),u=e.__r3f.previousAttach;u===void 0?delete o[l]:o[l]=u}else(r=e.__r3f)==null||r.previousAttach==null||r.previousAttach(n,e);(s=e.__r3f)==null||delete s.previousAttach}function uJ(n,{children:e,key:t,ref:r,...s},{children:o,key:l,ref:u,...h}={},f=!1){var g;const y=(g=n==null?void 0:n.__r3f)!=null?g:{},b=Object.entries(s),w=[];if(f){const M=Object.keys(h);for(let A=0;A{var k;if((k=n.__r3f)!=null&&k.primitive&&M==="object"||sp.equ(A,h[M]))return;if(/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/.test(M))return w.push([M,A,!0,[]]);let L=[];M.includes("-")&&(L=M.split("-")),w.push([M,A,!1,L]);for(const P in s){const D=s[P];P.startsWith(`${M}-`)&&w.push([P,D,!1,P.split("-")])}});const C={...s};return y.memoizedProps&&y.memoizedProps.args&&(C.args=y.memoizedProps.args),y.memoizedProps&&y.memoizedProps.attach&&(C.attach=y.memoizedProps.attach),{memoized:C,changes:w}}const Iye=typeof process<"u"&&!1;function lL(n,e){var t,r,s;const o=(t=n.__r3f)!=null?t:{},l=o.root,u=(r=l==null||l.getState==null?void 0:l.getState())!=null?r:{},{memoized:h,changes:f}=Mye(e)?e:uJ(n,e),g=o.eventCount;n.__r3f&&(n.__r3f.memoizedProps=h);for(let b=0;bP[D],n),!(L&&L.set))){const[P,...D]=A.reverse();k=D.reverse().reduce((z,U)=>z[U],n),w=P}if(C===lJ+"remove")if(k.constructor){let P=oG.get(k.constructor);P||(P=new k.constructor,oG.set(k.constructor,P)),C=P[w]}else C=0;if(M)C?o.handlers[w]=C:delete o.handlers[w],o.eventCount=Object.keys(o.handlers).length;else if(L&&L.set&&(L.copy||L instanceof iI)){if(Array.isArray(C))L.fromArray?L.fromArray(C):L.set(...C);else if(L.copy&&C&&C.constructor&&(Iye?L.constructor.name===C.constructor.name:L.constructor===C.constructor))L.copy(C);else if(C!==void 0){const P=L instanceof Ph;!P&&L.setScalar?L.setScalar(C):L instanceof iI&&C instanceof iI?L.mask=C.mask:L.set(C),!$ye()&&!u.linear&&P&&L.convertSRGBToLinear()}}else if(k[w]=C,k[w]instanceof Lm&&k[w].format===G3&&k[w].type===iX){const P=k[w];oL(P)&&oL(u.gl)?P.colorSpace=u.gl.outputColorSpace:P.encoding=u.gl.outputEncoding}NS(n)}if(o.parent&&n.raycast&&g!==o.eventCount){const b=mI(n).getState().internal,w=b.interaction.indexOf(n);w>-1&&b.interaction.splice(w,1),o.eventCount&&b.interaction.push(n)}return!(f.length===1&&f[0][0]==="onUpdate")&&f.length&&(s=n.__r3f)!=null&&s.parent&&JD(n),n}function NS(n){var e,t;const r=(e=n.__r3f)==null||(t=e.root)==null||t.getState==null?void 0:t.getState();r&&r.internal.frames===0&&r.invalidate()}function JD(n){n.onUpdate==null||n.onUpdate(n)}function Rye(){var n;const e=typeof self<"u"&&self||typeof window<"u"&&window;if(!e)return Rx.DefaultEventPriority;switch((n=e.event)==null?void 0:n.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return Rx.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return Rx.ContinuousEventPriority;default:return Rx.DefaultEventPriority}}function kye(n,e,t,r){const s=t.get(e);s&&(t.delete(e),t.size===0&&(n.delete(r),s.target.releasePointerCapture(r)))}function Oye(n,e){const{internal:t}=n.getState();t.interaction=t.interaction.filter(r=>r!==e),t.initialHits=t.initialHits.filter(r=>r!==e),t.hovered.forEach((r,s)=>{(r.eventObject===e||r.object===e)&&t.hovered.delete(s)}),t.capturedMap.forEach((r,s)=>{kye(t.capturedMap,e,r,s)})}const uG=new WeakMap;function cJ(n,e){return function(t,...r){let s=uG.get(t);return s||(s=new t,uG.set(t,s)),n&&n(s),Promise.all(r.map(o=>new Promise((l,u)=>s.load(o,h=>{h.scene&&Object.assign(h,Aye(h.scene)),l(h)},e,h=>u(new Error(`Could not load ${o}: ${h==null?void 0:h.message}`)))))).finally(()=>s.dispose==null?void 0:s.dispose())}}function AC(n,e,t,r){const s=Array.isArray(e)?e:[e],o=Sye(cJ(t,r),[n,...s],{equal:sp.equ});return Array.isArray(e)?o:o[0]}AC.preload=function(n,e,t){const r=Array.isArray(e)?e:[e];return wye(cJ(t),[n,...r])};AC.clear=function(n,e){const t=Array.isArray(e)?e:[e];return Eye([n,...t])};const Lye=new Map,{reconciler:Nye,applyProps:EBe}=xye(Lye,Rye);Nye.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:pe.version});function cG(n,e){if(e===Ooe)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),n;if(e===MD||e===sX){let t=n.getIndex();if(t===null){const l=[],u=n.getAttribute("position");if(u!==void 0){for(let h=0;h=2.0 are supported."));return}const h=new fbe(o,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});h.fileLoader.setRequestHeader(this.requestHeader);for(let f=0;f=0&&u[g]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+g+'".')}}h.setExtensions(l),h.setPlugins(u),h.parse(r,s)}parseAsync(e,t){const r=this;return new Promise(function(s,o){r.parse(e,t,s,o)})}}function Pye(){let n={};return{get:function(e){return n[e]},add:function(e,t){n[e]=t},remove:function(e){delete n[e]},removeAll:function(){n={}}}}const js={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_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class Bye{constructor(e){this.parser=e,this.name=js.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let r=0,s=t.length;r=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,o.source,l)}}class Jye{constructor(e){this.parser=e,this.name=js.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const t=this.name,r=this.parser,s=r.json,o=s.textures[e];if(!o.extensions||!o.extensions[t])return null;const l=o.extensions[t],u=s.images[l.source];let h=r.textureLoader;if(u.uri){const f=r.options.manager.getHandler(u.uri);f!==null&&(h=f)}return this.detectSupport().then(function(f){if(f)return r.loadTextureImage(e,l.source,h);if(s.extensionsRequired&&s.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return r.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(t.height===1)}})),this.isSupported}}class qye{constructor(e){this.parser=e,this.name=js.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const t=this.name,r=this.parser,s=r.json,o=s.textures[e];if(!o.extensions||!o.extensions[t])return null;const l=o.extensions[t],u=s.images[l.source];let h=r.textureLoader;if(u.uri){const f=r.options.manager.getHandler(u.uri);f!==null&&(h=f)}return this.detectSupport().then(function(f){if(f)return r.loadTextureImage(e,l.source,h);if(s.extensionsRequired&&s.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return r.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class Qye{constructor(e){this.name=js.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,r=t.bufferViews[e];if(r.extensions&&r.extensions[this.name]){const s=r.extensions[this.name],o=this.parser.getDependency("buffer",s.buffer),l=this.parser.options.meshoptDecoder;if(!l||!l.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 o.then(function(u){const h=s.byteOffset||0,f=s.byteLength||0,g=s.count,y=s.byteStride,b=new Uint8Array(u,h,f);return l.decodeGltfBufferAsync?l.decodeGltfBufferAsync(g,y,b,s.mode,s.filter).then(function(w){return w.buffer}):l.ready.then(function(){const w=new ArrayBuffer(g*y);return l.decodeGltfBuffer(new Uint8Array(w),g,y,b,s.mode,s.filter),w})})}else return null}}class Zye{constructor(e){this.name=js.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,r=t.nodes[e];if(!r.extensions||!r.extensions[this.name]||r.mesh===void 0)return null;const s=t.meshes[r.mesh];for(const f of s.primitives)if(f.mode!==cg.TRIANGLES&&f.mode!==cg.TRIANGLE_STRIP&&f.mode!==cg.TRIANGLE_FAN&&f.mode!==void 0)return null;const l=r.extensions[this.name].attributes,u=[],h={};for(const f in l)u.push(this.parser.getDependency("accessor",l[f]).then(g=>(h[f]=g,h[f])));return u.length<1?null:(u.push(this.parser.createNodeMesh(e)),Promise.all(u).then(f=>{const g=f.pop(),y=g.isGroup?g.children:[g],b=f[0].count,w=[];for(const C of y){const M=new Ys,A=new Bt,k=new Pu,L=new Bt(1,1,1),P=new Aae(C.geometry,C.material,b);for(let D=0;D=152?{TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3"}:{TEXCOORD_0:"uv",TEXCOORD_1:"uv2"},COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},ry={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},obe={CUBICSPLINE:void 0,LINEAR:Aw,STEP:x$},cL={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function abe(n){return n.DefaultMaterial===void 0&&(n.DefaultMaterial=new q3({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:nR})),n.DefaultMaterial}function Gb(n,e,t){for(const r in t.extensions)n[r]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[r]=t.extensions[r])}function vy(n,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(n.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function lbe(n,e,t){let r=!1,s=!1,o=!1;for(let f=0,g=e.length;f0||n.search(/^data\:image\/jpeg/)===0?"image/jpeg":n.search(/\.webp($|\?)/i)>0||n.search(/^data\:image\/webp/)===0?"image/webp":"image/png"}const dbe=new Ys;class fbe{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new Pye,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let r=!1,s=!1,o=-1;typeof navigator<"u"&&typeof navigator.userAgent<"u"&&(r=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)===!0,s=navigator.userAgent.indexOf("Firefox")>-1,o=s?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),typeof createImageBitmap>"u"||r||s&&o<98?this.textureLoader=new jae(this.options.manager):this.textureLoader=new Zae(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new rR(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const r=this,s=this.json,o=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(l){return l._markDefs&&l._markDefs()}),Promise.all(this._invokeAll(function(l){return l.beforeRoot&&l.beforeRoot()})).then(function(){return Promise.all([r.getDependencies("scene"),r.getDependencies("animation"),r.getDependencies("camera")])}).then(function(l){const u={scene:l[0][s.scene||0],scenes:l[0],animations:l[1],cameras:l[2],asset:s.asset,parser:r,userData:{}};Gb(o,u,s),vy(u,s),Promise.all(r._invokeAll(function(h){return h.afterRoot&&h.afterRoot(u)})).then(function(){e(u)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],r=this.json.meshes||[];for(let s=0,o=t.length;s{const h=this.associations.get(l);h!=null&&this.associations.set(u,h);for(const[f,g]of l.children.entries())o(g,u.children[f])};return o(r,s),s.name+="_instance_"+e.uses[t]++,s}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let r=0;r=2&&A.setY(oe,U[V*h+1]),h>=3&&A.setZ(oe,U[V*h+2]),h>=4&&A.setW(oe,U[V*h+3]),h>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return A})}loadTexture(e){const t=this.json,r=this.options,o=t.textures[e].source,l=t.images[o];let u=this.textureLoader;if(l.uri){const h=r.manager.getHandler(l.uri);h!==null&&(u=h)}return this.loadTextureImage(e,o,u)}loadTextureImage(e,t,r){const s=this,o=this.json,l=o.textures[e],u=o.images[t],h=(u.uri||u.bufferView)+":"+l.sampler;if(this.textureCache[h])return this.textureCache[h];const f=this.loadImageSource(t,r).then(function(g){g.flipY=!1,g.name=l.name||u.name||"",g.name===""&&typeof u.uri=="string"&&u.uri.startsWith("data:image/")===!1&&(g.name=u.uri);const b=(o.samplers||{})[l.sampler]||{};return g.magFilter=dG[b.magFilter]||z3,g.minFilter=dG[b.minFilter]||U3,g.wrapS=fG[b.wrapS]||w$,g.wrapT=fG[b.wrapT]||w$,s.associations.set(g,{textures:e}),g}).catch(function(){return null});return this.textureCache[h]=f,f}loadImageSource(e,t){const r=this,s=this.json,o=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(y=>y.clone());const l=s.images[e],u=self.URL||self.webkitURL;let h=l.uri||"",f=!1;if(l.bufferView!==void 0)h=r.getDependency("bufferView",l.bufferView).then(function(y){f=!0;const b=new Blob([y],{type:l.mimeType});return h=u.createObjectURL(b),h});else if(l.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const g=Promise.resolve(h).then(function(y){return new Promise(function(b,w){let C=b;t.isImageBitmapLoader===!0&&(C=function(M){const A=new Lm(M);A.needsUpdate=!0,b(A)}),t.load(k1.resolveURL(y,o.path),C,void 0,w)})}).then(function(y){return f===!0&&u.revokeObjectURL(h),y.userData.mimeType=l.mimeType||hbe(l.uri),y}).catch(function(y){throw console.error("THREE.GLTFLoader: Couldn't load texture",h),y});return this.sourceCache[e]=g,g}assignTexture(e,t,r,s){const o=this;return this.getDependency("texture",r.index).then(function(l){if(!l)return null;if(r.texCoord!==void 0&&r.texCoord>0&&(l=l.clone(),l.channel=r.texCoord),o.extensions[js.KHR_TEXTURE_TRANSFORM]){const u=r.extensions!==void 0?r.extensions[js.KHR_TEXTURE_TRANSFORM]:void 0;if(u){const h=o.associations.get(l);l=o.extensions[js.KHR_TEXTURE_TRANSFORM].extendTexture(l,u),o.associations.set(l,h)}}return s!==void 0&&("colorSpace"in l?l.colorSpace=s===3001?"srgb":"srgb-linear":l.encoding=s),e[t]=l,l})}assignFinalMaterial(e){const t=e.geometry;let r=e.material;const s=t.attributes.tangent===void 0,o=t.attributes.color!==void 0,l=t.attributes.normal===void 0;if(e.isPoints){const u="PointsMaterial:"+r.uuid;let h=this.cache.get(u);h||(h=new mX,Dy.prototype.copy.call(h,r),h.color.copy(r.color),h.map=r.map,h.sizeAttenuation=!1,this.cache.add(u,h)),r=h}else if(e.isLine){const u="LineBasicMaterial:"+r.uuid;let h=this.cache.get(u);h||(h=new pX,Dy.prototype.copy.call(h,r),h.color.copy(r.color),h.map=r.map,this.cache.add(u,h)),r=h}if(s||o||l){let u="ClonedMaterial:"+r.uuid+":";s&&(u+="derivative-tangents:"),o&&(u+="vertex-colors:"),l&&(u+="flat-shading:");let h=this.cache.get(u);h||(h=r.clone(),o&&(h.vertexColors=!0),l&&(h.flatShading=!0),s&&(h.normalScale&&(h.normalScale.y*=-1),h.clearcoatNormalScale&&(h.clearcoatNormalScale.y*=-1)),this.cache.add(u,h),this.associations.set(h,this.associations.get(r))),r=h}e.material=r}getMaterialType(){return q3}loadMaterial(e){const t=this,r=this.json,s=this.extensions,o=r.materials[e];let l;const u={},h=o.extensions||{},f=[];if(h[js.KHR_MATERIALS_UNLIT]){const y=s[js.KHR_MATERIALS_UNLIT];l=y.getMaterialType(),f.push(y.extendParams(u,o,t))}else{const y=o.pbrMetallicRoughness||{};if(u.color=new Ph(1,1,1),u.opacity=1,Array.isArray(y.baseColorFactor)){const b=y.baseColorFactor;u.color.fromArray(b),u.opacity=b[3]}y.baseColorTexture!==void 0&&f.push(t.assignTexture(u,"map",y.baseColorTexture,3001)),u.metalness=y.metallicFactor!==void 0?y.metallicFactor:1,u.roughness=y.roughnessFactor!==void 0?y.roughnessFactor:1,y.metallicRoughnessTexture!==void 0&&(f.push(t.assignTexture(u,"metalnessMap",y.metallicRoughnessTexture)),f.push(t.assignTexture(u,"roughnessMap",y.metallicRoughnessTexture))),l=this._invokeOne(function(b){return b.getMaterialType&&b.getMaterialType(e)}),f.push(Promise.all(this._invokeAll(function(b){return b.extendMaterialParams&&b.extendMaterialParams(e,u)})))}o.doubleSided===!0&&(u.side=woe);const g=o.alphaMode||cL.OPAQUE;if(g===cL.BLEND?(u.transparent=!0,u.depthWrite=!1):(u.transparent=!1,g===cL.MASK&&(u.alphaTest=o.alphaCutoff!==void 0?o.alphaCutoff:.5)),o.normalTexture!==void 0&&l!==qS&&(f.push(t.assignTexture(u,"normalMap",o.normalTexture)),u.normalScale=new cc(1,1),o.normalTexture.scale!==void 0)){const y=o.normalTexture.scale;u.normalScale.set(y,y)}return o.occlusionTexture!==void 0&&l!==qS&&(f.push(t.assignTexture(u,"aoMap",o.occlusionTexture)),o.occlusionTexture.strength!==void 0&&(u.aoMapIntensity=o.occlusionTexture.strength)),o.emissiveFactor!==void 0&&l!==qS&&(u.emissive=new Ph().fromArray(o.emissiveFactor)),o.emissiveTexture!==void 0&&l!==qS&&f.push(t.assignTexture(u,"emissiveMap",o.emissiveTexture,3001)),Promise.all(f).then(function(){const y=new l(u);return o.name&&(y.name=o.name),vy(y,o),t.associations.set(y,{materials:e}),o.extensions&&Gb(s,y,o),y})}createUniqueName(e){const t=Aa.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,r=this.extensions,s=this.primitiveCache;function o(u){return r[js.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(u,t).then(function(h){return pG(h,u,t)})}const l=[];for(let u=0,h=e.length;u0&&ube(k,o),k.name=t.createUniqueName(o.name||"mesh_"+e),vy(k,o),A.extensions&&Gb(s,k,A),t.assignFinalMaterial(k),y.push(k)}for(let w=0,C=y.length;w1?g=new LO:f.length===1?g=f[0]:g=new dh,g!==f[0])for(let y=0,b=f.length;y{const y=new Map;for(const[b,w]of s.associations)(b instanceof Dy||b instanceof Lm)&&y.set(b,w);return g.traverse(b=>{const w=s.associations.get(b);w!=null&&y.set(b,w)}),y};return s.associations=f(o),o})}}function pbe(n,e,t){const r=e.attributes,s=new Cv;if(r.POSITION!==void 0){const u=t.json.accessors[r.POSITION],h=u.min,f=u.max;if(h!==void 0&&f!==void 0){if(s.set(new Bt(h[0],h[1],h[2]),new Bt(f[0],f[1],f[2])),u.normalized){const g=QD(_w[u.componentType]);s.min.multiplyScalar(g),s.max.multiplyScalar(g)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const o=e.targets;if(o!==void 0){const u=new Bt,h=new Bt;for(let f=0,g=o.length;f{const u={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(l,u).then(t).catch(s)},r,s)}decodeDracoFile(e,t,r,s){const o={attributeIDs:r||this.defaultAttributeIDs,attributeTypes:s||this.defaultAttributeTypes,useUniqueIDs:!!r};this.decodeGeometry(e,o).then(t)}decodeGeometry(e,t){for(const h in t.attributeTypes){const f=t.attributeTypes[h];f.BYTES_PER_ELEMENT!==void 0&&(t.attributeTypes[h]=f.name)}const r=JSON.stringify(t);if(dL.has(e)){const h=dL.get(e);if(h.key===r)return h.promise;if(e.byteLength===0)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let s;const o=this.workerNextTaskID++,l=e.byteLength,u=this._getWorker(o,l).then(h=>(s=h,new Promise((f,g)=>{s._callbacks[o]={resolve:f,reject:g},s.postMessage({type:"decode",id:o,taskConfig:t,buffer:e},[e])}))).then(h=>this._createGeometry(h.geometry));return u.catch(()=>!0).then(()=>{s&&o&&this._releaseTask(s,o)}),dL.set(e,{key:r,promise:u}),u}_createGeometry(e){const t=new Zy;e.index&&t.setIndex(new Nm(e.index.array,1));for(let r=0;r{r.load(e,s,void 0,o)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;const e=typeof WebAssembly!="object"||this.decoderConfig.type==="js",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(r=>{const s=r[0];e||(this.decoderConfig.wasmBinary=r[1]);const o=gbe.toString(),l=["/* draco decoder */",s,"","/* worker */",o.substring(o.indexOf("{")+1,o.lastIndexOf("}"))].join(` -`);this.workerSourceURL=URL.createObjectURL(new Blob([l]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.lengtho._taskLoad?-1:1});const r=this.workerPool[this.workerPool.length-1];return r._taskCosts[e]=t,r._taskLoad+=t,r})}_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{const y=g.draco,b=new y.Decoder,w=new y.DecoderBuffer;w.Init(new Int8Array(h),h.byteLength);try{const C=t(y,b,w,f),M=C.attributes.map(A=>A.array.buffer);C.index&&M.push(C.index.array.buffer),self.postMessage({type:"decode",id:u.id,geometry:C},M)}catch(C){console.error(C),self.postMessage({type:"error",id:u.id,error:C.message})}finally{y.destroy(w),y.destroy(b)}});break}};function t(l,u,h,f){const g=f.attributeIDs,y=f.attributeTypes;let b,w;const C=u.GetEncodedGeometryType(h);if(C===l.TRIANGULAR_MESH)b=new l.Mesh,w=u.DecodeBufferToMesh(h,b);else if(C===l.POINT_CLOUD)b=new l.PointCloud,w=u.DecodeBufferToPointCloud(h,b);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!w.ok()||b.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+w.error_msg());const M={index:null,attributes:[]};for(const A in g){const k=self[y[A]];let L,P;if(f.useUniqueIDs)P=g[A],L=u.GetAttributeByUniqueId(b,P);else{if(P=u.GetAttributeId(b,l[g[A]]),P===-1)continue;L=u.GetAttribute(b,P)}M.attributes.push(s(l,u,b,A,k,L))}return C===l.TRIANGULAR_MESH&&(M.index=r(l,u,b)),l.destroy(b),M}function r(l,u,h){const g=h.num_faces()*3,y=g*4,b=l._malloc(y);u.GetTrianglesUInt32Array(h,y,b);const w=new Uint32Array(l.HEAPF32.buffer,b,g).slice();return l._free(b),{array:w,itemSize:1}}function s(l,u,h,f,g,y){const b=y.num_components(),C=h.num_points()*b,M=C*g.BYTES_PER_ELEMENT,A=o(l,g),k=l._malloc(M);u.GetAttributeDataArrayForAllPoints(h,y,A,M,k);const L=new g(l.HEAPF32.buffer,k,C).slice();return l._free(k),{name:f,array:L,itemSize:b}}function o(l,u){switch(u){case Float32Array:return l.DT_FLOAT32;case Int8Array:return l.DT_INT8;case Int16Array:return l.DT_INT16;case Int32Array:return l.DT_INT32;case Uint8Array:return l.DT_UINT8;case Uint16Array:return l.DT_UINT16;case Uint32Array:return l.DT_UINT32}}}let zM;const fL=()=>{if(zM)return zM;const n="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",e="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",t=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]),r=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(typeof WebAssembly!="object")return{supported:!1};let s=n;WebAssembly.validate(t)&&(s=e);let o;const l=WebAssembly.instantiate(u(s),{}).then(y=>{o=y.instance,o.exports.__wasm_call_ctors()});function u(y){const b=new Uint8Array(y.length);for(let C=0;C96?M-71:M>64?M-65:M>47?M+4:M>46?63:62}let w=0;for(let C=0;C{t&&t(r),n&&(UM||(UM=new mbe),UM.setDecoderPath(typeof n=="string"?n:fJ),r.setDRACOLoader(UM)),e&&r.setMeshoptDecoder(typeof fL=="function"?fL():fL)}}function Gt(n,e=!0,t=!0,r){return AC(WF,n,pJ(e,t,r))}Gt.preload=(n,e=!0,t=!0,r)=>AC.preload(WF,n,pJ(e,t,r));Gt.clear=n=>AC.clear(WF,n);Gt.setDecoderPath=n=>{fJ=n};function _be(n){const{nodes:e}=Gt(eJ);return[{type:"raw",geometry:e.BASE_FRONT_GRILL_1.geometry,material:e.BASE_FRONT_GRILL_1.material,scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(eJ);const mJ="/gpu-programming/assets/BASE_LEFT_COVER_1-DGxtL-mQ.glb";function vbe(n){const{nodes:e}=Gt(mJ);return[{type:"raw",geometry:e.BASE_LEFT_COVER_1.geometry,material:e.BASE_LEFT_COVER_1.material,scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(mJ);const gJ="/gpu-programming/assets/base_link-CxNG3VaF.glb";function ybe(n){const{nodes:e}=Gt(gJ);return[{type:"raw",geometry:e.base_link.geometry,material:e.base_link.material,scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(gJ);const _J="/gpu-programming/assets/BASE_RIGHT_COVER_1-hc0og1we.glb";function bbe(n){const{nodes:e}=Gt(_J);return[{type:"raw",geometry:e.BASE_RIGHT_COVER_1.geometry,material:e.BASE_RIGHT_COVER_1.material,scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(_J);const vJ="/gpu-programming/assets/Battery_1-CK31T6T2.glb";function Tbe(n){const{nodes:e}=Gt(vJ);return[{type:"raw",geometry:e.Battery_1.geometry,material:e.Battery_1.material,scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(vJ);const yJ="/gpu-programming/assets/BODY_BASE_CONNECTOR_1-BGiepl-q.glb";function Sbe(n){const{nodes:e}=Gt(yJ);return[{type:"raw",geometry:e.BODY_BASE_CONNECTOR_1.geometry,material:e.BODY_BASE_CONNECTOR_1.material,scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(yJ);const wbe="/gpu-programming/assets/DRIVE_TRACK_LEFT_1-BU9fqrup.glb";Gt.preload(wbe);const Ebe="/gpu-programming/assets/DRIVE_TRACK_RIGHT_1-inJUmdan.glb";Gt.preload(Ebe);const bJ="/gpu-programming/assets/EYE_LENS_1-dEqRsnM7.glb";function xbe(n){const{nodes:e}=Gt(bJ);return[{type:"raw",geometry:e.EYE_LENS_1.geometry,material:e.EYE_LENS_1.material,scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(bJ);const TJ="/gpu-programming/assets/FACE_1-m_5yRlpQ.glb";function $be(n){const{nodes:e}=Gt(TJ);return[{type:"raw",geometry:e.FACE_1.geometry,material:e.FACE_1.material,scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(TJ);const SJ="/gpu-programming/assets/FRONT_LEFT_WHEEL_1-CbTd7ucE.glb";function Cbe(n){const{nodes:e}=Gt(SJ);return[{type:"raw",geometry:e.FRONT_LEFT_WHEEL_1.geometry,material:e.FRONT_LEFT_WHEEL_1.material,scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(SJ);const wJ="/gpu-programming/assets/FRONT_RIGHT_WHEEL_1-DndcS7IV.glb";function Mbe(n){const{nodes:e}=Gt(wJ);return[{type:"raw",geometry:e.FRONT_RIGHT_WHEEL_1.geometry,material:e.FRONT_RIGHT_WHEEL_1.material,scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(wJ);const EJ="/gpu-programming/assets/HEAD_1-BuuEOSCL.glb";function Abe(n){const{nodes:e}=Gt(EJ);return[{type:"raw",geometry:e.HEAD_1.geometry,material:e.HEAD_1.material,scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(EJ);const xJ="/gpu-programming/assets/HEAD_VENT_LEFT_1-DjAZtO3_.glb";function Ibe(n){const{nodes:e}=Gt(xJ);return[{type:"raw",geometry:e.HEAD_VENT_LEFT_1.geometry,material:e.HEAD_VENT_LEFT_1.material,scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(xJ);const $J="/gpu-programming/assets/HEAD_VENT_RIGHT_1-BfOCx_V8.glb";function Rbe(n){const{nodes:e}=Gt($J);return[{type:"raw",geometry:e.HEAD_VENT_RIGHT_1.geometry,material:e.HEAD_VENT_RIGHT_1.material,scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload($J);const CJ="/gpu-programming/assets/LEFT_ARM_1-B8yh6mwG.glb";function kbe(n){const{nodes:e}=Gt(CJ);return[{type:"raw",geometry:e.LEFT_ARM_1.geometry,material:e.LEFT_ARM_1.material,scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(CJ);const MJ="/gpu-programming/assets/LEFT_ARM_CONNECTOR_1-CXrHlUi5.glb";function Obe(n){const{nodes:e}=Gt(MJ);return[{type:"raw",geometry:e.LEFT_ARM_CONNECTOR_1.geometry,material:e.LEFT_ARM_CONNECTOR_1.material,scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(MJ);const AJ="/gpu-programming/assets/MIDDLE_LEFT_WHEEL_1-BAVTGYOT.glb";function Lbe(n){const{nodes:e}=Gt(AJ);return[{type:"raw",geometry:e.MIDDLE_LEFT_WHEEL_1.geometry,material:e.MIDDLE_LEFT_WHEEL_1.material,scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(AJ);const IJ="/gpu-programming/assets/MIDDLE_RIGHT_WHEEL_1-GMj8YSda.glb";function Nbe(n){const{nodes:e}=Gt(IJ);return[{type:"raw",geometry:e.MIDDLE_RIGHT_WHEEL_1.geometry,material:e.MIDDLE_RIGHT_WHEEL_1.material,scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(IJ);const RJ="/gpu-programming/assets/NECK_GLOBE_BASE_1-CpAA3cya.glb";function Dbe(n){const{nodes:e}=Gt(RJ);return[{type:"raw",geometry:e.NECK_GLOBE_BASE_1.geometry,material:e.NECK_GLOBE_BASE_1.material,scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(RJ);const kJ="/gpu-programming/assets/REAR_LEFT_WHEEL_1-Ca-hbPaC.glb";function Pbe(n){const{nodes:e}=Gt(kJ);return[{type:"raw",geometry:e.REAR_LEFT_WHEEL_1.geometry,material:e.REAR_LEFT_WHEEL_1.material,scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(kJ);const OJ="/gpu-programming/assets/REAR_RIGHT_WHEEL_1-DLUpOsjA.glb";function Bbe(n){const{nodes:e}=Gt(OJ);return[{type:"raw",geometry:e.REAR_RIGHT_WHEEL_1.geometry,material:e.REAR_RIGHT_WHEEL_1.material,scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(OJ);const LJ="/gpu-programming/assets/RIGHT_ARM_1-CsUyYnQa.glb";function Fbe(n){const{nodes:e}=Gt(LJ);return[{type:"raw",geometry:e.RIGHT_ARM_1.geometry,material:e.RIGHT_ARM_1.material,scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(LJ);const NJ="/gpu-programming/assets/RIGHT_ARM_CONNECTOR_1-Og6IFGgn.glb";function zbe(n){const{nodes:e}=Gt(NJ);return[{type:"raw",geometry:e.RIGHT_ARM_CONNECTOR_1.geometry,material:e.RIGHT_ARM_CONNECTOR_1.material,scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(NJ);const DJ="/gpu-programming/assets/Torso_1-Dsttb7Xv.glb";function Ube(n){const{nodes:e}=Gt(DJ);return[{type:"raw",geometry:e.Torso_1.geometry,material:e.Torso_1.material,scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(DJ);const PJ="/gpu-programming/assets/VISOR_GLASS_1-DUgs1YBX.glb";function Hbe(n){const{nodes:e}=Gt(PJ);return[{type:"raw",geometry:e.VISOR_GLASS_1.geometry,material:e.VISOR_GLASS_1.material,scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(PJ);const BJ="/gpu-programming/assets/eyes_acceptance-DjNbu5s_.glb";function Gbe(n){const{nodes:e,materials:t}=Gt(BJ);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(BJ);const FJ="/gpu-programming/assets/eyes_admiration-KaqH2ZpQ.glb";function Wbe(n){const{nodes:e,materials:t}=Gt(FJ);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(FJ);const zJ="/gpu-programming/assets/eyes_amazement-DWEI8ZWl.glb";function Vbe(n){const{nodes:e,materials:t}=Gt(zJ);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(zJ);const UJ="/gpu-programming/assets/eyes_anger-BE-ut2mR.glb";function jbe(n){const{nodes:e,materials:t}=Gt(UJ);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(UJ);const HJ="/gpu-programming/assets/eyes_anticipation-b4B017F8.glb";function Ybe(n){const{nodes:e,materials:t}=Gt(HJ);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(HJ);const GJ="/gpu-programming/assets/eyes_annoyed-B_lb9L_O.glb";function Xbe(n){const{nodes:e,materials:t}=Gt(GJ);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(GJ);const WJ="/gpu-programming/assets/eyes_apprehension-DO3PTom6.glb";function Kbe(n){const{nodes:e,materials:t}=Gt(WJ);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(WJ);const VJ="/gpu-programming/assets/eyes_apprehension_1-KlPiBiR4.glb";function Jbe(n){const{nodes:e,materials:t}=Gt(VJ);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(VJ);const jJ="/gpu-programming/assets/eyes_boredom-C30alIvQ.glb";function qbe(n){const{nodes:e,materials:t}=Gt(jJ);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(jJ);const YJ="/gpu-programming/assets/eyes_default-CiQ6MqPO.glb";function mG(n){const{nodes:e,materials:t}=Gt(YJ);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(YJ);const XJ="/gpu-programming/assets/eyes_disgust-BPb8pu-1.glb";function Qbe(n){const{nodes:e,materials:t}=Gt(XJ);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(XJ);const KJ="/gpu-programming/assets/eyes_ecstacy_frame_1-CAg4aUVn.glb";function Zbe(n){const{nodes:e,materials:t}=Gt(KJ);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(KJ);const JJ="/gpu-programming/assets/eyes_ecstacy_frame_2-BOv7MWj_.glb";function e1e(n){const{nodes:e,materials:t}=Gt(JJ);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(JJ);const qJ="/gpu-programming/assets/eyes_fear-BL8fvSZL.glb";function t1e(n){const{nodes:e,materials:t}=Gt(qJ);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(qJ);const QJ="/gpu-programming/assets/eyes_grief-cP7yoD10.glb";function n1e(n){const{nodes:e,materials:t}=Gt(QJ);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(QJ);const ZJ="/gpu-programming/assets/eyes_interest-TZH0NZC_.glb";function r1e(n){const{nodes:e,materials:t}=Gt(ZJ);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(ZJ);const eq="/gpu-programming/assets/eyes_joy-B6oifIYP.glb";function i1e(n){const{nodes:e,materials:t}=Gt(eq);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(eq);const tq="/gpu-programming/assets/eyes_loathing-C8bUCbQG.glb";function s1e(n){const{nodes:e,materials:t}=Gt(tq);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(tq);const nq="/gpu-programming/assets/eyes_pensiveness-rZoWlZ1k.glb";function o1e(n){const{nodes:e,materials:t}=Gt(nq);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(nq);const rq="/gpu-programming/assets/eyes_rage-BpM8Xr2x.glb";function a1e(n){const{nodes:e,materials:t}=Gt(rq);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(rq);const iq="/gpu-programming/assets/eyes_sad-Coo-r01z.glb";function l1e(n){const{nodes:e,materials:t}=Gt(iq);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(iq);const sq="/gpu-programming/assets/eyes_serenity-C07tnszo.glb";function u1e(n){const{nodes:e,materials:t}=Gt(sq);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(sq);const oq="/gpu-programming/assets/eyes_surprise-eDHO2SUu.glb";function c1e(n){const{nodes:e,materials:t}=Gt(oq);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(oq);const aq="/gpu-programming/assets/eyes_terror-CHUlLq9_.glb";function h1e(n){const{nodes:e,materials:t}=Gt(aq);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(aq);const lq="/gpu-programming/assets/eyes_trust-DX4X5mD0.glb";function d1e(n){const{nodes:e,materials:t}=Gt(lq);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(lq);const uq="/gpu-programming/assets/eyes_vigilance-CGqg-60Y.glb";function f1e(n){const{nodes:e,materials:t}=Gt(uq);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(uq);const cq="/gpu-programming/assets/e_Sleeping-2563MAKh.glb";function p1e(n){const{nodes:e,materials:t}=Gt(cq);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(cq);const hq="/gpu-programming/assets/e_SleepingZZZ-CGdMpHBj.glb";function m1e(n){const{nodes:e,materials:t}=Gt(hq);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(hq);const dq="/gpu-programming/assets/e_Contempt-Bmkm0Bdj.glb";function g1e(n){const{nodes:e,materials:t}=Gt(dq);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(dq);const fq="/gpu-programming/assets/e_ContentLeft-C4jtUFpf.glb";function _1e(n){const{nodes:e,materials:t}=Gt(fq);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(fq);const pq="/gpu-programming/assets/e_ContentRight-BNMUpyf0.glb";function v1e(n){const{nodes:e,materials:t}=Gt(pq);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(pq);const mq="/gpu-programming/assets/e_Disoriented-DCBMT2ea.glb";function y1e(n){const{nodes:e,materials:t}=Gt(mq);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(mq);const gq="/gpu-programming/assets/e_EcstacyHilarious-Cl8xGsKE.glb";function b1e(n){const{nodes:e,materials:t}=Gt(gq);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(gq);const _q="/gpu-programming/assets/e_EcstacyStarryEyed-DRKN_BY4.glb";function T1e(n){const{nodes:e,materials:t}=Gt(_q);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(_q);const vq="/gpu-programming/assets/e_JoyGoofy-B110L9cn.glb";function S1e(n){const{nodes:e,materials:t}=Gt(vq);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(vq);const yq="/gpu-programming/assets/e_JoyGoofy2-BkM5jGNL.glb";function w1e(n){const{nodes:e,materials:t}=Gt(yq);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(yq);const bq="/gpu-programming/assets/e_JoyGoofy3-BJy3tNhw.glb";function E1e(n){const{nodes:e,materials:t}=Gt(bq);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(bq);const Tq="/gpu-programming/assets/e_Love-BGY9OUZu.glb";function x1e(n){const{nodes:e,materials:t}=Gt(Tq);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(Tq);const Sq="/gpu-programming/assets/e_Rage-C3KmRLkq.glb";function $1e(n){const{nodes:e,materials:t}=Gt(Sq);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(Sq);const wq="/gpu-programming/assets/e_Rage2-mVNSFSuR.glb";function C1e(n){const{nodes:e,materials:t}=Gt(wq);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(wq);const Eq="/gpu-programming/assets/e_Rage3-BfYM2b7r.glb";function M1e(n){const{nodes:e,materials:t}=Gt(Eq);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(Eq);const xq="/gpu-programming/assets/e_Rage4-oo9re96u.glb";function A1e(n){const{nodes:e,materials:t}=Gt(xq);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(xq);const $q="/gpu-programming/assets/e_RemorseShame-BrJPOqTm.glb";function I1e(n){const{nodes:e,materials:t}=Gt($q);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload($q);const R1e={"package://misty_description/meshes/BASE_FRONT_GRILL_1.stl":_be,"package://misty_description/meshes/BASE_LEFT_COVER_1.stl":vbe,"package://misty_description/meshes/base_link.stl":ybe,"package://misty_description/meshes/BASE_RIGHT_COVER_1.stl":bbe,"package://misty_description/meshes/Battery_1.stl":Tbe,"package://misty_description/meshes/BODY_BASE_CONNECTOR_1.stl":Sbe,"package://misty_description/meshes/EYE_LENS_1.stl":xbe,"package://misty_description/meshes/FACE_1.stl":$be,"package://misty_description/meshes/FRONT_LEFT_WHEEL_1.stl":Cbe,"package://misty_description/meshes/FRONT_RIGHT_WHEEL_1.stl":Mbe,"package://misty_description/meshes/HEAD_1.stl":Abe,"package://misty_description/meshes/HEAD_VENT_LEFT_1.stl":Ibe,"package://misty_description/meshes/HEAD_VENT_RIGHT_1.stl":Rbe,"package://misty_description/meshes/LEFT_ARM_1.stl":kbe,"package://misty_description/meshes/LEFT_ARM_CONNECTOR_1.stl":Obe,"package://misty_description/meshes/MIDDLE_LEFT_WHEEL_1.stl":Lbe,"package://misty_description/meshes/MIDDLE_RIGHT_WHEEL_1.stl":Nbe,"package://misty_description/meshes/NECK_GLOBE_BASE_1.stl":Dbe,"package://misty_description/meshes/REAR_LEFT_WHEEL_1.stl":Pbe,"package://misty_description/meshes/REAR_RIGHT_WHEEL_1.stl":Bbe,"package://misty_description/meshes/RIGHT_ARM_1.stl":Fbe,"package://misty_description/meshes/RIGHT_ARM_CONNECTOR_1.stl":zbe,"package://misty_description/meshes/Torso_1.stl":Ube,"package://misty_description/meshes/VISOR_GLASS_1.stl":Hbe,e_Sleeping:p1e,e_SleepingZZZ:m1e,e_Contempt:g1e,e_ContentLeft:_1e,e_ContentRight:v1e,e_Disoriented:y1e,e_EcstacyHilarious:b1e,e_EcstacyStarryEyed:T1e,e_JoyGoofy:S1e,e_JoyGoofy2:w1e,e_JoyGoofy3:E1e,e_Love:x1e,e_Rage:$1e,e_Rage2:C1e,e_Rage3:M1e,e_Rage4:A1e,e_RemorseShame:I1e,eyes_acceptance:Gbe,eyes_admiration:Wbe,eyes_amazement:Vbe,eyes_anger:jbe,eyes_annoyed:Xbe,eyes_anticipation:Ybe,eyes_apprehension:Kbe,eyes_apprehension_1:Jbe,eyes_boredom:qbe,eyes_default:mG,eyes_disgust:Qbe,eyes_distraction:mG,eyes_ecstasy_frame_1:Zbe,eyes_ecstasy_frame_2:e1e,eyes_fear:t1e,eyes_grief:n1e,eyes_interest:r1e,eyes_joy:i1e,eyes_loathing:s1e,eyes_pensiveness:o1e,eyes_rage:a1e,eyes_sad:l1e,eyes_serenity:u1e,eyes_surprise:c1e,eyes_terror:h1e,eyes_trust:d1e,eyes_vigilance:f1e};/** + */(function(n){function e(J,re){var se=J.length;J.push(re);e:for(;0>>1,Te=J[fe];if(0>>1;fes(qe,se))Res(Ze,qe)?(J[fe]=Ze,J[Re]=se,fe=Re):(J[fe]=qe,J[Ie]=se,fe=Ie);else if(Res(Ze,se))J[fe]=Ze,J[Re]=se,fe=Re;else break e}}return re}function s(J,re){var se=J.sortIndex-re.sortIndex;return se!==0?se:J.id-re.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;n.unstable_now=function(){return o.now()}}else{var l=Date,u=l.now();n.unstable_now=function(){return l.now()-u}}var h=[],f=[],g=1,y=null,b=3,w=!1,C=!1,M=!1,A=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,L=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function P(J){for(var re=t(f);re!==null;){if(re.callback===null)r(f);else if(re.startTime<=J)r(f),re.sortIndex=re.expirationTime,e(h,re);else break;re=t(f)}}function D(J){if(M=!1,P(J),!C)if(t(h)!==null)C=!0,ge(z);else{var re=t(f);re!==null&&we(D,re.startTime-J)}}function z(J,re){C=!1,M&&(M=!1,k(H),H=-1),w=!0;var se=b;try{for(P(re),y=t(h);y!==null&&(!(y.expirationTime>re)||J&&!Z());){var fe=y.callback;if(typeof fe=="function"){y.callback=null,b=y.priorityLevel;var Te=fe(y.expirationTime<=re);re=n.unstable_now(),typeof Te=="function"?y.callback=Te:y===t(h)&&r(h),P(re)}else r(h);y=t(h)}if(y!==null)var Fe=!0;else{var Ie=t(f);Ie!==null&&we(D,Ie.startTime-re),Fe=!1}return Fe}finally{y=null,b=se,w=!1}}var U=!1,V=null,H=-1,oe=5,le=-1;function Z(){return!(n.unstable_now()-leJ||125fe?(J.sortIndex=se,e(f,J),t(h)===null&&J===t(f)&&(M?(k(H),H=-1):M=!0,we(D,se-fe))):(J.sortIndex=Te,e(h,J),C||w||(C=!0,ge(z))),J},n.unstable_shouldYield=Z,n.unstable_wrapCallback=function(J){var re=b;return function(){var se=b;b=re;try{return J.apply(this,arguments)}finally{b=se}}}})(sJ);iJ.exports=sJ;var iG=iJ.exports;const Tye=n=>typeof n=="object"&&typeof n.then=="function",E1=[];function oJ(n,e,t=(r,s)=>r===s){if(n===e)return!0;if(!n||!e)return!1;const r=n.length;if(e.length!==r)return!1;for(let s=0;s0&&(o.timeout&&clearTimeout(o.timeout),o.timeout=setTimeout(o.remove,r.lifespan)),o.response;if(!t)throw o.promise}const s={keys:e,equal:r.equal,remove:()=>{const o=E1.indexOf(s);o!==-1&&E1.splice(o,1)},promise:(Tye(n)?n:n(...e)).then(o=>{s.response=o,r.lifespan&&r.lifespan>0&&(s.timeout=setTimeout(s.remove,r.lifespan))}).catch(o=>s.error=o)};if(E1.push(s),!t)throw s.promise}const Sye=(n,e,t)=>aJ(n,e,!1,t),wye=(n,e,t)=>void aJ(n,e,!0,t),Eye=n=>{if(n===void 0||n.length===0)E1.splice(0,E1.length);else{const e=E1.find(t=>oJ(n,t.keys,t.equal));e&&e.remove()}},lJ={};function xye(n,e){function t(g,{args:y=[],attach:b,...w},C){let M=`${g[0].toUpperCase()}${g.slice(1)}`,A;if(g==="primitive"){if(w.object===void 0)throw new Error("R3F: Primitives without 'object' are invalid!");const k=w.object;A=sx(k,{type:g,root:C,attach:b,primitive:!0})}else{const k=lJ[M];if(!k)throw new Error(`R3F: ${M} is not part of the THREE namespace! Did you forget to extend? See: https://docs.pmnd.rs/react-three-fiber/api/objects#using-3rd-party-objects-declaratively`);if(!Array.isArray(y))throw new Error("R3F: The args prop must be an array!");A=sx(new k(...y),{type:g,root:C,attach:b,memoizedProps:{args:y}})}return A.__r3f.attach===void 0&&(A instanceof Zy?A.__r3f.attach="geometry":A instanceof Dy&&(A.__r3f.attach="material")),M!=="inject"&&lL(A,w),A}function r(g,y){let b=!1;if(y){var w,C;(w=y.__r3f)!=null&&w.attach?aL(g,y,y.__r3f.attach):y.isObject3D&&g.isObject3D&&(g.add(y),b=!0),b||(C=g.__r3f)==null||C.objects.push(y),y.__r3f||sx(y,{}),y.__r3f.parent=g,JD(y),NS(y)}}function s(g,y,b){let w=!1;if(y){var C,M;if((C=y.__r3f)!=null&&C.attach)aL(g,y,y.__r3f.attach);else if(y.isObject3D&&g.isObject3D){y.parent=g,y.dispatchEvent({type:"added"}),g.dispatchEvent({type:"childadded",child:y});const A=g.children.filter(L=>L!==y),k=A.indexOf(b);g.children=[...A.slice(0,k),y,...A.slice(k)],w=!0}w||(M=g.__r3f)==null||M.objects.push(y),y.__r3f||sx(y,{}),y.__r3f.parent=g,JD(y),NS(y)}}function o(g,y,b=!1){g&&[...g].forEach(w=>l(y,w,b))}function l(g,y,b){if(y){var w,C,M;if(y.__r3f&&(y.__r3f.parent=null),(w=g.__r3f)!=null&&w.objects&&(g.__r3f.objects=g.__r3f.objects.filter(D=>D!==y)),(C=y.__r3f)!=null&&C.attach)uG(g,y,y.__r3f.attach);else if(y.isObject3D&&g.isObject3D){var A;g.remove(y),(A=y.__r3f)!=null&&A.root&&Oye(mI(y),y)}const L=(M=y.__r3f)==null?void 0:M.primitive,P=!L&&(b===void 0?y.dispose!==null:b);if(!L){var k;o((k=y.__r3f)==null?void 0:k.objects,y,P),o(y.children,y,P)}if(delete y.__r3f,P&&y.dispose&&y.type!=="Scene"){const D=()=>{try{y.dispose()}catch{}};typeof IS_REACT_ACT_ENVIRONMENT>"u"?iG.unstable_scheduleCallback(iG.unstable_IdlePriority,D):D()}NS(g)}}function u(g,y,b,w){var C;const M=(C=g.__r3f)==null?void 0:C.parent;if(!M)return;const A=t(y,b,g.__r3f.root);if(g.children){for(const k of g.children)k.__r3f&&r(A,k);g.children=g.children.filter(k=>!k.__r3f)}g.__r3f.objects.forEach(k=>r(A,k)),g.__r3f.objects=[],g.__r3f.autoRemovedBeforeAppend||l(M,g),A.parent&&(A.__r3f.autoRemovedBeforeAppend=!0),r(M,A),A.raycast&&A.__r3f.eventCount&&mI(A).getState().internal.interaction.push(A),[w,w.alternate].forEach(k=>{k!==null&&(k.stateNode=A,k.ref&&(typeof k.ref=="function"?k.ref(A):k.ref.current=A))})}const h=()=>console.warn("Text is not allowed in the R3F tree! This could be stray whitespace or characters.");return{reconciler:bye({createInstance:t,removeChild:l,appendChild:r,appendInitialChild:r,insertBefore:s,supportsMutation:!0,isPrimaryRenderer:!1,supportsPersistence:!1,supportsHydration:!1,noTimeout:-1,appendChildToContainer:(g,y)=>{if(!y)return;const b=g.getState().scene;b.__r3f&&(b.__r3f.root=g,r(b,y))},removeChildFromContainer:(g,y)=>{y&&l(g.getState().scene,y)},insertInContainerBefore:(g,y,b)=>{if(!y||!b)return;const w=g.getState().scene;w.__r3f&&s(w,y,b)},getRootHostContext:()=>null,getChildHostContext:g=>g,finalizeInitialChildren(g){var y;return!!((y=g==null?void 0:g.__r3f)!=null?y:{}).handlers},prepareUpdate(g,y,b,w){var C;if(((C=g==null?void 0:g.__r3f)!=null?C:{}).primitive&&w.object&&w.object!==g)return[!0];{const{args:A=[],children:k,...L}=w,{args:P=[],children:D,...z}=b;if(!Array.isArray(A))throw new Error("R3F: the args prop must be an array!");if(A.some((V,H)=>V!==P[H]))return[!0];const U=cJ(g,L,z,!0);return U.changes.length?[!1,U]:null}},commitUpdate(g,[y,b],w,C,M,A){y?u(g,w,M,A):lL(g,b)},commitMount(g,y,b,w){var C;const M=(C=g.__r3f)!=null?C:{};g.raycast&&M.handlers&&M.eventCount&&mI(g).getState().internal.interaction.push(g)},getPublicInstance:g=>g,prepareForCommit:()=>null,preparePortalMount:g=>sx(g.getState().scene),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance(g){var y;const{attach:b,parent:w}=(y=g.__r3f)!=null?y:{};b&&w&&uG(w,g,b),g.isObject3D&&(g.visible=!1),NS(g)},unhideInstance(g,y){var b;const{attach:w,parent:C}=(b=g.__r3f)!=null?b:{};w&&C&&aL(C,g,w),(g.isObject3D&&y.visible==null||y.visible)&&(g.visible=!0),NS(g)},createTextInstance:h,hideTextInstance:h,unhideTextInstance:h,getCurrentEventPriority:()=>e?e():Rx.DefaultEventPriority,beforeActiveInstanceBlur:()=>{},afterActiveInstanceBlur:()=>{},detachDeletedInstance:()=>{},now:typeof performance<"u"&&sp.fun(performance.now)?performance.now:sp.fun(Date.now)?Date.now:()=>0,scheduleTimeout:sp.fun(setTimeout)?setTimeout:void 0,cancelTimeout:sp.fun(clearTimeout)?clearTimeout:void 0}),applyProps:lL}}var sG,oG;const oL=n=>"colorSpace"in n||"outputColorSpace"in n,$ye=()=>{var n;return(n=lJ.ColorManagement)!=null?n:null};typeof window<"u"&&((sG=window.document)!=null&&sG.createElement||((oG=window.navigator)==null?void 0:oG.product)==="ReactNative")?me.useLayoutEffect:me.useEffect;class Cye extends me.Component{constructor(...e){super(...e),this.state={error:!1}}componentDidCatch(e){this.props.set(e)}render(){return this.state.error?null:this.props.children}}Cye.getDerivedStateFromError=()=>({error:!0});const uJ="__default",aG=new Map,Mye=n=>n&&!!n.memoized&&!!n.changes;function mI(n){let e=n.__r3f.root;for(;e.getState().previousRoot;)e=e.getState().previousRoot;return e}const sp={obj:n=>n===Object(n)&&!sp.arr(n)&&typeof n!="function",fun:n=>typeof n=="function",str:n=>typeof n=="string",num:n=>typeof n=="number",boo:n=>typeof n=="boolean",und:n=>n===void 0,arr:n=>Array.isArray(n),equ(n,e,{arrays:t="shallow",objects:r="reference",strict:s=!0}={}){if(typeof n!=typeof e||!!n!=!!e)return!1;if(sp.str(n)||sp.num(n))return n===e;const o=sp.obj(n);if(o&&r==="reference")return n===e;const l=sp.arr(n);if(l&&t==="reference")return n===e;if((l||o)&&n===e)return!0;let u;for(u in n)if(!(u in e))return!1;if(o&&t==="shallow"&&r==="shallow"){for(u in s?e:n)if(!sp.equ(n[u],e[u],{strict:s,objects:"reference"}))return!1}else for(u in s?e:n)if(n[u]!==e[u])return!1;if(sp.und(u)){if(l&&n.length===0&&e.length===0||o&&Object.keys(n).length===0&&Object.keys(e).length===0)return!0;if(n!==e)return!1}return!0}};function Aye(n){const e={nodes:{},materials:{}};return n&&n.traverse(t=>{t.name&&(e.nodes[t.name]=t),t.material&&!e.materials[t.material.name]&&(e.materials[t.material.name]=t.material)}),e}function sx(n,e){const t=n;return t.__r3f={type:"",root:null,previousAttach:null,memoizedProps:{},eventCount:0,handlers:{},objects:[],parent:null,...e},n}function KD(n,e){let t=n;if(e.includes("-")){const r=e.split("-"),s=r.pop();return t=r.reduce((o,l)=>o[l],n),{target:t,key:s}}else return{target:t,key:e}}const lG=/-\d+$/;function aL(n,e,t){if(sp.str(t)){if(lG.test(t)){const o=t.replace(lG,""),{target:l,key:u}=KD(n,o);Array.isArray(l[u])||(l[u]=[])}const{target:r,key:s}=KD(n,t);e.__r3f.previousAttach=r[s],r[s]=e}else e.__r3f.previousAttach=t(n,e)}function uG(n,e,t){var r,s;if(sp.str(t)){const{target:o,key:l}=KD(n,t),u=e.__r3f.previousAttach;u===void 0?delete o[l]:o[l]=u}else(r=e.__r3f)==null||r.previousAttach==null||r.previousAttach(n,e);(s=e.__r3f)==null||delete s.previousAttach}function cJ(n,{children:e,key:t,ref:r,...s},{children:o,key:l,ref:u,...h}={},f=!1){var g;const y=(g=n==null?void 0:n.__r3f)!=null?g:{},b=Object.entries(s),w=[];if(f){const M=Object.keys(h);for(let A=0;A{var k;if((k=n.__r3f)!=null&&k.primitive&&M==="object"||sp.equ(A,h[M]))return;if(/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/.test(M))return w.push([M,A,!0,[]]);let L=[];M.includes("-")&&(L=M.split("-")),w.push([M,A,!1,L]);for(const P in s){const D=s[P];P.startsWith(`${M}-`)&&w.push([P,D,!1,P.split("-")])}});const C={...s};return y.memoizedProps&&y.memoizedProps.args&&(C.args=y.memoizedProps.args),y.memoizedProps&&y.memoizedProps.attach&&(C.attach=y.memoizedProps.attach),{memoized:C,changes:w}}const Iye=typeof process<"u"&&!1;function lL(n,e){var t,r,s;const o=(t=n.__r3f)!=null?t:{},l=o.root,u=(r=l==null||l.getState==null?void 0:l.getState())!=null?r:{},{memoized:h,changes:f}=Mye(e)?e:cJ(n,e),g=o.eventCount;n.__r3f&&(n.__r3f.memoizedProps=h);for(let b=0;bP[D],n),!(L&&L.set))){const[P,...D]=A.reverse();k=D.reverse().reduce((z,U)=>z[U],n),w=P}if(C===uJ+"remove")if(k.constructor){let P=aG.get(k.constructor);P||(P=new k.constructor,aG.set(k.constructor,P)),C=P[w]}else C=0;if(M)C?o.handlers[w]=C:delete o.handlers[w],o.eventCount=Object.keys(o.handlers).length;else if(L&&L.set&&(L.copy||L instanceof iI)){if(Array.isArray(C))L.fromArray?L.fromArray(C):L.set(...C);else if(L.copy&&C&&C.constructor&&(Iye?L.constructor.name===C.constructor.name:L.constructor===C.constructor))L.copy(C);else if(C!==void 0){const P=L instanceof Ph;!P&&L.setScalar?L.setScalar(C):L instanceof iI&&C instanceof iI?L.mask=C.mask:L.set(C),!$ye()&&!u.linear&&P&&L.convertSRGBToLinear()}}else if(k[w]=C,k[w]instanceof Lm&&k[w].format===G3&&k[w].type===sX){const P=k[w];oL(P)&&oL(u.gl)?P.colorSpace=u.gl.outputColorSpace:P.encoding=u.gl.outputEncoding}NS(n)}if(o.parent&&n.raycast&&g!==o.eventCount){const b=mI(n).getState().internal,w=b.interaction.indexOf(n);w>-1&&b.interaction.splice(w,1),o.eventCount&&b.interaction.push(n)}return!(f.length===1&&f[0][0]==="onUpdate")&&f.length&&(s=n.__r3f)!=null&&s.parent&&JD(n),n}function NS(n){var e,t;const r=(e=n.__r3f)==null||(t=e.root)==null||t.getState==null?void 0:t.getState();r&&r.internal.frames===0&&r.invalidate()}function JD(n){n.onUpdate==null||n.onUpdate(n)}function Rye(){var n;const e=typeof self<"u"&&self||typeof window<"u"&&window;if(!e)return Rx.DefaultEventPriority;switch((n=e.event)==null?void 0:n.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return Rx.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return Rx.ContinuousEventPriority;default:return Rx.DefaultEventPriority}}function kye(n,e,t,r){const s=t.get(e);s&&(t.delete(e),t.size===0&&(n.delete(r),s.target.releasePointerCapture(r)))}function Oye(n,e){const{internal:t}=n.getState();t.interaction=t.interaction.filter(r=>r!==e),t.initialHits=t.initialHits.filter(r=>r!==e),t.hovered.forEach((r,s)=>{(r.eventObject===e||r.object===e)&&t.hovered.delete(s)}),t.capturedMap.forEach((r,s)=>{kye(t.capturedMap,e,r,s)})}const cG=new WeakMap;function hJ(n,e){return function(t,...r){let s=cG.get(t);return s||(s=new t,cG.set(t,s)),n&&n(s),Promise.all(r.map(o=>new Promise((l,u)=>s.load(o,h=>{h.scene&&Object.assign(h,Aye(h.scene)),l(h)},e,h=>u(new Error(`Could not load ${o}: ${h==null?void 0:h.message}`)))))).finally(()=>s.dispose==null?void 0:s.dispose())}}function AC(n,e,t,r){const s=Array.isArray(e)?e:[e],o=Sye(hJ(t,r),[n,...s],{equal:sp.equ});return Array.isArray(e)?o:o[0]}AC.preload=function(n,e,t){const r=Array.isArray(e)?e:[e];return wye(hJ(t),[n,...r])};AC.clear=function(n,e){const t=Array.isArray(e)?e:[e];return Eye([n,...t])};const Lye=new Map,{reconciler:Nye,applyProps:EBe}=xye(Lye,Rye);Nye.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:me.version});function hG(n,e){if(e===Loe)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),n;if(e===MD||e===oX){let t=n.getIndex();if(t===null){const l=[],u=n.getAttribute("position");if(u!==void 0){for(let h=0;h=2.0 are supported."));return}const h=new fbe(o,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});h.fileLoader.setRequestHeader(this.requestHeader);for(let f=0;f=0&&u[g]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+g+'".')}}h.setExtensions(l),h.setPlugins(u),h.parse(r,s)}parseAsync(e,t){const r=this;return new Promise(function(s,o){r.parse(e,t,s,o)})}}function Pye(){let n={};return{get:function(e){return n[e]},add:function(e,t){n[e]=t},remove:function(e){delete n[e]},removeAll:function(){n={}}}}const js={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_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class Bye{constructor(e){this.parser=e,this.name=js.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let r=0,s=t.length;r=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,o.source,l)}}class Jye{constructor(e){this.parser=e,this.name=js.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const t=this.name,r=this.parser,s=r.json,o=s.textures[e];if(!o.extensions||!o.extensions[t])return null;const l=o.extensions[t],u=s.images[l.source];let h=r.textureLoader;if(u.uri){const f=r.options.manager.getHandler(u.uri);f!==null&&(h=f)}return this.detectSupport().then(function(f){if(f)return r.loadTextureImage(e,l.source,h);if(s.extensionsRequired&&s.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return r.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(t.height===1)}})),this.isSupported}}class qye{constructor(e){this.parser=e,this.name=js.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const t=this.name,r=this.parser,s=r.json,o=s.textures[e];if(!o.extensions||!o.extensions[t])return null;const l=o.extensions[t],u=s.images[l.source];let h=r.textureLoader;if(u.uri){const f=r.options.manager.getHandler(u.uri);f!==null&&(h=f)}return this.detectSupport().then(function(f){if(f)return r.loadTextureImage(e,l.source,h);if(s.extensionsRequired&&s.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return r.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class Qye{constructor(e){this.name=js.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,r=t.bufferViews[e];if(r.extensions&&r.extensions[this.name]){const s=r.extensions[this.name],o=this.parser.getDependency("buffer",s.buffer),l=this.parser.options.meshoptDecoder;if(!l||!l.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 o.then(function(u){const h=s.byteOffset||0,f=s.byteLength||0,g=s.count,y=s.byteStride,b=new Uint8Array(u,h,f);return l.decodeGltfBufferAsync?l.decodeGltfBufferAsync(g,y,b,s.mode,s.filter).then(function(w){return w.buffer}):l.ready.then(function(){const w=new ArrayBuffer(g*y);return l.decodeGltfBuffer(new Uint8Array(w),g,y,b,s.mode,s.filter),w})})}else return null}}class Zye{constructor(e){this.name=js.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,r=t.nodes[e];if(!r.extensions||!r.extensions[this.name]||r.mesh===void 0)return null;const s=t.meshes[r.mesh];for(const f of s.primitives)if(f.mode!==cg.TRIANGLES&&f.mode!==cg.TRIANGLE_STRIP&&f.mode!==cg.TRIANGLE_FAN&&f.mode!==void 0)return null;const l=r.extensions[this.name].attributes,u=[],h={};for(const f in l)u.push(this.parser.getDependency("accessor",l[f]).then(g=>(h[f]=g,h[f])));return u.length<1?null:(u.push(this.parser.createNodeMesh(e)),Promise.all(u).then(f=>{const g=f.pop(),y=g.isGroup?g.children:[g],b=f[0].count,w=[];for(const C of y){const M=new Ys,A=new Pt,k=new Pu,L=new Pt(1,1,1),P=new Iae(C.geometry,C.material,b);for(let D=0;D=152?{TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3"}:{TEXCOORD_0:"uv",TEXCOORD_1:"uv2"},COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},ry={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},obe={CUBICSPLINE:void 0,LINEAR:Aw,STEP:x$},cL={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function abe(n){return n.DefaultMaterial===void 0&&(n.DefaultMaterial=new q3({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:nR})),n.DefaultMaterial}function Wb(n,e,t){for(const r in t.extensions)n[r]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[r]=t.extensions[r])}function vy(n,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(n.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function lbe(n,e,t){let r=!1,s=!1,o=!1;for(let f=0,g=e.length;f0||n.search(/^data\:image\/jpeg/)===0?"image/jpeg":n.search(/\.webp($|\?)/i)>0||n.search(/^data\:image\/webp/)===0?"image/webp":"image/png"}const dbe=new Ys;class fbe{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new Pye,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let r=!1,s=!1,o=-1;typeof navigator<"u"&&typeof navigator.userAgent<"u"&&(r=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)===!0,s=navigator.userAgent.indexOf("Firefox")>-1,o=s?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),typeof createImageBitmap>"u"||r||s&&o<98?this.textureLoader=new Yae(this.options.manager):this.textureLoader=new ele(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new rR(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const r=this,s=this.json,o=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(l){return l._markDefs&&l._markDefs()}),Promise.all(this._invokeAll(function(l){return l.beforeRoot&&l.beforeRoot()})).then(function(){return Promise.all([r.getDependencies("scene"),r.getDependencies("animation"),r.getDependencies("camera")])}).then(function(l){const u={scene:l[0][s.scene||0],scenes:l[0],animations:l[1],cameras:l[2],asset:s.asset,parser:r,userData:{}};Wb(o,u,s),vy(u,s),Promise.all(r._invokeAll(function(h){return h.afterRoot&&h.afterRoot(u)})).then(function(){e(u)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],r=this.json.meshes||[];for(let s=0,o=t.length;s{const h=this.associations.get(l);h!=null&&this.associations.set(u,h);for(const[f,g]of l.children.entries())o(g,u.children[f])};return o(r,s),s.name+="_instance_"+e.uses[t]++,s}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let r=0;r=2&&A.setY(oe,U[V*h+1]),h>=3&&A.setZ(oe,U[V*h+2]),h>=4&&A.setW(oe,U[V*h+3]),h>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return A})}loadTexture(e){const t=this.json,r=this.options,o=t.textures[e].source,l=t.images[o];let u=this.textureLoader;if(l.uri){const h=r.manager.getHandler(l.uri);h!==null&&(u=h)}return this.loadTextureImage(e,o,u)}loadTextureImage(e,t,r){const s=this,o=this.json,l=o.textures[e],u=o.images[t],h=(u.uri||u.bufferView)+":"+l.sampler;if(this.textureCache[h])return this.textureCache[h];const f=this.loadImageSource(t,r).then(function(g){g.flipY=!1,g.name=l.name||u.name||"",g.name===""&&typeof u.uri=="string"&&u.uri.startsWith("data:image/")===!1&&(g.name=u.uri);const b=(o.samplers||{})[l.sampler]||{};return g.magFilter=fG[b.magFilter]||z3,g.minFilter=fG[b.minFilter]||U3,g.wrapS=pG[b.wrapS]||w$,g.wrapT=pG[b.wrapT]||w$,s.associations.set(g,{textures:e}),g}).catch(function(){return null});return this.textureCache[h]=f,f}loadImageSource(e,t){const r=this,s=this.json,o=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(y=>y.clone());const l=s.images[e],u=self.URL||self.webkitURL;let h=l.uri||"",f=!1;if(l.bufferView!==void 0)h=r.getDependency("bufferView",l.bufferView).then(function(y){f=!0;const b=new Blob([y],{type:l.mimeType});return h=u.createObjectURL(b),h});else if(l.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const g=Promise.resolve(h).then(function(y){return new Promise(function(b,w){let C=b;t.isImageBitmapLoader===!0&&(C=function(M){const A=new Lm(M);A.needsUpdate=!0,b(A)}),t.load(O1.resolveURL(y,o.path),C,void 0,w)})}).then(function(y){return f===!0&&u.revokeObjectURL(h),y.userData.mimeType=l.mimeType||hbe(l.uri),y}).catch(function(y){throw console.error("THREE.GLTFLoader: Couldn't load texture",h),y});return this.sourceCache[e]=g,g}assignTexture(e,t,r,s){const o=this;return this.getDependency("texture",r.index).then(function(l){if(!l)return null;if(r.texCoord!==void 0&&r.texCoord>0&&(l=l.clone(),l.channel=r.texCoord),o.extensions[js.KHR_TEXTURE_TRANSFORM]){const u=r.extensions!==void 0?r.extensions[js.KHR_TEXTURE_TRANSFORM]:void 0;if(u){const h=o.associations.get(l);l=o.extensions[js.KHR_TEXTURE_TRANSFORM].extendTexture(l,u),o.associations.set(l,h)}}return s!==void 0&&("colorSpace"in l?l.colorSpace=s===3001?"srgb":"srgb-linear":l.encoding=s),e[t]=l,l})}assignFinalMaterial(e){const t=e.geometry;let r=e.material;const s=t.attributes.tangent===void 0,o=t.attributes.color!==void 0,l=t.attributes.normal===void 0;if(e.isPoints){const u="PointsMaterial:"+r.uuid;let h=this.cache.get(u);h||(h=new gX,Dy.prototype.copy.call(h,r),h.color.copy(r.color),h.map=r.map,h.sizeAttenuation=!1,this.cache.add(u,h)),r=h}else if(e.isLine){const u="LineBasicMaterial:"+r.uuid;let h=this.cache.get(u);h||(h=new mX,Dy.prototype.copy.call(h,r),h.color.copy(r.color),h.map=r.map,this.cache.add(u,h)),r=h}if(s||o||l){let u="ClonedMaterial:"+r.uuid+":";s&&(u+="derivative-tangents:"),o&&(u+="vertex-colors:"),l&&(u+="flat-shading:");let h=this.cache.get(u);h||(h=r.clone(),o&&(h.vertexColors=!0),l&&(h.flatShading=!0),s&&(h.normalScale&&(h.normalScale.y*=-1),h.clearcoatNormalScale&&(h.clearcoatNormalScale.y*=-1)),this.cache.add(u,h),this.associations.set(h,this.associations.get(r))),r=h}e.material=r}getMaterialType(){return q3}loadMaterial(e){const t=this,r=this.json,s=this.extensions,o=r.materials[e];let l;const u={},h=o.extensions||{},f=[];if(h[js.KHR_MATERIALS_UNLIT]){const y=s[js.KHR_MATERIALS_UNLIT];l=y.getMaterialType(),f.push(y.extendParams(u,o,t))}else{const y=o.pbrMetallicRoughness||{};if(u.color=new Ph(1,1,1),u.opacity=1,Array.isArray(y.baseColorFactor)){const b=y.baseColorFactor;u.color.fromArray(b),u.opacity=b[3]}y.baseColorTexture!==void 0&&f.push(t.assignTexture(u,"map",y.baseColorTexture,3001)),u.metalness=y.metallicFactor!==void 0?y.metallicFactor:1,u.roughness=y.roughnessFactor!==void 0?y.roughnessFactor:1,y.metallicRoughnessTexture!==void 0&&(f.push(t.assignTexture(u,"metalnessMap",y.metallicRoughnessTexture)),f.push(t.assignTexture(u,"roughnessMap",y.metallicRoughnessTexture))),l=this._invokeOne(function(b){return b.getMaterialType&&b.getMaterialType(e)}),f.push(Promise.all(this._invokeAll(function(b){return b.extendMaterialParams&&b.extendMaterialParams(e,u)})))}o.doubleSided===!0&&(u.side=Eoe);const g=o.alphaMode||cL.OPAQUE;if(g===cL.BLEND?(u.transparent=!0,u.depthWrite=!1):(u.transparent=!1,g===cL.MASK&&(u.alphaTest=o.alphaCutoff!==void 0?o.alphaCutoff:.5)),o.normalTexture!==void 0&&l!==qS&&(f.push(t.assignTexture(u,"normalMap",o.normalTexture)),u.normalScale=new cc(1,1),o.normalTexture.scale!==void 0)){const y=o.normalTexture.scale;u.normalScale.set(y,y)}return o.occlusionTexture!==void 0&&l!==qS&&(f.push(t.assignTexture(u,"aoMap",o.occlusionTexture)),o.occlusionTexture.strength!==void 0&&(u.aoMapIntensity=o.occlusionTexture.strength)),o.emissiveFactor!==void 0&&l!==qS&&(u.emissive=new Ph().fromArray(o.emissiveFactor)),o.emissiveTexture!==void 0&&l!==qS&&f.push(t.assignTexture(u,"emissiveMap",o.emissiveTexture,3001)),Promise.all(f).then(function(){const y=new l(u);return o.name&&(y.name=o.name),vy(y,o),t.associations.set(y,{materials:e}),o.extensions&&Wb(s,y,o),y})}createUniqueName(e){const t=Aa.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,r=this.extensions,s=this.primitiveCache;function o(u){return r[js.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(u,t).then(function(h){return mG(h,u,t)})}const l=[];for(let u=0,h=e.length;u0&&ube(k,o),k.name=t.createUniqueName(o.name||"mesh_"+e),vy(k,o),A.extensions&&Wb(s,k,A),t.assignFinalMaterial(k),y.push(k)}for(let w=0,C=y.length;w1?g=new LO:f.length===1?g=f[0]:g=new dh,g!==f[0])for(let y=0,b=f.length;y{const y=new Map;for(const[b,w]of s.associations)(b instanceof Dy||b instanceof Lm)&&y.set(b,w);return g.traverse(b=>{const w=s.associations.get(b);w!=null&&y.set(b,w)}),y};return s.associations=f(o),o})}}function pbe(n,e,t){const r=e.attributes,s=new Cv;if(r.POSITION!==void 0){const u=t.json.accessors[r.POSITION],h=u.min,f=u.max;if(h!==void 0&&f!==void 0){if(s.set(new Pt(h[0],h[1],h[2]),new Pt(f[0],f[1],f[2])),u.normalized){const g=QD(_w[u.componentType]);s.min.multiplyScalar(g),s.max.multiplyScalar(g)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const o=e.targets;if(o!==void 0){const u=new Pt,h=new Pt;for(let f=0,g=o.length;f{const u={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(l,u).then(t).catch(s)},r,s)}decodeDracoFile(e,t,r,s){const o={attributeIDs:r||this.defaultAttributeIDs,attributeTypes:s||this.defaultAttributeTypes,useUniqueIDs:!!r};this.decodeGeometry(e,o).then(t)}decodeGeometry(e,t){for(const h in t.attributeTypes){const f=t.attributeTypes[h];f.BYTES_PER_ELEMENT!==void 0&&(t.attributeTypes[h]=f.name)}const r=JSON.stringify(t);if(dL.has(e)){const h=dL.get(e);if(h.key===r)return h.promise;if(e.byteLength===0)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let s;const o=this.workerNextTaskID++,l=e.byteLength,u=this._getWorker(o,l).then(h=>(s=h,new Promise((f,g)=>{s._callbacks[o]={resolve:f,reject:g},s.postMessage({type:"decode",id:o,taskConfig:t,buffer:e},[e])}))).then(h=>this._createGeometry(h.geometry));return u.catch(()=>!0).then(()=>{s&&o&&this._releaseTask(s,o)}),dL.set(e,{key:r,promise:u}),u}_createGeometry(e){const t=new Zy;e.index&&t.setIndex(new Nm(e.index.array,1));for(let r=0;r{r.load(e,s,void 0,o)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;const e=typeof WebAssembly!="object"||this.decoderConfig.type==="js",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(r=>{const s=r[0];e||(this.decoderConfig.wasmBinary=r[1]);const o=gbe.toString(),l=["/* draco decoder */",s,"","/* worker */",o.substring(o.indexOf("{")+1,o.lastIndexOf("}"))].join(` +`);this.workerSourceURL=URL.createObjectURL(new Blob([l]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.lengtho._taskLoad?-1:1});const r=this.workerPool[this.workerPool.length-1];return r._taskCosts[e]=t,r._taskLoad+=t,r})}_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{const y=g.draco,b=new y.Decoder,w=new y.DecoderBuffer;w.Init(new Int8Array(h),h.byteLength);try{const C=t(y,b,w,f),M=C.attributes.map(A=>A.array.buffer);C.index&&M.push(C.index.array.buffer),self.postMessage({type:"decode",id:u.id,geometry:C},M)}catch(C){console.error(C),self.postMessage({type:"error",id:u.id,error:C.message})}finally{y.destroy(w),y.destroy(b)}});break}};function t(l,u,h,f){const g=f.attributeIDs,y=f.attributeTypes;let b,w;const C=u.GetEncodedGeometryType(h);if(C===l.TRIANGULAR_MESH)b=new l.Mesh,w=u.DecodeBufferToMesh(h,b);else if(C===l.POINT_CLOUD)b=new l.PointCloud,w=u.DecodeBufferToPointCloud(h,b);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!w.ok()||b.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+w.error_msg());const M={index:null,attributes:[]};for(const A in g){const k=self[y[A]];let L,P;if(f.useUniqueIDs)P=g[A],L=u.GetAttributeByUniqueId(b,P);else{if(P=u.GetAttributeId(b,l[g[A]]),P===-1)continue;L=u.GetAttribute(b,P)}M.attributes.push(s(l,u,b,A,k,L))}return C===l.TRIANGULAR_MESH&&(M.index=r(l,u,b)),l.destroy(b),M}function r(l,u,h){const g=h.num_faces()*3,y=g*4,b=l._malloc(y);u.GetTrianglesUInt32Array(h,y,b);const w=new Uint32Array(l.HEAPF32.buffer,b,g).slice();return l._free(b),{array:w,itemSize:1}}function s(l,u,h,f,g,y){const b=y.num_components(),C=h.num_points()*b,M=C*g.BYTES_PER_ELEMENT,A=o(l,g),k=l._malloc(M);u.GetAttributeDataArrayForAllPoints(h,y,A,M,k);const L=new g(l.HEAPF32.buffer,k,C).slice();return l._free(k),{name:f,array:L,itemSize:b}}function o(l,u){switch(u){case Float32Array:return l.DT_FLOAT32;case Int8Array:return l.DT_INT8;case Int16Array:return l.DT_INT16;case Int32Array:return l.DT_INT32;case Uint8Array:return l.DT_UINT8;case Uint16Array:return l.DT_UINT16;case Uint32Array:return l.DT_UINT32}}}let zM;const fL=()=>{if(zM)return zM;const n="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",e="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",t=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]),r=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(typeof WebAssembly!="object")return{supported:!1};let s=n;WebAssembly.validate(t)&&(s=e);let o;const l=WebAssembly.instantiate(u(s),{}).then(y=>{o=y.instance,o.exports.__wasm_call_ctors()});function u(y){const b=new Uint8Array(y.length);for(let C=0;C96?M-71:M>64?M-65:M>47?M+4:M>46?63:62}let w=0;for(let C=0;C{t&&t(r),n&&(UM||(UM=new mbe),UM.setDecoderPath(typeof n=="string"?n:pJ),r.setDRACOLoader(UM)),e&&r.setMeshoptDecoder(typeof fL=="function"?fL():fL)}}function Gt(n,e=!0,t=!0,r){return AC(WF,n,mJ(e,t,r))}Gt.preload=(n,e=!0,t=!0,r)=>AC.preload(WF,n,mJ(e,t,r));Gt.clear=n=>AC.clear(WF,n);Gt.setDecoderPath=n=>{pJ=n};function _be(n){const{nodes:e}=Gt(tJ);return[{type:"raw",geometry:e.BASE_FRONT_GRILL_1.geometry,material:e.BASE_FRONT_GRILL_1.material,scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(tJ);const gJ="/gpu-programming/assets/BASE_LEFT_COVER_1-DGxtL-mQ.glb";function vbe(n){const{nodes:e}=Gt(gJ);return[{type:"raw",geometry:e.BASE_LEFT_COVER_1.geometry,material:e.BASE_LEFT_COVER_1.material,scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(gJ);const _J="/gpu-programming/assets/base_link-CxNG3VaF.glb";function ybe(n){const{nodes:e}=Gt(_J);return[{type:"raw",geometry:e.base_link.geometry,material:e.base_link.material,scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(_J);const vJ="/gpu-programming/assets/BASE_RIGHT_COVER_1-hc0og1we.glb";function bbe(n){const{nodes:e}=Gt(vJ);return[{type:"raw",geometry:e.BASE_RIGHT_COVER_1.geometry,material:e.BASE_RIGHT_COVER_1.material,scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(vJ);const yJ="/gpu-programming/assets/Battery_1-CK31T6T2.glb";function Tbe(n){const{nodes:e}=Gt(yJ);return[{type:"raw",geometry:e.Battery_1.geometry,material:e.Battery_1.material,scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(yJ);const bJ="/gpu-programming/assets/BODY_BASE_CONNECTOR_1-BGiepl-q.glb";function Sbe(n){const{nodes:e}=Gt(bJ);return[{type:"raw",geometry:e.BODY_BASE_CONNECTOR_1.geometry,material:e.BODY_BASE_CONNECTOR_1.material,scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(bJ);const wbe="/gpu-programming/assets/DRIVE_TRACK_LEFT_1-BU9fqrup.glb";Gt.preload(wbe);const Ebe="/gpu-programming/assets/DRIVE_TRACK_RIGHT_1-inJUmdan.glb";Gt.preload(Ebe);const TJ="/gpu-programming/assets/EYE_LENS_1-dEqRsnM7.glb";function xbe(n){const{nodes:e}=Gt(TJ);return[{type:"raw",geometry:e.EYE_LENS_1.geometry,material:e.EYE_LENS_1.material,scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(TJ);const SJ="/gpu-programming/assets/FACE_1-m_5yRlpQ.glb";function $be(n){const{nodes:e}=Gt(SJ);return[{type:"raw",geometry:e.FACE_1.geometry,material:e.FACE_1.material,scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(SJ);const wJ="/gpu-programming/assets/FRONT_LEFT_WHEEL_1-CbTd7ucE.glb";function Cbe(n){const{nodes:e}=Gt(wJ);return[{type:"raw",geometry:e.FRONT_LEFT_WHEEL_1.geometry,material:e.FRONT_LEFT_WHEEL_1.material,scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(wJ);const EJ="/gpu-programming/assets/FRONT_RIGHT_WHEEL_1-DndcS7IV.glb";function Mbe(n){const{nodes:e}=Gt(EJ);return[{type:"raw",geometry:e.FRONT_RIGHT_WHEEL_1.geometry,material:e.FRONT_RIGHT_WHEEL_1.material,scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(EJ);const xJ="/gpu-programming/assets/HEAD_1-BuuEOSCL.glb";function Abe(n){const{nodes:e}=Gt(xJ);return[{type:"raw",geometry:e.HEAD_1.geometry,material:e.HEAD_1.material,scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(xJ);const $J="/gpu-programming/assets/HEAD_VENT_LEFT_1-DjAZtO3_.glb";function Ibe(n){const{nodes:e}=Gt($J);return[{type:"raw",geometry:e.HEAD_VENT_LEFT_1.geometry,material:e.HEAD_VENT_LEFT_1.material,scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload($J);const CJ="/gpu-programming/assets/HEAD_VENT_RIGHT_1-BfOCx_V8.glb";function Rbe(n){const{nodes:e}=Gt(CJ);return[{type:"raw",geometry:e.HEAD_VENT_RIGHT_1.geometry,material:e.HEAD_VENT_RIGHT_1.material,scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(CJ);const MJ="/gpu-programming/assets/LEFT_ARM_1-B8yh6mwG.glb";function kbe(n){const{nodes:e}=Gt(MJ);return[{type:"raw",geometry:e.LEFT_ARM_1.geometry,material:e.LEFT_ARM_1.material,scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(MJ);const AJ="/gpu-programming/assets/LEFT_ARM_CONNECTOR_1-CXrHlUi5.glb";function Obe(n){const{nodes:e}=Gt(AJ);return[{type:"raw",geometry:e.LEFT_ARM_CONNECTOR_1.geometry,material:e.LEFT_ARM_CONNECTOR_1.material,scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(AJ);const IJ="/gpu-programming/assets/MIDDLE_LEFT_WHEEL_1-BAVTGYOT.glb";function Lbe(n){const{nodes:e}=Gt(IJ);return[{type:"raw",geometry:e.MIDDLE_LEFT_WHEEL_1.geometry,material:e.MIDDLE_LEFT_WHEEL_1.material,scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(IJ);const RJ="/gpu-programming/assets/MIDDLE_RIGHT_WHEEL_1-GMj8YSda.glb";function Nbe(n){const{nodes:e}=Gt(RJ);return[{type:"raw",geometry:e.MIDDLE_RIGHT_WHEEL_1.geometry,material:e.MIDDLE_RIGHT_WHEEL_1.material,scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(RJ);const kJ="/gpu-programming/assets/NECK_GLOBE_BASE_1-CpAA3cya.glb";function Dbe(n){const{nodes:e}=Gt(kJ);return[{type:"raw",geometry:e.NECK_GLOBE_BASE_1.geometry,material:e.NECK_GLOBE_BASE_1.material,scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(kJ);const OJ="/gpu-programming/assets/REAR_LEFT_WHEEL_1-Ca-hbPaC.glb";function Pbe(n){const{nodes:e}=Gt(OJ);return[{type:"raw",geometry:e.REAR_LEFT_WHEEL_1.geometry,material:e.REAR_LEFT_WHEEL_1.material,scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(OJ);const LJ="/gpu-programming/assets/REAR_RIGHT_WHEEL_1-DLUpOsjA.glb";function Bbe(n){const{nodes:e}=Gt(LJ);return[{type:"raw",geometry:e.REAR_RIGHT_WHEEL_1.geometry,material:e.REAR_RIGHT_WHEEL_1.material,scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(LJ);const NJ="/gpu-programming/assets/RIGHT_ARM_1-CsUyYnQa.glb";function Fbe(n){const{nodes:e}=Gt(NJ);return[{type:"raw",geometry:e.RIGHT_ARM_1.geometry,material:e.RIGHT_ARM_1.material,scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(NJ);const DJ="/gpu-programming/assets/RIGHT_ARM_CONNECTOR_1-Og6IFGgn.glb";function zbe(n){const{nodes:e}=Gt(DJ);return[{type:"raw",geometry:e.RIGHT_ARM_CONNECTOR_1.geometry,material:e.RIGHT_ARM_CONNECTOR_1.material,scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(DJ);const PJ="/gpu-programming/assets/Torso_1-Dsttb7Xv.glb";function Ube(n){const{nodes:e}=Gt(PJ);return[{type:"raw",geometry:e.Torso_1.geometry,material:e.Torso_1.material,scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(PJ);const BJ="/gpu-programming/assets/VISOR_GLASS_1-DUgs1YBX.glb";function Hbe(n){const{nodes:e}=Gt(BJ);return[{type:"raw",geometry:e.VISOR_GLASS_1.geometry,material:e.VISOR_GLASS_1.material,scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(BJ);const FJ="/gpu-programming/assets/eyes_acceptance-DjNbu5s_.glb";function Gbe(n){const{nodes:e,materials:t}=Gt(FJ);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(FJ);const zJ="/gpu-programming/assets/eyes_admiration-KaqH2ZpQ.glb";function Wbe(n){const{nodes:e,materials:t}=Gt(zJ);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(zJ);const UJ="/gpu-programming/assets/eyes_amazement-DWEI8ZWl.glb";function Vbe(n){const{nodes:e,materials:t}=Gt(UJ);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(UJ);const HJ="/gpu-programming/assets/eyes_anger-BE-ut2mR.glb";function jbe(n){const{nodes:e,materials:t}=Gt(HJ);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(HJ);const GJ="/gpu-programming/assets/eyes_anticipation-b4B017F8.glb";function Ybe(n){const{nodes:e,materials:t}=Gt(GJ);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(GJ);const WJ="/gpu-programming/assets/eyes_annoyed-B_lb9L_O.glb";function Xbe(n){const{nodes:e,materials:t}=Gt(WJ);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(WJ);const VJ="/gpu-programming/assets/eyes_apprehension-DO3PTom6.glb";function Kbe(n){const{nodes:e,materials:t}=Gt(VJ);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(VJ);const jJ="/gpu-programming/assets/eyes_apprehension_1-KlPiBiR4.glb";function Jbe(n){const{nodes:e,materials:t}=Gt(jJ);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(jJ);const YJ="/gpu-programming/assets/eyes_boredom-C30alIvQ.glb";function qbe(n){const{nodes:e,materials:t}=Gt(YJ);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(YJ);const XJ="/gpu-programming/assets/eyes_default-CiQ6MqPO.glb";function gG(n){const{nodes:e,materials:t}=Gt(XJ);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(XJ);const KJ="/gpu-programming/assets/eyes_disgust-BPb8pu-1.glb";function Qbe(n){const{nodes:e,materials:t}=Gt(KJ);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(KJ);const JJ="/gpu-programming/assets/eyes_ecstacy_frame_1-CAg4aUVn.glb";function Zbe(n){const{nodes:e,materials:t}=Gt(JJ);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(JJ);const qJ="/gpu-programming/assets/eyes_ecstacy_frame_2-BOv7MWj_.glb";function e1e(n){const{nodes:e,materials:t}=Gt(qJ);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(qJ);const QJ="/gpu-programming/assets/eyes_fear-BL8fvSZL.glb";function t1e(n){const{nodes:e,materials:t}=Gt(QJ);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(QJ);const ZJ="/gpu-programming/assets/eyes_grief-cP7yoD10.glb";function n1e(n){const{nodes:e,materials:t}=Gt(ZJ);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(ZJ);const eq="/gpu-programming/assets/eyes_interest-TZH0NZC_.glb";function r1e(n){const{nodes:e,materials:t}=Gt(eq);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(eq);const tq="/gpu-programming/assets/eyes_joy-B6oifIYP.glb";function i1e(n){const{nodes:e,materials:t}=Gt(tq);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(tq);const nq="/gpu-programming/assets/eyes_loathing-C8bUCbQG.glb";function s1e(n){const{nodes:e,materials:t}=Gt(nq);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(nq);const rq="/gpu-programming/assets/eyes_pensiveness-rZoWlZ1k.glb";function o1e(n){const{nodes:e,materials:t}=Gt(rq);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(rq);const iq="/gpu-programming/assets/eyes_rage-BpM8Xr2x.glb";function a1e(n){const{nodes:e,materials:t}=Gt(iq);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(iq);const sq="/gpu-programming/assets/eyes_sad-Coo-r01z.glb";function l1e(n){const{nodes:e,materials:t}=Gt(sq);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(sq);const oq="/gpu-programming/assets/eyes_serenity-C07tnszo.glb";function u1e(n){const{nodes:e,materials:t}=Gt(oq);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(oq);const aq="/gpu-programming/assets/eyes_surprise-eDHO2SUu.glb";function c1e(n){const{nodes:e,materials:t}=Gt(aq);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(aq);const lq="/gpu-programming/assets/eyes_terror-CHUlLq9_.glb";function h1e(n){const{nodes:e,materials:t}=Gt(lq);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(lq);const uq="/gpu-programming/assets/eyes_trust-DX4X5mD0.glb";function d1e(n){const{nodes:e,materials:t}=Gt(uq);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(uq);const cq="/gpu-programming/assets/eyes_vigilance-CGqg-60Y.glb";function f1e(n){const{nodes:e,materials:t}=Gt(cq);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(cq);const hq="/gpu-programming/assets/e_Sleeping-2563MAKh.glb";function p1e(n){const{nodes:e,materials:t}=Gt(hq);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(hq);const dq="/gpu-programming/assets/e_SleepingZZZ-CGdMpHBj.glb";function m1e(n){const{nodes:e,materials:t}=Gt(dq);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(dq);const fq="/gpu-programming/assets/e_Contempt-Bmkm0Bdj.glb";function g1e(n){const{nodes:e,materials:t}=Gt(fq);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(fq);const pq="/gpu-programming/assets/e_ContentLeft-C4jtUFpf.glb";function _1e(n){const{nodes:e,materials:t}=Gt(pq);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(pq);const mq="/gpu-programming/assets/e_ContentRight-BNMUpyf0.glb";function v1e(n){const{nodes:e,materials:t}=Gt(mq);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(mq);const gq="/gpu-programming/assets/e_Disoriented-DCBMT2ea.glb";function y1e(n){const{nodes:e,materials:t}=Gt(gq);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(gq);const _q="/gpu-programming/assets/e_EcstacyHilarious-Cl8xGsKE.glb";function b1e(n){const{nodes:e,materials:t}=Gt(_q);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(_q);const vq="/gpu-programming/assets/e_EcstacyStarryEyed-DRKN_BY4.glb";function T1e(n){const{nodes:e,materials:t}=Gt(vq);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(vq);const yq="/gpu-programming/assets/e_JoyGoofy-B110L9cn.glb";function S1e(n){const{nodes:e,materials:t}=Gt(yq);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(yq);const bq="/gpu-programming/assets/e_JoyGoofy2-BkM5jGNL.glb";function w1e(n){const{nodes:e,materials:t}=Gt(bq);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(bq);const Tq="/gpu-programming/assets/e_JoyGoofy3-BJy3tNhw.glb";function E1e(n){const{nodes:e,materials:t}=Gt(Tq);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(Tq);const Sq="/gpu-programming/assets/e_Love-BGY9OUZu.glb";function x1e(n){const{nodes:e,materials:t}=Gt(Sq);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(Sq);const wq="/gpu-programming/assets/e_Rage-C3KmRLkq.glb";function $1e(n){const{nodes:e,materials:t}=Gt(wq);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(wq);const Eq="/gpu-programming/assets/e_Rage2-mVNSFSuR.glb";function C1e(n){const{nodes:e,materials:t}=Gt(Eq);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(Eq);const xq="/gpu-programming/assets/e_Rage3-BfYM2b7r.glb";function M1e(n){const{nodes:e,materials:t}=Gt(xq);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(xq);const $q="/gpu-programming/assets/e_Rage4-oo9re96u.glb";function A1e(n){const{nodes:e,materials:t}=Gt($q);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload($q);const Cq="/gpu-programming/assets/e_RemorseShame-BrJPOqTm.glb";function I1e(n){const{nodes:e,materials:t}=Gt(Cq);return[{type:"raw",geometry:e.Plane.geometry,material:t["Material.001"],scale:[1,1,1],rotation:[0,0,0]}]}Gt.preload(Cq);const R1e={"package://misty_description/meshes/BASE_FRONT_GRILL_1.stl":_be,"package://misty_description/meshes/BASE_LEFT_COVER_1.stl":vbe,"package://misty_description/meshes/base_link.stl":ybe,"package://misty_description/meshes/BASE_RIGHT_COVER_1.stl":bbe,"package://misty_description/meshes/Battery_1.stl":Tbe,"package://misty_description/meshes/BODY_BASE_CONNECTOR_1.stl":Sbe,"package://misty_description/meshes/EYE_LENS_1.stl":xbe,"package://misty_description/meshes/FACE_1.stl":$be,"package://misty_description/meshes/FRONT_LEFT_WHEEL_1.stl":Cbe,"package://misty_description/meshes/FRONT_RIGHT_WHEEL_1.stl":Mbe,"package://misty_description/meshes/HEAD_1.stl":Abe,"package://misty_description/meshes/HEAD_VENT_LEFT_1.stl":Ibe,"package://misty_description/meshes/HEAD_VENT_RIGHT_1.stl":Rbe,"package://misty_description/meshes/LEFT_ARM_1.stl":kbe,"package://misty_description/meshes/LEFT_ARM_CONNECTOR_1.stl":Obe,"package://misty_description/meshes/MIDDLE_LEFT_WHEEL_1.stl":Lbe,"package://misty_description/meshes/MIDDLE_RIGHT_WHEEL_1.stl":Nbe,"package://misty_description/meshes/NECK_GLOBE_BASE_1.stl":Dbe,"package://misty_description/meshes/REAR_LEFT_WHEEL_1.stl":Pbe,"package://misty_description/meshes/REAR_RIGHT_WHEEL_1.stl":Bbe,"package://misty_description/meshes/RIGHT_ARM_1.stl":Fbe,"package://misty_description/meshes/RIGHT_ARM_CONNECTOR_1.stl":zbe,"package://misty_description/meshes/Torso_1.stl":Ube,"package://misty_description/meshes/VISOR_GLASS_1.stl":Hbe,e_Sleeping:p1e,e_SleepingZZZ:m1e,e_Contempt:g1e,e_ContentLeft:_1e,e_ContentRight:v1e,e_Disoriented:y1e,e_EcstacyHilarious:b1e,e_EcstacyStarryEyed:T1e,e_JoyGoofy:S1e,e_JoyGoofy2:w1e,e_JoyGoofy3:E1e,e_Love:x1e,e_Rage:$1e,e_Rage2:C1e,e_Rage3:M1e,e_Rage4:A1e,e_RemorseShame:I1e,eyes_acceptance:Gbe,eyes_admiration:Wbe,eyes_amazement:Vbe,eyes_anger:jbe,eyes_annoyed:Xbe,eyes_anticipation:Ybe,eyes_apprehension:Kbe,eyes_apprehension_1:Jbe,eyes_boredom:qbe,eyes_default:gG,eyes_disgust:Qbe,eyes_distraction:gG,eyes_ecstasy_frame_1:Zbe,eyes_ecstasy_frame_2:e1e,eyes_fear:t1e,eyes_grief:n1e,eyes_interest:r1e,eyes_joy:i1e,eyes_loathing:s1e,eyes_pensiveness:o1e,eyes_rage:a1e,eyes_sad:l1e,eyes_serenity:u1e,eyes_surprise:c1e,eyes_terror:h1e,eyes_trust:d1e,eyes_vigilance:f1e};/** * @license * Copyright 2010-2022 Three.js Authors * SPDX-License-Identifier: MIT - */const hE="143",l1={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},u1={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},Cq=0,ZD=1,Mq=2,k1e=3,Aq=0,e2=1,Zx=2,E1=3,p_=0,cd=1,lp=2,Iq=1,O1e=2,pp=0,mv=1,_R=2,eP=3,tP=4,Rq=5,p1=100,kq=101,VF=102,nP=103,rP=104,Oq=200,Lq=201,Nq=202,Dq=203,t2=204,n2=205,Pq=206,Bq=207,Fq=208,zq=209,Uq=210,Hq=0,Gq=1,Wq=2,vR=3,Vq=4,jq=5,Yq=6,Xq=7,IC=0,Kq=1,Jq=2,l0=0,qq=1,Qq=2,Zq=3,jF=4,eQ=5,r2=300,Gy=301,Wy=302,D$=303,P$=304,dE=306,Lw=1e3,ap=1001,B$=1002,Wl=1003,yR=1004,L1e=1004,bR=1005,N1e=1005,wl=1006,YF=1007,D1e=1007,uT=1008,P1e=1008,af=1009,tQ=1010,nQ=1011,XF=1012,rQ=1013,dv=1014,r_=1015,Q1=1016,iQ=1017,sQ=1018,Py=1020,oQ=1021,aQ=1022,jp=1023,lQ=1024,uQ=1025,By=1026,Vy=1027,cQ=1028,hQ=1029,dQ=1030,fQ=1031,pQ=1033,gI=33776,_I=33777,vI=33778,yI=33779,iP=35840,sP=35841,oP=35842,aP=35843,mQ=36196,lP=37492,uP=37496,cP=37808,hP=37809,dP=37810,fP=37811,pP=37812,mP=37813,gP=37814,_P=37815,vP=37816,yP=37817,bP=37818,TP=37819,SP=37820,wP=37821,EP=36492,gQ=2200,_Q=2201,vQ=2202,F$=2300,z$=2301,bI=2302,x1=2400,$1=2401,U$=2402,i2=2500,KF=2501,B1e=0,F1e=1,z1e=2,xg=3e3,ms=3001,nb=3200,Nw=3201,cT=0,yQ=1,U1e="",J0="srgb",xy="srgb-linear",H1e=0,TI=7680,G1e=7681,W1e=7682,V1e=7683,j1e=34055,Y1e=34056,X1e=5386,K1e=512,J1e=513,q1e=514,Q1e=515,Z1e=516,eTe=517,tTe=518,bQ=519,H$=35044,N1=35048,nTe=35040,rTe=35045,iTe=35049,sTe=35041,oTe=35046,aTe=35050,lTe=35042,uTe="100",xP="300 es",TR=1035;class jm{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const r=this._listeners;r[e]===void 0&&(r[e]=[]),r[e].indexOf(t)===-1&&r[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;const r=this._listeners;return r[e]!==void 0&&r[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;const r=this._listeners[e];if(r!==void 0){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const t=this._listeners[e.type];if(t!==void 0){e.target=this;const r=t.slice(0);for(let s=0,o=r.length;s>8&255]+Cf[n>>16&255]+Cf[n>>24&255]+"-"+Cf[e&255]+Cf[e>>8&255]+"-"+Cf[e>>16&15|64]+Cf[e>>24&255]+"-"+Cf[t&63|128]+Cf[t>>8&255]+"-"+Cf[t>>16&255]+Cf[t>>24&255]+Cf[r&255]+Cf[r>>8&255]+Cf[r>>16&255]+Cf[r>>24&255]).toLowerCase()}function hh(n,e,t){return Math.max(e,Math.min(t,n))}function JF(n,e){return(n%e+e)%e}function cTe(n,e,t,r,s){return r+(n-e)*(s-r)/(t-e)}function hTe(n,e,t){return n!==e?(t-n)/(e-n):0}function e$(n,e,t){return(1-t)*n+t*e}function dTe(n,e,t,r){return e$(n,e,1-Math.exp(-t*r))}function fTe(n,e=1){return e-Math.abs(JF(n,e*2)-e)}function pTe(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*(3-2*n))}function mTe(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*n*(n*(n*6-15)+10))}function gTe(n,e){return n+Math.floor(Math.random()*(e-n+1))}function _Te(n,e){return n+Math.random()*(e-n)}function vTe(n){return n*(.5-Math.random())}function yTe(n){n!==void 0&&(gG=n);let e=gG+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function bTe(n){return n*D1}function TTe(n){return n*G$}function $P(n){return(n&n-1)===0&&n!==0}function TQ(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function SR(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function STe(n,e,t,r,s){const o=Math.cos,l=Math.sin,u=o(t/2),h=l(t/2),f=o((e+r)/2),g=l((e+r)/2),y=o((e-r)/2),b=l((e-r)/2),w=o((r-e)/2),C=l((r-e)/2);switch(s){case"XYX":n.set(u*g,h*y,h*b,u*f);break;case"YZY":n.set(h*b,u*g,h*y,u*f);break;case"ZXZ":n.set(h*y,h*b,u*g,u*f);break;case"XZX":n.set(u*g,h*C,h*w,u*f);break;case"YXY":n.set(h*w,u*g,h*C,u*f);break;case"ZYZ":n.set(h*C,h*w,u*g,u*f);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+s)}}function wTe(n,e){switch(e.constructor){case Float32Array:return n;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function ETe(n,e){switch(e.constructor){case Float32Array:return n;case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}var SQ=Object.freeze({__proto__:null,DEG2RAD:D1,RAD2DEG:G$,generateUUID:Pm,clamp:hh,euclideanModulo:JF,mapLinear:cTe,inverseLerp:hTe,lerp:e$,damp:dTe,pingpong:fTe,smoothstep:pTe,smootherstep:mTe,randInt:gTe,randFloat:_Te,randFloatSpread:vTe,seededRandom:yTe,degToRad:bTe,radToDeg:TTe,isPowerOfTwo:$P,ceilPowerOfTwo:TQ,floorPowerOfTwo:SR,setQuaternionFromProperEuler:STe,normalize:ETe,denormalize:wTe});class jt{constructor(e=0,t=0){jt.prototype.isVector2=!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){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,r=this.y,s=e.elements;return this.x=s[0]*t+s[3]*r+s[6],this.y=s[1]*t+s[4]*r+s[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 r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(t,r)))}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,r=this.y-e.y;return t*t+r*r}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,r){return this.x=e.x+(t.x-e.x)*r,this.y=e.y+(t.y-e.y)*r,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const r=Math.cos(t),s=Math.sin(t),o=this.x-e.x,l=this.y-e.y;return this.x=o*r-l*s+e.x,this.y=o*s+l*r+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class up{constructor(){up.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1]}set(e,t,r,s,o,l,u,h,f){const g=this.elements;return g[0]=e,g[1]=s,g[2]=u,g[3]=t,g[4]=o,g[5]=h,g[6]=r,g[7]=l,g[8]=f,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,r=e.elements;return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],this}extractBasis(e,t,r){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),r.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 r=e.elements,s=t.elements,o=this.elements,l=r[0],u=r[3],h=r[6],f=r[1],g=r[4],y=r[7],b=r[2],w=r[5],C=r[8],M=s[0],A=s[3],k=s[6],L=s[1],P=s[4],D=s[7],z=s[2],U=s[5],V=s[8];return o[0]=l*M+u*L+h*z,o[3]=l*A+u*P+h*U,o[6]=l*k+u*D+h*V,o[1]=f*M+g*L+y*z,o[4]=f*A+g*P+y*U,o[7]=f*k+g*D+y*V,o[2]=b*M+w*L+C*z,o[5]=b*A+w*P+C*U,o[8]=b*k+w*D+C*V,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],r=e[1],s=e[2],o=e[3],l=e[4],u=e[5],h=e[6],f=e[7],g=e[8];return t*l*g-t*u*f-r*o*g+r*u*h+s*o*f-s*l*h}invert(){const e=this.elements,t=e[0],r=e[1],s=e[2],o=e[3],l=e[4],u=e[5],h=e[6],f=e[7],g=e[8],y=g*l-u*f,b=u*h-g*o,w=f*o-l*h,C=t*y+r*b+s*w;if(C===0)return this.set(0,0,0,0,0,0,0,0,0);const M=1/C;return e[0]=y*M,e[1]=(s*f-g*r)*M,e[2]=(u*r-s*l)*M,e[3]=b*M,e[4]=(g*t-s*h)*M,e[5]=(s*o-u*t)*M,e[6]=w*M,e[7]=(r*h-f*t)*M,e[8]=(l*t-r*o)*M,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,r,s,o,l,u){const h=Math.cos(o),f=Math.sin(o);return this.set(r*h,r*f,-r*(h*l+f*u)+l+e,-s*f,s*h,-s*(-f*l+h*u)+u+t,0,0,1),this}scale(e,t){const r=this.elements;return r[0]*=e,r[3]*=e,r[6]*=e,r[1]*=t,r[4]*=t,r[7]*=t,this}rotate(e){const t=Math.cos(e),r=Math.sin(e),s=this.elements,o=s[0],l=s[3],u=s[6],h=s[1],f=s[4],g=s[7];return s[0]=t*o+r*h,s[3]=t*l+r*f,s[6]=t*u+r*g,s[1]=-r*o+t*h,s[4]=-r*l+t*f,s[7]=-r*u+t*g,this}translate(e,t){const r=this.elements;return r[0]+=e*r[2],r[3]+=e*r[5],r[6]+=e*r[8],r[1]+=t*r[2],r[4]+=t*r[5],r[7]+=t*r[8],this}equals(e){const t=this.elements,r=e.elements;for(let s=0;s<9;s++)if(t[s]!==r[s])return!1;return!0}fromArray(e,t=0){for(let r=0;r<9;r++)this.elements[r]=e[r+t];return this}toArray(e=[],t=0){const r=this.elements;return e[t]=r[0],e[t+1]=r[1],e[t+2]=r[2],e[t+3]=r[3],e[t+4]=r[4],e[t+5]=r[5],e[t+6]=r[6],e[t+7]=r[7],e[t+8]=r[8],e}clone(){return new this.constructor().fromArray(this.elements)}}function wQ(n){for(let e=n.length-1;e>=0;--e)if(n[e]>65535)return!0;return!1}const xTe={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function QS(n,e){return new xTe[n](e)}function W$(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function P1(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function SI(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}const pL={[J0]:{[xy]:P1},[xy]:{[J0]:SI}},ug={legacyMode:!0,get workingColorSpace(){return xy},set workingColorSpace(n){console.warn("THREE.ColorManagement: .workingColorSpace is readonly.")},convert:function(n,e,t){if(this.legacyMode||e===t||!e||!t)return n;if(pL[e]&&pL[e][t]!==void 0){const r=pL[e][t];return n.r=r(n.r),n.g=r(n.g),n.b=r(n.b),n}throw new Error("Unsupported color space conversion.")},fromWorkingColorSpace:function(n,e){return this.convert(n,this.workingColorSpace,e)},toWorkingColorSpace:function(n,e){return this.convert(n,e,this.workingColorSpace)}},EQ={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},od={r:0,g:0,b:0},jg={h:0,s:0,l:0},HM={h:0,s:0,l:0};function mL(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*6*(2/3-t):n}function GM(n,e){return e.r=n.r,e.g=n.g,e.b=n.b,e}class Fn{constructor(e,t,r){return this.isColor=!0,this.r=1,this.g=1,this.b=1,t===void 0&&r===void 0?this.set(e):this.setRGB(e,t,r)}set(e){return e&&e.isColor?this.copy(e):typeof e=="number"?this.setHex(e):typeof e=="string"&&this.setStyle(e),this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=J0){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,ug.toWorkingColorSpace(this,t),this}setRGB(e,t,r,s=xy){return this.r=e,this.g=t,this.b=r,ug.toWorkingColorSpace(this,s),this}setHSL(e,t,r,s=xy){if(e=JF(e,1),t=hh(t,0,1),r=hh(r,0,1),t===0)this.r=this.g=this.b=r;else{const o=r<=.5?r*(1+t):r+t-r*t,l=2*r-o;this.r=mL(l,o,e+1/3),this.g=mL(l,o,e),this.b=mL(l,o,e-1/3)}return ug.toWorkingColorSpace(this,s),this}setStyle(e,t=J0){function r(o){o!==void 0&&parseFloat(o)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let s;if(s=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(e)){let o;const l=s[1],u=s[2];switch(l){case"rgb":case"rgba":if(o=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(u))return this.r=Math.min(255,parseInt(o[1],10))/255,this.g=Math.min(255,parseInt(o[2],10))/255,this.b=Math.min(255,parseInt(o[3],10))/255,ug.toWorkingColorSpace(this,t),r(o[4]),this;if(o=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(u))return this.r=Math.min(100,parseInt(o[1],10))/100,this.g=Math.min(100,parseInt(o[2],10))/100,this.b=Math.min(100,parseInt(o[3],10))/100,ug.toWorkingColorSpace(this,t),r(o[4]),this;break;case"hsl":case"hsla":if(o=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(u)){const h=parseFloat(o[1])/360,f=parseInt(o[2],10)/100,g=parseInt(o[3],10)/100;return r(o[4]),this.setHSL(h,f,g,t)}break}}else if(s=/^\#([A-Fa-f\d]+)$/.exec(e)){const o=s[1],l=o.length;if(l===3)return this.r=parseInt(o.charAt(0)+o.charAt(0),16)/255,this.g=parseInt(o.charAt(1)+o.charAt(1),16)/255,this.b=parseInt(o.charAt(2)+o.charAt(2),16)/255,ug.toWorkingColorSpace(this,t),this;if(l===6)return this.r=parseInt(o.charAt(0)+o.charAt(1),16)/255,this.g=parseInt(o.charAt(2)+o.charAt(3),16)/255,this.b=parseInt(o.charAt(4)+o.charAt(5),16)/255,ug.toWorkingColorSpace(this,t),this}return e&&e.length>0?this.setColorName(e,t):this}setColorName(e,t=J0){const r=EQ[e.toLowerCase()];return r!==void 0?this.setHex(r,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=P1(e.r),this.g=P1(e.g),this.b=P1(e.b),this}copyLinearToSRGB(e){return this.r=SI(e.r),this.g=SI(e.g),this.b=SI(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=J0){return ug.fromWorkingColorSpace(GM(this,od),e),hh(od.r*255,0,255)<<16^hh(od.g*255,0,255)<<8^hh(od.b*255,0,255)<<0}getHexString(e=J0){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=xy){ug.fromWorkingColorSpace(GM(this,od),t);const r=od.r,s=od.g,o=od.b,l=Math.max(r,s,o),u=Math.min(r,s,o);let h,f;const g=(u+l)/2;if(u===l)h=0,f=0;else{const y=l-u;switch(f=g<=.5?y/(l+u):y/(2-l-u),l){case r:h=(s-o)/y+(s"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{pS===void 0&&(pS=W$("canvas")),pS.width=e.width,pS.height=e.height;const r=pS.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),t=pS}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(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=W$("canvas");t.width=e.width,t.height=e.height;const r=t.getContext("2d");r.drawImage(e,0,0,e.width,e.height);const s=r.getImageData(0,0,e.width,e.height),o=s.data;for(let l=0;l1)switch(this.wrapS){case Lw:e.x=e.x-Math.floor(e.x);break;case ap:e.x=e.x<0?0:1;break;case B$:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case Lw:e.y=e.y-Math.floor(e.y);break;case ap:e.y=e.y<0?0:1;break;case B$:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}}dc.DEFAULT_IMAGE=null;dc.DEFAULT_MAPPING=r2;class Ts{constructor(e=0,t=0,r=0,s=1){Ts.prototype.isVector4=!0,this.x=e,this.y=t,this.z=r,this.w=s}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,r,s){return this.x=e,this.y=t,this.z=r,this.w=s,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=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,r=this.y,s=this.z,o=this.w,l=e.elements;return this.x=l[0]*t+l[4]*r+l[8]*s+l[12]*o,this.y=l[1]*t+l[5]*r+l[9]*s+l[13]*o,this.z=l[2]*t+l[6]*r+l[10]*s+l[14]*o,this.w=l[3]*t+l[7]*r+l[11]*s+l[15]*o,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,r,s,o;const l=e.elements,u=l[0],h=l[4],f=l[8],g=l[1],y=l[5],b=l[9],w=l[2],C=l[6],M=l[10];if(Math.abs(h-g)<.01&&Math.abs(f-w)<.01&&Math.abs(b-C)<.01){if(Math.abs(h+g)<.1&&Math.abs(f+w)<.1&&Math.abs(b+C)<.1&&Math.abs(u+y+M-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const k=(u+1)/2,L=(y+1)/2,P=(M+1)/2,D=(h+g)/4,z=(f+w)/4,U=(b+C)/4;return k>L&&k>P?k<.01?(r=0,s=.707106781,o=.707106781):(r=Math.sqrt(k),s=D/r,o=z/r):L>P?L<.01?(r=.707106781,s=0,o=.707106781):(s=Math.sqrt(L),r=D/s,o=U/s):P<.01?(r=.707106781,s=.707106781,o=0):(o=Math.sqrt(P),r=z/o,s=U/o),this.set(r,s,o,t),this}let A=Math.sqrt((C-b)*(C-b)+(f-w)*(f-w)+(g-h)*(g-h));return Math.abs(A)<.001&&(A=1),this.x=(C-b)/A,this.y=(f-w)/A,this.z=(g-h)/A,this.w=Math.acos((u+y+M-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 r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(t,r)))}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,r){return this.x=e.x+(t.x-e.x)*r,this.y=e.y+(t.y-e.y)*r,this.z=e.z+(t.z-e.z)*r,this.w=e.w+(t.w-e.w)*r,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class Nc extends jm{constructor(e,t,r={}){super(),this.isWebGLRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new Ts(0,0,e,t),this.scissorTest=!1,this.viewport=new Ts(0,0,e,t);const s={width:e,height:t,depth:1};this.texture=new dc(s,r.mapping,r.wrapS,r.wrapT,r.magFilter,r.minFilter,r.format,r.type,r.anisotropy,r.encoding),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=r.generateMipmaps!==void 0?r.generateMipmaps:!1,this.texture.internalFormat=r.internalFormat!==void 0?r.internalFormat:null,this.texture.minFilter=r.minFilter!==void 0?r.minFilter:wl,this.depthBuffer=r.depthBuffer!==void 0?r.depthBuffer:!0,this.stencilBuffer=r.stencilBuffer!==void 0?r.stencilBuffer:!1,this.depthTexture=r.depthTexture!==void 0?r.depthTexture:null,this.samples=r.samples!==void 0?r.samples:0}setSize(e,t,r=1){(this.width!==e||this.height!==t||this.depth!==r)&&(this.width=e,this.height=t,this.depth=r,this.texture.image.width=e,this.texture.image.height=t,this.texture.image.depth=r,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.texture.isRenderTargetTexture=!0;const t=Object.assign({},e.texture.image);return this.texture.source=new C1(t),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class RC extends dc{constructor(e=null,t=1,r=1,s=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:r,depth:s},this.magFilter=Wl,this.minFilter=Wl,this.wrapR=ap,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class CTe extends Nc{constructor(e,t,r){super(e,t),this.isWebGLArrayRenderTarget=!0,this.depth=r,this.texture=new RC(null,e,t,r),this.texture.isRenderTargetTexture=!0}}class s2 extends dc{constructor(e=null,t=1,r=1,s=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:r,depth:s},this.magFilter=Wl,this.minFilter=Wl,this.wrapR=ap,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class MTe extends Nc{constructor(e,t,r){super(e,t),this.isWebGL3DRenderTarget=!0,this.depth=r,this.texture=new s2(null,e,t,r),this.texture.isRenderTargetTexture=!0}}class ATe extends Nc{constructor(e,t,r,s={}){super(e,t,s),this.isWebGLMultipleRenderTargets=!0;const o=this.texture;this.texture=[];for(let l=0;l=0?1:-1,P=1-k*k;if(P>Number.EPSILON){const z=Math.sqrt(P),U=Math.atan2(z,k*L);A=Math.sin(A*U)/z,u=Math.sin(u*U)/z}const D=u*L;if(h=h*A+b*D,f=f*A+w*D,g=g*A+C*D,y=y*A+M*D,A===1-u){const z=1/Math.sqrt(h*h+f*f+g*g+y*y);h*=z,f*=z,g*=z,y*=z}}e[t]=h,e[t+1]=f,e[t+2]=g,e[t+3]=y}static multiplyQuaternionsFlat(e,t,r,s,o,l){const u=r[s],h=r[s+1],f=r[s+2],g=r[s+3],y=o[l],b=o[l+1],w=o[l+2],C=o[l+3];return e[t]=u*C+g*y+h*w-f*b,e[t+1]=h*C+g*b+f*y-u*w,e[t+2]=f*C+g*w+u*b-h*y,e[t+3]=g*C-u*y-h*b-f*w,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,r,s){return this._x=e,this._y=t,this._z=r,this._w=s,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 r=e._x,s=e._y,o=e._z,l=e._order,u=Math.cos,h=Math.sin,f=u(r/2),g=u(s/2),y=u(o/2),b=h(r/2),w=h(s/2),C=h(o/2);switch(l){case"XYZ":this._x=b*g*y+f*w*C,this._y=f*w*y-b*g*C,this._z=f*g*C+b*w*y,this._w=f*g*y-b*w*C;break;case"YXZ":this._x=b*g*y+f*w*C,this._y=f*w*y-b*g*C,this._z=f*g*C-b*w*y,this._w=f*g*y+b*w*C;break;case"ZXY":this._x=b*g*y-f*w*C,this._y=f*w*y+b*g*C,this._z=f*g*C+b*w*y,this._w=f*g*y-b*w*C;break;case"ZYX":this._x=b*g*y-f*w*C,this._y=f*w*y+b*g*C,this._z=f*g*C-b*w*y,this._w=f*g*y+b*w*C;break;case"YZX":this._x=b*g*y+f*w*C,this._y=f*w*y+b*g*C,this._z=f*g*C-b*w*y,this._w=f*g*y-b*w*C;break;case"XZY":this._x=b*g*y-f*w*C,this._y=f*w*y-b*g*C,this._z=f*g*C+b*w*y,this._w=f*g*y+b*w*C;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+l)}return t!==!1&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const r=t/2,s=Math.sin(r);return this._x=e.x*s,this._y=e.y*s,this._z=e.z*s,this._w=Math.cos(r),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,r=t[0],s=t[4],o=t[8],l=t[1],u=t[5],h=t[9],f=t[2],g=t[6],y=t[10],b=r+u+y;if(b>0){const w=.5/Math.sqrt(b+1);this._w=.25/w,this._x=(g-h)*w,this._y=(o-f)*w,this._z=(l-s)*w}else if(r>u&&r>y){const w=2*Math.sqrt(1+r-u-y);this._w=(g-h)/w,this._x=.25*w,this._y=(s+l)/w,this._z=(o+f)/w}else if(u>y){const w=2*Math.sqrt(1+u-r-y);this._w=(o-f)/w,this._x=(s+l)/w,this._y=.25*w,this._z=(h+g)/w}else{const w=2*Math.sqrt(1+y-r-u);this._w=(l-s)/w,this._x=(o+f)/w,this._y=(h+g)/w,this._z=.25*w}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let r=e.dot(t)+1;return rMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=r):(this._x=0,this._y=-e.z,this._z=e.y,this._w=r)):(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=r),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(hh(this.dot(e),-1,1)))}rotateTowards(e,t){const r=this.angleTo(e);if(r===0)return this;const s=Math.min(1,t/r);return this.slerp(e,s),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const r=e._x,s=e._y,o=e._z,l=e._w,u=t._x,h=t._y,f=t._z,g=t._w;return this._x=r*g+l*u+s*f-o*h,this._y=s*g+l*h+o*u-r*f,this._z=o*g+l*f+r*h-s*u,this._w=l*g-r*u-s*h-o*f,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const r=this._x,s=this._y,o=this._z,l=this._w;let u=l*e._w+r*e._x+s*e._y+o*e._z;if(u<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,u=-u):this.copy(e),u>=1)return this._w=l,this._x=r,this._y=s,this._z=o,this;const h=1-u*u;if(h<=Number.EPSILON){const w=1-t;return this._w=w*l+t*this._w,this._x=w*r+t*this._x,this._y=w*s+t*this._y,this._z=w*o+t*this._z,this.normalize(),this._onChangeCallback(),this}const f=Math.sqrt(h),g=Math.atan2(f,u),y=Math.sin((1-t)*g)/f,b=Math.sin(t*g)/f;return this._w=l*y+this._w*b,this._x=r*y+this._x*b,this._y=s*y+this._y*b,this._z=o*y+this._z*b,this._onChangeCallback(),this}slerpQuaternions(e,t,r){return this.copy(e).slerp(t,r)}random(){const e=Math.random(),t=Math.sqrt(1-e),r=Math.sqrt(e),s=2*Math.PI*Math.random(),o=2*Math.PI*Math.random();return this.set(t*Math.cos(s),r*Math.sin(o),r*Math.cos(o),t*Math.sin(s))}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(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class Ae{constructor(e=0,t=0,r=0){Ae.prototype.isVector3=!0,this.x=e,this.y=t,this.z=r}set(e,t,r){return r===void 0&&(r=this.z),this.x=e,this.y=t,this.z=r,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){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(_G.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(_G.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,r=this.y,s=this.z,o=e.elements;return this.x=o[0]*t+o[3]*r+o[6]*s,this.y=o[1]*t+o[4]*r+o[7]*s,this.z=o[2]*t+o[5]*r+o[8]*s,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,r=this.y,s=this.z,o=e.elements,l=1/(o[3]*t+o[7]*r+o[11]*s+o[15]);return this.x=(o[0]*t+o[4]*r+o[8]*s+o[12])*l,this.y=(o[1]*t+o[5]*r+o[9]*s+o[13])*l,this.z=(o[2]*t+o[6]*r+o[10]*s+o[14])*l,this}applyQuaternion(e){const t=this.x,r=this.y,s=this.z,o=e.x,l=e.y,u=e.z,h=e.w,f=h*t+l*s-u*r,g=h*r+u*t-o*s,y=h*s+o*r-l*t,b=-o*t-l*r-u*s;return this.x=f*h+b*-o+g*-u-y*-l,this.y=g*h+b*-l+y*-o-f*-u,this.z=y*h+b*-u+f*-l-g*-o,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,r=this.y,s=this.z,o=e.elements;return this.x=o[0]*t+o[4]*r+o[8]*s,this.y=o[1]*t+o[5]*r+o[9]*s,this.z=o[2]*t+o[6]*r+o[10]*s,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 r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(t,r)))}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,r){return this.x=e.x+(t.x-e.x)*r,this.y=e.y+(t.y-e.y)*r,this.z=e.z+(t.z-e.z)*r,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const r=e.x,s=e.y,o=e.z,l=t.x,u=t.y,h=t.z;return this.x=s*h-o*u,this.y=o*l-r*h,this.z=r*u-s*l,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const r=e.dot(this)/t;return this.copy(e).multiplyScalar(r)}projectOnPlane(e){return _L.copy(this).projectOnVector(e),this.sub(_L)}reflect(e){return this.sub(_L.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const r=this.dot(e)/t;return Math.acos(hh(r,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,r=this.y-e.y,s=this.z-e.z;return t*t+r*r+s*s}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,r){const s=Math.sin(t)*e;return this.x=s*Math.sin(r),this.y=Math.cos(t)*e,this.z=s*Math.cos(r),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,r){return this.x=e*Math.sin(t),this.y=r,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(),r=this.setFromMatrixColumn(e,1).length(),s=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=r,this.z=s,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=(Math.random()-.5)*2,t=Math.random()*Math.PI*2,r=Math.sqrt(1-e**2);return this.x=r*Math.cos(t),this.y=r*Math.sin(t),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const _L=new Ae,_G=new Sl;class d0{constructor(e=new Ae(1/0,1/0,1/0),t=new Ae(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){let t=1/0,r=1/0,s=1/0,o=-1/0,l=-1/0,u=-1/0;for(let h=0,f=e.length;ho&&(o=g),y>l&&(l=y),b>u&&(u=b)}return this.min.set(t,r,s),this.max.set(o,l,u),this}setFromBufferAttribute(e){let t=1/0,r=1/0,s=1/0,o=-1/0,l=-1/0,u=-1/0;for(let h=0,f=e.count;ho&&(o=g),y>l&&(l=y),b>u&&(u=b)}return this.min.set(t,r,s),this.max.set(o,l,u),this}setFromPoints(e){this.makeEmpty();for(let t=0,r=e.length;tthis.max.x||e.ythis.max.y||e.zthis.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.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,Wb),Wb.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,r;return e.normal.x>0?(t=e.normal.x*this.min.x,r=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,r=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,r+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,r+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,r+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,r+=e.normal.z*this.min.z),t<=-e.constant&&r>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(ax),WM.subVectors(this.max,ax),mS.subVectors(e.a,ax),gS.subVectors(e.b,ax),_S.subVectors(e.c,ax),iy.subVectors(gS,mS),sy.subVectors(_S,gS),Vb.subVectors(mS,_S);let t=[0,-iy.z,iy.y,0,-sy.z,sy.y,0,-Vb.z,Vb.y,iy.z,0,-iy.x,sy.z,0,-sy.x,Vb.z,0,-Vb.x,-iy.y,iy.x,0,-sy.y,sy.x,0,-Vb.y,Vb.x,0];return!yL(t,mS,gS,_S,WM)||(t=[1,0,0,0,1,0,0,0,1],!yL(t,mS,gS,_S,WM))?!1:(VM.crossVectors(iy,sy),t=[VM.x,VM.y,VM.z],yL(t,mS,gS,_S,WM))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return Wb.copy(e).clamp(this.min,this.max).sub(e).length()}getBoundingSphere(e){return this.getCenter(e.center),e.radius=this.getSize(Wb).length()*.5,e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(q_[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),q_[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),q_[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),q_[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),q_[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),q_[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),q_[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),q_[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(q_),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const q_=[new Ae,new Ae,new Ae,new Ae,new Ae,new Ae,new Ae,new Ae],Wb=new Ae,vL=new d0,mS=new Ae,gS=new Ae,_S=new Ae,iy=new Ae,sy=new Ae,Vb=new Ae,ax=new Ae,WM=new Ae,VM=new Ae,jb=new Ae;function yL(n,e,t,r,s){for(let o=0,l=n.length-3;o<=l;o+=3){jb.fromArray(n,o);const u=s.x*Math.abs(jb.x)+s.y*Math.abs(jb.y)+s.z*Math.abs(jb.z),h=e.dot(jb),f=t.dot(jb),g=r.dot(jb);if(Math.max(-Math.max(h,f,g),Math.min(h,f,g))>u)return!1}return!0}const ITe=new d0,vG=new Ae,jM=new Ae,bL=new Ae;class b_{constructor(e=new Ae,t=-1){this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const r=this.center;t!==void 0?r.copy(t):ITe.setFromPoints(e).getCenter(r);let s=0;for(let o=0,l=e.length;othis.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){bL.subVectors(e,this.center);const t=bL.lengthSq();if(t>this.radius*this.radius){const r=Math.sqrt(t),s=(r-this.radius)*.5;this.center.add(bL.multiplyScalar(s/r)),this.radius+=s}return this}union(e){return this.center.equals(e.center)===!0?jM.set(0,0,1).multiplyScalar(e.radius):jM.subVectors(e.center,this.center).normalize().multiplyScalar(e.radius),this.expandByPoint(vG.copy(e.center).add(jM)),this.expandByPoint(vG.copy(e.center).sub(jM)),this}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const Q_=new Ae,TL=new Ae,YM=new Ae,oy=new Ae,SL=new Ae,XM=new Ae,wL=new Ae;class kC{constructor(e=new Ae,t=new Ae(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,Q_)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const r=t.dot(this.direction);return r<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(r).add(this.origin)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=Q_.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Q_.copy(this.direction).multiplyScalar(t).add(this.origin),Q_.distanceToSquared(e))}distanceSqToSegment(e,t,r,s){TL.copy(e).add(t).multiplyScalar(.5),YM.copy(t).sub(e).normalize(),oy.copy(this.origin).sub(TL);const o=e.distanceTo(t)*.5,l=-this.direction.dot(YM),u=oy.dot(this.direction),h=-oy.dot(YM),f=oy.lengthSq(),g=Math.abs(1-l*l);let y,b,w,C;if(g>0)if(y=l*h-u,b=l*u-h,C=o*g,y>=0)if(b>=-C)if(b<=C){const M=1/g;y*=M,b*=M,w=y*(y+l*b+2*u)+b*(l*y+b+2*h)+f}else b=o,y=Math.max(0,-(l*b+u)),w=-y*y+b*(b+2*h)+f;else b=-o,y=Math.max(0,-(l*b+u)),w=-y*y+b*(b+2*h)+f;else b<=-C?(y=Math.max(0,-(-l*o+u)),b=y>0?-o:Math.min(Math.max(-o,-h),o),w=-y*y+b*(b+2*h)+f):b<=C?(y=0,b=Math.min(Math.max(-o,-h),o),w=b*(b+2*h)+f):(y=Math.max(0,-(l*o+u)),b=y>0?o:Math.min(Math.max(-o,-h),o),w=-y*y+b*(b+2*h)+f);else b=l>0?-o:o,y=Math.max(0,-(l*b+u)),w=-y*y+b*(b+2*h)+f;return r&&r.copy(this.direction).multiplyScalar(y).add(this.origin),s&&s.copy(YM).multiplyScalar(b).add(TL),w}intersectSphere(e,t){Q_.subVectors(e.center,this.origin);const r=Q_.dot(this.direction),s=Q_.dot(Q_)-r*r,o=e.radius*e.radius;if(s>o)return null;const l=Math.sqrt(o-s),u=r-l,h=r+l;return u<0&&h<0?null:u<0?this.at(h,t):this.at(u,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const r=-(this.origin.dot(e.normal)+e.constant)/t;return r>=0?r:null}intersectPlane(e,t){const r=this.distanceToPlane(e);return r===null?null:this.at(r,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let r,s,o,l,u,h;const f=1/this.direction.x,g=1/this.direction.y,y=1/this.direction.z,b=this.origin;return f>=0?(r=(e.min.x-b.x)*f,s=(e.max.x-b.x)*f):(r=(e.max.x-b.x)*f,s=(e.min.x-b.x)*f),g>=0?(o=(e.min.y-b.y)*g,l=(e.max.y-b.y)*g):(o=(e.max.y-b.y)*g,l=(e.min.y-b.y)*g),r>l||o>s||((o>r||r!==r)&&(r=o),(l=0?(u=(e.min.z-b.z)*y,h=(e.max.z-b.z)*y):(u=(e.max.z-b.z)*y,h=(e.min.z-b.z)*y),r>h||u>s)||((u>r||r!==r)&&(r=u),(h=0?r:s,t)}intersectsBox(e){return this.intersectBox(e,Q_)!==null}intersectTriangle(e,t,r,s,o){SL.subVectors(t,e),XM.subVectors(r,e),wL.crossVectors(SL,XM);let l=this.direction.dot(wL),u;if(l>0){if(s)return null;u=1}else if(l<0)u=-1,l=-l;else return null;oy.subVectors(this.origin,e);const h=u*this.direction.dot(XM.crossVectors(oy,XM));if(h<0)return null;const f=u*this.direction.dot(SL.cross(oy));if(f<0||h+f>l)return null;const g=-u*oy.dot(wL);return g<0?null:this.at(g/l,o)}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 Qr{constructor(){Qr.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}set(e,t,r,s,o,l,u,h,f,g,y,b,w,C,M,A){const k=this.elements;return k[0]=e,k[4]=t,k[8]=r,k[12]=s,k[1]=o,k[5]=l,k[9]=u,k[13]=h,k[2]=f,k[6]=g,k[10]=y,k[14]=b,k[3]=w,k[7]=C,k[11]=M,k[15]=A,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 Qr().fromArray(this.elements)}copy(e){const t=this.elements,r=e.elements;return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],t[9]=r[9],t[10]=r[10],t[11]=r[11],t[12]=r[12],t[13]=r[13],t[14]=r[14],t[15]=r[15],this}copyPosition(e){const t=this.elements,r=e.elements;return t[12]=r[12],t[13]=r[13],t[14]=r[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,r){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),r.setFromMatrixColumn(this,2),this}makeBasis(e,t,r){return this.set(e.x,t.x,r.x,0,e.y,t.y,r.y,0,e.z,t.z,r.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,r=e.elements,s=1/vS.setFromMatrixColumn(e,0).length(),o=1/vS.setFromMatrixColumn(e,1).length(),l=1/vS.setFromMatrixColumn(e,2).length();return t[0]=r[0]*s,t[1]=r[1]*s,t[2]=r[2]*s,t[3]=0,t[4]=r[4]*o,t[5]=r[5]*o,t[6]=r[6]*o,t[7]=0,t[8]=r[8]*l,t[9]=r[9]*l,t[10]=r[10]*l,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,r=e.x,s=e.y,o=e.z,l=Math.cos(r),u=Math.sin(r),h=Math.cos(s),f=Math.sin(s),g=Math.cos(o),y=Math.sin(o);if(e.order==="XYZ"){const b=l*g,w=l*y,C=u*g,M=u*y;t[0]=h*g,t[4]=-h*y,t[8]=f,t[1]=w+C*f,t[5]=b-M*f,t[9]=-u*h,t[2]=M-b*f,t[6]=C+w*f,t[10]=l*h}else if(e.order==="YXZ"){const b=h*g,w=h*y,C=f*g,M=f*y;t[0]=b+M*u,t[4]=C*u-w,t[8]=l*f,t[1]=l*y,t[5]=l*g,t[9]=-u,t[2]=w*u-C,t[6]=M+b*u,t[10]=l*h}else if(e.order==="ZXY"){const b=h*g,w=h*y,C=f*g,M=f*y;t[0]=b-M*u,t[4]=-l*y,t[8]=C+w*u,t[1]=w+C*u,t[5]=l*g,t[9]=M-b*u,t[2]=-l*f,t[6]=u,t[10]=l*h}else if(e.order==="ZYX"){const b=l*g,w=l*y,C=u*g,M=u*y;t[0]=h*g,t[4]=C*f-w,t[8]=b*f+M,t[1]=h*y,t[5]=M*f+b,t[9]=w*f-C,t[2]=-f,t[6]=u*h,t[10]=l*h}else if(e.order==="YZX"){const b=l*h,w=l*f,C=u*h,M=u*f;t[0]=h*g,t[4]=M-b*y,t[8]=C*y+w,t[1]=y,t[5]=l*g,t[9]=-u*g,t[2]=-f*g,t[6]=w*y+C,t[10]=b-M*y}else if(e.order==="XZY"){const b=l*h,w=l*f,C=u*h,M=u*f;t[0]=h*g,t[4]=-y,t[8]=f*g,t[1]=b*y+M,t[5]=l*g,t[9]=w*y-C,t[2]=C*y-w,t[6]=u*g,t[10]=M*y+b}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(RTe,e,kTe)}lookAt(e,t,r){const s=this.elements;return $m.subVectors(e,t),$m.lengthSq()===0&&($m.z=1),$m.normalize(),ay.crossVectors(r,$m),ay.lengthSq()===0&&(Math.abs(r.z)===1?$m.x+=1e-4:$m.z+=1e-4,$m.normalize(),ay.crossVectors(r,$m)),ay.normalize(),KM.crossVectors($m,ay),s[0]=ay.x,s[4]=KM.x,s[8]=$m.x,s[1]=ay.y,s[5]=KM.y,s[9]=$m.y,s[2]=ay.z,s[6]=KM.z,s[10]=$m.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const r=e.elements,s=t.elements,o=this.elements,l=r[0],u=r[4],h=r[8],f=r[12],g=r[1],y=r[5],b=r[9],w=r[13],C=r[2],M=r[6],A=r[10],k=r[14],L=r[3],P=r[7],D=r[11],z=r[15],U=s[0],V=s[4],H=s[8],oe=s[12],le=s[1],Z=s[5],q=s[9],he=s[13],ae=s[2],ue=s[6],ge=s[10],we=s[14],J=s[3],re=s[7],ie=s[11],fe=s[15];return o[0]=l*U+u*le+h*ae+f*J,o[4]=l*V+u*Z+h*ue+f*re,o[8]=l*H+u*q+h*ge+f*ie,o[12]=l*oe+u*he+h*we+f*fe,o[1]=g*U+y*le+b*ae+w*J,o[5]=g*V+y*Z+b*ue+w*re,o[9]=g*H+y*q+b*ge+w*ie,o[13]=g*oe+y*he+b*we+w*fe,o[2]=C*U+M*le+A*ae+k*J,o[6]=C*V+M*Z+A*ue+k*re,o[10]=C*H+M*q+A*ge+k*ie,o[14]=C*oe+M*he+A*we+k*fe,o[3]=L*U+P*le+D*ae+z*J,o[7]=L*V+P*Z+D*ue+z*re,o[11]=L*H+P*q+D*ge+z*ie,o[15]=L*oe+P*he+D*we+z*fe,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],r=e[4],s=e[8],o=e[12],l=e[1],u=e[5],h=e[9],f=e[13],g=e[2],y=e[6],b=e[10],w=e[14],C=e[3],M=e[7],A=e[11],k=e[15];return C*(+o*h*y-s*f*y-o*u*b+r*f*b+s*u*w-r*h*w)+M*(+t*h*w-t*f*b+o*l*b-s*l*w+s*f*g-o*h*g)+A*(+t*f*y-t*u*w-o*l*y+r*l*w+o*u*g-r*f*g)+k*(-s*u*g-t*h*y+t*u*b+s*l*y-r*l*b+r*h*g)}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,r){const s=this.elements;return e.isVector3?(s[12]=e.x,s[13]=e.y,s[14]=e.z):(s[12]=e,s[13]=t,s[14]=r),this}invert(){const e=this.elements,t=e[0],r=e[1],s=e[2],o=e[3],l=e[4],u=e[5],h=e[6],f=e[7],g=e[8],y=e[9],b=e[10],w=e[11],C=e[12],M=e[13],A=e[14],k=e[15],L=y*A*f-M*b*f+M*h*w-u*A*w-y*h*k+u*b*k,P=C*b*f-g*A*f-C*h*w+l*A*w+g*h*k-l*b*k,D=g*M*f-C*y*f+C*u*w-l*M*w-g*u*k+l*y*k,z=C*y*h-g*M*h-C*u*b+l*M*b+g*u*A-l*y*A,U=t*L+r*P+s*D+o*z;if(U===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const V=1/U;return e[0]=L*V,e[1]=(M*b*o-y*A*o-M*s*w+r*A*w+y*s*k-r*b*k)*V,e[2]=(u*A*o-M*h*o+M*s*f-r*A*f-u*s*k+r*h*k)*V,e[3]=(y*h*o-u*b*o-y*s*f+r*b*f+u*s*w-r*h*w)*V,e[4]=P*V,e[5]=(g*A*o-C*b*o+C*s*w-t*A*w-g*s*k+t*b*k)*V,e[6]=(C*h*o-l*A*o-C*s*f+t*A*f+l*s*k-t*h*k)*V,e[7]=(l*b*o-g*h*o+g*s*f-t*b*f-l*s*w+t*h*w)*V,e[8]=D*V,e[9]=(C*y*o-g*M*o-C*r*w+t*M*w+g*r*k-t*y*k)*V,e[10]=(l*M*o-C*u*o+C*r*f-t*M*f-l*r*k+t*u*k)*V,e[11]=(g*u*o-l*y*o-g*r*f+t*y*f+l*r*w-t*u*w)*V,e[12]=z*V,e[13]=(g*M*s-C*y*s+C*r*b-t*M*b-g*r*A+t*y*A)*V,e[14]=(C*u*s-l*M*s-C*r*h+t*M*h+l*r*A-t*u*A)*V,e[15]=(l*y*s-g*u*s+g*r*h-t*y*h-l*r*b+t*u*b)*V,this}scale(e){const t=this.elements,r=e.x,s=e.y,o=e.z;return t[0]*=r,t[4]*=s,t[8]*=o,t[1]*=r,t[5]*=s,t[9]*=o,t[2]*=r,t[6]*=s,t[10]*=o,t[3]*=r,t[7]*=s,t[11]*=o,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],r=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],s=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,r,s))}makeTranslation(e,t,r){return this.set(1,0,0,e,0,1,0,t,0,0,1,r,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),r=Math.sin(e);return this.set(1,0,0,0,0,t,-r,0,0,r,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),r=Math.sin(e);return this.set(t,0,r,0,0,1,0,0,-r,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),r=Math.sin(e);return this.set(t,-r,0,0,r,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const r=Math.cos(t),s=Math.sin(t),o=1-r,l=e.x,u=e.y,h=e.z,f=o*l,g=o*u;return this.set(f*l+r,f*u-s*h,f*h+s*u,0,f*u+s*h,g*u+r,g*h-s*l,0,f*h-s*u,g*h+s*l,o*h*h+r,0,0,0,0,1),this}makeScale(e,t,r){return this.set(e,0,0,0,0,t,0,0,0,0,r,0,0,0,0,1),this}makeShear(e,t,r,s,o,l){return this.set(1,r,o,0,e,1,l,0,t,s,1,0,0,0,0,1),this}compose(e,t,r){const s=this.elements,o=t._x,l=t._y,u=t._z,h=t._w,f=o+o,g=l+l,y=u+u,b=o*f,w=o*g,C=o*y,M=l*g,A=l*y,k=u*y,L=h*f,P=h*g,D=h*y,z=r.x,U=r.y,V=r.z;return s[0]=(1-(M+k))*z,s[1]=(w+D)*z,s[2]=(C-P)*z,s[3]=0,s[4]=(w-D)*U,s[5]=(1-(b+k))*U,s[6]=(A+L)*U,s[7]=0,s[8]=(C+P)*V,s[9]=(A-L)*V,s[10]=(1-(b+M))*V,s[11]=0,s[12]=e.x,s[13]=e.y,s[14]=e.z,s[15]=1,this}decompose(e,t,r){const s=this.elements;let o=vS.set(s[0],s[1],s[2]).length();const l=vS.set(s[4],s[5],s[6]).length(),u=vS.set(s[8],s[9],s[10]).length();this.determinant()<0&&(o=-o),e.x=s[12],e.y=s[13],e.z=s[14],Yg.copy(this);const h=1/o,f=1/l,g=1/u;return Yg.elements[0]*=h,Yg.elements[1]*=h,Yg.elements[2]*=h,Yg.elements[4]*=f,Yg.elements[5]*=f,Yg.elements[6]*=f,Yg.elements[8]*=g,Yg.elements[9]*=g,Yg.elements[10]*=g,t.setFromRotationMatrix(Yg),r.x=o,r.y=l,r.z=u,this}makePerspective(e,t,r,s,o,l){const u=this.elements,h=2*o/(t-e),f=2*o/(r-s),g=(t+e)/(t-e),y=(r+s)/(r-s),b=-(l+o)/(l-o),w=-2*l*o/(l-o);return u[0]=h,u[4]=0,u[8]=g,u[12]=0,u[1]=0,u[5]=f,u[9]=y,u[13]=0,u[2]=0,u[6]=0,u[10]=b,u[14]=w,u[3]=0,u[7]=0,u[11]=-1,u[15]=0,this}makeOrthographic(e,t,r,s,o,l){const u=this.elements,h=1/(t-e),f=1/(r-s),g=1/(l-o),y=(t+e)*h,b=(r+s)*f,w=(l+o)*g;return u[0]=2*h,u[4]=0,u[8]=0,u[12]=-y,u[1]=0,u[5]=2*f,u[9]=0,u[13]=-b,u[2]=0,u[6]=0,u[10]=-2*g,u[14]=-w,u[3]=0,u[7]=0,u[11]=0,u[15]=1,this}equals(e){const t=this.elements,r=e.elements;for(let s=0;s<16;s++)if(t[s]!==r[s])return!1;return!0}fromArray(e,t=0){for(let r=0;r<16;r++)this.elements[r]=e[r+t];return this}toArray(e=[],t=0){const r=this.elements;return e[t]=r[0],e[t+1]=r[1],e[t+2]=r[2],e[t+3]=r[3],e[t+4]=r[4],e[t+5]=r[5],e[t+6]=r[6],e[t+7]=r[7],e[t+8]=r[8],e[t+9]=r[9],e[t+10]=r[10],e[t+11]=r[11],e[t+12]=r[12],e[t+13]=r[13],e[t+14]=r[14],e[t+15]=r[15],e}}const vS=new Ae,Yg=new Qr,RTe=new Ae(0,0,0),kTe=new Ae(1,1,1),ay=new Ae,KM=new Ae,$m=new Ae,yG=new Qr,bG=new Sl;class hT{constructor(e=0,t=0,r=0,s=hT.DefaultOrder){this.isEuler=!0,this._x=e,this._y=t,this._z=r,this._order=s}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,r,s=this._order){return this._x=e,this._y=t,this._z=r,this._order=s,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,r=!0){const s=e.elements,o=s[0],l=s[4],u=s[8],h=s[1],f=s[5],g=s[9],y=s[2],b=s[6],w=s[10];switch(t){case"XYZ":this._y=Math.asin(hh(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(-g,w),this._z=Math.atan2(-l,o)):(this._x=Math.atan2(b,f),this._z=0);break;case"YXZ":this._x=Math.asin(-hh(g,-1,1)),Math.abs(g)<.9999999?(this._y=Math.atan2(u,w),this._z=Math.atan2(h,f)):(this._y=Math.atan2(-y,o),this._z=0);break;case"ZXY":this._x=Math.asin(hh(b,-1,1)),Math.abs(b)<.9999999?(this._y=Math.atan2(-y,w),this._z=Math.atan2(-l,f)):(this._y=0,this._z=Math.atan2(h,o));break;case"ZYX":this._y=Math.asin(-hh(y,-1,1)),Math.abs(y)<.9999999?(this._x=Math.atan2(b,w),this._z=Math.atan2(h,o)):(this._x=0,this._z=Math.atan2(-l,f));break;case"YZX":this._z=Math.asin(hh(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(-g,f),this._y=Math.atan2(-y,o)):(this._x=0,this._y=Math.atan2(u,w));break;case"XZY":this._z=Math.asin(-hh(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(b,f),this._y=Math.atan2(u,o)):(this._x=Math.atan2(-g,w),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,r===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,r){return yG.makeRotationFromQuaternion(e),this.setFromRotationMatrix(yG,t,r)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return bG.setFromEuler(this),this.setFromQuaternion(bG,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}toVector3(){console.error("THREE.Euler: .toVector3() has been removed. Use Vector3.setFromEuler() instead")}}hT.DefaultOrder="XYZ";hT.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];class B1{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let t=0;t1){for(let r=0;r0){s.children=[];for(let u=0;u0){s.animations=[];for(let u=0;u0&&(r.geometries=u),h.length>0&&(r.materials=h),f.length>0&&(r.textures=f),g.length>0&&(r.images=g),y.length>0&&(r.shapes=y),b.length>0&&(r.skeletons=b),w.length>0&&(r.animations=w),C.length>0&&(r.nodes=C)}return r.object=s,r;function l(u){const h=[];for(const f in u){const g=u[f];delete g.metadata,h.push(g)}return h}}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)),t===!0)for(let r=0;r0?s.multiplyScalar(1/Math.sqrt(o)):s.set(0,0,0)}static getBarycoord(e,t,r,s,o){Xg.subVectors(s,t),ev.subVectors(r,t),EL.subVectors(e,t);const l=Xg.dot(Xg),u=Xg.dot(ev),h=Xg.dot(EL),f=ev.dot(ev),g=ev.dot(EL),y=l*f-u*u;if(y===0)return o.set(-2,-1,-1);const b=1/y,w=(f*h-u*g)*b,C=(l*g-u*h)*b;return o.set(1-w-C,C,w)}static containsPoint(e,t,r,s){return this.getBarycoord(e,t,r,s,tv),tv.x>=0&&tv.y>=0&&tv.x+tv.y<=1}static getUV(e,t,r,s,o,l,u,h){return this.getBarycoord(e,t,r,s,tv),h.set(0,0),h.addScaledVector(o,tv.x),h.addScaledVector(l,tv.y),h.addScaledVector(u,tv.z),h}static isFrontFacing(e,t,r,s){return Xg.subVectors(r,t),ev.subVectors(e,t),Xg.cross(ev).dot(s)<0}set(e,t,r){return this.a.copy(e),this.b.copy(t),this.c.copy(r),this}setFromPointsAndIndices(e,t,r,s){return this.a.copy(e[t]),this.b.copy(e[r]),this.c.copy(e[s]),this}setFromAttributeAndIndices(e,t,r,s){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,r),this.c.fromBufferAttribute(e,s),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 Xg.subVectors(this.c,this.b),ev.subVectors(this.a,this.b),Xg.cross(ev).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Im.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Im.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,r,s,o){return Im.getUV(e,this.a,this.b,this.c,t,r,s,o)}containsPoint(e){return Im.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Im.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const r=this.a,s=this.b,o=this.c;let l,u;bS.subVectors(s,r),TS.subVectors(o,r),xL.subVectors(e,r);const h=bS.dot(xL),f=TS.dot(xL);if(h<=0&&f<=0)return t.copy(r);$L.subVectors(e,s);const g=bS.dot($L),y=TS.dot($L);if(g>=0&&y<=g)return t.copy(s);const b=h*y-g*f;if(b<=0&&h>=0&&g<=0)return l=h/(h-g),t.copy(r).addScaledVector(bS,l);CL.subVectors(e,o);const w=bS.dot(CL),C=TS.dot(CL);if(C>=0&&w<=C)return t.copy(o);const M=w*f-h*C;if(M<=0&&f>=0&&C<=0)return u=f/(f-C),t.copy(r).addScaledVector(TS,u);const A=g*C-w*y;if(A<=0&&y-g>=0&&w-C>=0)return $G.subVectors(o,s),u=(y-g)/(y-g+(w-C)),t.copy(s).addScaledVector($G,u);const k=1/(A+M+b);return l=M*k,u=b*k,t.copy(r).addScaledVector(bS,l).addScaledVector(TS,u)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}let PTe=0;class hd extends jm{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:PTe++}),this.uuid=Pm(),this.name="",this.type="Material",this.blending=mv,this.side=p_,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=t2,this.blendDst=n2,this.blendEquation=p1,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=vR,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=bQ,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=TI,this.stencilZFail=TI,this.stencilZPass=TI,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(e!==void 0)for(const t in e){const r=e[t];if(r===void 0){console.warn("THREE.Material: '"+t+"' parameter is undefined.");continue}if(t==="shading"){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=r===Iq;continue}const s=this[t];if(s===void 0){console.warn("THREE."+this.type+": '"+t+"' is not a property of this material.");continue}s&&s.isColor?s.set(r):s&&s.isVector3&&r&&r.isVector3?s.copy(r):this[t]=r}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const r={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.color&&this.color.isColor&&(r.color=this.color.getHex()),this.roughness!==void 0&&(r.roughness=this.roughness),this.metalness!==void 0&&(r.metalness=this.metalness),this.sheen!==void 0&&(r.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(r.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(r.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(r.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(r.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(r.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(r.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(r.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(r.shininess=this.shininess),this.clearcoat!==void 0&&(r.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(r.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(r.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(r.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(r.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,r.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.iridescence!==void 0&&(r.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(r.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(r.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(r.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(r.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(r.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(r.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(r.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(r.lightMap=this.lightMap.toJSON(e).uuid,r.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(r.aoMap=this.aoMap.toJSON(e).uuid,r.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(r.bumpMap=this.bumpMap.toJSON(e).uuid,r.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(r.normalMap=this.normalMap.toJSON(e).uuid,r.normalMapType=this.normalMapType,r.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(r.displacementMap=this.displacementMap.toJSON(e).uuid,r.displacementScale=this.displacementScale,r.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(r.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(r.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(r.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(r.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(r.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(r.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(r.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(r.combine=this.combine)),this.envMapIntensity!==void 0&&(r.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(r.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(r.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(r.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(r.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(r.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(r.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(r.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&(r.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(r.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(r.size=this.size),this.shadowSide!==null&&(r.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(r.sizeAttenuation=this.sizeAttenuation),this.blending!==mv&&(r.blending=this.blending),this.side!==p_&&(r.side=this.side),this.vertexColors&&(r.vertexColors=!0),this.opacity<1&&(r.opacity=this.opacity),this.transparent===!0&&(r.transparent=this.transparent),r.depthFunc=this.depthFunc,r.depthTest=this.depthTest,r.depthWrite=this.depthWrite,r.colorWrite=this.colorWrite,r.stencilWrite=this.stencilWrite,r.stencilWriteMask=this.stencilWriteMask,r.stencilFunc=this.stencilFunc,r.stencilRef=this.stencilRef,r.stencilFuncMask=this.stencilFuncMask,r.stencilFail=this.stencilFail,r.stencilZFail=this.stencilZFail,r.stencilZPass=this.stencilZPass,this.rotation!==void 0&&this.rotation!==0&&(r.rotation=this.rotation),this.polygonOffset===!0&&(r.polygonOffset=!0),this.polygonOffsetFactor!==0&&(r.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(r.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(r.linewidth=this.linewidth),this.dashSize!==void 0&&(r.dashSize=this.dashSize),this.gapSize!==void 0&&(r.gapSize=this.gapSize),this.scale!==void 0&&(r.scale=this.scale),this.dithering===!0&&(r.dithering=!0),this.alphaTest>0&&(r.alphaTest=this.alphaTest),this.alphaToCoverage===!0&&(r.alphaToCoverage=this.alphaToCoverage),this.premultipliedAlpha===!0&&(r.premultipliedAlpha=this.premultipliedAlpha),this.wireframe===!0&&(r.wireframe=this.wireframe),this.wireframeLinewidth>1&&(r.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(r.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(r.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(r.flatShading=this.flatShading),this.visible===!1&&(r.visible=!1),this.toneMapped===!1&&(r.toneMapped=!1),this.fog===!1&&(r.fog=!1),JSON.stringify(this.userData)!=="{}"&&(r.userData=this.userData);function s(o){const l=[];for(const u in o){const h=o[u];delete h.metadata,l.push(h)}return l}if(t){const o=s(e.textures),l=s(e.images);o.length>0&&(r.textures=o),l.length>0&&(r.images=l)}return r}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.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 r=null;if(t!==null){const s=t.length;r=new Array(s);for(let o=0;o!==s;++o)r[o]=t[o].clone()}return this.clippingPlanes=r,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){e===!0&&this.version++}}class f0 extends hd{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Fn(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=IC,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const kh=new Ae,qM=new jt;class Do{constructor(e,t,r){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=r===!0,this.usage=H$,this.updateRange={offset:0,count:-1},this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&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,r){e*=this.itemSize,r*=t.itemSize;for(let s=0,o=this.itemSize;s0&&(e.userData=this.userData),this.parameters!==void 0){const h=this.parameters;for(const f in h)h[f]!==void 0&&(e[f]=h[f]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const r=this.attributes;for(const h in r){const f=r[h];e.data.attributes[h]=f.toJSON(e.data)}const s={};let o=!1;for(const h in this.morphAttributes){const f=this.morphAttributes[h],g=[];for(let y=0,b=f.length;y0&&(s[h]=g,o=!0)}o&&(e.data.morphAttributes=s,e.data.morphTargetsRelative=this.morphTargetsRelative);const l=this.groups;l.length>0&&(e.data.groups=JSON.parse(JSON.stringify(l)));const u=this.boundingSphere;return u!==null&&(e.data.boundingSphere={center:u.center.toArray(),radius:u.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 r=e.index;r!==null&&this.setIndex(r.clone(t));const s=e.attributes;for(const f in s){const g=s[f];this.setAttribute(f,g.clone(t))}const o=e.morphAttributes;for(const f in o){const g=[],y=o[f];for(let b=0,w=y.length;b0){const r=e[t[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;st.far?null:{distance:f,point:iA.clone(),object:n}}function sA(n,e,t,r,s,o,l,u,h,f,g,y){ly.fromBufferAttribute(s,f),uy.fromBufferAttribute(s,g),cy.fromBufferAttribute(s,y);const b=n.morphTargetInfluences;if(o&&b){QM.set(0,0,0),ZM.set(0,0,0),eA.set(0,0,0);for(let C=0,M=o.length;C0?1:-1,g.push(re.x,re.y,re.z),y.push(Te/V),y.push(1-ie/H),we+=1}}for(let ie=0;ie>8&255]+Cf[n>>16&255]+Cf[n>>24&255]+"-"+Cf[e&255]+Cf[e>>8&255]+"-"+Cf[e>>16&15|64]+Cf[e>>24&255]+"-"+Cf[t&63|128]+Cf[t>>8&255]+"-"+Cf[t>>16&255]+Cf[t>>24&255]+Cf[r&255]+Cf[r>>8&255]+Cf[r>>16&255]+Cf[r>>24&255]).toLowerCase()}function hh(n,e,t){return Math.max(e,Math.min(t,n))}function JF(n,e){return(n%e+e)%e}function cTe(n,e,t,r,s){return r+(n-e)*(s-r)/(t-e)}function hTe(n,e,t){return n!==e?(t-n)/(e-n):0}function e$(n,e,t){return(1-t)*n+t*e}function dTe(n,e,t,r){return e$(n,e,1-Math.exp(-t*r))}function fTe(n,e=1){return e-Math.abs(JF(n,e*2)-e)}function pTe(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*(3-2*n))}function mTe(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*n*(n*(n*6-15)+10))}function gTe(n,e){return n+Math.floor(Math.random()*(e-n+1))}function _Te(n,e){return n+Math.random()*(e-n)}function vTe(n){return n*(.5-Math.random())}function yTe(n){n!==void 0&&(_G=n);let e=_G+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function bTe(n){return n*P1}function TTe(n){return n*G$}function $P(n){return(n&n-1)===0&&n!==0}function SQ(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function SR(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function STe(n,e,t,r,s){const o=Math.cos,l=Math.sin,u=o(t/2),h=l(t/2),f=o((e+r)/2),g=l((e+r)/2),y=o((e-r)/2),b=l((e-r)/2),w=o((r-e)/2),C=l((r-e)/2);switch(s){case"XYX":n.set(u*g,h*y,h*b,u*f);break;case"YZY":n.set(h*b,u*g,h*y,u*f);break;case"ZXZ":n.set(h*y,h*b,u*g,u*f);break;case"XZX":n.set(u*g,h*C,h*w,u*f);break;case"YXY":n.set(h*w,u*g,h*C,u*f);break;case"ZYZ":n.set(h*C,h*w,u*g,u*f);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+s)}}function wTe(n,e){switch(e.constructor){case Float32Array:return n;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function ETe(n,e){switch(e.constructor){case Float32Array:return n;case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}var wQ=Object.freeze({__proto__:null,DEG2RAD:P1,RAD2DEG:G$,generateUUID:Pm,clamp:hh,euclideanModulo:JF,mapLinear:cTe,inverseLerp:hTe,lerp:e$,damp:dTe,pingpong:fTe,smoothstep:pTe,smootherstep:mTe,randInt:gTe,randFloat:_Te,randFloatSpread:vTe,seededRandom:yTe,degToRad:bTe,radToDeg:TTe,isPowerOfTwo:$P,ceilPowerOfTwo:SQ,floorPowerOfTwo:SR,setQuaternionFromProperEuler:STe,normalize:ETe,denormalize:wTe});class Vt{constructor(e=0,t=0){Vt.prototype.isVector2=!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){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,r=this.y,s=e.elements;return this.x=s[0]*t+s[3]*r+s[6],this.y=s[1]*t+s[4]*r+s[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 r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(t,r)))}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,r=this.y-e.y;return t*t+r*r}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,r){return this.x=e.x+(t.x-e.x)*r,this.y=e.y+(t.y-e.y)*r,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const r=Math.cos(t),s=Math.sin(t),o=this.x-e.x,l=this.y-e.y;return this.x=o*r-l*s+e.x,this.y=o*s+l*r+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class up{constructor(){up.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1]}set(e,t,r,s,o,l,u,h,f){const g=this.elements;return g[0]=e,g[1]=s,g[2]=u,g[3]=t,g[4]=o,g[5]=h,g[6]=r,g[7]=l,g[8]=f,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,r=e.elements;return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],this}extractBasis(e,t,r){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),r.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 r=e.elements,s=t.elements,o=this.elements,l=r[0],u=r[3],h=r[6],f=r[1],g=r[4],y=r[7],b=r[2],w=r[5],C=r[8],M=s[0],A=s[3],k=s[6],L=s[1],P=s[4],D=s[7],z=s[2],U=s[5],V=s[8];return o[0]=l*M+u*L+h*z,o[3]=l*A+u*P+h*U,o[6]=l*k+u*D+h*V,o[1]=f*M+g*L+y*z,o[4]=f*A+g*P+y*U,o[7]=f*k+g*D+y*V,o[2]=b*M+w*L+C*z,o[5]=b*A+w*P+C*U,o[8]=b*k+w*D+C*V,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],r=e[1],s=e[2],o=e[3],l=e[4],u=e[5],h=e[6],f=e[7],g=e[8];return t*l*g-t*u*f-r*o*g+r*u*h+s*o*f-s*l*h}invert(){const e=this.elements,t=e[0],r=e[1],s=e[2],o=e[3],l=e[4],u=e[5],h=e[6],f=e[7],g=e[8],y=g*l-u*f,b=u*h-g*o,w=f*o-l*h,C=t*y+r*b+s*w;if(C===0)return this.set(0,0,0,0,0,0,0,0,0);const M=1/C;return e[0]=y*M,e[1]=(s*f-g*r)*M,e[2]=(u*r-s*l)*M,e[3]=b*M,e[4]=(g*t-s*h)*M,e[5]=(s*o-u*t)*M,e[6]=w*M,e[7]=(r*h-f*t)*M,e[8]=(l*t-r*o)*M,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,r,s,o,l,u){const h=Math.cos(o),f=Math.sin(o);return this.set(r*h,r*f,-r*(h*l+f*u)+l+e,-s*f,s*h,-s*(-f*l+h*u)+u+t,0,0,1),this}scale(e,t){const r=this.elements;return r[0]*=e,r[3]*=e,r[6]*=e,r[1]*=t,r[4]*=t,r[7]*=t,this}rotate(e){const t=Math.cos(e),r=Math.sin(e),s=this.elements,o=s[0],l=s[3],u=s[6],h=s[1],f=s[4],g=s[7];return s[0]=t*o+r*h,s[3]=t*l+r*f,s[6]=t*u+r*g,s[1]=-r*o+t*h,s[4]=-r*l+t*f,s[7]=-r*u+t*g,this}translate(e,t){const r=this.elements;return r[0]+=e*r[2],r[3]+=e*r[5],r[6]+=e*r[8],r[1]+=t*r[2],r[4]+=t*r[5],r[7]+=t*r[8],this}equals(e){const t=this.elements,r=e.elements;for(let s=0;s<9;s++)if(t[s]!==r[s])return!1;return!0}fromArray(e,t=0){for(let r=0;r<9;r++)this.elements[r]=e[r+t];return this}toArray(e=[],t=0){const r=this.elements;return e[t]=r[0],e[t+1]=r[1],e[t+2]=r[2],e[t+3]=r[3],e[t+4]=r[4],e[t+5]=r[5],e[t+6]=r[6],e[t+7]=r[7],e[t+8]=r[8],e}clone(){return new this.constructor().fromArray(this.elements)}}function EQ(n){for(let e=n.length-1;e>=0;--e)if(n[e]>65535)return!0;return!1}const xTe={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function QS(n,e){return new xTe[n](e)}function W$(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function B1(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function SI(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}const pL={[J0]:{[xy]:B1},[xy]:{[J0]:SI}},ug={legacyMode:!0,get workingColorSpace(){return xy},set workingColorSpace(n){console.warn("THREE.ColorManagement: .workingColorSpace is readonly.")},convert:function(n,e,t){if(this.legacyMode||e===t||!e||!t)return n;if(pL[e]&&pL[e][t]!==void 0){const r=pL[e][t];return n.r=r(n.r),n.g=r(n.g),n.b=r(n.b),n}throw new Error("Unsupported color space conversion.")},fromWorkingColorSpace:function(n,e){return this.convert(n,this.workingColorSpace,e)},toWorkingColorSpace:function(n,e){return this.convert(n,e,this.workingColorSpace)}},xQ={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},od={r:0,g:0,b:0},jg={h:0,s:0,l:0},HM={h:0,s:0,l:0};function mL(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*6*(2/3-t):n}function GM(n,e){return e.r=n.r,e.g=n.g,e.b=n.b,e}class Fn{constructor(e,t,r){return this.isColor=!0,this.r=1,this.g=1,this.b=1,t===void 0&&r===void 0?this.set(e):this.setRGB(e,t,r)}set(e){return e&&e.isColor?this.copy(e):typeof e=="number"?this.setHex(e):typeof e=="string"&&this.setStyle(e),this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=J0){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,ug.toWorkingColorSpace(this,t),this}setRGB(e,t,r,s=xy){return this.r=e,this.g=t,this.b=r,ug.toWorkingColorSpace(this,s),this}setHSL(e,t,r,s=xy){if(e=JF(e,1),t=hh(t,0,1),r=hh(r,0,1),t===0)this.r=this.g=this.b=r;else{const o=r<=.5?r*(1+t):r+t-r*t,l=2*r-o;this.r=mL(l,o,e+1/3),this.g=mL(l,o,e),this.b=mL(l,o,e-1/3)}return ug.toWorkingColorSpace(this,s),this}setStyle(e,t=J0){function r(o){o!==void 0&&parseFloat(o)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let s;if(s=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(e)){let o;const l=s[1],u=s[2];switch(l){case"rgb":case"rgba":if(o=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(u))return this.r=Math.min(255,parseInt(o[1],10))/255,this.g=Math.min(255,parseInt(o[2],10))/255,this.b=Math.min(255,parseInt(o[3],10))/255,ug.toWorkingColorSpace(this,t),r(o[4]),this;if(o=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(u))return this.r=Math.min(100,parseInt(o[1],10))/100,this.g=Math.min(100,parseInt(o[2],10))/100,this.b=Math.min(100,parseInt(o[3],10))/100,ug.toWorkingColorSpace(this,t),r(o[4]),this;break;case"hsl":case"hsla":if(o=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(u)){const h=parseFloat(o[1])/360,f=parseInt(o[2],10)/100,g=parseInt(o[3],10)/100;return r(o[4]),this.setHSL(h,f,g,t)}break}}else if(s=/^\#([A-Fa-f\d]+)$/.exec(e)){const o=s[1],l=o.length;if(l===3)return this.r=parseInt(o.charAt(0)+o.charAt(0),16)/255,this.g=parseInt(o.charAt(1)+o.charAt(1),16)/255,this.b=parseInt(o.charAt(2)+o.charAt(2),16)/255,ug.toWorkingColorSpace(this,t),this;if(l===6)return this.r=parseInt(o.charAt(0)+o.charAt(1),16)/255,this.g=parseInt(o.charAt(2)+o.charAt(3),16)/255,this.b=parseInt(o.charAt(4)+o.charAt(5),16)/255,ug.toWorkingColorSpace(this,t),this}return e&&e.length>0?this.setColorName(e,t):this}setColorName(e,t=J0){const r=xQ[e.toLowerCase()];return r!==void 0?this.setHex(r,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=B1(e.r),this.g=B1(e.g),this.b=B1(e.b),this}copyLinearToSRGB(e){return this.r=SI(e.r),this.g=SI(e.g),this.b=SI(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=J0){return ug.fromWorkingColorSpace(GM(this,od),e),hh(od.r*255,0,255)<<16^hh(od.g*255,0,255)<<8^hh(od.b*255,0,255)<<0}getHexString(e=J0){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=xy){ug.fromWorkingColorSpace(GM(this,od),t);const r=od.r,s=od.g,o=od.b,l=Math.max(r,s,o),u=Math.min(r,s,o);let h,f;const g=(u+l)/2;if(u===l)h=0,f=0;else{const y=l-u;switch(f=g<=.5?y/(l+u):y/(2-l-u),l){case r:h=(s-o)/y+(s"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{pS===void 0&&(pS=W$("canvas")),pS.width=e.width,pS.height=e.height;const r=pS.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),t=pS}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(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=W$("canvas");t.width=e.width,t.height=e.height;const r=t.getContext("2d");r.drawImage(e,0,0,e.width,e.height);const s=r.getImageData(0,0,e.width,e.height),o=s.data;for(let l=0;l1)switch(this.wrapS){case Lw:e.x=e.x-Math.floor(e.x);break;case ap:e.x=e.x<0?0:1;break;case B$:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case Lw:e.y=e.y-Math.floor(e.y);break;case ap:e.y=e.y<0?0:1;break;case B$:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}}dc.DEFAULT_IMAGE=null;dc.DEFAULT_MAPPING=r2;class Ts{constructor(e=0,t=0,r=0,s=1){Ts.prototype.isVector4=!0,this.x=e,this.y=t,this.z=r,this.w=s}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,r,s){return this.x=e,this.y=t,this.z=r,this.w=s,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=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,r=this.y,s=this.z,o=this.w,l=e.elements;return this.x=l[0]*t+l[4]*r+l[8]*s+l[12]*o,this.y=l[1]*t+l[5]*r+l[9]*s+l[13]*o,this.z=l[2]*t+l[6]*r+l[10]*s+l[14]*o,this.w=l[3]*t+l[7]*r+l[11]*s+l[15]*o,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,r,s,o;const l=e.elements,u=l[0],h=l[4],f=l[8],g=l[1],y=l[5],b=l[9],w=l[2],C=l[6],M=l[10];if(Math.abs(h-g)<.01&&Math.abs(f-w)<.01&&Math.abs(b-C)<.01){if(Math.abs(h+g)<.1&&Math.abs(f+w)<.1&&Math.abs(b+C)<.1&&Math.abs(u+y+M-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const k=(u+1)/2,L=(y+1)/2,P=(M+1)/2,D=(h+g)/4,z=(f+w)/4,U=(b+C)/4;return k>L&&k>P?k<.01?(r=0,s=.707106781,o=.707106781):(r=Math.sqrt(k),s=D/r,o=z/r):L>P?L<.01?(r=.707106781,s=0,o=.707106781):(s=Math.sqrt(L),r=D/s,o=U/s):P<.01?(r=.707106781,s=.707106781,o=0):(o=Math.sqrt(P),r=z/o,s=U/o),this.set(r,s,o,t),this}let A=Math.sqrt((C-b)*(C-b)+(f-w)*(f-w)+(g-h)*(g-h));return Math.abs(A)<.001&&(A=1),this.x=(C-b)/A,this.y=(f-w)/A,this.z=(g-h)/A,this.w=Math.acos((u+y+M-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 r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(t,r)))}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,r){return this.x=e.x+(t.x-e.x)*r,this.y=e.y+(t.y-e.y)*r,this.z=e.z+(t.z-e.z)*r,this.w=e.w+(t.w-e.w)*r,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class Nc extends jm{constructor(e,t,r={}){super(),this.isWebGLRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new Ts(0,0,e,t),this.scissorTest=!1,this.viewport=new Ts(0,0,e,t);const s={width:e,height:t,depth:1};this.texture=new dc(s,r.mapping,r.wrapS,r.wrapT,r.magFilter,r.minFilter,r.format,r.type,r.anisotropy,r.encoding),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=r.generateMipmaps!==void 0?r.generateMipmaps:!1,this.texture.internalFormat=r.internalFormat!==void 0?r.internalFormat:null,this.texture.minFilter=r.minFilter!==void 0?r.minFilter:wl,this.depthBuffer=r.depthBuffer!==void 0?r.depthBuffer:!0,this.stencilBuffer=r.stencilBuffer!==void 0?r.stencilBuffer:!1,this.depthTexture=r.depthTexture!==void 0?r.depthTexture:null,this.samples=r.samples!==void 0?r.samples:0}setSize(e,t,r=1){(this.width!==e||this.height!==t||this.depth!==r)&&(this.width=e,this.height=t,this.depth=r,this.texture.image.width=e,this.texture.image.height=t,this.texture.image.depth=r,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.texture.isRenderTargetTexture=!0;const t=Object.assign({},e.texture.image);return this.texture.source=new M1(t),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class RC extends dc{constructor(e=null,t=1,r=1,s=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:r,depth:s},this.magFilter=Wl,this.minFilter=Wl,this.wrapR=ap,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class CTe extends Nc{constructor(e,t,r){super(e,t),this.isWebGLArrayRenderTarget=!0,this.depth=r,this.texture=new RC(null,e,t,r),this.texture.isRenderTargetTexture=!0}}class s2 extends dc{constructor(e=null,t=1,r=1,s=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:r,depth:s},this.magFilter=Wl,this.minFilter=Wl,this.wrapR=ap,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class MTe extends Nc{constructor(e,t,r){super(e,t),this.isWebGL3DRenderTarget=!0,this.depth=r,this.texture=new s2(null,e,t,r),this.texture.isRenderTargetTexture=!0}}class ATe extends Nc{constructor(e,t,r,s={}){super(e,t,s),this.isWebGLMultipleRenderTargets=!0;const o=this.texture;this.texture=[];for(let l=0;l=0?1:-1,P=1-k*k;if(P>Number.EPSILON){const z=Math.sqrt(P),U=Math.atan2(z,k*L);A=Math.sin(A*U)/z,u=Math.sin(u*U)/z}const D=u*L;if(h=h*A+b*D,f=f*A+w*D,g=g*A+C*D,y=y*A+M*D,A===1-u){const z=1/Math.sqrt(h*h+f*f+g*g+y*y);h*=z,f*=z,g*=z,y*=z}}e[t]=h,e[t+1]=f,e[t+2]=g,e[t+3]=y}static multiplyQuaternionsFlat(e,t,r,s,o,l){const u=r[s],h=r[s+1],f=r[s+2],g=r[s+3],y=o[l],b=o[l+1],w=o[l+2],C=o[l+3];return e[t]=u*C+g*y+h*w-f*b,e[t+1]=h*C+g*b+f*y-u*w,e[t+2]=f*C+g*w+u*b-h*y,e[t+3]=g*C-u*y-h*b-f*w,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,r,s){return this._x=e,this._y=t,this._z=r,this._w=s,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 r=e._x,s=e._y,o=e._z,l=e._order,u=Math.cos,h=Math.sin,f=u(r/2),g=u(s/2),y=u(o/2),b=h(r/2),w=h(s/2),C=h(o/2);switch(l){case"XYZ":this._x=b*g*y+f*w*C,this._y=f*w*y-b*g*C,this._z=f*g*C+b*w*y,this._w=f*g*y-b*w*C;break;case"YXZ":this._x=b*g*y+f*w*C,this._y=f*w*y-b*g*C,this._z=f*g*C-b*w*y,this._w=f*g*y+b*w*C;break;case"ZXY":this._x=b*g*y-f*w*C,this._y=f*w*y+b*g*C,this._z=f*g*C+b*w*y,this._w=f*g*y-b*w*C;break;case"ZYX":this._x=b*g*y-f*w*C,this._y=f*w*y+b*g*C,this._z=f*g*C-b*w*y,this._w=f*g*y+b*w*C;break;case"YZX":this._x=b*g*y+f*w*C,this._y=f*w*y+b*g*C,this._z=f*g*C-b*w*y,this._w=f*g*y-b*w*C;break;case"XZY":this._x=b*g*y-f*w*C,this._y=f*w*y-b*g*C,this._z=f*g*C+b*w*y,this._w=f*g*y+b*w*C;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+l)}return t!==!1&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const r=t/2,s=Math.sin(r);return this._x=e.x*s,this._y=e.y*s,this._z=e.z*s,this._w=Math.cos(r),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,r=t[0],s=t[4],o=t[8],l=t[1],u=t[5],h=t[9],f=t[2],g=t[6],y=t[10],b=r+u+y;if(b>0){const w=.5/Math.sqrt(b+1);this._w=.25/w,this._x=(g-h)*w,this._y=(o-f)*w,this._z=(l-s)*w}else if(r>u&&r>y){const w=2*Math.sqrt(1+r-u-y);this._w=(g-h)/w,this._x=.25*w,this._y=(s+l)/w,this._z=(o+f)/w}else if(u>y){const w=2*Math.sqrt(1+u-r-y);this._w=(o-f)/w,this._x=(s+l)/w,this._y=.25*w,this._z=(h+g)/w}else{const w=2*Math.sqrt(1+y-r-u);this._w=(l-s)/w,this._x=(o+f)/w,this._y=(h+g)/w,this._z=.25*w}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let r=e.dot(t)+1;return rMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=r):(this._x=0,this._y=-e.z,this._z=e.y,this._w=r)):(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=r),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(hh(this.dot(e),-1,1)))}rotateTowards(e,t){const r=this.angleTo(e);if(r===0)return this;const s=Math.min(1,t/r);return this.slerp(e,s),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const r=e._x,s=e._y,o=e._z,l=e._w,u=t._x,h=t._y,f=t._z,g=t._w;return this._x=r*g+l*u+s*f-o*h,this._y=s*g+l*h+o*u-r*f,this._z=o*g+l*f+r*h-s*u,this._w=l*g-r*u-s*h-o*f,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const r=this._x,s=this._y,o=this._z,l=this._w;let u=l*e._w+r*e._x+s*e._y+o*e._z;if(u<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,u=-u):this.copy(e),u>=1)return this._w=l,this._x=r,this._y=s,this._z=o,this;const h=1-u*u;if(h<=Number.EPSILON){const w=1-t;return this._w=w*l+t*this._w,this._x=w*r+t*this._x,this._y=w*s+t*this._y,this._z=w*o+t*this._z,this.normalize(),this._onChangeCallback(),this}const f=Math.sqrt(h),g=Math.atan2(f,u),y=Math.sin((1-t)*g)/f,b=Math.sin(t*g)/f;return this._w=l*y+this._w*b,this._x=r*y+this._x*b,this._y=s*y+this._y*b,this._z=o*y+this._z*b,this._onChangeCallback(),this}slerpQuaternions(e,t,r){return this.copy(e).slerp(t,r)}random(){const e=Math.random(),t=Math.sqrt(1-e),r=Math.sqrt(e),s=2*Math.PI*Math.random(),o=2*Math.PI*Math.random();return this.set(t*Math.cos(s),r*Math.sin(o),r*Math.cos(o),t*Math.sin(s))}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(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class Me{constructor(e=0,t=0,r=0){Me.prototype.isVector3=!0,this.x=e,this.y=t,this.z=r}set(e,t,r){return r===void 0&&(r=this.z),this.x=e,this.y=t,this.z=r,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){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(vG.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(vG.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,r=this.y,s=this.z,o=e.elements;return this.x=o[0]*t+o[3]*r+o[6]*s,this.y=o[1]*t+o[4]*r+o[7]*s,this.z=o[2]*t+o[5]*r+o[8]*s,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,r=this.y,s=this.z,o=e.elements,l=1/(o[3]*t+o[7]*r+o[11]*s+o[15]);return this.x=(o[0]*t+o[4]*r+o[8]*s+o[12])*l,this.y=(o[1]*t+o[5]*r+o[9]*s+o[13])*l,this.z=(o[2]*t+o[6]*r+o[10]*s+o[14])*l,this}applyQuaternion(e){const t=this.x,r=this.y,s=this.z,o=e.x,l=e.y,u=e.z,h=e.w,f=h*t+l*s-u*r,g=h*r+u*t-o*s,y=h*s+o*r-l*t,b=-o*t-l*r-u*s;return this.x=f*h+b*-o+g*-u-y*-l,this.y=g*h+b*-l+y*-o-f*-u,this.z=y*h+b*-u+f*-l-g*-o,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,r=this.y,s=this.z,o=e.elements;return this.x=o[0]*t+o[4]*r+o[8]*s,this.y=o[1]*t+o[5]*r+o[9]*s,this.z=o[2]*t+o[6]*r+o[10]*s,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 r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(t,r)))}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,r){return this.x=e.x+(t.x-e.x)*r,this.y=e.y+(t.y-e.y)*r,this.z=e.z+(t.z-e.z)*r,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const r=e.x,s=e.y,o=e.z,l=t.x,u=t.y,h=t.z;return this.x=s*h-o*u,this.y=o*l-r*h,this.z=r*u-s*l,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const r=e.dot(this)/t;return this.copy(e).multiplyScalar(r)}projectOnPlane(e){return _L.copy(this).projectOnVector(e),this.sub(_L)}reflect(e){return this.sub(_L.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const r=this.dot(e)/t;return Math.acos(hh(r,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,r=this.y-e.y,s=this.z-e.z;return t*t+r*r+s*s}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,r){const s=Math.sin(t)*e;return this.x=s*Math.sin(r),this.y=Math.cos(t)*e,this.z=s*Math.cos(r),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,r){return this.x=e*Math.sin(t),this.y=r,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(),r=this.setFromMatrixColumn(e,1).length(),s=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=r,this.z=s,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=(Math.random()-.5)*2,t=Math.random()*Math.PI*2,r=Math.sqrt(1-e**2);return this.x=r*Math.cos(t),this.y=r*Math.sin(t),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const _L=new Me,vG=new Sl;class d0{constructor(e=new Me(1/0,1/0,1/0),t=new Me(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){let t=1/0,r=1/0,s=1/0,o=-1/0,l=-1/0,u=-1/0;for(let h=0,f=e.length;ho&&(o=g),y>l&&(l=y),b>u&&(u=b)}return this.min.set(t,r,s),this.max.set(o,l,u),this}setFromBufferAttribute(e){let t=1/0,r=1/0,s=1/0,o=-1/0,l=-1/0,u=-1/0;for(let h=0,f=e.count;ho&&(o=g),y>l&&(l=y),b>u&&(u=b)}return this.min.set(t,r,s),this.max.set(o,l,u),this}setFromPoints(e){this.makeEmpty();for(let t=0,r=e.length;tthis.max.x||e.ythis.max.y||e.zthis.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.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,Vb),Vb.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,r;return e.normal.x>0?(t=e.normal.x*this.min.x,r=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,r=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,r+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,r+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,r+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,r+=e.normal.z*this.min.z),t<=-e.constant&&r>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(ax),WM.subVectors(this.max,ax),mS.subVectors(e.a,ax),gS.subVectors(e.b,ax),_S.subVectors(e.c,ax),iy.subVectors(gS,mS),sy.subVectors(_S,gS),jb.subVectors(mS,_S);let t=[0,-iy.z,iy.y,0,-sy.z,sy.y,0,-jb.z,jb.y,iy.z,0,-iy.x,sy.z,0,-sy.x,jb.z,0,-jb.x,-iy.y,iy.x,0,-sy.y,sy.x,0,-jb.y,jb.x,0];return!yL(t,mS,gS,_S,WM)||(t=[1,0,0,0,1,0,0,0,1],!yL(t,mS,gS,_S,WM))?!1:(VM.crossVectors(iy,sy),t=[VM.x,VM.y,VM.z],yL(t,mS,gS,_S,WM))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return Vb.copy(e).clamp(this.min,this.max).sub(e).length()}getBoundingSphere(e){return this.getCenter(e.center),e.radius=this.getSize(Vb).length()*.5,e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(q_[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),q_[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),q_[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),q_[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),q_[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),q_[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),q_[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),q_[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(q_),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const q_=[new Me,new Me,new Me,new Me,new Me,new Me,new Me,new Me],Vb=new Me,vL=new d0,mS=new Me,gS=new Me,_S=new Me,iy=new Me,sy=new Me,jb=new Me,ax=new Me,WM=new Me,VM=new Me,Yb=new Me;function yL(n,e,t,r,s){for(let o=0,l=n.length-3;o<=l;o+=3){Yb.fromArray(n,o);const u=s.x*Math.abs(Yb.x)+s.y*Math.abs(Yb.y)+s.z*Math.abs(Yb.z),h=e.dot(Yb),f=t.dot(Yb),g=r.dot(Yb);if(Math.max(-Math.max(h,f,g),Math.min(h,f,g))>u)return!1}return!0}const ITe=new d0,yG=new Me,jM=new Me,bL=new Me;class b_{constructor(e=new Me,t=-1){this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const r=this.center;t!==void 0?r.copy(t):ITe.setFromPoints(e).getCenter(r);let s=0;for(let o=0,l=e.length;othis.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){bL.subVectors(e,this.center);const t=bL.lengthSq();if(t>this.radius*this.radius){const r=Math.sqrt(t),s=(r-this.radius)*.5;this.center.add(bL.multiplyScalar(s/r)),this.radius+=s}return this}union(e){return this.center.equals(e.center)===!0?jM.set(0,0,1).multiplyScalar(e.radius):jM.subVectors(e.center,this.center).normalize().multiplyScalar(e.radius),this.expandByPoint(yG.copy(e.center).add(jM)),this.expandByPoint(yG.copy(e.center).sub(jM)),this}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const Q_=new Me,TL=new Me,YM=new Me,oy=new Me,SL=new Me,XM=new Me,wL=new Me;class kC{constructor(e=new Me,t=new Me(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,Q_)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const r=t.dot(this.direction);return r<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(r).add(this.origin)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=Q_.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Q_.copy(this.direction).multiplyScalar(t).add(this.origin),Q_.distanceToSquared(e))}distanceSqToSegment(e,t,r,s){TL.copy(e).add(t).multiplyScalar(.5),YM.copy(t).sub(e).normalize(),oy.copy(this.origin).sub(TL);const o=e.distanceTo(t)*.5,l=-this.direction.dot(YM),u=oy.dot(this.direction),h=-oy.dot(YM),f=oy.lengthSq(),g=Math.abs(1-l*l);let y,b,w,C;if(g>0)if(y=l*h-u,b=l*u-h,C=o*g,y>=0)if(b>=-C)if(b<=C){const M=1/g;y*=M,b*=M,w=y*(y+l*b+2*u)+b*(l*y+b+2*h)+f}else b=o,y=Math.max(0,-(l*b+u)),w=-y*y+b*(b+2*h)+f;else b=-o,y=Math.max(0,-(l*b+u)),w=-y*y+b*(b+2*h)+f;else b<=-C?(y=Math.max(0,-(-l*o+u)),b=y>0?-o:Math.min(Math.max(-o,-h),o),w=-y*y+b*(b+2*h)+f):b<=C?(y=0,b=Math.min(Math.max(-o,-h),o),w=b*(b+2*h)+f):(y=Math.max(0,-(l*o+u)),b=y>0?o:Math.min(Math.max(-o,-h),o),w=-y*y+b*(b+2*h)+f);else b=l>0?-o:o,y=Math.max(0,-(l*b+u)),w=-y*y+b*(b+2*h)+f;return r&&r.copy(this.direction).multiplyScalar(y).add(this.origin),s&&s.copy(YM).multiplyScalar(b).add(TL),w}intersectSphere(e,t){Q_.subVectors(e.center,this.origin);const r=Q_.dot(this.direction),s=Q_.dot(Q_)-r*r,o=e.radius*e.radius;if(s>o)return null;const l=Math.sqrt(o-s),u=r-l,h=r+l;return u<0&&h<0?null:u<0?this.at(h,t):this.at(u,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const r=-(this.origin.dot(e.normal)+e.constant)/t;return r>=0?r:null}intersectPlane(e,t){const r=this.distanceToPlane(e);return r===null?null:this.at(r,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let r,s,o,l,u,h;const f=1/this.direction.x,g=1/this.direction.y,y=1/this.direction.z,b=this.origin;return f>=0?(r=(e.min.x-b.x)*f,s=(e.max.x-b.x)*f):(r=(e.max.x-b.x)*f,s=(e.min.x-b.x)*f),g>=0?(o=(e.min.y-b.y)*g,l=(e.max.y-b.y)*g):(o=(e.max.y-b.y)*g,l=(e.min.y-b.y)*g),r>l||o>s||((o>r||r!==r)&&(r=o),(l=0?(u=(e.min.z-b.z)*y,h=(e.max.z-b.z)*y):(u=(e.max.z-b.z)*y,h=(e.min.z-b.z)*y),r>h||u>s)||((u>r||r!==r)&&(r=u),(h=0?r:s,t)}intersectsBox(e){return this.intersectBox(e,Q_)!==null}intersectTriangle(e,t,r,s,o){SL.subVectors(t,e),XM.subVectors(r,e),wL.crossVectors(SL,XM);let l=this.direction.dot(wL),u;if(l>0){if(s)return null;u=1}else if(l<0)u=-1,l=-l;else return null;oy.subVectors(this.origin,e);const h=u*this.direction.dot(XM.crossVectors(oy,XM));if(h<0)return null;const f=u*this.direction.dot(SL.cross(oy));if(f<0||h+f>l)return null;const g=-u*oy.dot(wL);return g<0?null:this.at(g/l,o)}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 Qr{constructor(){Qr.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}set(e,t,r,s,o,l,u,h,f,g,y,b,w,C,M,A){const k=this.elements;return k[0]=e,k[4]=t,k[8]=r,k[12]=s,k[1]=o,k[5]=l,k[9]=u,k[13]=h,k[2]=f,k[6]=g,k[10]=y,k[14]=b,k[3]=w,k[7]=C,k[11]=M,k[15]=A,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 Qr().fromArray(this.elements)}copy(e){const t=this.elements,r=e.elements;return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],t[9]=r[9],t[10]=r[10],t[11]=r[11],t[12]=r[12],t[13]=r[13],t[14]=r[14],t[15]=r[15],this}copyPosition(e){const t=this.elements,r=e.elements;return t[12]=r[12],t[13]=r[13],t[14]=r[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,r){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),r.setFromMatrixColumn(this,2),this}makeBasis(e,t,r){return this.set(e.x,t.x,r.x,0,e.y,t.y,r.y,0,e.z,t.z,r.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,r=e.elements,s=1/vS.setFromMatrixColumn(e,0).length(),o=1/vS.setFromMatrixColumn(e,1).length(),l=1/vS.setFromMatrixColumn(e,2).length();return t[0]=r[0]*s,t[1]=r[1]*s,t[2]=r[2]*s,t[3]=0,t[4]=r[4]*o,t[5]=r[5]*o,t[6]=r[6]*o,t[7]=0,t[8]=r[8]*l,t[9]=r[9]*l,t[10]=r[10]*l,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,r=e.x,s=e.y,o=e.z,l=Math.cos(r),u=Math.sin(r),h=Math.cos(s),f=Math.sin(s),g=Math.cos(o),y=Math.sin(o);if(e.order==="XYZ"){const b=l*g,w=l*y,C=u*g,M=u*y;t[0]=h*g,t[4]=-h*y,t[8]=f,t[1]=w+C*f,t[5]=b-M*f,t[9]=-u*h,t[2]=M-b*f,t[6]=C+w*f,t[10]=l*h}else if(e.order==="YXZ"){const b=h*g,w=h*y,C=f*g,M=f*y;t[0]=b+M*u,t[4]=C*u-w,t[8]=l*f,t[1]=l*y,t[5]=l*g,t[9]=-u,t[2]=w*u-C,t[6]=M+b*u,t[10]=l*h}else if(e.order==="ZXY"){const b=h*g,w=h*y,C=f*g,M=f*y;t[0]=b-M*u,t[4]=-l*y,t[8]=C+w*u,t[1]=w+C*u,t[5]=l*g,t[9]=M-b*u,t[2]=-l*f,t[6]=u,t[10]=l*h}else if(e.order==="ZYX"){const b=l*g,w=l*y,C=u*g,M=u*y;t[0]=h*g,t[4]=C*f-w,t[8]=b*f+M,t[1]=h*y,t[5]=M*f+b,t[9]=w*f-C,t[2]=-f,t[6]=u*h,t[10]=l*h}else if(e.order==="YZX"){const b=l*h,w=l*f,C=u*h,M=u*f;t[0]=h*g,t[4]=M-b*y,t[8]=C*y+w,t[1]=y,t[5]=l*g,t[9]=-u*g,t[2]=-f*g,t[6]=w*y+C,t[10]=b-M*y}else if(e.order==="XZY"){const b=l*h,w=l*f,C=u*h,M=u*f;t[0]=h*g,t[4]=-y,t[8]=f*g,t[1]=b*y+M,t[5]=l*g,t[9]=w*y-C,t[2]=C*y-w,t[6]=u*g,t[10]=M*y+b}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(RTe,e,kTe)}lookAt(e,t,r){const s=this.elements;return $m.subVectors(e,t),$m.lengthSq()===0&&($m.z=1),$m.normalize(),ay.crossVectors(r,$m),ay.lengthSq()===0&&(Math.abs(r.z)===1?$m.x+=1e-4:$m.z+=1e-4,$m.normalize(),ay.crossVectors(r,$m)),ay.normalize(),KM.crossVectors($m,ay),s[0]=ay.x,s[4]=KM.x,s[8]=$m.x,s[1]=ay.y,s[5]=KM.y,s[9]=$m.y,s[2]=ay.z,s[6]=KM.z,s[10]=$m.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const r=e.elements,s=t.elements,o=this.elements,l=r[0],u=r[4],h=r[8],f=r[12],g=r[1],y=r[5],b=r[9],w=r[13],C=r[2],M=r[6],A=r[10],k=r[14],L=r[3],P=r[7],D=r[11],z=r[15],U=s[0],V=s[4],H=s[8],oe=s[12],le=s[1],Z=s[5],q=s[9],he=s[13],ae=s[2],ue=s[6],ge=s[10],we=s[14],J=s[3],re=s[7],se=s[11],fe=s[15];return o[0]=l*U+u*le+h*ae+f*J,o[4]=l*V+u*Z+h*ue+f*re,o[8]=l*H+u*q+h*ge+f*se,o[12]=l*oe+u*he+h*we+f*fe,o[1]=g*U+y*le+b*ae+w*J,o[5]=g*V+y*Z+b*ue+w*re,o[9]=g*H+y*q+b*ge+w*se,o[13]=g*oe+y*he+b*we+w*fe,o[2]=C*U+M*le+A*ae+k*J,o[6]=C*V+M*Z+A*ue+k*re,o[10]=C*H+M*q+A*ge+k*se,o[14]=C*oe+M*he+A*we+k*fe,o[3]=L*U+P*le+D*ae+z*J,o[7]=L*V+P*Z+D*ue+z*re,o[11]=L*H+P*q+D*ge+z*se,o[15]=L*oe+P*he+D*we+z*fe,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],r=e[4],s=e[8],o=e[12],l=e[1],u=e[5],h=e[9],f=e[13],g=e[2],y=e[6],b=e[10],w=e[14],C=e[3],M=e[7],A=e[11],k=e[15];return C*(+o*h*y-s*f*y-o*u*b+r*f*b+s*u*w-r*h*w)+M*(+t*h*w-t*f*b+o*l*b-s*l*w+s*f*g-o*h*g)+A*(+t*f*y-t*u*w-o*l*y+r*l*w+o*u*g-r*f*g)+k*(-s*u*g-t*h*y+t*u*b+s*l*y-r*l*b+r*h*g)}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,r){const s=this.elements;return e.isVector3?(s[12]=e.x,s[13]=e.y,s[14]=e.z):(s[12]=e,s[13]=t,s[14]=r),this}invert(){const e=this.elements,t=e[0],r=e[1],s=e[2],o=e[3],l=e[4],u=e[5],h=e[6],f=e[7],g=e[8],y=e[9],b=e[10],w=e[11],C=e[12],M=e[13],A=e[14],k=e[15],L=y*A*f-M*b*f+M*h*w-u*A*w-y*h*k+u*b*k,P=C*b*f-g*A*f-C*h*w+l*A*w+g*h*k-l*b*k,D=g*M*f-C*y*f+C*u*w-l*M*w-g*u*k+l*y*k,z=C*y*h-g*M*h-C*u*b+l*M*b+g*u*A-l*y*A,U=t*L+r*P+s*D+o*z;if(U===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const V=1/U;return e[0]=L*V,e[1]=(M*b*o-y*A*o-M*s*w+r*A*w+y*s*k-r*b*k)*V,e[2]=(u*A*o-M*h*o+M*s*f-r*A*f-u*s*k+r*h*k)*V,e[3]=(y*h*o-u*b*o-y*s*f+r*b*f+u*s*w-r*h*w)*V,e[4]=P*V,e[5]=(g*A*o-C*b*o+C*s*w-t*A*w-g*s*k+t*b*k)*V,e[6]=(C*h*o-l*A*o-C*s*f+t*A*f+l*s*k-t*h*k)*V,e[7]=(l*b*o-g*h*o+g*s*f-t*b*f-l*s*w+t*h*w)*V,e[8]=D*V,e[9]=(C*y*o-g*M*o-C*r*w+t*M*w+g*r*k-t*y*k)*V,e[10]=(l*M*o-C*u*o+C*r*f-t*M*f-l*r*k+t*u*k)*V,e[11]=(g*u*o-l*y*o-g*r*f+t*y*f+l*r*w-t*u*w)*V,e[12]=z*V,e[13]=(g*M*s-C*y*s+C*r*b-t*M*b-g*r*A+t*y*A)*V,e[14]=(C*u*s-l*M*s-C*r*h+t*M*h+l*r*A-t*u*A)*V,e[15]=(l*y*s-g*u*s+g*r*h-t*y*h-l*r*b+t*u*b)*V,this}scale(e){const t=this.elements,r=e.x,s=e.y,o=e.z;return t[0]*=r,t[4]*=s,t[8]*=o,t[1]*=r,t[5]*=s,t[9]*=o,t[2]*=r,t[6]*=s,t[10]*=o,t[3]*=r,t[7]*=s,t[11]*=o,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],r=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],s=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,r,s))}makeTranslation(e,t,r){return this.set(1,0,0,e,0,1,0,t,0,0,1,r,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),r=Math.sin(e);return this.set(1,0,0,0,0,t,-r,0,0,r,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),r=Math.sin(e);return this.set(t,0,r,0,0,1,0,0,-r,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),r=Math.sin(e);return this.set(t,-r,0,0,r,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const r=Math.cos(t),s=Math.sin(t),o=1-r,l=e.x,u=e.y,h=e.z,f=o*l,g=o*u;return this.set(f*l+r,f*u-s*h,f*h+s*u,0,f*u+s*h,g*u+r,g*h-s*l,0,f*h-s*u,g*h+s*l,o*h*h+r,0,0,0,0,1),this}makeScale(e,t,r){return this.set(e,0,0,0,0,t,0,0,0,0,r,0,0,0,0,1),this}makeShear(e,t,r,s,o,l){return this.set(1,r,o,0,e,1,l,0,t,s,1,0,0,0,0,1),this}compose(e,t,r){const s=this.elements,o=t._x,l=t._y,u=t._z,h=t._w,f=o+o,g=l+l,y=u+u,b=o*f,w=o*g,C=o*y,M=l*g,A=l*y,k=u*y,L=h*f,P=h*g,D=h*y,z=r.x,U=r.y,V=r.z;return s[0]=(1-(M+k))*z,s[1]=(w+D)*z,s[2]=(C-P)*z,s[3]=0,s[4]=(w-D)*U,s[5]=(1-(b+k))*U,s[6]=(A+L)*U,s[7]=0,s[8]=(C+P)*V,s[9]=(A-L)*V,s[10]=(1-(b+M))*V,s[11]=0,s[12]=e.x,s[13]=e.y,s[14]=e.z,s[15]=1,this}decompose(e,t,r){const s=this.elements;let o=vS.set(s[0],s[1],s[2]).length();const l=vS.set(s[4],s[5],s[6]).length(),u=vS.set(s[8],s[9],s[10]).length();this.determinant()<0&&(o=-o),e.x=s[12],e.y=s[13],e.z=s[14],Yg.copy(this);const h=1/o,f=1/l,g=1/u;return Yg.elements[0]*=h,Yg.elements[1]*=h,Yg.elements[2]*=h,Yg.elements[4]*=f,Yg.elements[5]*=f,Yg.elements[6]*=f,Yg.elements[8]*=g,Yg.elements[9]*=g,Yg.elements[10]*=g,t.setFromRotationMatrix(Yg),r.x=o,r.y=l,r.z=u,this}makePerspective(e,t,r,s,o,l){const u=this.elements,h=2*o/(t-e),f=2*o/(r-s),g=(t+e)/(t-e),y=(r+s)/(r-s),b=-(l+o)/(l-o),w=-2*l*o/(l-o);return u[0]=h,u[4]=0,u[8]=g,u[12]=0,u[1]=0,u[5]=f,u[9]=y,u[13]=0,u[2]=0,u[6]=0,u[10]=b,u[14]=w,u[3]=0,u[7]=0,u[11]=-1,u[15]=0,this}makeOrthographic(e,t,r,s,o,l){const u=this.elements,h=1/(t-e),f=1/(r-s),g=1/(l-o),y=(t+e)*h,b=(r+s)*f,w=(l+o)*g;return u[0]=2*h,u[4]=0,u[8]=0,u[12]=-y,u[1]=0,u[5]=2*f,u[9]=0,u[13]=-b,u[2]=0,u[6]=0,u[10]=-2*g,u[14]=-w,u[3]=0,u[7]=0,u[11]=0,u[15]=1,this}equals(e){const t=this.elements,r=e.elements;for(let s=0;s<16;s++)if(t[s]!==r[s])return!1;return!0}fromArray(e,t=0){for(let r=0;r<16;r++)this.elements[r]=e[r+t];return this}toArray(e=[],t=0){const r=this.elements;return e[t]=r[0],e[t+1]=r[1],e[t+2]=r[2],e[t+3]=r[3],e[t+4]=r[4],e[t+5]=r[5],e[t+6]=r[6],e[t+7]=r[7],e[t+8]=r[8],e[t+9]=r[9],e[t+10]=r[10],e[t+11]=r[11],e[t+12]=r[12],e[t+13]=r[13],e[t+14]=r[14],e[t+15]=r[15],e}}const vS=new Me,Yg=new Qr,RTe=new Me(0,0,0),kTe=new Me(1,1,1),ay=new Me,KM=new Me,$m=new Me,bG=new Qr,TG=new Sl;class dT{constructor(e=0,t=0,r=0,s=dT.DefaultOrder){this.isEuler=!0,this._x=e,this._y=t,this._z=r,this._order=s}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,r,s=this._order){return this._x=e,this._y=t,this._z=r,this._order=s,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,r=!0){const s=e.elements,o=s[0],l=s[4],u=s[8],h=s[1],f=s[5],g=s[9],y=s[2],b=s[6],w=s[10];switch(t){case"XYZ":this._y=Math.asin(hh(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(-g,w),this._z=Math.atan2(-l,o)):(this._x=Math.atan2(b,f),this._z=0);break;case"YXZ":this._x=Math.asin(-hh(g,-1,1)),Math.abs(g)<.9999999?(this._y=Math.atan2(u,w),this._z=Math.atan2(h,f)):(this._y=Math.atan2(-y,o),this._z=0);break;case"ZXY":this._x=Math.asin(hh(b,-1,1)),Math.abs(b)<.9999999?(this._y=Math.atan2(-y,w),this._z=Math.atan2(-l,f)):(this._y=0,this._z=Math.atan2(h,o));break;case"ZYX":this._y=Math.asin(-hh(y,-1,1)),Math.abs(y)<.9999999?(this._x=Math.atan2(b,w),this._z=Math.atan2(h,o)):(this._x=0,this._z=Math.atan2(-l,f));break;case"YZX":this._z=Math.asin(hh(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(-g,f),this._y=Math.atan2(-y,o)):(this._x=0,this._y=Math.atan2(u,w));break;case"XZY":this._z=Math.asin(-hh(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(b,f),this._y=Math.atan2(u,o)):(this._x=Math.atan2(-g,w),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,r===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,r){return bG.makeRotationFromQuaternion(e),this.setFromRotationMatrix(bG,t,r)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return TG.setFromEuler(this),this.setFromQuaternion(TG,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}toVector3(){console.error("THREE.Euler: .toVector3() has been removed. Use Vector3.setFromEuler() instead")}}dT.DefaultOrder="XYZ";dT.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];class F1{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let t=0;t1){for(let r=0;r0){s.children=[];for(let u=0;u0){s.animations=[];for(let u=0;u0&&(r.geometries=u),h.length>0&&(r.materials=h),f.length>0&&(r.textures=f),g.length>0&&(r.images=g),y.length>0&&(r.shapes=y),b.length>0&&(r.skeletons=b),w.length>0&&(r.animations=w),C.length>0&&(r.nodes=C)}return r.object=s,r;function l(u){const h=[];for(const f in u){const g=u[f];delete g.metadata,h.push(g)}return h}}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)),t===!0)for(let r=0;r0?s.multiplyScalar(1/Math.sqrt(o)):s.set(0,0,0)}static getBarycoord(e,t,r,s,o){Xg.subVectors(s,t),ev.subVectors(r,t),EL.subVectors(e,t);const l=Xg.dot(Xg),u=Xg.dot(ev),h=Xg.dot(EL),f=ev.dot(ev),g=ev.dot(EL),y=l*f-u*u;if(y===0)return o.set(-2,-1,-1);const b=1/y,w=(f*h-u*g)*b,C=(l*g-u*h)*b;return o.set(1-w-C,C,w)}static containsPoint(e,t,r,s){return this.getBarycoord(e,t,r,s,tv),tv.x>=0&&tv.y>=0&&tv.x+tv.y<=1}static getUV(e,t,r,s,o,l,u,h){return this.getBarycoord(e,t,r,s,tv),h.set(0,0),h.addScaledVector(o,tv.x),h.addScaledVector(l,tv.y),h.addScaledVector(u,tv.z),h}static isFrontFacing(e,t,r,s){return Xg.subVectors(r,t),ev.subVectors(e,t),Xg.cross(ev).dot(s)<0}set(e,t,r){return this.a.copy(e),this.b.copy(t),this.c.copy(r),this}setFromPointsAndIndices(e,t,r,s){return this.a.copy(e[t]),this.b.copy(e[r]),this.c.copy(e[s]),this}setFromAttributeAndIndices(e,t,r,s){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,r),this.c.fromBufferAttribute(e,s),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 Xg.subVectors(this.c,this.b),ev.subVectors(this.a,this.b),Xg.cross(ev).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Im.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Im.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,r,s,o){return Im.getUV(e,this.a,this.b,this.c,t,r,s,o)}containsPoint(e){return Im.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Im.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const r=this.a,s=this.b,o=this.c;let l,u;bS.subVectors(s,r),TS.subVectors(o,r),xL.subVectors(e,r);const h=bS.dot(xL),f=TS.dot(xL);if(h<=0&&f<=0)return t.copy(r);$L.subVectors(e,s);const g=bS.dot($L),y=TS.dot($L);if(g>=0&&y<=g)return t.copy(s);const b=h*y-g*f;if(b<=0&&h>=0&&g<=0)return l=h/(h-g),t.copy(r).addScaledVector(bS,l);CL.subVectors(e,o);const w=bS.dot(CL),C=TS.dot(CL);if(C>=0&&w<=C)return t.copy(o);const M=w*f-h*C;if(M<=0&&f>=0&&C<=0)return u=f/(f-C),t.copy(r).addScaledVector(TS,u);const A=g*C-w*y;if(A<=0&&y-g>=0&&w-C>=0)return CG.subVectors(o,s),u=(y-g)/(y-g+(w-C)),t.copy(s).addScaledVector(CG,u);const k=1/(A+M+b);return l=M*k,u=b*k,t.copy(r).addScaledVector(bS,l).addScaledVector(TS,u)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}let PTe=0;class hd extends jm{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:PTe++}),this.uuid=Pm(),this.name="",this.type="Material",this.blending=mv,this.side=p_,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=t2,this.blendDst=n2,this.blendEquation=m1,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=vR,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=TQ,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=TI,this.stencilZFail=TI,this.stencilZPass=TI,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(e!==void 0)for(const t in e){const r=e[t];if(r===void 0){console.warn("THREE.Material: '"+t+"' parameter is undefined.");continue}if(t==="shading"){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=r===Rq;continue}const s=this[t];if(s===void 0){console.warn("THREE."+this.type+": '"+t+"' is not a property of this material.");continue}s&&s.isColor?s.set(r):s&&s.isVector3&&r&&r.isVector3?s.copy(r):this[t]=r}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const r={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.color&&this.color.isColor&&(r.color=this.color.getHex()),this.roughness!==void 0&&(r.roughness=this.roughness),this.metalness!==void 0&&(r.metalness=this.metalness),this.sheen!==void 0&&(r.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(r.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(r.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(r.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(r.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(r.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(r.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(r.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(r.shininess=this.shininess),this.clearcoat!==void 0&&(r.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(r.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(r.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(r.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(r.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,r.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.iridescence!==void 0&&(r.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(r.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(r.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(r.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(r.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(r.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(r.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(r.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(r.lightMap=this.lightMap.toJSON(e).uuid,r.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(r.aoMap=this.aoMap.toJSON(e).uuid,r.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(r.bumpMap=this.bumpMap.toJSON(e).uuid,r.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(r.normalMap=this.normalMap.toJSON(e).uuid,r.normalMapType=this.normalMapType,r.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(r.displacementMap=this.displacementMap.toJSON(e).uuid,r.displacementScale=this.displacementScale,r.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(r.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(r.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(r.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(r.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(r.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(r.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(r.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(r.combine=this.combine)),this.envMapIntensity!==void 0&&(r.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(r.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(r.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(r.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(r.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(r.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(r.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(r.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&(r.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(r.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(r.size=this.size),this.shadowSide!==null&&(r.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(r.sizeAttenuation=this.sizeAttenuation),this.blending!==mv&&(r.blending=this.blending),this.side!==p_&&(r.side=this.side),this.vertexColors&&(r.vertexColors=!0),this.opacity<1&&(r.opacity=this.opacity),this.transparent===!0&&(r.transparent=this.transparent),r.depthFunc=this.depthFunc,r.depthTest=this.depthTest,r.depthWrite=this.depthWrite,r.colorWrite=this.colorWrite,r.stencilWrite=this.stencilWrite,r.stencilWriteMask=this.stencilWriteMask,r.stencilFunc=this.stencilFunc,r.stencilRef=this.stencilRef,r.stencilFuncMask=this.stencilFuncMask,r.stencilFail=this.stencilFail,r.stencilZFail=this.stencilZFail,r.stencilZPass=this.stencilZPass,this.rotation!==void 0&&this.rotation!==0&&(r.rotation=this.rotation),this.polygonOffset===!0&&(r.polygonOffset=!0),this.polygonOffsetFactor!==0&&(r.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(r.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(r.linewidth=this.linewidth),this.dashSize!==void 0&&(r.dashSize=this.dashSize),this.gapSize!==void 0&&(r.gapSize=this.gapSize),this.scale!==void 0&&(r.scale=this.scale),this.dithering===!0&&(r.dithering=!0),this.alphaTest>0&&(r.alphaTest=this.alphaTest),this.alphaToCoverage===!0&&(r.alphaToCoverage=this.alphaToCoverage),this.premultipliedAlpha===!0&&(r.premultipliedAlpha=this.premultipliedAlpha),this.wireframe===!0&&(r.wireframe=this.wireframe),this.wireframeLinewidth>1&&(r.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(r.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(r.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(r.flatShading=this.flatShading),this.visible===!1&&(r.visible=!1),this.toneMapped===!1&&(r.toneMapped=!1),this.fog===!1&&(r.fog=!1),JSON.stringify(this.userData)!=="{}"&&(r.userData=this.userData);function s(o){const l=[];for(const u in o){const h=o[u];delete h.metadata,l.push(h)}return l}if(t){const o=s(e.textures),l=s(e.images);o.length>0&&(r.textures=o),l.length>0&&(r.images=l)}return r}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.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 r=null;if(t!==null){const s=t.length;r=new Array(s);for(let o=0;o!==s;++o)r[o]=t[o].clone()}return this.clippingPlanes=r,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){e===!0&&this.version++}}class f0 extends hd{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Fn(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=IC,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const kh=new Me,qM=new Vt;class Do{constructor(e,t,r){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=r===!0,this.usage=H$,this.updateRange={offset:0,count:-1},this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&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,r){e*=this.itemSize,r*=t.itemSize;for(let s=0,o=this.itemSize;s0&&(e.userData=this.userData),this.parameters!==void 0){const h=this.parameters;for(const f in h)h[f]!==void 0&&(e[f]=h[f]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const r=this.attributes;for(const h in r){const f=r[h];e.data.attributes[h]=f.toJSON(e.data)}const s={};let o=!1;for(const h in this.morphAttributes){const f=this.morphAttributes[h],g=[];for(let y=0,b=f.length;y0&&(s[h]=g,o=!0)}o&&(e.data.morphAttributes=s,e.data.morphTargetsRelative=this.morphTargetsRelative);const l=this.groups;l.length>0&&(e.data.groups=JSON.parse(JSON.stringify(l)));const u=this.boundingSphere;return u!==null&&(e.data.boundingSphere={center:u.center.toArray(),radius:u.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 r=e.index;r!==null&&this.setIndex(r.clone(t));const s=e.attributes;for(const f in s){const g=s[f];this.setAttribute(f,g.clone(t))}const o=e.morphAttributes;for(const f in o){const g=[],y=o[f];for(let b=0,w=y.length;b0){const r=e[t[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;st.far?null:{distance:f,point:iA.clone(),object:n}}function sA(n,e,t,r,s,o,l,u,h,f,g,y){ly.fromBufferAttribute(s,f),uy.fromBufferAttribute(s,g),cy.fromBufferAttribute(s,y);const b=n.morphTargetInfluences;if(o&&b){QM.set(0,0,0),ZM.set(0,0,0),eA.set(0,0,0);for(let C=0,M=o.length;C0?1:-1,g.push(re.x,re.y,re.z),y.push(Te/V),y.push(1-se/H),we+=1}}for(let se=0;se0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;const r={};for(const s in this.extensions)this.extensions[s]===!0&&(r[s]=!0);return Object.keys(r).length>0&&(t.extensions=r),t}}class fE extends ro{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Qr,this.projectionMatrix=new Qr,this.projectionMatrixInverse=new Qr}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)}}class Za extends fE{constructor(e=50,t=1,r=.1,s=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=r,this.far=s,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=G$*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(D1*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return G$*2*Math.atan(Math.tan(D1*.5*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,r,s,o,l){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=r,this.view.offsetY=s,this.view.width=o,this.view.height=l,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(D1*.5*this.fov)/this.zoom,r=2*t,s=this.aspect*r,o=-.5*s;const l=this.view;if(this.view!==null&&this.view.enabled){const h=l.fullWidth,f=l.fullHeight;o+=l.offsetX*s/h,t-=l.offsetY*r/f,s*=l.width/h,r*=l.height/f}const u=this.filmOffset;u!==0&&(o+=e*u/this.getFilmWidth()),this.projectionMatrix.makePerspective(o,o+s,t,t-r,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,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}const ES=90,xS=1;class xQ extends ro{constructor(e,t,r){if(super(),this.type="CubeCamera",r.isWebGLCubeRenderTarget!==!0){console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.");return}this.renderTarget=r;const s=new Za(ES,xS,e,t);s.layers=this.layers,s.up.set(0,-1,0),s.lookAt(new Ae(1,0,0)),this.add(s);const o=new Za(ES,xS,e,t);o.layers=this.layers,o.up.set(0,-1,0),o.lookAt(new Ae(-1,0,0)),this.add(o);const l=new Za(ES,xS,e,t);l.layers=this.layers,l.up.set(0,0,1),l.lookAt(new Ae(0,1,0)),this.add(l);const u=new Za(ES,xS,e,t);u.layers=this.layers,u.up.set(0,0,-1),u.lookAt(new Ae(0,-1,0)),this.add(u);const h=new Za(ES,xS,e,t);h.layers=this.layers,h.up.set(0,-1,0),h.lookAt(new Ae(0,0,1)),this.add(h);const f=new Za(ES,xS,e,t);f.layers=this.layers,f.up.set(0,-1,0),f.lookAt(new Ae(0,0,-1)),this.add(f)}update(e,t){this.parent===null&&this.updateMatrixWorld();const r=this.renderTarget,[s,o,l,u,h,f]=this.children,g=e.getRenderTarget(),y=e.toneMapping,b=e.xr.enabled;e.toneMapping=l0,e.xr.enabled=!1;const w=r.texture.generateMipmaps;r.texture.generateMipmaps=!1,e.setRenderTarget(r,0),e.render(t,s),e.setRenderTarget(r,1),e.render(t,o),e.setRenderTarget(r,2),e.render(t,l),e.setRenderTarget(r,3),e.render(t,u),e.setRenderTarget(r,4),e.render(t,h),r.texture.generateMipmaps=w,e.setRenderTarget(r,5),e.render(t,f),e.setRenderTarget(g),e.toneMapping=y,e.xr.enabled=b,r.texture.needsPMREMUpdate=!0}}class LC extends dc{constructor(e,t,r,s,o,l,u,h,f,g){e=e!==void 0?e:[],t=t!==void 0?t:Gy,super(e,t,r,s,o,l,u,h,f,g),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class $Q extends Nc{constructor(e,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const r={width:e,height:e,depth:1},s=[r,r,r,r,r,r];this.texture=new LC(s,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=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:wl}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 r={uniforms:{tEquirect:{value:null}},vertexShader:` +}`;class xd extends hd{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=XTe,this.fragmentShader=KTe,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,e!==void 0&&(e.attributes!==void 0&&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=Dw(e.uniforms),this.uniformsGroups=YTe(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){const t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(const s in this.uniforms){const o=this.uniforms[s].value;o&&o.isTexture?t.uniforms[s]={type:"t",value:o.toJSON(e).uuid}:o&&o.isColor?t.uniforms[s]={type:"c",value:o.getHex()}:o&&o.isVector2?t.uniforms[s]={type:"v2",value:o.toArray()}:o&&o.isVector3?t.uniforms[s]={type:"v3",value:o.toArray()}:o&&o.isVector4?t.uniforms[s]={type:"v4",value:o.toArray()}:o&&o.isMatrix3?t.uniforms[s]={type:"m3",value:o.toArray()}:o&&o.isMatrix4?t.uniforms[s]={type:"m4",value:o.toArray()}:t.uniforms[s]={value:o}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;const r={};for(const s in this.extensions)this.extensions[s]===!0&&(r[s]=!0);return Object.keys(r).length>0&&(t.extensions=r),t}}class fE extends ro{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Qr,this.projectionMatrix=new Qr,this.projectionMatrixInverse=new Qr}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)}}class Za extends fE{constructor(e=50,t=1,r=.1,s=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=r,this.far=s,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=G$*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(P1*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return G$*2*Math.atan(Math.tan(P1*.5*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,r,s,o,l){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=r,this.view.offsetY=s,this.view.width=o,this.view.height=l,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(P1*.5*this.fov)/this.zoom,r=2*t,s=this.aspect*r,o=-.5*s;const l=this.view;if(this.view!==null&&this.view.enabled){const h=l.fullWidth,f=l.fullHeight;o+=l.offsetX*s/h,t-=l.offsetY*r/f,s*=l.width/h,r*=l.height/f}const u=this.filmOffset;u!==0&&(o+=e*u/this.getFilmWidth()),this.projectionMatrix.makePerspective(o,o+s,t,t-r,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,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}const ES=90,xS=1;class $Q extends ro{constructor(e,t,r){if(super(),this.type="CubeCamera",r.isWebGLCubeRenderTarget!==!0){console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.");return}this.renderTarget=r;const s=new Za(ES,xS,e,t);s.layers=this.layers,s.up.set(0,-1,0),s.lookAt(new Me(1,0,0)),this.add(s);const o=new Za(ES,xS,e,t);o.layers=this.layers,o.up.set(0,-1,0),o.lookAt(new Me(-1,0,0)),this.add(o);const l=new Za(ES,xS,e,t);l.layers=this.layers,l.up.set(0,0,1),l.lookAt(new Me(0,1,0)),this.add(l);const u=new Za(ES,xS,e,t);u.layers=this.layers,u.up.set(0,0,-1),u.lookAt(new Me(0,-1,0)),this.add(u);const h=new Za(ES,xS,e,t);h.layers=this.layers,h.up.set(0,-1,0),h.lookAt(new Me(0,0,1)),this.add(h);const f=new Za(ES,xS,e,t);f.layers=this.layers,f.up.set(0,-1,0),f.lookAt(new Me(0,0,-1)),this.add(f)}update(e,t){this.parent===null&&this.updateMatrixWorld();const r=this.renderTarget,[s,o,l,u,h,f]=this.children,g=e.getRenderTarget(),y=e.toneMapping,b=e.xr.enabled;e.toneMapping=l0,e.xr.enabled=!1;const w=r.texture.generateMipmaps;r.texture.generateMipmaps=!1,e.setRenderTarget(r,0),e.render(t,s),e.setRenderTarget(r,1),e.render(t,o),e.setRenderTarget(r,2),e.render(t,l),e.setRenderTarget(r,3),e.render(t,u),e.setRenderTarget(r,4),e.render(t,h),r.texture.generateMipmaps=w,e.setRenderTarget(r,5),e.render(t,f),e.setRenderTarget(g),e.toneMapping=y,e.xr.enabled=b,r.texture.needsPMREMUpdate=!0}}class LC extends dc{constructor(e,t,r,s,o,l,u,h,f,g){e=e!==void 0?e:[],t=t!==void 0?t:Gy,super(e,t,r,s,o,l,u,h,f,g),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class CQ extends Nc{constructor(e,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const r={width:e,height:e,depth:1},s=[r,r,r,r,r,r];this.texture=new LC(s,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=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:wl}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 r={uniforms:{tEquirect:{value:null}},vertexShader:` varying vec3 vWorldDirection; @@ -1782,7 +1782,7 @@ No matching component was found for: gl_FragColor = texture2D( tEquirect, sampleUV ); } - `},s=new pu(5,5,5),o=new xd({name:"CubemapFromEquirect",uniforms:Dw(r.uniforms),vertexShader:r.vertexShader,fragmentShader:r.fragmentShader,side:cd,blending:pp});o.uniforms.tEquirect.value=t;const l=new Hn(s,o),u=t.minFilter;return t.minFilter===uT&&(t.minFilter=wl),new xQ(1,10,this).update(e,l),t.minFilter=u,l.geometry.dispose(),l.material.dispose(),this}clear(e,t,r,s){const o=e.getRenderTarget();for(let l=0;l<6;l++)e.setRenderTarget(this,l),e.clear(t,r,s);e.setRenderTarget(o)}}const LL=new Ae,JTe=new Ae,qTe=new up;class ov{constructor(e=new Ae(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,r,s){return this.normal.set(e,t,r),this.constant=s,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,r){const s=LL.subVectors(r,t).cross(JTe.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(s,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 r=e.delta(LL),s=this.normal.dot(r);if(s===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const o=-(e.start.dot(this.normal)+this.constant)/s;return o<0||o>1?null:t.copy(r).multiplyScalar(o).add(e.start)}intersectsLine(e){const t=this.distanceToPoint(e.start),r=this.distanceToPoint(e.end);return t<0&&r>0||r<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 r=t||qTe.getNormalMatrix(e),s=this.coplanarPoint(LL).applyMatrix4(e),o=this.normal.applyMatrix3(r).normalize();return this.constant=-s.dot(o),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const $S=new b_,oA=new Ae;class o2{constructor(e=new ov,t=new ov,r=new ov,s=new ov,o=new ov,l=new ov){this.planes=[e,t,r,s,o,l]}set(e,t,r,s,o,l){const u=this.planes;return u[0].copy(e),u[1].copy(t),u[2].copy(r),u[3].copy(s),u[4].copy(o),u[5].copy(l),this}copy(e){const t=this.planes;for(let r=0;r<6;r++)t[r].copy(e.planes[r]);return this}setFromProjectionMatrix(e){const t=this.planes,r=e.elements,s=r[0],o=r[1],l=r[2],u=r[3],h=r[4],f=r[5],g=r[6],y=r[7],b=r[8],w=r[9],C=r[10],M=r[11],A=r[12],k=r[13],L=r[14],P=r[15];return t[0].setComponents(u-s,y-h,M-b,P-A).normalize(),t[1].setComponents(u+s,y+h,M+b,P+A).normalize(),t[2].setComponents(u+o,y+f,M+w,P+k).normalize(),t[3].setComponents(u-o,y-f,M-w,P-k).normalize(),t[4].setComponents(u-l,y-g,M-C,P-L).normalize(),t[5].setComponents(u+l,y+g,M+C,P+L).normalize(),this}intersectsObject(e){const t=e.geometry;return t.boundingSphere===null&&t.computeBoundingSphere(),$S.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere($S)}intersectsSprite(e){return $S.center.set(0,0,0),$S.radius=.7071067811865476,$S.applyMatrix4(e.matrixWorld),this.intersectsSphere($S)}intersectsSphere(e){const t=this.planes,r=e.center,s=-e.radius;for(let o=0;o<6;o++)if(t[o].distanceToPoint(r)0?e.max.x:e.min.x,oA.y=s.normal.y>0?e.max.y:e.min.y,oA.z=s.normal.z>0?e.max.z:e.min.z,s.distanceToPoint(oA)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let r=0;r<6;r++)if(t[r].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function CQ(){let n=null,e=!1,t=null,r=null;function s(o,l){t(o,l),r=n.requestAnimationFrame(s)}return{start:function(){e!==!0&&t!==null&&(r=n.requestAnimationFrame(s),e=!0)},stop:function(){n.cancelAnimationFrame(r),e=!1},setAnimationLoop:function(o){t=o},setContext:function(o){n=o}}}function QTe(n,e){const t=e.isWebGL2,r=new WeakMap;function s(f,g){const y=f.array,b=f.usage,w=n.createBuffer();n.bindBuffer(g,w),n.bufferData(g,y,b),f.onUploadCallback();let C;if(y instanceof Float32Array)C=5126;else if(y instanceof Uint16Array)if(f.isFloat16BufferAttribute)if(t)C=5131;else throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");else C=5123;else if(y instanceof Int16Array)C=5122;else if(y instanceof Uint32Array)C=5125;else if(y instanceof Int32Array)C=5124;else if(y instanceof Int8Array)C=5120;else if(y instanceof Uint8Array)C=5121;else if(y instanceof Uint8ClampedArray)C=5121;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+y);return{buffer:w,type:C,bytesPerElement:y.BYTES_PER_ELEMENT,version:f.version}}function o(f,g,y){const b=g.array,w=g.updateRange;n.bindBuffer(y,f),w.count===-1?n.bufferSubData(y,0,b):(t?n.bufferSubData(y,w.offset*b.BYTES_PER_ELEMENT,b,w.offset,w.count):n.bufferSubData(y,w.offset*b.BYTES_PER_ELEMENT,b.subarray(w.offset,w.offset+w.count)),w.count=-1)}function l(f){return f.isInterleavedBufferAttribute&&(f=f.data),r.get(f)}function u(f){f.isInterleavedBufferAttribute&&(f=f.data);const g=r.get(f);g&&(n.deleteBuffer(g.buffer),r.delete(f))}function h(f,g){if(f.isGLBufferAttribute){const b=r.get(f);(!b||b.version1?null:t.copy(r).multiplyScalar(o).add(e.start)}intersectsLine(e){const t=this.distanceToPoint(e.start),r=this.distanceToPoint(e.end);return t<0&&r>0||r<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 r=t||qTe.getNormalMatrix(e),s=this.coplanarPoint(LL).applyMatrix4(e),o=this.normal.applyMatrix3(r).normalize();return this.constant=-s.dot(o),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const $S=new b_,oA=new Me;class o2{constructor(e=new ov,t=new ov,r=new ov,s=new ov,o=new ov,l=new ov){this.planes=[e,t,r,s,o,l]}set(e,t,r,s,o,l){const u=this.planes;return u[0].copy(e),u[1].copy(t),u[2].copy(r),u[3].copy(s),u[4].copy(o),u[5].copy(l),this}copy(e){const t=this.planes;for(let r=0;r<6;r++)t[r].copy(e.planes[r]);return this}setFromProjectionMatrix(e){const t=this.planes,r=e.elements,s=r[0],o=r[1],l=r[2],u=r[3],h=r[4],f=r[5],g=r[6],y=r[7],b=r[8],w=r[9],C=r[10],M=r[11],A=r[12],k=r[13],L=r[14],P=r[15];return t[0].setComponents(u-s,y-h,M-b,P-A).normalize(),t[1].setComponents(u+s,y+h,M+b,P+A).normalize(),t[2].setComponents(u+o,y+f,M+w,P+k).normalize(),t[3].setComponents(u-o,y-f,M-w,P-k).normalize(),t[4].setComponents(u-l,y-g,M-C,P-L).normalize(),t[5].setComponents(u+l,y+g,M+C,P+L).normalize(),this}intersectsObject(e){const t=e.geometry;return t.boundingSphere===null&&t.computeBoundingSphere(),$S.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere($S)}intersectsSprite(e){return $S.center.set(0,0,0),$S.radius=.7071067811865476,$S.applyMatrix4(e.matrixWorld),this.intersectsSphere($S)}intersectsSphere(e){const t=this.planes,r=e.center,s=-e.radius;for(let o=0;o<6;o++)if(t[o].distanceToPoint(r)0?e.max.x:e.min.x,oA.y=s.normal.y>0?e.max.y:e.min.y,oA.z=s.normal.z>0?e.max.z:e.min.z,s.distanceToPoint(oA)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let r=0;r<6;r++)if(t[r].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function MQ(){let n=null,e=!1,t=null,r=null;function s(o,l){t(o,l),r=n.requestAnimationFrame(s)}return{start:function(){e!==!0&&t!==null&&(r=n.requestAnimationFrame(s),e=!0)},stop:function(){n.cancelAnimationFrame(r),e=!1},setAnimationLoop:function(o){t=o},setContext:function(o){n=o}}}function QTe(n,e){const t=e.isWebGL2,r=new WeakMap;function s(f,g){const y=f.array,b=f.usage,w=n.createBuffer();n.bindBuffer(g,w),n.bufferData(g,y,b),f.onUploadCallback();let C;if(y instanceof Float32Array)C=5126;else if(y instanceof Uint16Array)if(f.isFloat16BufferAttribute)if(t)C=5131;else throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");else C=5123;else if(y instanceof Int16Array)C=5122;else if(y instanceof Uint32Array)C=5125;else if(y instanceof Int32Array)C=5124;else if(y instanceof Int8Array)C=5120;else if(y instanceof Uint8Array)C=5121;else if(y instanceof Uint8ClampedArray)C=5121;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+y);return{buffer:w,type:C,bytesPerElement:y.BYTES_PER_ELEMENT,version:f.version}}function o(f,g,y){const b=g.array,w=g.updateRange;n.bindBuffer(y,f),w.count===-1?n.bufferSubData(y,0,b):(t?n.bufferSubData(y,w.offset*b.BYTES_PER_ELEMENT,b,w.offset,w.count):n.bufferSubData(y,w.offset*b.BYTES_PER_ELEMENT,b.subarray(w.offset,w.offset+w.count)),w.count=-1)}function l(f){return f.isInterleavedBufferAttribute&&(f=f.data),r.get(f)}function u(f){f.isInterleavedBufferAttribute&&(f=f.data);const g=r.get(f);g&&(n.deleteBuffer(g.buffer),r.delete(f))}function h(f,g){if(f.isGLBufferAttribute){const b=r.get(f);(!b||b.version #include #include -}`,ps={alphamap_fragment:ZTe,alphamap_pars_fragment:eSe,alphatest_fragment:tSe,alphatest_pars_fragment:nSe,aomap_fragment:rSe,aomap_pars_fragment:iSe,begin_vertex:sSe,beginnormal_vertex:oSe,bsdfs:aSe,iridescence_fragment:lSe,bumpmap_pars_fragment:uSe,clipping_planes_fragment:cSe,clipping_planes_pars_fragment:hSe,clipping_planes_pars_vertex:dSe,clipping_planes_vertex:fSe,color_fragment:pSe,color_pars_fragment:mSe,color_pars_vertex:gSe,color_vertex:_Se,common:vSe,cube_uv_reflection_fragment:ySe,defaultnormal_vertex:bSe,displacementmap_pars_vertex:TSe,displacementmap_vertex:SSe,emissivemap_fragment:wSe,emissivemap_pars_fragment:ESe,encodings_fragment:xSe,encodings_pars_fragment:$Se,envmap_fragment:CSe,envmap_common_pars_fragment:MSe,envmap_pars_fragment:ASe,envmap_pars_vertex:ISe,envmap_physical_pars_fragment:USe,envmap_vertex:RSe,fog_vertex:kSe,fog_pars_vertex:OSe,fog_fragment:LSe,fog_pars_fragment:NSe,gradientmap_pars_fragment:DSe,lightmap_fragment:PSe,lightmap_pars_fragment:BSe,lights_lambert_vertex:FSe,lights_pars_begin:zSe,lights_toon_fragment:HSe,lights_toon_pars_fragment:GSe,lights_phong_fragment:WSe,lights_phong_pars_fragment:VSe,lights_physical_fragment:jSe,lights_physical_pars_fragment:YSe,lights_fragment_begin:XSe,lights_fragment_maps:KSe,lights_fragment_end:JSe,logdepthbuf_fragment:qSe,logdepthbuf_pars_fragment:QSe,logdepthbuf_pars_vertex:ZSe,logdepthbuf_vertex:ewe,map_fragment:twe,map_pars_fragment:nwe,map_particle_fragment:rwe,map_particle_pars_fragment:iwe,metalnessmap_fragment:swe,metalnessmap_pars_fragment:owe,morphcolor_vertex:awe,morphnormal_vertex:lwe,morphtarget_pars_vertex:uwe,morphtarget_vertex:cwe,normal_fragment_begin:hwe,normal_fragment_maps:dwe,normal_pars_fragment:fwe,normal_pars_vertex:pwe,normal_vertex:mwe,normalmap_pars_fragment:gwe,clearcoat_normal_fragment_begin:_we,clearcoat_normal_fragment_maps:vwe,clearcoat_pars_fragment:ywe,iridescence_pars_fragment:bwe,output_fragment:Twe,packing:Swe,premultiplied_alpha_fragment:wwe,project_vertex:Ewe,dithering_fragment:xwe,dithering_pars_fragment:$we,roughnessmap_fragment:Cwe,roughnessmap_pars_fragment:Mwe,shadowmap_pars_fragment:Awe,shadowmap_pars_vertex:Iwe,shadowmap_vertex:Rwe,shadowmask_pars_fragment:kwe,skinbase_vertex:Owe,skinning_pars_vertex:Lwe,skinning_vertex:Nwe,skinnormal_vertex:Dwe,specularmap_fragment:Pwe,specularmap_pars_fragment:Bwe,tonemapping_fragment:Fwe,tonemapping_pars_fragment:zwe,transmission_fragment:Uwe,transmission_pars_fragment:Hwe,uv_pars_fragment:Gwe,uv_pars_vertex:Wwe,uv_vertex:Vwe,uv2_pars_fragment:jwe,uv2_pars_vertex:Ywe,uv2_vertex:Xwe,worldpos_vertex:Kwe,background_vert:Jwe,background_frag:qwe,cube_vert:Qwe,cube_frag:Zwe,depth_vert:eEe,depth_frag:tEe,distanceRGBA_vert:nEe,distanceRGBA_frag:rEe,equirect_vert:iEe,equirect_frag:sEe,linedashed_vert:oEe,linedashed_frag:aEe,meshbasic_vert:lEe,meshbasic_frag:uEe,meshlambert_vert:cEe,meshlambert_frag:hEe,meshmatcap_vert:dEe,meshmatcap_frag:fEe,meshnormal_vert:pEe,meshnormal_frag:mEe,meshphong_vert:gEe,meshphong_frag:_Ee,meshphysical_vert:vEe,meshphysical_frag:yEe,meshtoon_vert:bEe,meshtoon_frag:TEe,points_vert:SEe,points_frag:wEe,shadow_vert:EEe,shadow_frag:xEe,sprite_vert:$Ee,sprite_frag:CEe},Xn={common:{diffuse:{value:new Fn(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new up},uv2Transform:{value:new up},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 jt(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 Fn(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 Fn(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new up}},sprite:{diffuse:{value:new Fn(16777215)},opacity:{value:1},center:{value:new jt(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new up}}},op={basic:{uniforms:Af([Xn.common,Xn.specularmap,Xn.envmap,Xn.aomap,Xn.lightmap,Xn.fog]),vertexShader:ps.meshbasic_vert,fragmentShader:ps.meshbasic_frag},lambert:{uniforms:Af([Xn.common,Xn.specularmap,Xn.envmap,Xn.aomap,Xn.lightmap,Xn.emissivemap,Xn.fog,Xn.lights,{emissive:{value:new Fn(0)}}]),vertexShader:ps.meshlambert_vert,fragmentShader:ps.meshlambert_frag},phong:{uniforms:Af([Xn.common,Xn.specularmap,Xn.envmap,Xn.aomap,Xn.lightmap,Xn.emissivemap,Xn.bumpmap,Xn.normalmap,Xn.displacementmap,Xn.fog,Xn.lights,{emissive:{value:new Fn(0)},specular:{value:new Fn(1118481)},shininess:{value:30}}]),vertexShader:ps.meshphong_vert,fragmentShader:ps.meshphong_frag},standard:{uniforms:Af([Xn.common,Xn.envmap,Xn.aomap,Xn.lightmap,Xn.emissivemap,Xn.bumpmap,Xn.normalmap,Xn.displacementmap,Xn.roughnessmap,Xn.metalnessmap,Xn.fog,Xn.lights,{emissive:{value:new Fn(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:ps.meshphysical_vert,fragmentShader:ps.meshphysical_frag},toon:{uniforms:Af([Xn.common,Xn.aomap,Xn.lightmap,Xn.emissivemap,Xn.bumpmap,Xn.normalmap,Xn.displacementmap,Xn.gradientmap,Xn.fog,Xn.lights,{emissive:{value:new Fn(0)}}]),vertexShader:ps.meshtoon_vert,fragmentShader:ps.meshtoon_frag},matcap:{uniforms:Af([Xn.common,Xn.bumpmap,Xn.normalmap,Xn.displacementmap,Xn.fog,{matcap:{value:null}}]),vertexShader:ps.meshmatcap_vert,fragmentShader:ps.meshmatcap_frag},points:{uniforms:Af([Xn.points,Xn.fog]),vertexShader:ps.points_vert,fragmentShader:ps.points_frag},dashed:{uniforms:Af([Xn.common,Xn.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:ps.linedashed_vert,fragmentShader:ps.linedashed_frag},depth:{uniforms:Af([Xn.common,Xn.displacementmap]),vertexShader:ps.depth_vert,fragmentShader:ps.depth_frag},normal:{uniforms:Af([Xn.common,Xn.bumpmap,Xn.normalmap,Xn.displacementmap,{opacity:{value:1}}]),vertexShader:ps.meshnormal_vert,fragmentShader:ps.meshnormal_frag},sprite:{uniforms:Af([Xn.sprite,Xn.fog]),vertexShader:ps.sprite_vert,fragmentShader:ps.sprite_frag},background:{uniforms:{uvTransform:{value:new up},t2D:{value:null}},vertexShader:ps.background_vert,fragmentShader:ps.background_frag},cube:{uniforms:Af([Xn.envmap,{opacity:{value:1}}]),vertexShader:ps.cube_vert,fragmentShader:ps.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:ps.equirect_vert,fragmentShader:ps.equirect_frag},distanceRGBA:{uniforms:Af([Xn.common,Xn.displacementmap,{referencePosition:{value:new Ae},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:ps.distanceRGBA_vert,fragmentShader:ps.distanceRGBA_frag},shadow:{uniforms:Af([Xn.lights,Xn.fog,{color:{value:new Fn(0)},opacity:{value:1}}]),vertexShader:ps.shadow_vert,fragmentShader:ps.shadow_frag}};op.physical={uniforms:Af([op.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new jt(1,1)},clearcoatNormalMap:{value:null},iridescence:{value:0},iridescenceMap:{value:null},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},sheen:{value:0},sheenColor:{value:new Fn(0)},sheenColorMap:{value:null},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new jt},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationColor:{value:new Fn(0)},specularIntensity:{value:1},specularIntensityMap:{value:null},specularColor:{value:new Fn(1,1,1)},specularColorMap:{value:null}}]),vertexShader:ps.meshphysical_vert,fragmentShader:ps.meshphysical_frag};function MEe(n,e,t,r,s,o){const l=new Fn(0);let u=s===!0?0:1,h,f,g=null,y=0,b=null;function w(M,A){let k=!1,L=A.isScene===!0?A.background:null;L&&L.isTexture&&(L=e.get(L));const P=n.xr,D=P.getSession&&P.getSession();D&&D.environmentBlendMode==="additive"&&(L=null),L===null?C(l,u):L&&L.isColor&&(C(L,1),k=!0),(n.autoClear||k)&&n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil),L&&(L.isCubeTexture||L.mapping===dE)?(f===void 0&&(f=new Hn(new pu(1,1,1),new xd({name:"BackgroundCubeMaterial",uniforms:Dw(op.cube.uniforms),vertexShader:op.cube.vertexShader,fragmentShader:op.cube.fragmentShader,side:cd,depthTest:!1,depthWrite:!1,fog:!1})),f.geometry.deleteAttribute("normal"),f.geometry.deleteAttribute("uv"),f.onBeforeRender=function(z,U,V){this.matrixWorld.copyPosition(V.matrixWorld)},Object.defineProperty(f.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(f)),f.material.uniforms.envMap.value=L,f.material.uniforms.flipEnvMap.value=L.isCubeTexture&&L.isRenderTargetTexture===!1?-1:1,(g!==L||y!==L.version||b!==n.toneMapping)&&(f.material.needsUpdate=!0,g=L,y=L.version,b=n.toneMapping),f.layers.enableAll(),M.unshift(f,f.geometry,f.material,0,0,null)):L&&L.isTexture&&(h===void 0&&(h=new Hn(new c0(2,2),new xd({name:"BackgroundMaterial",uniforms:Dw(op.background.uniforms),vertexShader:op.background.vertexShader,fragmentShader:op.background.fragmentShader,side:p_,depthTest:!1,depthWrite:!1,fog:!1})),h.geometry.deleteAttribute("normal"),Object.defineProperty(h.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(h)),h.material.uniforms.t2D.value=L,L.matrixAutoUpdate===!0&&L.updateMatrix(),h.material.uniforms.uvTransform.value.copy(L.matrix),(g!==L||y!==L.version||b!==n.toneMapping)&&(h.material.needsUpdate=!0,g=L,y=L.version,b=n.toneMapping),h.layers.enableAll(),M.unshift(h,h.geometry,h.material,0,0,null))}function C(M,A){t.buffers.color.setClear(M.r,M.g,M.b,A,o)}return{getClearColor:function(){return l},setClearColor:function(M,A=1){l.set(M),u=A,C(l,u)},getClearAlpha:function(){return u},setClearAlpha:function(M){u=M,C(l,u)},render:w}}function AEe(n,e,t,r){const s=n.getParameter(34921),o=r.isWebGL2?null:e.get("OES_vertex_array_object"),l=r.isWebGL2||o!==null,u={},h=A(null);let f=h,g=!1;function y(ae,ue,ge,we,J){let re=!1;if(l){const ie=M(we,ge,ue);f!==ie&&(f=ie,w(f.object)),re=k(ae,we,ge,J),re&&L(ae,we,ge,J)}else{const ie=ue.wireframe===!0;(f.geometry!==we.id||f.program!==ge.id||f.wireframe!==ie)&&(f.geometry=we.id,f.program=ge.id,f.wireframe=ie,re=!0)}J!==null&&t.update(J,34963),(re||g)&&(g=!1,H(ae,ue,ge,we),J!==null&&n.bindBuffer(34963,t.get(J).buffer))}function b(){return r.isWebGL2?n.createVertexArray():o.createVertexArrayOES()}function w(ae){return r.isWebGL2?n.bindVertexArray(ae):o.bindVertexArrayOES(ae)}function C(ae){return r.isWebGL2?n.deleteVertexArray(ae):o.deleteVertexArrayOES(ae)}function M(ae,ue,ge){const we=ge.wireframe===!0;let J=u[ae.id];J===void 0&&(J={},u[ae.id]=J);let re=J[ue.id];re===void 0&&(re={},J[ue.id]=re);let ie=re[we];return ie===void 0&&(ie=A(b()),re[we]=ie),ie}function A(ae){const ue=[],ge=[],we=[];for(let J=0;J=0){const Fe=J[Te];let Ie=re[Te];if(Ie===void 0&&(Te==="instanceMatrix"&&ae.instanceMatrix&&(Ie=ae.instanceMatrix),Te==="instanceColor"&&ae.instanceColor&&(Ie=ae.instanceColor)),Fe===void 0||Fe.attribute!==Ie||Ie&&Fe.data!==Ie.data)return!0;ie++}return f.attributesNum!==ie||f.index!==we}function L(ae,ue,ge,we){const J={},re=ue.attributes;let ie=0;const fe=ge.getAttributes();for(const Te in fe)if(fe[Te].location>=0){let Fe=re[Te];Fe===void 0&&(Te==="instanceMatrix"&&ae.instanceMatrix&&(Fe=ae.instanceMatrix),Te==="instanceColor"&&ae.instanceColor&&(Fe=ae.instanceColor));const Ie={};Ie.attribute=Fe,Fe&&Fe.data&&(Ie.data=Fe.data),J[Te]=Ie,ie++}f.attributes=J,f.attributesNum=ie,f.index=we}function P(){const ae=f.newAttributes;for(let ue=0,ge=ae.length;ue=0){let Fe=J[fe];if(Fe===void 0&&(fe==="instanceMatrix"&&ae.instanceMatrix&&(Fe=ae.instanceMatrix),fe==="instanceColor"&&ae.instanceColor&&(Fe=ae.instanceColor)),Fe!==void 0){const Ie=Fe.normalized,Je=Fe.itemSize,Re=t.get(Fe);if(Re===void 0)continue;const Qe=Re.buffer,nt=Re.type,ft=Re.bytesPerElement;if(Fe.isInterleavedBufferAttribute){const lt=Fe.data,ze=lt.stride,Ce=Fe.offset;if(lt.isInstancedInterleavedBuffer){for(let He=0;He0&&n.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";V="mediump"}return V==="mediump"&&n.getShaderPrecisionFormat(35633,36337).precision>0&&n.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}const l=typeof WebGL2RenderingContext<"u"&&n instanceof WebGL2RenderingContext||typeof WebGL2ComputeRenderingContext<"u"&&n instanceof WebGL2ComputeRenderingContext;let u=t.precision!==void 0?t.precision:"highp";const h=o(u);h!==u&&(console.warn("THREE.WebGLRenderer:",u,"not supported, using",h,"instead."),u=h);const f=l||e.has("WEBGL_draw_buffers"),g=t.logarithmicDepthBuffer===!0,y=n.getParameter(34930),b=n.getParameter(35660),w=n.getParameter(3379),C=n.getParameter(34076),M=n.getParameter(34921),A=n.getParameter(36347),k=n.getParameter(36348),L=n.getParameter(36349),P=b>0,D=l||e.has("OES_texture_float"),z=P&&D,U=l?n.getParameter(36183):0;return{isWebGL2:l,drawBuffers:f,getMaxAnisotropy:s,getMaxPrecision:o,precision:u,logarithmicDepthBuffer:g,maxTextures:y,maxVertexTextures:b,maxTextureSize:w,maxCubemapSize:C,maxAttributes:M,maxVertexUniforms:A,maxVaryings:k,maxFragmentUniforms:L,vertexTextures:P,floatFragmentTextures:D,floatVertexTextures:z,maxSamples:U}}function kEe(n){const e=this;let t=null,r=0,s=!1,o=!1;const l=new ov,u=new up,h={value:null,needsUpdate:!1};this.uniform=h,this.numPlanes=0,this.numIntersection=0,this.init=function(y,b,w){const C=y.length!==0||b||r!==0||s;return s=b,t=g(y,w,0),r=y.length,C},this.beginShadows=function(){o=!0,g(null)},this.endShadows=function(){o=!1,f()},this.setState=function(y,b,w){const C=y.clippingPlanes,M=y.clipIntersection,A=y.clipShadows,k=n.get(y);if(!s||C===null||C.length===0||o&&!A)o?g(null):f();else{const L=o?0:r,P=L*4;let D=k.clippingState||null;h.value=D,D=g(C,b,P,w);for(let z=0;z!==P;++z)D[z]=t[z];k.clippingState=D,this.numIntersection=M?this.numPlanes:0,this.numPlanes+=L}};function f(){h.value!==t&&(h.value=t,h.needsUpdate=r>0),e.numPlanes=r,e.numIntersection=0}function g(y,b,w,C){const M=y!==null?y.length:0;let A=null;if(M!==0){if(A=h.value,C!==!0||A===null){const k=w+M*4,L=b.matrixWorldInverse;u.getNormalMatrix(L),(A===null||A.length0){const f=new $Q(h.height/2);return f.fromEquirectangularTexture(n,l),e.set(l,f),l.addEventListener("dispose",s),t(f.texture,l.mapping)}else return null}}return l}function s(l){const u=l.target;u.removeEventListener("dispose",s);const h=e.get(u);h!==void 0&&(e.delete(u),h.dispose())}function o(){e=new WeakMap}return{get:r,dispose:o}}class u_ extends fE{constructor(e=-1,t=1,r=1,s=-1,o=.1,l=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=r,this.bottom=s,this.near=o,this.far=l,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,r,s,o,l){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=r,this.view.offsetY=s,this.view.width=o,this.view.height=l,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),r=(this.right+this.left)/2,s=(this.top+this.bottom)/2;let o=r-e,l=r+e,u=s+t,h=s-t;if(this.view!==null&&this.view.enabled){const f=(this.right-this.left)/this.view.fullWidth/this.zoom,g=(this.top-this.bottom)/this.view.fullHeight/this.zoom;o+=f*this.view.offsetX,l=o+f*this.view.width,u-=g*this.view.offsetY,h=u-g*this.view.height}this.projectionMatrix.makeOrthographic(o,l,u,h,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,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}const ZS=4,MG=[.125,.215,.35,.446,.526,.582],m1=20,NL=new u_,AG=new Fn;let DL=null;const c1=(1+Math.sqrt(5))/2,CS=1/c1,IG=[new Ae(1,1,1),new Ae(-1,1,1),new Ae(1,1,-1),new Ae(-1,1,-1),new Ae(0,c1,CS),new Ae(0,c1,-CS),new Ae(CS,0,c1),new Ae(-CS,0,c1),new Ae(c1,CS,0),new Ae(-c1,CS,0)];class CP{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,r=.1,s=100){DL=this._renderer.getRenderTarget(),this._setSize(256);const o=this._allocateTargets();return o.depthBuffer=!0,this._sceneToCubeUV(e,r,s,o),t>0&&this._blur(o,0,0,t),this._applyPMREM(o),this._cleanup(o),o}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=OG(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=kG(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e2?k:0,k,k),h.setRenderTarget(s),w&&h.render(b,o),h.render(e,o)}b.geometry.dispose(),b.material.dispose(),h.toneMapping=g,h.autoClear=f,e.background=C}_textureToCubeUV(e,t){const r=this._renderer,s=e.mapping===Gy||e.mapping===Wy;s?(this._cubemapMaterial===null&&(this._cubemapMaterial=OG()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=kG());const o=s?this._cubemapMaterial:this._equirectMaterial,l=new Hn(this._lodPlanes[0],o),u=o.uniforms;u.envMap.value=e;const h=this._cubeSize;aA(t,0,0,3*h,2*h),r.setRenderTarget(t),r.render(l,NL)}_applyPMREM(e){const t=this._renderer,r=t.autoClear;t.autoClear=!1;for(let s=1;sm1&&console.warn(`sigmaRadians, ${o}, is too large and will clip, as it requested ${A} samples when the maximum is set to ${m1}`);const k=[];let L=0;for(let V=0;VP-ZS?s-P+ZS:0),U=4*(this._cubeSize-D);aA(t,z,U,3*D,2*D),h.setRenderTarget(t),h.render(y,NL)}}function LEe(n){const e=[],t=[],r=[];let s=n;const o=n-ZS+1+MG.length;for(let l=0;ln-ZS?h=MG[l-n+ZS-1]:l===0&&(h=0),r.push(h);const f=1/(u-2),g=-f,y=1+f,b=[g,g,y,g,y,y,g,g,y,y,g,y],w=6,C=6,M=3,A=2,k=1,L=new Float32Array(M*C*w),P=new Float32Array(A*C*w),D=new Float32Array(k*C*w);for(let U=0;U2?0:-1,oe=[V,H,0,V+2/3,H,0,V+2/3,H+1,0,V,H,0,V+2/3,H+1,0,V,H+1,0];L.set(oe,M*C*U),P.set(b,A*C*U);const le=[U,U,U,U,U,U];D.set(le,k*C*U)}const z=new ui;z.setAttribute("position",new Do(L,M)),z.setAttribute("uv",new Do(P,A)),z.setAttribute("faceIndex",new Do(D,k)),e.push(z),s>ZS&&s--}return{lodPlanes:e,sizeLods:t,sigmas:r}}function RG(n,e,t){const r=new Nc(n,e,t);return r.texture.mapping=dE,r.texture.name="PMREM.cubeUv",r.scissorTest=!0,r}function aA(n,e,t,r,s){n.viewport.set(e,t,r,s),n.scissor.set(e,t,r,s)}function NEe(n,e,t){const r=new Float32Array(m1),s=new Ae(0,1,0);return new xd({name:"SphericalGaussianBlur",defines:{n:m1,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${n}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:r},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:s}},vertexShader:e4(),fragmentShader:` +}`,ps={alphamap_fragment:ZTe,alphamap_pars_fragment:eSe,alphatest_fragment:tSe,alphatest_pars_fragment:nSe,aomap_fragment:rSe,aomap_pars_fragment:iSe,begin_vertex:sSe,beginnormal_vertex:oSe,bsdfs:aSe,iridescence_fragment:lSe,bumpmap_pars_fragment:uSe,clipping_planes_fragment:cSe,clipping_planes_pars_fragment:hSe,clipping_planes_pars_vertex:dSe,clipping_planes_vertex:fSe,color_fragment:pSe,color_pars_fragment:mSe,color_pars_vertex:gSe,color_vertex:_Se,common:vSe,cube_uv_reflection_fragment:ySe,defaultnormal_vertex:bSe,displacementmap_pars_vertex:TSe,displacementmap_vertex:SSe,emissivemap_fragment:wSe,emissivemap_pars_fragment:ESe,encodings_fragment:xSe,encodings_pars_fragment:$Se,envmap_fragment:CSe,envmap_common_pars_fragment:MSe,envmap_pars_fragment:ASe,envmap_pars_vertex:ISe,envmap_physical_pars_fragment:USe,envmap_vertex:RSe,fog_vertex:kSe,fog_pars_vertex:OSe,fog_fragment:LSe,fog_pars_fragment:NSe,gradientmap_pars_fragment:DSe,lightmap_fragment:PSe,lightmap_pars_fragment:BSe,lights_lambert_vertex:FSe,lights_pars_begin:zSe,lights_toon_fragment:HSe,lights_toon_pars_fragment:GSe,lights_phong_fragment:WSe,lights_phong_pars_fragment:VSe,lights_physical_fragment:jSe,lights_physical_pars_fragment:YSe,lights_fragment_begin:XSe,lights_fragment_maps:KSe,lights_fragment_end:JSe,logdepthbuf_fragment:qSe,logdepthbuf_pars_fragment:QSe,logdepthbuf_pars_vertex:ZSe,logdepthbuf_vertex:ewe,map_fragment:twe,map_pars_fragment:nwe,map_particle_fragment:rwe,map_particle_pars_fragment:iwe,metalnessmap_fragment:swe,metalnessmap_pars_fragment:owe,morphcolor_vertex:awe,morphnormal_vertex:lwe,morphtarget_pars_vertex:uwe,morphtarget_vertex:cwe,normal_fragment_begin:hwe,normal_fragment_maps:dwe,normal_pars_fragment:fwe,normal_pars_vertex:pwe,normal_vertex:mwe,normalmap_pars_fragment:gwe,clearcoat_normal_fragment_begin:_we,clearcoat_normal_fragment_maps:vwe,clearcoat_pars_fragment:ywe,iridescence_pars_fragment:bwe,output_fragment:Twe,packing:Swe,premultiplied_alpha_fragment:wwe,project_vertex:Ewe,dithering_fragment:xwe,dithering_pars_fragment:$we,roughnessmap_fragment:Cwe,roughnessmap_pars_fragment:Mwe,shadowmap_pars_fragment:Awe,shadowmap_pars_vertex:Iwe,shadowmap_vertex:Rwe,shadowmask_pars_fragment:kwe,skinbase_vertex:Owe,skinning_pars_vertex:Lwe,skinning_vertex:Nwe,skinnormal_vertex:Dwe,specularmap_fragment:Pwe,specularmap_pars_fragment:Bwe,tonemapping_fragment:Fwe,tonemapping_pars_fragment:zwe,transmission_fragment:Uwe,transmission_pars_fragment:Hwe,uv_pars_fragment:Gwe,uv_pars_vertex:Wwe,uv_vertex:Vwe,uv2_pars_fragment:jwe,uv2_pars_vertex:Ywe,uv2_vertex:Xwe,worldpos_vertex:Kwe,background_vert:Jwe,background_frag:qwe,cube_vert:Qwe,cube_frag:Zwe,depth_vert:eEe,depth_frag:tEe,distanceRGBA_vert:nEe,distanceRGBA_frag:rEe,equirect_vert:iEe,equirect_frag:sEe,linedashed_vert:oEe,linedashed_frag:aEe,meshbasic_vert:lEe,meshbasic_frag:uEe,meshlambert_vert:cEe,meshlambert_frag:hEe,meshmatcap_vert:dEe,meshmatcap_frag:fEe,meshnormal_vert:pEe,meshnormal_frag:mEe,meshphong_vert:gEe,meshphong_frag:_Ee,meshphysical_vert:vEe,meshphysical_frag:yEe,meshtoon_vert:bEe,meshtoon_frag:TEe,points_vert:SEe,points_frag:wEe,shadow_vert:EEe,shadow_frag:xEe,sprite_vert:$Ee,sprite_frag:CEe},Xn={common:{diffuse:{value:new Fn(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new up},uv2Transform:{value:new up},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 Vt(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 Fn(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 Fn(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new up}},sprite:{diffuse:{value:new Fn(16777215)},opacity:{value:1},center:{value:new Vt(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new up}}},op={basic:{uniforms:Af([Xn.common,Xn.specularmap,Xn.envmap,Xn.aomap,Xn.lightmap,Xn.fog]),vertexShader:ps.meshbasic_vert,fragmentShader:ps.meshbasic_frag},lambert:{uniforms:Af([Xn.common,Xn.specularmap,Xn.envmap,Xn.aomap,Xn.lightmap,Xn.emissivemap,Xn.fog,Xn.lights,{emissive:{value:new Fn(0)}}]),vertexShader:ps.meshlambert_vert,fragmentShader:ps.meshlambert_frag},phong:{uniforms:Af([Xn.common,Xn.specularmap,Xn.envmap,Xn.aomap,Xn.lightmap,Xn.emissivemap,Xn.bumpmap,Xn.normalmap,Xn.displacementmap,Xn.fog,Xn.lights,{emissive:{value:new Fn(0)},specular:{value:new Fn(1118481)},shininess:{value:30}}]),vertexShader:ps.meshphong_vert,fragmentShader:ps.meshphong_frag},standard:{uniforms:Af([Xn.common,Xn.envmap,Xn.aomap,Xn.lightmap,Xn.emissivemap,Xn.bumpmap,Xn.normalmap,Xn.displacementmap,Xn.roughnessmap,Xn.metalnessmap,Xn.fog,Xn.lights,{emissive:{value:new Fn(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:ps.meshphysical_vert,fragmentShader:ps.meshphysical_frag},toon:{uniforms:Af([Xn.common,Xn.aomap,Xn.lightmap,Xn.emissivemap,Xn.bumpmap,Xn.normalmap,Xn.displacementmap,Xn.gradientmap,Xn.fog,Xn.lights,{emissive:{value:new Fn(0)}}]),vertexShader:ps.meshtoon_vert,fragmentShader:ps.meshtoon_frag},matcap:{uniforms:Af([Xn.common,Xn.bumpmap,Xn.normalmap,Xn.displacementmap,Xn.fog,{matcap:{value:null}}]),vertexShader:ps.meshmatcap_vert,fragmentShader:ps.meshmatcap_frag},points:{uniforms:Af([Xn.points,Xn.fog]),vertexShader:ps.points_vert,fragmentShader:ps.points_frag},dashed:{uniforms:Af([Xn.common,Xn.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:ps.linedashed_vert,fragmentShader:ps.linedashed_frag},depth:{uniforms:Af([Xn.common,Xn.displacementmap]),vertexShader:ps.depth_vert,fragmentShader:ps.depth_frag},normal:{uniforms:Af([Xn.common,Xn.bumpmap,Xn.normalmap,Xn.displacementmap,{opacity:{value:1}}]),vertexShader:ps.meshnormal_vert,fragmentShader:ps.meshnormal_frag},sprite:{uniforms:Af([Xn.sprite,Xn.fog]),vertexShader:ps.sprite_vert,fragmentShader:ps.sprite_frag},background:{uniforms:{uvTransform:{value:new up},t2D:{value:null}},vertexShader:ps.background_vert,fragmentShader:ps.background_frag},cube:{uniforms:Af([Xn.envmap,{opacity:{value:1}}]),vertexShader:ps.cube_vert,fragmentShader:ps.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:ps.equirect_vert,fragmentShader:ps.equirect_frag},distanceRGBA:{uniforms:Af([Xn.common,Xn.displacementmap,{referencePosition:{value:new Me},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:ps.distanceRGBA_vert,fragmentShader:ps.distanceRGBA_frag},shadow:{uniforms:Af([Xn.lights,Xn.fog,{color:{value:new Fn(0)},opacity:{value:1}}]),vertexShader:ps.shadow_vert,fragmentShader:ps.shadow_frag}};op.physical={uniforms:Af([op.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new Vt(1,1)},clearcoatNormalMap:{value:null},iridescence:{value:0},iridescenceMap:{value:null},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},sheen:{value:0},sheenColor:{value:new Fn(0)},sheenColorMap:{value:null},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new Vt},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationColor:{value:new Fn(0)},specularIntensity:{value:1},specularIntensityMap:{value:null},specularColor:{value:new Fn(1,1,1)},specularColorMap:{value:null}}]),vertexShader:ps.meshphysical_vert,fragmentShader:ps.meshphysical_frag};function MEe(n,e,t,r,s,o){const l=new Fn(0);let u=s===!0?0:1,h,f,g=null,y=0,b=null;function w(M,A){let k=!1,L=A.isScene===!0?A.background:null;L&&L.isTexture&&(L=e.get(L));const P=n.xr,D=P.getSession&&P.getSession();D&&D.environmentBlendMode==="additive"&&(L=null),L===null?C(l,u):L&&L.isColor&&(C(L,1),k=!0),(n.autoClear||k)&&n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil),L&&(L.isCubeTexture||L.mapping===dE)?(f===void 0&&(f=new Hn(new pu(1,1,1),new xd({name:"BackgroundCubeMaterial",uniforms:Dw(op.cube.uniforms),vertexShader:op.cube.vertexShader,fragmentShader:op.cube.fragmentShader,side:cd,depthTest:!1,depthWrite:!1,fog:!1})),f.geometry.deleteAttribute("normal"),f.geometry.deleteAttribute("uv"),f.onBeforeRender=function(z,U,V){this.matrixWorld.copyPosition(V.matrixWorld)},Object.defineProperty(f.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(f)),f.material.uniforms.envMap.value=L,f.material.uniforms.flipEnvMap.value=L.isCubeTexture&&L.isRenderTargetTexture===!1?-1:1,(g!==L||y!==L.version||b!==n.toneMapping)&&(f.material.needsUpdate=!0,g=L,y=L.version,b=n.toneMapping),f.layers.enableAll(),M.unshift(f,f.geometry,f.material,0,0,null)):L&&L.isTexture&&(h===void 0&&(h=new Hn(new c0(2,2),new xd({name:"BackgroundMaterial",uniforms:Dw(op.background.uniforms),vertexShader:op.background.vertexShader,fragmentShader:op.background.fragmentShader,side:p_,depthTest:!1,depthWrite:!1,fog:!1})),h.geometry.deleteAttribute("normal"),Object.defineProperty(h.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(h)),h.material.uniforms.t2D.value=L,L.matrixAutoUpdate===!0&&L.updateMatrix(),h.material.uniforms.uvTransform.value.copy(L.matrix),(g!==L||y!==L.version||b!==n.toneMapping)&&(h.material.needsUpdate=!0,g=L,y=L.version,b=n.toneMapping),h.layers.enableAll(),M.unshift(h,h.geometry,h.material,0,0,null))}function C(M,A){t.buffers.color.setClear(M.r,M.g,M.b,A,o)}return{getClearColor:function(){return l},setClearColor:function(M,A=1){l.set(M),u=A,C(l,u)},getClearAlpha:function(){return u},setClearAlpha:function(M){u=M,C(l,u)},render:w}}function AEe(n,e,t,r){const s=n.getParameter(34921),o=r.isWebGL2?null:e.get("OES_vertex_array_object"),l=r.isWebGL2||o!==null,u={},h=A(null);let f=h,g=!1;function y(ae,ue,ge,we,J){let re=!1;if(l){const se=M(we,ge,ue);f!==se&&(f=se,w(f.object)),re=k(ae,we,ge,J),re&&L(ae,we,ge,J)}else{const se=ue.wireframe===!0;(f.geometry!==we.id||f.program!==ge.id||f.wireframe!==se)&&(f.geometry=we.id,f.program=ge.id,f.wireframe=se,re=!0)}J!==null&&t.update(J,34963),(re||g)&&(g=!1,H(ae,ue,ge,we),J!==null&&n.bindBuffer(34963,t.get(J).buffer))}function b(){return r.isWebGL2?n.createVertexArray():o.createVertexArrayOES()}function w(ae){return r.isWebGL2?n.bindVertexArray(ae):o.bindVertexArrayOES(ae)}function C(ae){return r.isWebGL2?n.deleteVertexArray(ae):o.deleteVertexArrayOES(ae)}function M(ae,ue,ge){const we=ge.wireframe===!0;let J=u[ae.id];J===void 0&&(J={},u[ae.id]=J);let re=J[ue.id];re===void 0&&(re={},J[ue.id]=re);let se=re[we];return se===void 0&&(se=A(b()),re[we]=se),se}function A(ae){const ue=[],ge=[],we=[];for(let J=0;J=0){const Fe=J[Te];let Ie=re[Te];if(Ie===void 0&&(Te==="instanceMatrix"&&ae.instanceMatrix&&(Ie=ae.instanceMatrix),Te==="instanceColor"&&ae.instanceColor&&(Ie=ae.instanceColor)),Fe===void 0||Fe.attribute!==Ie||Ie&&Fe.data!==Ie.data)return!0;se++}return f.attributesNum!==se||f.index!==we}function L(ae,ue,ge,we){const J={},re=ue.attributes;let se=0;const fe=ge.getAttributes();for(const Te in fe)if(fe[Te].location>=0){let Fe=re[Te];Fe===void 0&&(Te==="instanceMatrix"&&ae.instanceMatrix&&(Fe=ae.instanceMatrix),Te==="instanceColor"&&ae.instanceColor&&(Fe=ae.instanceColor));const Ie={};Ie.attribute=Fe,Fe&&Fe.data&&(Ie.data=Fe.data),J[Te]=Ie,se++}f.attributes=J,f.attributesNum=se,f.index=we}function P(){const ae=f.newAttributes;for(let ue=0,ge=ae.length;ue=0){let Fe=J[fe];if(Fe===void 0&&(fe==="instanceMatrix"&&ae.instanceMatrix&&(Fe=ae.instanceMatrix),fe==="instanceColor"&&ae.instanceColor&&(Fe=ae.instanceColor)),Fe!==void 0){const Ie=Fe.normalized,qe=Fe.itemSize,Re=t.get(Fe);if(Re===void 0)continue;const Ze=Re.buffer,rt=Re.type,ft=Re.bytesPerElement;if(Fe.isInterleavedBufferAttribute){const ut=Fe.data,ze=ut.stride,$e=Fe.offset;if(ut.isInstancedInterleavedBuffer){for(let He=0;He0&&n.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";V="mediump"}return V==="mediump"&&n.getShaderPrecisionFormat(35633,36337).precision>0&&n.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}const l=typeof WebGL2RenderingContext<"u"&&n instanceof WebGL2RenderingContext||typeof WebGL2ComputeRenderingContext<"u"&&n instanceof WebGL2ComputeRenderingContext;let u=t.precision!==void 0?t.precision:"highp";const h=o(u);h!==u&&(console.warn("THREE.WebGLRenderer:",u,"not supported, using",h,"instead."),u=h);const f=l||e.has("WEBGL_draw_buffers"),g=t.logarithmicDepthBuffer===!0,y=n.getParameter(34930),b=n.getParameter(35660),w=n.getParameter(3379),C=n.getParameter(34076),M=n.getParameter(34921),A=n.getParameter(36347),k=n.getParameter(36348),L=n.getParameter(36349),P=b>0,D=l||e.has("OES_texture_float"),z=P&&D,U=l?n.getParameter(36183):0;return{isWebGL2:l,drawBuffers:f,getMaxAnisotropy:s,getMaxPrecision:o,precision:u,logarithmicDepthBuffer:g,maxTextures:y,maxVertexTextures:b,maxTextureSize:w,maxCubemapSize:C,maxAttributes:M,maxVertexUniforms:A,maxVaryings:k,maxFragmentUniforms:L,vertexTextures:P,floatFragmentTextures:D,floatVertexTextures:z,maxSamples:U}}function kEe(n){const e=this;let t=null,r=0,s=!1,o=!1;const l=new ov,u=new up,h={value:null,needsUpdate:!1};this.uniform=h,this.numPlanes=0,this.numIntersection=0,this.init=function(y,b,w){const C=y.length!==0||b||r!==0||s;return s=b,t=g(y,w,0),r=y.length,C},this.beginShadows=function(){o=!0,g(null)},this.endShadows=function(){o=!1,f()},this.setState=function(y,b,w){const C=y.clippingPlanes,M=y.clipIntersection,A=y.clipShadows,k=n.get(y);if(!s||C===null||C.length===0||o&&!A)o?g(null):f();else{const L=o?0:r,P=L*4;let D=k.clippingState||null;h.value=D,D=g(C,b,P,w);for(let z=0;z!==P;++z)D[z]=t[z];k.clippingState=D,this.numIntersection=M?this.numPlanes:0,this.numPlanes+=L}};function f(){h.value!==t&&(h.value=t,h.needsUpdate=r>0),e.numPlanes=r,e.numIntersection=0}function g(y,b,w,C){const M=y!==null?y.length:0;let A=null;if(M!==0){if(A=h.value,C!==!0||A===null){const k=w+M*4,L=b.matrixWorldInverse;u.getNormalMatrix(L),(A===null||A.length0){const f=new CQ(h.height/2);return f.fromEquirectangularTexture(n,l),e.set(l,f),l.addEventListener("dispose",s),t(f.texture,l.mapping)}else return null}}return l}function s(l){const u=l.target;u.removeEventListener("dispose",s);const h=e.get(u);h!==void 0&&(e.delete(u),h.dispose())}function o(){e=new WeakMap}return{get:r,dispose:o}}class u_ extends fE{constructor(e=-1,t=1,r=1,s=-1,o=.1,l=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=r,this.bottom=s,this.near=o,this.far=l,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,r,s,o,l){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=r,this.view.offsetY=s,this.view.width=o,this.view.height=l,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),r=(this.right+this.left)/2,s=(this.top+this.bottom)/2;let o=r-e,l=r+e,u=s+t,h=s-t;if(this.view!==null&&this.view.enabled){const f=(this.right-this.left)/this.view.fullWidth/this.zoom,g=(this.top-this.bottom)/this.view.fullHeight/this.zoom;o+=f*this.view.offsetX,l=o+f*this.view.width,u-=g*this.view.offsetY,h=u-g*this.view.height}this.projectionMatrix.makeOrthographic(o,l,u,h,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,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}const ZS=4,AG=[.125,.215,.35,.446,.526,.582],g1=20,NL=new u_,IG=new Fn;let DL=null;const h1=(1+Math.sqrt(5))/2,CS=1/h1,RG=[new Me(1,1,1),new Me(-1,1,1),new Me(1,1,-1),new Me(-1,1,-1),new Me(0,h1,CS),new Me(0,h1,-CS),new Me(CS,0,h1),new Me(-CS,0,h1),new Me(h1,CS,0),new Me(-h1,CS,0)];class CP{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,r=.1,s=100){DL=this._renderer.getRenderTarget(),this._setSize(256);const o=this._allocateTargets();return o.depthBuffer=!0,this._sceneToCubeUV(e,r,s,o),t>0&&this._blur(o,0,0,t),this._applyPMREM(o),this._cleanup(o),o}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=LG(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=OG(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e2?k:0,k,k),h.setRenderTarget(s),w&&h.render(b,o),h.render(e,o)}b.geometry.dispose(),b.material.dispose(),h.toneMapping=g,h.autoClear=f,e.background=C}_textureToCubeUV(e,t){const r=this._renderer,s=e.mapping===Gy||e.mapping===Wy;s?(this._cubemapMaterial===null&&(this._cubemapMaterial=LG()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=OG());const o=s?this._cubemapMaterial:this._equirectMaterial,l=new Hn(this._lodPlanes[0],o),u=o.uniforms;u.envMap.value=e;const h=this._cubeSize;aA(t,0,0,3*h,2*h),r.setRenderTarget(t),r.render(l,NL)}_applyPMREM(e){const t=this._renderer,r=t.autoClear;t.autoClear=!1;for(let s=1;sg1&&console.warn(`sigmaRadians, ${o}, is too large and will clip, as it requested ${A} samples when the maximum is set to ${g1}`);const k=[];let L=0;for(let V=0;VP-ZS?s-P+ZS:0),U=4*(this._cubeSize-D);aA(t,z,U,3*D,2*D),h.setRenderTarget(t),h.render(y,NL)}}function LEe(n){const e=[],t=[],r=[];let s=n;const o=n-ZS+1+AG.length;for(let l=0;ln-ZS?h=AG[l-n+ZS-1]:l===0&&(h=0),r.push(h);const f=1/(u-2),g=-f,y=1+f,b=[g,g,y,g,y,y,g,g,y,y,g,y],w=6,C=6,M=3,A=2,k=1,L=new Float32Array(M*C*w),P=new Float32Array(A*C*w),D=new Float32Array(k*C*w);for(let U=0;U2?0:-1,oe=[V,H,0,V+2/3,H,0,V+2/3,H+1,0,V,H,0,V+2/3,H+1,0,V,H+1,0];L.set(oe,M*C*U),P.set(b,A*C*U);const le=[U,U,U,U,U,U];D.set(le,k*C*U)}const z=new ui;z.setAttribute("position",new Do(L,M)),z.setAttribute("uv",new Do(P,A)),z.setAttribute("faceIndex",new Do(D,k)),e.push(z),s>ZS&&s--}return{lodPlanes:e,sizeLods:t,sigmas:r}}function kG(n,e,t){const r=new Nc(n,e,t);return r.texture.mapping=dE,r.texture.name="PMREM.cubeUv",r.scissorTest=!0,r}function aA(n,e,t,r,s){n.viewport.set(e,t,r,s),n.scissor.set(e,t,r,s)}function NEe(n,e,t){const r=new Float32Array(g1),s=new Me(0,1,0);return new xd({name:"SphericalGaussianBlur",defines:{n:g1,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${n}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:r},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:s}},vertexShader:e4(),fragmentShader:` precision mediump float; precision mediump int; @@ -4731,7 +4731,7 @@ void main() { } } - `,blending:pp,depthTest:!1,depthWrite:!1})}function kG(){return new xd({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:e4(),fragmentShader:` + `,blending:pp,depthTest:!1,depthWrite:!1})}function OG(){return new xd({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:e4(),fragmentShader:` precision mediump float; precision mediump int; @@ -4750,7 +4750,7 @@ void main() { gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); } - `,blending:pp,depthTest:!1,depthWrite:!1})}function OG(){return new xd({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:e4(),fragmentShader:` + `,blending:pp,depthTest:!1,depthWrite:!1})}function LG(){return new xd({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:e4(),fragmentShader:` precision mediump float; precision mediump int; @@ -4821,37 +4821,37 @@ void main() { gl_Position = vec4( position, 1.0 ); } - `}function DEe(n){let e=new WeakMap,t=null;function r(u){if(u&&u.isTexture){const h=u.mapping,f=h===D$||h===P$,g=h===Gy||h===Wy;if(f||g)if(u.isRenderTargetTexture&&u.needsPMREMUpdate===!0){u.needsPMREMUpdate=!1;let y=e.get(u);return t===null&&(t=new CP(n)),y=f?t.fromEquirectangular(u,y):t.fromCubemap(u,y),e.set(u,y),y.texture}else{if(e.has(u))return e.get(u).texture;{const y=u.image;if(f&&y&&y.height>0||g&&y&&s(y)){t===null&&(t=new CP(n));const b=f?t.fromEquirectangular(u):t.fromCubemap(u);return e.set(u,b),u.addEventListener("dispose",o),b.texture}else return null}}}return u}function s(u){let h=0;const f=6;for(let g=0;ge.maxTextureSize&&(q=Math.ceil(Z/e.maxTextureSize),Z=e.maxTextureSize);const he=new Float32Array(Z*q*4*M),ae=new RC(he,Z,q,M);ae.type=r_,ae.needsUpdate=!0;const ue=le*4;for(let ge=0;ge0)return n;const s=e*t;let o=LG[s];if(o===void 0&&(o=new Float32Array(s),LG[s]=o),e!==0){r.toArray(o,0);for(let l=1,u=0;l!==e;++l)u+=t,n[l].toArray(o,u)}return o}function _p(n,e){if(n.length!==e.length)return!1;for(let t=0,r=n.length;t0||g&&y&&s(y)){t===null&&(t=new CP(n));const b=f?t.fromEquirectangular(u):t.fromCubemap(u);return e.set(u,b),u.addEventListener("dispose",o),b.texture}else return null}}}return u}function s(u){let h=0;const f=6;for(let g=0;ge.maxTextureSize&&(q=Math.ceil(Z/e.maxTextureSize),Z=e.maxTextureSize);const he=new Float32Array(Z*q*4*M),ae=new RC(he,Z,q,M);ae.type=r_,ae.needsUpdate=!0;const ue=le*4;for(let ge=0;ge0)return n;const s=e*t;let o=NG[s];if(o===void 0&&(o=new Float32Array(s),NG[s]=o),e!==0){r.toArray(o,0);for(let l=1,u=0;l!==e;++l)u+=t,n[l].toArray(o,u)}return o}function _p(n,e){if(n.length!==e.length)return!1;for(let t=0,r=n.length;t":" "} ${u}: ${t[l]}`)}return r.join(` -`)}function Pxe(n){switch(n){case xg:return["Linear","( value )"];case ms:return["sRGB","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported encoding:",n),["Linear","( value )"]}}function UG(n,e,t){const r=n.getShaderParameter(e,35713),s=n.getShaderInfoLog(e).trim();if(r&&s==="")return"";const o=/ERROR: 0:(\d+)/.exec(s);if(o){const l=parseInt(o[1]);return t.toUpperCase()+` +`)}function Pxe(n){switch(n){case xg:return["Linear","( value )"];case ms:return["sRGB","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported encoding:",n),["Linear","( value )"]}}function HG(n,e,t){const r=n.getShaderParameter(e,35713),s=n.getShaderInfoLog(e).trim();if(r&&s==="")return"";const o=/ERROR: 0:(\d+)/.exec(s);if(o){const l=parseInt(o[1]);return t.toUpperCase()+` `+s+` -`+Dxe(n.getShaderSource(e),l)}else return s}function Bxe(n,e){const t=Pxe(e);return"vec4 "+n+"( vec4 value ) { return LinearTo"+t[0]+t[1]+"; }"}function Fxe(n,e){let t;switch(e){case qq:t="Linear";break;case Qq:t="Reinhard";break;case Zq:t="OptimizedCineon";break;case jF:t="ACESFilmic";break;case eQ:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+n+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}function zxe(n){return[n.extensionDerivatives||n.envMapCubeUVHeight||n.bumpMap||n.tangentSpaceNormalMap||n.clearcoatNormalMap||n.flatShading||n.shaderID==="physical"?"#extension GL_OES_standard_derivatives : enable":"",(n.extensionFragDepth||n.logarithmicDepthBuffer)&&n.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",n.extensionDrawBuffers&&n.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(n.extensionShaderTextureLOD||n.envMap||n.transmission)&&n.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(kx).join(` +`+Dxe(n.getShaderSource(e),l)}else return s}function Bxe(n,e){const t=Pxe(e);return"vec4 "+n+"( vec4 value ) { return LinearTo"+t[0]+t[1]+"; }"}function Fxe(n,e){let t;switch(e){case Qq:t="Linear";break;case Zq:t="Reinhard";break;case eQ:t="OptimizedCineon";break;case jF:t="ACESFilmic";break;case tQ:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+n+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}function zxe(n){return[n.extensionDerivatives||n.envMapCubeUVHeight||n.bumpMap||n.tangentSpaceNormalMap||n.clearcoatNormalMap||n.flatShading||n.shaderID==="physical"?"#extension GL_OES_standard_derivatives : enable":"",(n.extensionFragDepth||n.logarithmicDepthBuffer)&&n.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",n.extensionDrawBuffers&&n.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(n.extensionShaderTextureLOD||n.envMap||n.transmission)&&n.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(kx).join(` `)}function Uxe(n){const e=[];for(const t in n){const r=n[t];r!==!1&&e.push("#define "+t+" "+r)}return e.join(` -`)}function Hxe(n,e){const t={},r=n.getProgramParameter(e,35721);for(let s=0;s/gm;function MP(n){return n.replace(Gxe,Wxe)}function Wxe(n,e){const t=ps[e];if(t===void 0)throw new Error("Can not resolve #include <"+e+">");return MP(t)}const Vxe=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,jxe=/#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 WG(n){return n.replace(jxe,kQ).replace(Vxe,Yxe)}function Yxe(n,e,t,r){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),kQ(n,e,t,r)}function kQ(n,e,t,r){let s="";for(let o=parseInt(e);o/gm;function MP(n){return n.replace(Gxe,Wxe)}function Wxe(n,e){const t=ps[e];if(t===void 0)throw new Error("Can not resolve #include <"+e+">");return MP(t)}const Vxe=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,jxe=/#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 VG(n){return n.replace(jxe,OQ).replace(Vxe,Yxe)}function Yxe(n,e,t,r){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),OQ(n,e,t,r)}function OQ(n,e,t,r){let s="";for(let o=parseInt(e);o0&&(A+=` `),k=[w,C].filter(kx).join(` `),k.length>0&&(k+=` -`)):(A=[VG(t),"#define SHADER_NAME "+t.shaderName,C,t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.supportsVertexTextures?"#define VERTEX_TEXTURES":"",t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+g:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMap&&t.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",t.normalMap&&t.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.displacementMap&&t.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",t.specularColorMap?"#define USE_SPECULARCOLORMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.sheenColorMap?"#define USE_SHEENCOLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",t.vertexTangents?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUvs?"#define USE_UV":"",t.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.morphColors&&t.isWebGL2?"#define USE_MORPHCOLORS":"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+t.morphTextureStride:"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+h:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.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"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` +`)):(A=[jG(t),"#define SHADER_NAME "+t.shaderName,C,t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.supportsVertexTextures?"#define VERTEX_TEXTURES":"",t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+g:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMap&&t.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",t.normalMap&&t.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.displacementMap&&t.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",t.specularColorMap?"#define USE_SPECULARCOLORMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.sheenColorMap?"#define USE_SHEENCOLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",t.vertexTangents?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUvs?"#define USE_UV":"",t.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.morphColors&&t.isWebGL2?"#define USE_MORPHCOLORS":"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+t.morphTextureStride:"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+h:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.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"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` `].filter(kx).join(` -`),k=[w,VG(t),"#define SHADER_NAME "+t.shaderName,C,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+f:"",t.envMap?"#define "+g:"",t.envMap?"#define "+y:"",b?"#define CUBEUV_TEXEL_WIDTH "+b.texelWidth:"",b?"#define CUBEUV_TEXEL_HEIGHT "+b.texelHeight:"",b?"#define CUBEUV_MAX_MIP "+b.maxMip+".0":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMap&&t.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",t.normalMap&&t.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescence?"#define USE_IRIDESCENCE":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",t.specularColorMap?"#define USE_SPECULARCOLORMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEENCOLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.vertexTangents?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUvs?"#define USE_UV":"",t.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+h:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==l0?"#define TONE_MAPPING":"",t.toneMapping!==l0?ps.tonemapping_pars_fragment:"",t.toneMapping!==l0?Fxe("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",ps.encodings_pars_fragment,Bxe("linearToOutputTexel",t.outputEncoding),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` +`),k=[w,jG(t),"#define SHADER_NAME "+t.shaderName,C,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+f:"",t.envMap?"#define "+g:"",t.envMap?"#define "+y:"",b?"#define CUBEUV_TEXEL_WIDTH "+b.texelWidth:"",b?"#define CUBEUV_TEXEL_HEIGHT "+b.texelHeight:"",b?"#define CUBEUV_MAX_MIP "+b.maxMip+".0":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMap&&t.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",t.normalMap&&t.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescence?"#define USE_IRIDESCENCE":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",t.specularColorMap?"#define USE_SPECULARCOLORMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEENCOLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.vertexTangents?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUvs?"#define USE_UV":"",t.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+h:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==l0?"#define TONE_MAPPING":"",t.toneMapping!==l0?ps.tonemapping_pars_fragment:"",t.toneMapping!==l0?Fxe("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",ps.encodings_pars_fragment,Bxe("linearToOutputTexel",t.outputEncoding),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` `].filter(kx).join(` -`)),l=MP(l),l=HG(l,t),l=GG(l,t),u=MP(u),u=HG(u,t),u=GG(u,t),l=WG(l),u=WG(u),t.isWebGL2&&t.isRawShaderMaterial!==!0&&(L=`#version 300 es +`)),l=MP(l),l=GG(l,t),l=WG(l,t),u=MP(u),u=GG(u,t),u=WG(u,t),l=VG(l),u=VG(u),t.isWebGL2&&t.isRawShaderMaterial!==!0&&(L=`#version 300 es `,A=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join(` `)+` `+A,k=["#define varying in",t.glslVersion===xP?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===xP?"":"#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(` `)+` -`+k);const P=L+A+l,D=L+k+u,z=zG(s,35633,P),U=zG(s,35632,D);if(s.attachShader(M,z),s.attachShader(M,U),t.index0AttributeName!==void 0?s.bindAttribLocation(M,0,t.index0AttributeName):t.morphTargets===!0&&s.bindAttribLocation(M,0,"position"),s.linkProgram(M),n.debug.checkShaderErrors){const oe=s.getProgramInfoLog(M).trim(),le=s.getShaderInfoLog(z).trim(),Z=s.getShaderInfoLog(U).trim();let q=!0,he=!0;if(s.getProgramParameter(M,35714)===!1){q=!1;const ae=UG(s,z,"vertex"),ue=UG(s,U,"fragment");console.error("THREE.WebGLProgram: Shader Error "+s.getError()+" - VALIDATE_STATUS "+s.getProgramParameter(M,35715)+` +`+k);const P=L+A+l,D=L+k+u,z=UG(s,35633,P),U=UG(s,35632,D);if(s.attachShader(M,z),s.attachShader(M,U),t.index0AttributeName!==void 0?s.bindAttribLocation(M,0,t.index0AttributeName):t.morphTargets===!0&&s.bindAttribLocation(M,0,"position"),s.linkProgram(M),n.debug.checkShaderErrors){const oe=s.getProgramInfoLog(M).trim(),le=s.getShaderInfoLog(z).trim(),Z=s.getShaderInfoLog(U).trim();let q=!0,he=!0;if(s.getProgramParameter(M,35714)===!1){q=!1;const ae=HG(s,z,"vertex"),ue=HG(s,U,"fragment");console.error("THREE.WebGLProgram: Shader Error "+s.getError()+" - VALIDATE_STATUS "+s.getProgramParameter(M,35715)+` Program Info Log: `+oe+` `+ae+` -`+ue)}else oe!==""?console.warn("THREE.WebGLProgram: Program Info Log:",oe):(le===""||Z==="")&&(he=!1);he&&(this.diagnostics={runnable:q,programLog:oe,vertexShader:{log:le,prefix:A},fragmentShader:{log:Z,prefix:k}})}s.deleteShader(z),s.deleteShader(U);let V;this.getUniforms=function(){return V===void 0&&(V=new wI(s,M)),V};let H;return this.getAttributes=function(){return H===void 0&&(H=Hxe(s,M)),H},this.destroy=function(){r.releaseStatesOfProgram(this),s.deleteProgram(M),this.program=void 0},this.name=t.shaderName,this.id=Nxe++,this.cacheKey=e,this.usedTimes=1,this.program=M,this.vertexShader=z,this.fragmentShader=U,this}let e$e=0;class t$e{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,r=e.fragmentShader,s=this._getShaderStage(t),o=this._getShaderStage(r),l=this._getShaderCacheForMaterial(e);return l.has(s)===!1&&(l.add(s),s.usedTimes++),l.has(o)===!1&&(l.add(o),o.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const r of t)r.usedTimes--,r.usedTimes===0&&this.shaderCache.delete(r.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 t.has(e)===!1&&t.set(e,new Set),t.get(e)}_getShaderStage(e){const t=this.shaderCache;if(t.has(e)===!1){const r=new n$e(e);t.set(e,r)}return t.get(e)}}class n$e{constructor(e){this.id=e$e++,this.code=e,this.usedTimes=0}}function r$e(n,e,t,r,s,o,l){const u=new B1,h=new t$e,f=[],g=s.isWebGL2,y=s.logarithmicDepthBuffer,b=s.vertexTextures;let w=s.precision;const C={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function M(H,oe,le,Z,q){const he=Z.fog,ae=q.geometry,ue=H.isMeshStandardMaterial?Z.environment:null,ge=(H.isMeshStandardMaterial?t:e).get(H.envMap||ue),we=ge&&ge.mapping===dE?ge.image.height:null,J=C[H.type];H.precision!==null&&(w=s.getMaxPrecision(H.precision),w!==H.precision&&console.warn("THREE.WebGLProgram.getParameters:",H.precision,"not supported, using",w,"instead."));const re=ae.morphAttributes.position||ae.morphAttributes.normal||ae.morphAttributes.color,ie=re!==void 0?re.length:0;let fe=0;ae.morphAttributes.position!==void 0&&(fe=1),ae.morphAttributes.normal!==void 0&&(fe=2),ae.morphAttributes.color!==void 0&&(fe=3);let Te,Fe,Ie,Je;if(J){const lt=op[J];Te=lt.vertexShader,Fe=lt.fragmentShader}else Te=H.vertexShader,Fe=H.fragmentShader,h.update(H),Ie=h.getVertexShaderID(H),Je=h.getFragmentShaderID(H);const Re=n.getRenderTarget(),Qe=H.alphaTest>0,nt=H.clearcoat>0,ft=H.iridescence>0;return{isWebGL2:g,shaderID:J,shaderName:H.type,vertexShader:Te,fragmentShader:Fe,defines:H.defines,customVertexShaderID:Ie,customFragmentShaderID:Je,isRawShaderMaterial:H.isRawShaderMaterial===!0,glslVersion:H.glslVersion,precision:w,instancing:q.isInstancedMesh===!0,instancingColor:q.isInstancedMesh===!0&&q.instanceColor!==null,supportsVertexTextures:b,outputEncoding:Re===null?n.outputEncoding:Re.isXRRenderTarget===!0?Re.texture.encoding:xg,map:!!H.map,matcap:!!H.matcap,envMap:!!ge,envMapMode:ge&&ge.mapping,envMapCubeUVHeight:we,lightMap:!!H.lightMap,aoMap:!!H.aoMap,emissiveMap:!!H.emissiveMap,bumpMap:!!H.bumpMap,normalMap:!!H.normalMap,objectSpaceNormalMap:H.normalMapType===yQ,tangentSpaceNormalMap:H.normalMapType===cT,decodeVideoTexture:!!H.map&&H.map.isVideoTexture===!0&&H.map.encoding===ms,clearcoat:nt,clearcoatMap:nt&&!!H.clearcoatMap,clearcoatRoughnessMap:nt&&!!H.clearcoatRoughnessMap,clearcoatNormalMap:nt&&!!H.clearcoatNormalMap,iridescence:ft,iridescenceMap:ft&&!!H.iridescenceMap,iridescenceThicknessMap:ft&&!!H.iridescenceThicknessMap,displacementMap:!!H.displacementMap,roughnessMap:!!H.roughnessMap,metalnessMap:!!H.metalnessMap,specularMap:!!H.specularMap,specularIntensityMap:!!H.specularIntensityMap,specularColorMap:!!H.specularColorMap,opaque:H.transparent===!1&&H.blending===mv,alphaMap:!!H.alphaMap,alphaTest:Qe,gradientMap:!!H.gradientMap,sheen:H.sheen>0,sheenColorMap:!!H.sheenColorMap,sheenRoughnessMap:!!H.sheenRoughnessMap,transmission:H.transmission>0,transmissionMap:!!H.transmissionMap,thicknessMap:!!H.thicknessMap,combine:H.combine,vertexTangents:!!H.normalMap&&!!ae.attributes.tangent,vertexColors:H.vertexColors,vertexAlphas:H.vertexColors===!0&&!!ae.attributes.color&&ae.attributes.color.itemSize===4,vertexUvs:!!H.map||!!H.bumpMap||!!H.normalMap||!!H.specularMap||!!H.alphaMap||!!H.emissiveMap||!!H.roughnessMap||!!H.metalnessMap||!!H.clearcoatMap||!!H.clearcoatRoughnessMap||!!H.clearcoatNormalMap||!!H.iridescenceMap||!!H.iridescenceThicknessMap||!!H.displacementMap||!!H.transmissionMap||!!H.thicknessMap||!!H.specularIntensityMap||!!H.specularColorMap||!!H.sheenColorMap||!!H.sheenRoughnessMap,uvsVertexOnly:!(H.map||H.bumpMap||H.normalMap||H.specularMap||H.alphaMap||H.emissiveMap||H.roughnessMap||H.metalnessMap||H.clearcoatNormalMap||H.iridescenceMap||H.iridescenceThicknessMap||H.transmission>0||H.transmissionMap||H.thicknessMap||H.specularIntensityMap||H.specularColorMap||H.sheen>0||H.sheenColorMap||H.sheenRoughnessMap)&&!!H.displacementMap,fog:!!he,useFog:H.fog===!0,fogExp2:he&&he.isFogExp2,flatShading:!!H.flatShading,sizeAttenuation:H.sizeAttenuation,logarithmicDepthBuffer:y,skinning:q.isSkinnedMesh===!0,morphTargets:ae.morphAttributes.position!==void 0,morphNormals:ae.morphAttributes.normal!==void 0,morphColors:ae.morphAttributes.color!==void 0,morphTargetsCount:ie,morphTextureStride:fe,numDirLights:oe.directional.length,numPointLights:oe.point.length,numSpotLights:oe.spot.length,numRectAreaLights:oe.rectArea.length,numHemiLights:oe.hemi.length,numDirLightShadows:oe.directionalShadowMap.length,numPointLightShadows:oe.pointShadowMap.length,numSpotLightShadows:oe.spotShadowMap.length,numClippingPlanes:l.numPlanes,numClipIntersection:l.numIntersection,dithering:H.dithering,shadowMapEnabled:n.shadowMap.enabled&&le.length>0,shadowMapType:n.shadowMap.type,toneMapping:H.toneMapped?n.toneMapping:l0,physicallyCorrectLights:n.physicallyCorrectLights,premultipliedAlpha:H.premultipliedAlpha,doubleSided:H.side===lp,flipSided:H.side===cd,useDepthPacking:!!H.depthPacking,depthPacking:H.depthPacking||0,index0AttributeName:H.index0AttributeName,extensionDerivatives:H.extensions&&H.extensions.derivatives,extensionFragDepth:H.extensions&&H.extensions.fragDepth,extensionDrawBuffers:H.extensions&&H.extensions.drawBuffers,extensionShaderTextureLOD:H.extensions&&H.extensions.shaderTextureLOD,rendererExtensionFragDepth:g||r.has("EXT_frag_depth"),rendererExtensionDrawBuffers:g||r.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:g||r.has("EXT_shader_texture_lod"),customProgramCacheKey:H.customProgramCacheKey()}}function A(H){const oe=[];if(H.shaderID?oe.push(H.shaderID):(oe.push(H.customVertexShaderID),oe.push(H.customFragmentShaderID)),H.defines!==void 0)for(const le in H.defines)oe.push(le),oe.push(H.defines[le]);return H.isRawShaderMaterial===!1&&(k(oe,H),L(oe,H),oe.push(n.outputEncoding)),oe.push(H.customProgramCacheKey),oe.join()}function k(H,oe){H.push(oe.precision),H.push(oe.outputEncoding),H.push(oe.envMapMode),H.push(oe.envMapCubeUVHeight),H.push(oe.combine),H.push(oe.vertexUvs),H.push(oe.fogExp2),H.push(oe.sizeAttenuation),H.push(oe.morphTargetsCount),H.push(oe.morphAttributeCount),H.push(oe.numDirLights),H.push(oe.numPointLights),H.push(oe.numSpotLights),H.push(oe.numHemiLights),H.push(oe.numRectAreaLights),H.push(oe.numDirLightShadows),H.push(oe.numPointLightShadows),H.push(oe.numSpotLightShadows),H.push(oe.shadowMapType),H.push(oe.toneMapping),H.push(oe.numClippingPlanes),H.push(oe.numClipIntersection),H.push(oe.depthPacking)}function L(H,oe){u.disableAll(),oe.isWebGL2&&u.enable(0),oe.supportsVertexTextures&&u.enable(1),oe.instancing&&u.enable(2),oe.instancingColor&&u.enable(3),oe.map&&u.enable(4),oe.matcap&&u.enable(5),oe.envMap&&u.enable(6),oe.lightMap&&u.enable(7),oe.aoMap&&u.enable(8),oe.emissiveMap&&u.enable(9),oe.bumpMap&&u.enable(10),oe.normalMap&&u.enable(11),oe.objectSpaceNormalMap&&u.enable(12),oe.tangentSpaceNormalMap&&u.enable(13),oe.clearcoat&&u.enable(14),oe.clearcoatMap&&u.enable(15),oe.clearcoatRoughnessMap&&u.enable(16),oe.clearcoatNormalMap&&u.enable(17),oe.iridescence&&u.enable(18),oe.iridescenceMap&&u.enable(19),oe.iridescenceThicknessMap&&u.enable(20),oe.displacementMap&&u.enable(21),oe.specularMap&&u.enable(22),oe.roughnessMap&&u.enable(23),oe.metalnessMap&&u.enable(24),oe.gradientMap&&u.enable(25),oe.alphaMap&&u.enable(26),oe.alphaTest&&u.enable(27),oe.vertexColors&&u.enable(28),oe.vertexAlphas&&u.enable(29),oe.vertexUvs&&u.enable(30),oe.vertexTangents&&u.enable(31),oe.uvsVertexOnly&&u.enable(32),oe.fog&&u.enable(33),H.push(u.mask),u.disableAll(),oe.useFog&&u.enable(0),oe.flatShading&&u.enable(1),oe.logarithmicDepthBuffer&&u.enable(2),oe.skinning&&u.enable(3),oe.morphTargets&&u.enable(4),oe.morphNormals&&u.enable(5),oe.morphColors&&u.enable(6),oe.premultipliedAlpha&&u.enable(7),oe.shadowMapEnabled&&u.enable(8),oe.physicallyCorrectLights&&u.enable(9),oe.doubleSided&&u.enable(10),oe.flipSided&&u.enable(11),oe.useDepthPacking&&u.enable(12),oe.dithering&&u.enable(13),oe.specularIntensityMap&&u.enable(14),oe.specularColorMap&&u.enable(15),oe.transmission&&u.enable(16),oe.transmissionMap&&u.enable(17),oe.thicknessMap&&u.enable(18),oe.sheen&&u.enable(19),oe.sheenColorMap&&u.enable(20),oe.sheenRoughnessMap&&u.enable(21),oe.decodeVideoTexture&&u.enable(22),oe.opaque&&u.enable(23),H.push(u.mask)}function P(H){const oe=C[H.type];let le;if(oe){const Z=op[oe];le=OC.clone(Z.uniforms)}else le=H.uniforms;return le}function D(H,oe){let le;for(let Z=0,q=f.length;Z0?r.push(k):w.transparent===!0?s.push(k):t.push(k)}function h(y,b,w,C,M,A){const k=l(y,b,w,C,M,A);w.transmission>0?r.unshift(k):w.transparent===!0?s.unshift(k):t.unshift(k)}function f(y,b){t.length>1&&t.sort(y||s$e),r.length>1&&r.sort(b||jG),s.length>1&&s.sort(b||jG)}function g(){for(let y=e,b=n.length;y=n.get(r).length?(o=new YG,n.get(r).push(o)):o=n.get(r)[s],o}function t(){n=new WeakMap}return{get:e,dispose:t}}function a$e(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new Ae,color:new Fn};break;case"SpotLight":t={position:new Ae,direction:new Ae,color:new Fn,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new Ae,color:new Fn,distance:0,decay:0};break;case"HemisphereLight":t={direction:new Ae,skyColor:new Fn,groundColor:new Fn};break;case"RectAreaLight":t={color:new Fn,position:new Ae,halfWidth:new Ae,halfHeight:new Ae};break}return n[e.id]=t,t}}}function l$e(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new jt};break;case"SpotLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new jt};break;case"PointLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new jt,shadowCameraNear:1,shadowCameraFar:1e3};break}return n[e.id]=t,t}}}let u$e=0;function c$e(n,e){return(e.castShadow?1:0)-(n.castShadow?1:0)}function h$e(n,e){const t=new a$e,r=l$e(),s={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 g=0;g<9;g++)s.probe.push(new Ae);const o=new Ae,l=new Qr,u=new Qr;function h(g,y){let b=0,w=0,C=0;for(let oe=0;oe<9;oe++)s.probe[oe].set(0,0,0);let M=0,A=0,k=0,L=0,P=0,D=0,z=0,U=0;g.sort(c$e);const V=y!==!0?Math.PI:1;for(let oe=0,le=g.length;oe0&&(e.isWebGL2||n.has("OES_texture_float_linear")===!0?(s.rectAreaLTC1=Xn.LTC_FLOAT_1,s.rectAreaLTC2=Xn.LTC_FLOAT_2):n.has("OES_texture_half_float_linear")===!0?(s.rectAreaLTC1=Xn.LTC_HALF_1,s.rectAreaLTC2=Xn.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),s.ambient[0]=b,s.ambient[1]=w,s.ambient[2]=C;const H=s.hash;(H.directionalLength!==M||H.pointLength!==A||H.spotLength!==k||H.rectAreaLength!==L||H.hemiLength!==P||H.numDirectionalShadows!==D||H.numPointShadows!==z||H.numSpotShadows!==U)&&(s.directional.length=M,s.spot.length=k,s.rectArea.length=L,s.point.length=A,s.hemi.length=P,s.directionalShadow.length=D,s.directionalShadowMap.length=D,s.pointShadow.length=z,s.pointShadowMap.length=z,s.spotShadow.length=U,s.spotShadowMap.length=U,s.directionalShadowMatrix.length=D,s.pointShadowMatrix.length=z,s.spotShadowMatrix.length=U,H.directionalLength=M,H.pointLength=A,H.spotLength=k,H.rectAreaLength=L,H.hemiLength=P,H.numDirectionalShadows=D,H.numPointShadows=z,H.numSpotShadows=U,s.version=u$e++)}function f(g,y){let b=0,w=0,C=0,M=0,A=0;const k=y.matrixWorldInverse;for(let L=0,P=g.length;L=t.get(o).length?(u=new XG(n,e),t.get(o).push(u)):u=t.get(o)[l],u}function s(){t=new WeakMap}return{get:r,dispose:s}}class NC extends hd{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=nb,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class l2 extends hd{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.referencePosition=new Ae,this.nearDistance=1,this.farDistance=1e3,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.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}}const f$e=`void main() { +`+ue)}else oe!==""?console.warn("THREE.WebGLProgram: Program Info Log:",oe):(le===""||Z==="")&&(he=!1);he&&(this.diagnostics={runnable:q,programLog:oe,vertexShader:{log:le,prefix:A},fragmentShader:{log:Z,prefix:k}})}s.deleteShader(z),s.deleteShader(U);let V;this.getUniforms=function(){return V===void 0&&(V=new wI(s,M)),V};let H;return this.getAttributes=function(){return H===void 0&&(H=Hxe(s,M)),H},this.destroy=function(){r.releaseStatesOfProgram(this),s.deleteProgram(M),this.program=void 0},this.name=t.shaderName,this.id=Nxe++,this.cacheKey=e,this.usedTimes=1,this.program=M,this.vertexShader=z,this.fragmentShader=U,this}let e$e=0;class t$e{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,r=e.fragmentShader,s=this._getShaderStage(t),o=this._getShaderStage(r),l=this._getShaderCacheForMaterial(e);return l.has(s)===!1&&(l.add(s),s.usedTimes++),l.has(o)===!1&&(l.add(o),o.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const r of t)r.usedTimes--,r.usedTimes===0&&this.shaderCache.delete(r.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 t.has(e)===!1&&t.set(e,new Set),t.get(e)}_getShaderStage(e){const t=this.shaderCache;if(t.has(e)===!1){const r=new n$e(e);t.set(e,r)}return t.get(e)}}class n$e{constructor(e){this.id=e$e++,this.code=e,this.usedTimes=0}}function r$e(n,e,t,r,s,o,l){const u=new F1,h=new t$e,f=[],g=s.isWebGL2,y=s.logarithmicDepthBuffer,b=s.vertexTextures;let w=s.precision;const C={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function M(H,oe,le,Z,q){const he=Z.fog,ae=q.geometry,ue=H.isMeshStandardMaterial?Z.environment:null,ge=(H.isMeshStandardMaterial?t:e).get(H.envMap||ue),we=ge&&ge.mapping===dE?ge.image.height:null,J=C[H.type];H.precision!==null&&(w=s.getMaxPrecision(H.precision),w!==H.precision&&console.warn("THREE.WebGLProgram.getParameters:",H.precision,"not supported, using",w,"instead."));const re=ae.morphAttributes.position||ae.morphAttributes.normal||ae.morphAttributes.color,se=re!==void 0?re.length:0;let fe=0;ae.morphAttributes.position!==void 0&&(fe=1),ae.morphAttributes.normal!==void 0&&(fe=2),ae.morphAttributes.color!==void 0&&(fe=3);let Te,Fe,Ie,qe;if(J){const ut=op[J];Te=ut.vertexShader,Fe=ut.fragmentShader}else Te=H.vertexShader,Fe=H.fragmentShader,h.update(H),Ie=h.getVertexShaderID(H),qe=h.getFragmentShaderID(H);const Re=n.getRenderTarget(),Ze=H.alphaTest>0,rt=H.clearcoat>0,ft=H.iridescence>0;return{isWebGL2:g,shaderID:J,shaderName:H.type,vertexShader:Te,fragmentShader:Fe,defines:H.defines,customVertexShaderID:Ie,customFragmentShaderID:qe,isRawShaderMaterial:H.isRawShaderMaterial===!0,glslVersion:H.glslVersion,precision:w,instancing:q.isInstancedMesh===!0,instancingColor:q.isInstancedMesh===!0&&q.instanceColor!==null,supportsVertexTextures:b,outputEncoding:Re===null?n.outputEncoding:Re.isXRRenderTarget===!0?Re.texture.encoding:xg,map:!!H.map,matcap:!!H.matcap,envMap:!!ge,envMapMode:ge&&ge.mapping,envMapCubeUVHeight:we,lightMap:!!H.lightMap,aoMap:!!H.aoMap,emissiveMap:!!H.emissiveMap,bumpMap:!!H.bumpMap,normalMap:!!H.normalMap,objectSpaceNormalMap:H.normalMapType===bQ,tangentSpaceNormalMap:H.normalMapType===hT,decodeVideoTexture:!!H.map&&H.map.isVideoTexture===!0&&H.map.encoding===ms,clearcoat:rt,clearcoatMap:rt&&!!H.clearcoatMap,clearcoatRoughnessMap:rt&&!!H.clearcoatRoughnessMap,clearcoatNormalMap:rt&&!!H.clearcoatNormalMap,iridescence:ft,iridescenceMap:ft&&!!H.iridescenceMap,iridescenceThicknessMap:ft&&!!H.iridescenceThicknessMap,displacementMap:!!H.displacementMap,roughnessMap:!!H.roughnessMap,metalnessMap:!!H.metalnessMap,specularMap:!!H.specularMap,specularIntensityMap:!!H.specularIntensityMap,specularColorMap:!!H.specularColorMap,opaque:H.transparent===!1&&H.blending===mv,alphaMap:!!H.alphaMap,alphaTest:Ze,gradientMap:!!H.gradientMap,sheen:H.sheen>0,sheenColorMap:!!H.sheenColorMap,sheenRoughnessMap:!!H.sheenRoughnessMap,transmission:H.transmission>0,transmissionMap:!!H.transmissionMap,thicknessMap:!!H.thicknessMap,combine:H.combine,vertexTangents:!!H.normalMap&&!!ae.attributes.tangent,vertexColors:H.vertexColors,vertexAlphas:H.vertexColors===!0&&!!ae.attributes.color&&ae.attributes.color.itemSize===4,vertexUvs:!!H.map||!!H.bumpMap||!!H.normalMap||!!H.specularMap||!!H.alphaMap||!!H.emissiveMap||!!H.roughnessMap||!!H.metalnessMap||!!H.clearcoatMap||!!H.clearcoatRoughnessMap||!!H.clearcoatNormalMap||!!H.iridescenceMap||!!H.iridescenceThicknessMap||!!H.displacementMap||!!H.transmissionMap||!!H.thicknessMap||!!H.specularIntensityMap||!!H.specularColorMap||!!H.sheenColorMap||!!H.sheenRoughnessMap,uvsVertexOnly:!(H.map||H.bumpMap||H.normalMap||H.specularMap||H.alphaMap||H.emissiveMap||H.roughnessMap||H.metalnessMap||H.clearcoatNormalMap||H.iridescenceMap||H.iridescenceThicknessMap||H.transmission>0||H.transmissionMap||H.thicknessMap||H.specularIntensityMap||H.specularColorMap||H.sheen>0||H.sheenColorMap||H.sheenRoughnessMap)&&!!H.displacementMap,fog:!!he,useFog:H.fog===!0,fogExp2:he&&he.isFogExp2,flatShading:!!H.flatShading,sizeAttenuation:H.sizeAttenuation,logarithmicDepthBuffer:y,skinning:q.isSkinnedMesh===!0,morphTargets:ae.morphAttributes.position!==void 0,morphNormals:ae.morphAttributes.normal!==void 0,morphColors:ae.morphAttributes.color!==void 0,morphTargetsCount:se,morphTextureStride:fe,numDirLights:oe.directional.length,numPointLights:oe.point.length,numSpotLights:oe.spot.length,numRectAreaLights:oe.rectArea.length,numHemiLights:oe.hemi.length,numDirLightShadows:oe.directionalShadowMap.length,numPointLightShadows:oe.pointShadowMap.length,numSpotLightShadows:oe.spotShadowMap.length,numClippingPlanes:l.numPlanes,numClipIntersection:l.numIntersection,dithering:H.dithering,shadowMapEnabled:n.shadowMap.enabled&&le.length>0,shadowMapType:n.shadowMap.type,toneMapping:H.toneMapped?n.toneMapping:l0,physicallyCorrectLights:n.physicallyCorrectLights,premultipliedAlpha:H.premultipliedAlpha,doubleSided:H.side===lp,flipSided:H.side===cd,useDepthPacking:!!H.depthPacking,depthPacking:H.depthPacking||0,index0AttributeName:H.index0AttributeName,extensionDerivatives:H.extensions&&H.extensions.derivatives,extensionFragDepth:H.extensions&&H.extensions.fragDepth,extensionDrawBuffers:H.extensions&&H.extensions.drawBuffers,extensionShaderTextureLOD:H.extensions&&H.extensions.shaderTextureLOD,rendererExtensionFragDepth:g||r.has("EXT_frag_depth"),rendererExtensionDrawBuffers:g||r.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:g||r.has("EXT_shader_texture_lod"),customProgramCacheKey:H.customProgramCacheKey()}}function A(H){const oe=[];if(H.shaderID?oe.push(H.shaderID):(oe.push(H.customVertexShaderID),oe.push(H.customFragmentShaderID)),H.defines!==void 0)for(const le in H.defines)oe.push(le),oe.push(H.defines[le]);return H.isRawShaderMaterial===!1&&(k(oe,H),L(oe,H),oe.push(n.outputEncoding)),oe.push(H.customProgramCacheKey),oe.join()}function k(H,oe){H.push(oe.precision),H.push(oe.outputEncoding),H.push(oe.envMapMode),H.push(oe.envMapCubeUVHeight),H.push(oe.combine),H.push(oe.vertexUvs),H.push(oe.fogExp2),H.push(oe.sizeAttenuation),H.push(oe.morphTargetsCount),H.push(oe.morphAttributeCount),H.push(oe.numDirLights),H.push(oe.numPointLights),H.push(oe.numSpotLights),H.push(oe.numHemiLights),H.push(oe.numRectAreaLights),H.push(oe.numDirLightShadows),H.push(oe.numPointLightShadows),H.push(oe.numSpotLightShadows),H.push(oe.shadowMapType),H.push(oe.toneMapping),H.push(oe.numClippingPlanes),H.push(oe.numClipIntersection),H.push(oe.depthPacking)}function L(H,oe){u.disableAll(),oe.isWebGL2&&u.enable(0),oe.supportsVertexTextures&&u.enable(1),oe.instancing&&u.enable(2),oe.instancingColor&&u.enable(3),oe.map&&u.enable(4),oe.matcap&&u.enable(5),oe.envMap&&u.enable(6),oe.lightMap&&u.enable(7),oe.aoMap&&u.enable(8),oe.emissiveMap&&u.enable(9),oe.bumpMap&&u.enable(10),oe.normalMap&&u.enable(11),oe.objectSpaceNormalMap&&u.enable(12),oe.tangentSpaceNormalMap&&u.enable(13),oe.clearcoat&&u.enable(14),oe.clearcoatMap&&u.enable(15),oe.clearcoatRoughnessMap&&u.enable(16),oe.clearcoatNormalMap&&u.enable(17),oe.iridescence&&u.enable(18),oe.iridescenceMap&&u.enable(19),oe.iridescenceThicknessMap&&u.enable(20),oe.displacementMap&&u.enable(21),oe.specularMap&&u.enable(22),oe.roughnessMap&&u.enable(23),oe.metalnessMap&&u.enable(24),oe.gradientMap&&u.enable(25),oe.alphaMap&&u.enable(26),oe.alphaTest&&u.enable(27),oe.vertexColors&&u.enable(28),oe.vertexAlphas&&u.enable(29),oe.vertexUvs&&u.enable(30),oe.vertexTangents&&u.enable(31),oe.uvsVertexOnly&&u.enable(32),oe.fog&&u.enable(33),H.push(u.mask),u.disableAll(),oe.useFog&&u.enable(0),oe.flatShading&&u.enable(1),oe.logarithmicDepthBuffer&&u.enable(2),oe.skinning&&u.enable(3),oe.morphTargets&&u.enable(4),oe.morphNormals&&u.enable(5),oe.morphColors&&u.enable(6),oe.premultipliedAlpha&&u.enable(7),oe.shadowMapEnabled&&u.enable(8),oe.physicallyCorrectLights&&u.enable(9),oe.doubleSided&&u.enable(10),oe.flipSided&&u.enable(11),oe.useDepthPacking&&u.enable(12),oe.dithering&&u.enable(13),oe.specularIntensityMap&&u.enable(14),oe.specularColorMap&&u.enable(15),oe.transmission&&u.enable(16),oe.transmissionMap&&u.enable(17),oe.thicknessMap&&u.enable(18),oe.sheen&&u.enable(19),oe.sheenColorMap&&u.enable(20),oe.sheenRoughnessMap&&u.enable(21),oe.decodeVideoTexture&&u.enable(22),oe.opaque&&u.enable(23),H.push(u.mask)}function P(H){const oe=C[H.type];let le;if(oe){const Z=op[oe];le=OC.clone(Z.uniforms)}else le=H.uniforms;return le}function D(H,oe){let le;for(let Z=0,q=f.length;Z0?r.push(k):w.transparent===!0?s.push(k):t.push(k)}function h(y,b,w,C,M,A){const k=l(y,b,w,C,M,A);w.transmission>0?r.unshift(k):w.transparent===!0?s.unshift(k):t.unshift(k)}function f(y,b){t.length>1&&t.sort(y||s$e),r.length>1&&r.sort(b||YG),s.length>1&&s.sort(b||YG)}function g(){for(let y=e,b=n.length;y=n.get(r).length?(o=new XG,n.get(r).push(o)):o=n.get(r)[s],o}function t(){n=new WeakMap}return{get:e,dispose:t}}function a$e(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new Me,color:new Fn};break;case"SpotLight":t={position:new Me,direction:new Me,color:new Fn,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new Me,color:new Fn,distance:0,decay:0};break;case"HemisphereLight":t={direction:new Me,skyColor:new Fn,groundColor:new Fn};break;case"RectAreaLight":t={color:new Fn,position:new Me,halfWidth:new Me,halfHeight:new Me};break}return n[e.id]=t,t}}}function l$e(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Vt};break;case"SpotLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Vt};break;case"PointLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Vt,shadowCameraNear:1,shadowCameraFar:1e3};break}return n[e.id]=t,t}}}let u$e=0;function c$e(n,e){return(e.castShadow?1:0)-(n.castShadow?1:0)}function h$e(n,e){const t=new a$e,r=l$e(),s={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 g=0;g<9;g++)s.probe.push(new Me);const o=new Me,l=new Qr,u=new Qr;function h(g,y){let b=0,w=0,C=0;for(let oe=0;oe<9;oe++)s.probe[oe].set(0,0,0);let M=0,A=0,k=0,L=0,P=0,D=0,z=0,U=0;g.sort(c$e);const V=y!==!0?Math.PI:1;for(let oe=0,le=g.length;oe0&&(e.isWebGL2||n.has("OES_texture_float_linear")===!0?(s.rectAreaLTC1=Xn.LTC_FLOAT_1,s.rectAreaLTC2=Xn.LTC_FLOAT_2):n.has("OES_texture_half_float_linear")===!0?(s.rectAreaLTC1=Xn.LTC_HALF_1,s.rectAreaLTC2=Xn.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),s.ambient[0]=b,s.ambient[1]=w,s.ambient[2]=C;const H=s.hash;(H.directionalLength!==M||H.pointLength!==A||H.spotLength!==k||H.rectAreaLength!==L||H.hemiLength!==P||H.numDirectionalShadows!==D||H.numPointShadows!==z||H.numSpotShadows!==U)&&(s.directional.length=M,s.spot.length=k,s.rectArea.length=L,s.point.length=A,s.hemi.length=P,s.directionalShadow.length=D,s.directionalShadowMap.length=D,s.pointShadow.length=z,s.pointShadowMap.length=z,s.spotShadow.length=U,s.spotShadowMap.length=U,s.directionalShadowMatrix.length=D,s.pointShadowMatrix.length=z,s.spotShadowMatrix.length=U,H.directionalLength=M,H.pointLength=A,H.spotLength=k,H.rectAreaLength=L,H.hemiLength=P,H.numDirectionalShadows=D,H.numPointShadows=z,H.numSpotShadows=U,s.version=u$e++)}function f(g,y){let b=0,w=0,C=0,M=0,A=0;const k=y.matrixWorldInverse;for(let L=0,P=g.length;L=t.get(o).length?(u=new KG(n,e),t.get(o).push(u)):u=t.get(o)[l],u}function s(){t=new WeakMap}return{get:r,dispose:s}}class NC extends hd{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=nb,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class l2 extends hd{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.referencePosition=new Me,this.nearDistance=1,this.farDistance=1e3,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.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}}const f$e=`void main() { gl_Position = vec4( position, 1.0 ); }`,p$e=`uniform sampler2D shadow_pass; uniform vec2 resolution; @@ -4879,7 +4879,7 @@ void main() { squared_mean = squared_mean / samples; float std_dev = sqrt( squared_mean - mean * mean ); gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); -}`;function m$e(n,e,t){let r=new o2;const s=new jt,o=new jt,l=new Ts,u=new NC({depthPacking:Nw}),h=new l2,f={},g=t.maxTextureSize,y={0:cd,1:p_,2:lp},b=new xd({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new jt},radius:{value:4}},vertexShader:f$e,fragmentShader:p$e}),w=b.clone();w.defines.HORIZONTAL_PASS=1;const C=new ui;C.setAttribute("position",new Do(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const M=new Hn(C,b),A=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=e2,this.render=function(D,z,U){if(A.enabled===!1||A.autoUpdate===!1&&A.needsUpdate===!1||D.length===0)return;const V=n.getRenderTarget(),H=n.getActiveCubeFace(),oe=n.getActiveMipmapLevel(),le=n.state;le.setBlending(pp),le.buffers.color.setClear(1,1,1,1),le.buffers.depth.setTest(!0),le.setScissorTest(!1);for(let Z=0,q=D.length;Zg||s.y>g)&&(s.x>g&&(o.x=Math.floor(g/ue.x),s.x=o.x*ue.x,ae.mapSize.x=o.x),s.y>g&&(o.y=Math.floor(g/ue.y),s.y=o.y*ue.y,ae.mapSize.y=o.y)),ae.map===null){const we=this.type!==E1?{minFilter:Wl,magFilter:Wl}:{};ae.map=new Nc(s.x,s.y,we),ae.map.texture.name=he.name+".shadowMap",ae.camera.updateProjectionMatrix()}n.setRenderTarget(ae.map),n.clear();const ge=ae.getViewportCount();for(let we=0;we0){const q=le.uuid,he=z.uuid;let ae=f[q];ae===void 0&&(ae={},f[q]=ae);let ue=ae[he];ue===void 0&&(ue=le.clone(),ae[he]=ue),le=ue}return le.visible=z.visible,le.wireframe=z.wireframe,oe===E1?le.side=z.shadowSide!==null?z.shadowSide:z.side:le.side=z.shadowSide!==null?z.shadowSide:y[z.side],le.alphaMap=z.alphaMap,le.alphaTest=z.alphaTest,le.clipShadows=z.clipShadows,le.clippingPlanes=z.clippingPlanes,le.clipIntersection=z.clipIntersection,le.displacementMap=z.displacementMap,le.displacementScale=z.displacementScale,le.displacementBias=z.displacementBias,le.wireframeLinewidth=z.wireframeLinewidth,le.linewidth=z.linewidth,U.isPointLight===!0&&le.isMeshDistanceMaterial===!0&&(le.referencePosition.setFromMatrixPosition(U.matrixWorld),le.nearDistance=V,le.farDistance=H),le}function P(D,z,U,V,H){if(D.visible===!1)return;if(D.layers.test(z.layers)&&(D.isMesh||D.isLine||D.isPoints)&&(D.castShadow||D.receiveShadow&&H===E1)&&(!D.frustumCulled||r.intersectsObject(D))){D.modelViewMatrix.multiplyMatrices(U.matrixWorldInverse,D.matrixWorld);const le=e.update(D),Z=D.material;if(Array.isArray(Z)){const q=le.groups;for(let he=0,ae=q.length;he=1):J.indexOf("OpenGL ES")!==-1&&(we=parseFloat(/^OpenGL ES (\d)/.exec(J)[1]),ge=we>=2);let re=null,ie={};const fe=n.getParameter(3088),Te=n.getParameter(2978),Fe=new Ts().fromArray(fe),Ie=new Ts().fromArray(Te);function Je(Ge,tn,_t){const Jt=new Uint8Array(4),Kt=n.createTexture();n.bindTexture(Ge,Kt),n.texParameteri(Ge,10241,9728),n.texParameteri(Ge,10240,9728);for(let On=0;On<_t;On++)n.texImage2D(tn+On,0,6408,1,1,0,6408,5121,Jt);return Kt}const Re={};Re[3553]=Je(3553,3553,1),Re[34067]=Je(34067,34069,6),u.setClear(0,0,0,1),h.setClear(1),f.setClear(0),Qe(2929),h.setFunc(vR),Nt(!1),kt(ZD),Qe(2884),rt(pp);function Qe(Ge){b[Ge]!==!0&&(n.enable(Ge),b[Ge]=!0)}function nt(Ge){b[Ge]!==!1&&(n.disable(Ge),b[Ge]=!1)}function ft(Ge,tn){return w[Ge]!==tn?(n.bindFramebuffer(Ge,tn),w[Ge]=tn,r&&(Ge===36009&&(w[36160]=tn),Ge===36160&&(w[36009]=tn)),!0):!1}function lt(Ge,tn){let _t=M,Jt=!1;if(Ge)if(_t=C.get(tn),_t===void 0&&(_t=[],C.set(tn,_t)),Ge.isWebGLMultipleRenderTargets){const Kt=Ge.texture;if(_t.length!==Kt.length||_t[0]!==36064){for(let On=0,ii=Kt.length;Onht||xe.height>ht)&&(St=ht/Math.max(xe.width,xe.height)),St<1||se===!0)if(typeof HTMLImageElement<"u"&&xe instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&xe instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&xe instanceof ImageBitmap){const It=se?SR:Math.floor,pt=It(St*xe.width),Ke=It(St*xe.height);M===void 0&&(M=L(pt,Ke));const Le=$e?L(pt,Ke):M;return Le.width=pt,Le.height=Ke,Le.getContext("2d").drawImage(xe,0,0,pt,Ke),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+xe.width+"x"+xe.height+") to ("+pt+"x"+Ke+")."),Le}else return"data"in xe&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+xe.width+"x"+xe.height+")."),xe;return xe}function D(xe){return $P(xe.width)&&$P(xe.height)}function z(xe){return u?!1:xe.wrapS!==ap||xe.wrapT!==ap||xe.minFilter!==Wl&&xe.minFilter!==wl}function U(xe,se){return xe.generateMipmaps&&se&&xe.minFilter!==Wl&&xe.minFilter!==wl}function V(xe){n.generateMipmap(xe)}function H(xe,se,$e,ht,St=!1){if(u===!1)return se;if(xe!==null){if(n[xe]!==void 0)return n[xe];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+xe+"'")}let It=se;return se===6403&&($e===5126&&(It=33326),$e===5131&&(It=33325),$e===5121&&(It=33321)),se===33319&&($e===5126&&(It=33328),$e===5131&&(It=33327),$e===5121&&(It=33323)),se===6408&&($e===5126&&(It=34836),$e===5131&&(It=34842),$e===5121&&(It=ht===ms&&St===!1?35907:32856),$e===32819&&(It=32854),$e===32820&&(It=32855)),(It===33325||It===33326||It===33327||It===33328||It===34842||It===34836)&&e.get("EXT_color_buffer_float"),It}function oe(xe,se,$e){return U(xe,$e)===!0||xe.isFramebufferTexture&&xe.minFilter!==Wl&&xe.minFilter!==wl?Math.log2(Math.max(se.width,se.height))+1:xe.mipmaps!==void 0&&xe.mipmaps.length>0?xe.mipmaps.length:xe.isCompressedTexture&&Array.isArray(xe.image)?se.mipmaps.length:1}function le(xe){return xe===Wl||xe===yR||xe===bR?9728:9729}function Z(xe){const se=xe.target;se.removeEventListener("dispose",Z),he(se),se.isVideoTexture&&C.delete(se)}function q(xe){const se=xe.target;se.removeEventListener("dispose",q),ue(se)}function he(xe){const se=r.get(xe);if(se.__webglInit===void 0)return;const $e=xe.source,ht=A.get($e);if(ht){const St=ht[se.__cacheKey];St.usedTimes--,St.usedTimes===0&&ae(xe),Object.keys(ht).length===0&&A.delete($e)}r.remove(xe)}function ae(xe){const se=r.get(xe);n.deleteTexture(se.__webglTexture);const $e=xe.source,ht=A.get($e);delete ht[se.__cacheKey],l.memory.textures--}function ue(xe){const se=xe.texture,$e=r.get(xe),ht=r.get(se);if(ht.__webglTexture!==void 0&&(n.deleteTexture(ht.__webglTexture),l.memory.textures--),xe.depthTexture&&xe.depthTexture.dispose(),xe.isWebGLCubeRenderTarget)for(let St=0;St<6;St++)n.deleteFramebuffer($e.__webglFramebuffer[St]),$e.__webglDepthbuffer&&n.deleteRenderbuffer($e.__webglDepthbuffer[St]);else{if(n.deleteFramebuffer($e.__webglFramebuffer),$e.__webglDepthbuffer&&n.deleteRenderbuffer($e.__webglDepthbuffer),$e.__webglMultisampledFramebuffer&&n.deleteFramebuffer($e.__webglMultisampledFramebuffer),$e.__webglColorRenderbuffer)for(let St=0;St<$e.__webglColorRenderbuffer.length;St++)$e.__webglColorRenderbuffer[St]&&n.deleteRenderbuffer($e.__webglColorRenderbuffer[St]);$e.__webglDepthRenderbuffer&&n.deleteRenderbuffer($e.__webglDepthRenderbuffer)}if(xe.isWebGLMultipleRenderTargets)for(let St=0,It=se.length;St=h&&console.warn("THREE.WebGLTextures: Trying to use "+xe+" texture units while this GPU supports only "+h),ge+=1,xe}function re(xe){const se=[];return se.push(xe.wrapS),se.push(xe.wrapT),se.push(xe.magFilter),se.push(xe.minFilter),se.push(xe.anisotropy),se.push(xe.internalFormat),se.push(xe.format),se.push(xe.type),se.push(xe.generateMipmaps),se.push(xe.premultiplyAlpha),se.push(xe.flipY),se.push(xe.unpackAlignment),se.push(xe.encoding),se.join()}function ie(xe,se){const $e=r.get(xe);if(xe.isVideoTexture&&At(xe),xe.isRenderTargetTexture===!1&&xe.version>0&&$e.__version!==xe.version){const ht=xe.image;if(ht===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(ht.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{nt($e,xe,se);return}}t.activeTexture(33984+se),t.bindTexture(3553,$e.__webglTexture)}function fe(xe,se){const $e=r.get(xe);if(xe.version>0&&$e.__version!==xe.version){nt($e,xe,se);return}t.activeTexture(33984+se),t.bindTexture(35866,$e.__webglTexture)}function Te(xe,se){const $e=r.get(xe);if(xe.version>0&&$e.__version!==xe.version){nt($e,xe,se);return}t.activeTexture(33984+se),t.bindTexture(32879,$e.__webglTexture)}function Fe(xe,se){const $e=r.get(xe);if(xe.version>0&&$e.__version!==xe.version){ft($e,xe,se);return}t.activeTexture(33984+se),t.bindTexture(34067,$e.__webglTexture)}const Ie={[Lw]:10497,[ap]:33071,[B$]:33648},Je={[Wl]:9728,[yR]:9984,[bR]:9986,[wl]:9729,[YF]:9985,[uT]:9987};function Re(xe,se,$e){if($e?(n.texParameteri(xe,10242,Ie[se.wrapS]),n.texParameteri(xe,10243,Ie[se.wrapT]),(xe===32879||xe===35866)&&n.texParameteri(xe,32882,Ie[se.wrapR]),n.texParameteri(xe,10240,Je[se.magFilter]),n.texParameteri(xe,10241,Je[se.minFilter])):(n.texParameteri(xe,10242,33071),n.texParameteri(xe,10243,33071),(xe===32879||xe===35866)&&n.texParameteri(xe,32882,33071),(se.wrapS!==ap||se.wrapT!==ap)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),n.texParameteri(xe,10240,le(se.magFilter)),n.texParameteri(xe,10241,le(se.minFilter)),se.minFilter!==Wl&&se.minFilter!==wl&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),e.has("EXT_texture_filter_anisotropic")===!0){const ht=e.get("EXT_texture_filter_anisotropic");if(se.type===r_&&e.has("OES_texture_float_linear")===!1||u===!1&&se.type===Q1&&e.has("OES_texture_half_float_linear")===!1)return;(se.anisotropy>1||r.get(se).__currentAnisotropy)&&(n.texParameterf(xe,ht.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(se.anisotropy,s.getMaxAnisotropy())),r.get(se).__currentAnisotropy=se.anisotropy)}}function Qe(xe,se){let $e=!1;xe.__webglInit===void 0&&(xe.__webglInit=!0,se.addEventListener("dispose",Z));const ht=se.source;let St=A.get(ht);St===void 0&&(St={},A.set(ht,St));const It=re(se);if(It!==xe.__cacheKey){St[It]===void 0&&(St[It]={texture:n.createTexture(),usedTimes:0},l.memory.textures++,$e=!0),St[It].usedTimes++;const pt=St[xe.__cacheKey];pt!==void 0&&(St[xe.__cacheKey].usedTimes--,pt.usedTimes===0&&ae(se)),xe.__cacheKey=It,xe.__webglTexture=St[It].texture}return $e}function nt(xe,se,$e){let ht=3553;se.isDataArrayTexture&&(ht=35866),se.isData3DTexture&&(ht=32879);const St=Qe(xe,se),It=se.source;if(t.activeTexture(33984+$e),t.bindTexture(ht,xe.__webglTexture),It.version!==It.__currentVersion||St===!0){n.pixelStorei(37440,se.flipY),n.pixelStorei(37441,se.premultiplyAlpha),n.pixelStorei(3317,se.unpackAlignment),n.pixelStorei(37443,0);const pt=z(se)&&D(se.image)===!1;let Ke=P(se.image,pt,!1,g);Ke=mt(se,Ke);const Le=D(Ke)||u,Q=o.convert(se.format,se.encoding);let te=o.convert(se.type),me=H(se.internalFormat,Q,te,se.encoding,se.isVideoTexture);Re(ht,se,Le);let ke;const Xe=se.mipmaps,Wt=u&&se.isVideoTexture!==!0,Ge=It.__currentVersion===void 0||St===!0,tn=oe(se,Ke,Le);if(se.isDepthTexture)me=6402,u?se.type===r_?me=36012:se.type===dv?me=33190:se.type===Py?me=35056:me=33189:se.type===r_&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),se.format===By&&me===6402&&se.type!==XF&&se.type!==dv&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),se.type=dv,te=o.convert(se.type)),se.format===Vy&&me===6402&&(me=34041,se.type!==Py&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),se.type=Py,te=o.convert(se.type))),Ge&&(Wt?t.texStorage2D(3553,1,me,Ke.width,Ke.height):t.texImage2D(3553,0,me,Ke.width,Ke.height,0,Q,te,null));else if(se.isDataTexture)if(Xe.length>0&&Le){Wt&&Ge&&t.texStorage2D(3553,tn,me,Xe[0].width,Xe[0].height);for(let _t=0,Jt=Xe.length;_t>=1,Jt>>=1}}else if(Xe.length>0&&Le){Wt&&Ge&&t.texStorage2D(3553,tn,me,Xe[0].width,Xe[0].height);for(let _t=0,Jt=Xe.length;_t0&&Ge++,t.texStorage2D(34067,Ge,ke,Ke[0].width,Ke[0].height));for(let _t=0;_t<6;_t++)if(pt){Xe?t.texSubImage2D(34069+_t,0,0,0,Ke[_t].width,Ke[_t].height,te,me,Ke[_t].data):t.texImage2D(34069+_t,0,ke,Ke[_t].width,Ke[_t].height,0,te,me,Ke[_t].data);for(let Jt=0;Jt0&&Mt(xe)===!1){const Ke=It?se:[se];$e.__webglMultisampledFramebuffer=n.createFramebuffer(),$e.__webglColorRenderbuffer=[],t.bindFramebuffer(36160,$e.__webglMultisampledFramebuffer);for(let Le=0;Le0&&Mt(xe)===!1){const se=xe.isWebGLMultipleRenderTargets?xe.texture:[xe.texture],$e=xe.width,ht=xe.height;let St=16384;const It=[],pt=xe.stencilBuffer?33306:36096,Ke=r.get(xe),Le=xe.isWebGLMultipleRenderTargets===!0;if(Le)for(let Q=0;Q0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&se.__useRenderToTexture!==!1}function At(xe){const se=l.render.frame;C.get(xe)!==se&&(C.set(xe,se),xe.update())}function mt(xe,se){const $e=xe.encoding,ht=xe.format,St=xe.type;return xe.isCompressedTexture===!0||xe.isVideoTexture===!0||xe.format===TR||$e!==xg&&($e===ms?u===!1?e.has("EXT_sRGB")===!0&&ht===jp?(xe.format=TR,xe.minFilter=wl,xe.generateMipmaps=!1):se=qF.sRGBToLinear(se):(ht!==jp||St!==af)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture encoding:",$e)),se}this.allocateTextureUnit=J,this.resetTextureUnits=we,this.setTexture2D=ie,this.setTexture2DArray=fe,this.setTexture3D=Te,this.setTextureCube=Fe,this.rebindTextures=rt,this.setupRenderTarget=it,this.updateRenderTargetMipmap=Nt,this.updateMultisampleRenderTarget=kt,this.setupDepthRenderbuffer=He,this.setupFrameBufferTexture=lt,this.useMultisampledRTT=Mt}function OQ(n,e,t){const r=t.isWebGL2;function s(o,l=null){let u;if(o===af)return 5121;if(o===iQ)return 32819;if(o===sQ)return 32820;if(o===tQ)return 5120;if(o===nQ)return 5122;if(o===XF)return 5123;if(o===rQ)return 5124;if(o===dv)return 5125;if(o===r_)return 5126;if(o===Q1)return r?5131:(u=e.get("OES_texture_half_float"),u!==null?u.HALF_FLOAT_OES:null);if(o===oQ)return 6406;if(o===jp)return 6408;if(o===lQ)return 6409;if(o===uQ)return 6410;if(o===By)return 6402;if(o===Vy)return 34041;if(o===cQ)return 6403;if(o===aQ)return console.warn("THREE.WebGLRenderer: THREE.RGBFormat has been removed. Use THREE.RGBAFormat instead. https://github.com/mrdoob/three.js/pull/23228"),6408;if(o===TR)return u=e.get("EXT_sRGB"),u!==null?u.SRGB_ALPHA_EXT:null;if(o===hQ)return 36244;if(o===dQ)return 33319;if(o===fQ)return 33320;if(o===pQ)return 36249;if(o===gI||o===_I||o===vI||o===yI)if(l===ms)if(u=e.get("WEBGL_compressed_texture_s3tc_srgb"),u!==null){if(o===gI)return u.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(o===_I)return u.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(o===vI)return u.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(o===yI)return u.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(u=e.get("WEBGL_compressed_texture_s3tc"),u!==null){if(o===gI)return u.COMPRESSED_RGB_S3TC_DXT1_EXT;if(o===_I)return u.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(o===vI)return u.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(o===yI)return u.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(o===iP||o===sP||o===oP||o===aP)if(u=e.get("WEBGL_compressed_texture_pvrtc"),u!==null){if(o===iP)return u.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(o===sP)return u.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(o===oP)return u.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(o===aP)return u.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(o===mQ)return u=e.get("WEBGL_compressed_texture_etc1"),u!==null?u.COMPRESSED_RGB_ETC1_WEBGL:null;if(o===lP||o===uP)if(u=e.get("WEBGL_compressed_texture_etc"),u!==null){if(o===lP)return l===ms?u.COMPRESSED_SRGB8_ETC2:u.COMPRESSED_RGB8_ETC2;if(o===uP)return l===ms?u.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:u.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(o===cP||o===hP||o===dP||o===fP||o===pP||o===mP||o===gP||o===_P||o===vP||o===yP||o===bP||o===TP||o===SP||o===wP)if(u=e.get("WEBGL_compressed_texture_astc"),u!==null){if(o===cP)return l===ms?u.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:u.COMPRESSED_RGBA_ASTC_4x4_KHR;if(o===hP)return l===ms?u.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:u.COMPRESSED_RGBA_ASTC_5x4_KHR;if(o===dP)return l===ms?u.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:u.COMPRESSED_RGBA_ASTC_5x5_KHR;if(o===fP)return l===ms?u.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:u.COMPRESSED_RGBA_ASTC_6x5_KHR;if(o===pP)return l===ms?u.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:u.COMPRESSED_RGBA_ASTC_6x6_KHR;if(o===mP)return l===ms?u.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:u.COMPRESSED_RGBA_ASTC_8x5_KHR;if(o===gP)return l===ms?u.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:u.COMPRESSED_RGBA_ASTC_8x6_KHR;if(o===_P)return l===ms?u.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:u.COMPRESSED_RGBA_ASTC_8x8_KHR;if(o===vP)return l===ms?u.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:u.COMPRESSED_RGBA_ASTC_10x5_KHR;if(o===yP)return l===ms?u.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:u.COMPRESSED_RGBA_ASTC_10x6_KHR;if(o===bP)return l===ms?u.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:u.COMPRESSED_RGBA_ASTC_10x8_KHR;if(o===TP)return l===ms?u.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:u.COMPRESSED_RGBA_ASTC_10x10_KHR;if(o===SP)return l===ms?u.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:u.COMPRESSED_RGBA_ASTC_12x10_KHR;if(o===wP)return l===ms?u.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:u.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(o===EP)if(u=e.get("EXT_texture_compression_bptc"),u!==null){if(o===EP)return l===ms?u.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:u.COMPRESSED_RGBA_BPTC_UNORM_EXT}else return null;return o===Py?r?34042:(u=e.get("WEBGL_depth_texture"),u!==null?u.UNSIGNED_INT_24_8_WEBGL:null):n[o]!==void 0?n[o]:null}return{convert:s}}class LQ extends Za{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class ew extends ro{constructor(){super(),this.isGroup=!0,this.type="Group"}}const v$e={type:"move"};class FL{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new ew,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new ew,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new Ae,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new Ae),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new ew,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new Ae,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new Ae),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,r){let s=null,o=null,l=null;const u=this._targetRay,h=this._grip,f=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(f&&e.hand){l=!0;for(const M of e.hand.values()){const A=t.getJointPose(M,r);if(f.joints[M.jointName]===void 0){const L=new ew;L.matrixAutoUpdate=!1,L.visible=!1,f.joints[M.jointName]=L,f.add(L)}const k=f.joints[M.jointName];A!==null&&(k.matrix.fromArray(A.transform.matrix),k.matrix.decompose(k.position,k.rotation,k.scale),k.jointRadius=A.radius),k.visible=A!==null}const g=f.joints["index-finger-tip"],y=f.joints["thumb-tip"],b=g.position.distanceTo(y.position),w=.02,C=.005;f.inputState.pinching&&b>w+C?(f.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!f.inputState.pinching&&b<=w-C&&(f.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else h!==null&&e.gripSpace&&(o=t.getPose(e.gripSpace,r),o!==null&&(h.matrix.fromArray(o.transform.matrix),h.matrix.decompose(h.position,h.rotation,h.scale),o.linearVelocity?(h.hasLinearVelocity=!0,h.linearVelocity.copy(o.linearVelocity)):h.hasLinearVelocity=!1,o.angularVelocity?(h.hasAngularVelocity=!0,h.angularVelocity.copy(o.angularVelocity)):h.hasAngularVelocity=!1));u!==null&&(s=t.getPose(e.targetRaySpace,r),s===null&&o!==null&&(s=o),s!==null&&(u.matrix.fromArray(s.transform.matrix),u.matrix.decompose(u.position,u.rotation,u.scale),s.linearVelocity?(u.hasLinearVelocity=!0,u.linearVelocity.copy(s.linearVelocity)):u.hasLinearVelocity=!1,s.angularVelocity?(u.hasAngularVelocity=!0,u.angularVelocity.copy(s.angularVelocity)):u.hasAngularVelocity=!1,this.dispatchEvent(v$e)))}return u!==null&&(u.visible=s!==null),h!==null&&(h.visible=o!==null),f!==null&&(f.visible=l!==null),this}}class t4 extends dc{constructor(e,t,r,s,o,l,u,h,f,g){if(g=g!==void 0?g:By,g!==By&&g!==Vy)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");r===void 0&&g===By&&(r=dv),r===void 0&&g===Vy&&(r=Py),super(null,s,o,l,u,h,g,r,f),this.isDepthTexture=!0,this.image={width:e,height:t},this.magFilter=u!==void 0?u:Wl,this.minFilter=h!==void 0?h:Wl,this.flipY=!1,this.generateMipmaps=!1}}class y$e extends jm{constructor(e,t){super();const r=this;let s=null,o=1,l=null,u="local-floor",h=null,f=null,g=null,y=null,b=null,w=null;const C=t.getContextAttributes();let M=null,A=null;const k=[],L=[],P=new Za;P.layers.enable(1),P.viewport=new Ts;const D=new Za;D.layers.enable(2),D.viewport=new Ts;const z=[P,D],U=new LQ;U.layers.enable(1),U.layers.enable(2);let V=null,H=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(re){let ie=k[re];return ie===void 0&&(ie=new FL,k[re]=ie),ie.getTargetRaySpace()},this.getControllerGrip=function(re){let ie=k[re];return ie===void 0&&(ie=new FL,k[re]=ie),ie.getGripSpace()},this.getHand=function(re){let ie=k[re];return ie===void 0&&(ie=new FL,k[re]=ie),ie.getHandSpace()};function oe(re){const ie=L.indexOf(re.inputSource);if(ie===-1)return;const fe=k[ie];fe!==void 0&&fe.dispatchEvent({type:re.type,data:re.inputSource})}function le(){s.removeEventListener("select",oe),s.removeEventListener("selectstart",oe),s.removeEventListener("selectend",oe),s.removeEventListener("squeeze",oe),s.removeEventListener("squeezestart",oe),s.removeEventListener("squeezeend",oe),s.removeEventListener("end",le),s.removeEventListener("inputsourceschange",Z);for(let re=0;re=0&&(L[Te]=null,k[Te].dispatchEvent({type:"disconnected",data:fe}))}for(let ie=0;ie=L.length){L.push(fe),Te=Ie;break}else if(L[Ie]===null){L[Ie]=fe,Te=Ie;break}if(Te===-1)break}const Fe=k[Te];Fe&&Fe.dispatchEvent({type:"connected",data:fe})}}const q=new Ae,he=new Ae;function ae(re,ie,fe){q.setFromMatrixPosition(ie.matrixWorld),he.setFromMatrixPosition(fe.matrixWorld);const Te=q.distanceTo(he),Fe=ie.projectionMatrix.elements,Ie=fe.projectionMatrix.elements,Je=Fe[14]/(Fe[10]-1),Re=Fe[14]/(Fe[10]+1),Qe=(Fe[9]+1)/Fe[5],nt=(Fe[9]-1)/Fe[5],ft=(Fe[8]-1)/Fe[0],lt=(Ie[8]+1)/Ie[0],ze=Je*ft,Ce=Je*lt,He=Te/(-ft+lt),rt=He*-ft;ie.matrixWorld.decompose(re.position,re.quaternion,re.scale),re.translateX(rt),re.translateZ(He),re.matrixWorld.compose(re.position,re.quaternion,re.scale),re.matrixWorldInverse.copy(re.matrixWorld).invert();const it=Je+He,Nt=Re+He,kt=ze-rt,vt=Ce+(Te-rt),Mt=Qe*Re/Nt*it,At=nt*Re/Nt*it;re.projectionMatrix.makePerspective(kt,vt,Mt,At,it,Nt)}function ue(re,ie){ie===null?re.matrixWorld.copy(re.matrix):re.matrixWorld.multiplyMatrices(ie.matrixWorld,re.matrix),re.matrixWorldInverse.copy(re.matrixWorld).invert()}this.updateCamera=function(re){if(s===null)return;U.near=D.near=P.near=re.near,U.far=D.far=P.far=re.far,(V!==U.near||H!==U.far)&&(s.updateRenderState({depthNear:U.near,depthFar:U.far}),V=U.near,H=U.far);const ie=re.parent,fe=U.cameras;ue(U,ie);for(let Fe=0;Fe0&&(M.alphaTest.value=A.alphaTest);const k=e.get(A).envMap;if(k&&(M.envMap.value=k,M.flipEnvMap.value=k.isCubeTexture&&k.isRenderTargetTexture===!1?-1:1,M.reflectivity.value=A.reflectivity,M.ior.value=A.ior,M.refractionRatio.value=A.refractionRatio),A.lightMap){M.lightMap.value=A.lightMap;const D=n.physicallyCorrectLights!==!0?Math.PI:1;M.lightMapIntensity.value=A.lightMapIntensity*D}A.aoMap&&(M.aoMap.value=A.aoMap,M.aoMapIntensity.value=A.aoMapIntensity);let L;A.map?L=A.map:A.specularMap?L=A.specularMap:A.displacementMap?L=A.displacementMap:A.normalMap?L=A.normalMap:A.bumpMap?L=A.bumpMap:A.roughnessMap?L=A.roughnessMap:A.metalnessMap?L=A.metalnessMap:A.alphaMap?L=A.alphaMap:A.emissiveMap?L=A.emissiveMap:A.clearcoatMap?L=A.clearcoatMap:A.clearcoatNormalMap?L=A.clearcoatNormalMap:A.clearcoatRoughnessMap?L=A.clearcoatRoughnessMap:A.iridescenceMap?L=A.iridescenceMap:A.iridescenceThicknessMap?L=A.iridescenceThicknessMap:A.specularIntensityMap?L=A.specularIntensityMap:A.specularColorMap?L=A.specularColorMap:A.transmissionMap?L=A.transmissionMap:A.thicknessMap?L=A.thicknessMap:A.sheenColorMap?L=A.sheenColorMap:A.sheenRoughnessMap&&(L=A.sheenRoughnessMap),L!==void 0&&(L.isWebGLRenderTarget&&(L=L.texture),L.matrixAutoUpdate===!0&&L.updateMatrix(),M.uvTransform.value.copy(L.matrix));let P;A.aoMap?P=A.aoMap:A.lightMap&&(P=A.lightMap),P!==void 0&&(P.isWebGLRenderTarget&&(P=P.texture),P.matrixAutoUpdate===!0&&P.updateMatrix(),M.uv2Transform.value.copy(P.matrix))}function o(M,A){M.diffuse.value.copy(A.color),M.opacity.value=A.opacity}function l(M,A){M.dashSize.value=A.dashSize,M.totalSize.value=A.dashSize+A.gapSize,M.scale.value=A.scale}function u(M,A,k,L){M.diffuse.value.copy(A.color),M.opacity.value=A.opacity,M.size.value=A.size*k,M.scale.value=L*.5,A.map&&(M.map.value=A.map),A.alphaMap&&(M.alphaMap.value=A.alphaMap),A.alphaTest>0&&(M.alphaTest.value=A.alphaTest);let P;A.map?P=A.map:A.alphaMap&&(P=A.alphaMap),P!==void 0&&(P.matrixAutoUpdate===!0&&P.updateMatrix(),M.uvTransform.value.copy(P.matrix))}function h(M,A){M.diffuse.value.copy(A.color),M.opacity.value=A.opacity,M.rotation.value=A.rotation,A.map&&(M.map.value=A.map),A.alphaMap&&(M.alphaMap.value=A.alphaMap),A.alphaTest>0&&(M.alphaTest.value=A.alphaTest);let k;A.map?k=A.map:A.alphaMap&&(k=A.alphaMap),k!==void 0&&(k.matrixAutoUpdate===!0&&k.updateMatrix(),M.uvTransform.value.copy(k.matrix))}function f(M,A){M.specular.value.copy(A.specular),M.shininess.value=Math.max(A.shininess,1e-4)}function g(M,A){A.gradientMap&&(M.gradientMap.value=A.gradientMap)}function y(M,A){M.roughness.value=A.roughness,M.metalness.value=A.metalness,A.roughnessMap&&(M.roughnessMap.value=A.roughnessMap),A.metalnessMap&&(M.metalnessMap.value=A.metalnessMap),e.get(A).envMap&&(M.envMapIntensity.value=A.envMapIntensity)}function b(M,A,k){M.ior.value=A.ior,A.sheen>0&&(M.sheenColor.value.copy(A.sheenColor).multiplyScalar(A.sheen),M.sheenRoughness.value=A.sheenRoughness,A.sheenColorMap&&(M.sheenColorMap.value=A.sheenColorMap),A.sheenRoughnessMap&&(M.sheenRoughnessMap.value=A.sheenRoughnessMap)),A.clearcoat>0&&(M.clearcoat.value=A.clearcoat,M.clearcoatRoughness.value=A.clearcoatRoughness,A.clearcoatMap&&(M.clearcoatMap.value=A.clearcoatMap),A.clearcoatRoughnessMap&&(M.clearcoatRoughnessMap.value=A.clearcoatRoughnessMap),A.clearcoatNormalMap&&(M.clearcoatNormalScale.value.copy(A.clearcoatNormalScale),M.clearcoatNormalMap.value=A.clearcoatNormalMap,A.side===cd&&M.clearcoatNormalScale.value.negate())),A.iridescence>0&&(M.iridescence.value=A.iridescence,M.iridescenceIOR.value=A.iridescenceIOR,M.iridescenceThicknessMinimum.value=A.iridescenceThicknessRange[0],M.iridescenceThicknessMaximum.value=A.iridescenceThicknessRange[1],A.iridescenceMap&&(M.iridescenceMap.value=A.iridescenceMap),A.iridescenceThicknessMap&&(M.iridescenceThicknessMap.value=A.iridescenceThicknessMap)),A.transmission>0&&(M.transmission.value=A.transmission,M.transmissionSamplerMap.value=k.texture,M.transmissionSamplerSize.value.set(k.width,k.height),A.transmissionMap&&(M.transmissionMap.value=A.transmissionMap),M.thickness.value=A.thickness,A.thicknessMap&&(M.thicknessMap.value=A.thicknessMap),M.attenuationDistance.value=A.attenuationDistance,M.attenuationColor.value.copy(A.attenuationColor)),M.specularIntensity.value=A.specularIntensity,M.specularColor.value.copy(A.specularColor),A.specularIntensityMap&&(M.specularIntensityMap.value=A.specularIntensityMap),A.specularColorMap&&(M.specularColorMap.value=A.specularColorMap)}function w(M,A){A.matcap&&(M.matcap.value=A.matcap)}function C(M,A){M.referencePosition.value.copy(A.referencePosition),M.nearDistance.value=A.nearDistance,M.farDistance.value=A.farDistance}return{refreshFogUniforms:t,refreshMaterialUniforms:r}}function T$e(n,e,t,r){let s={},o={},l=[];const u=t.isWebGL2?n.getParameter(35375):0;function h(L,P){const D=P.program;r.uniformBlockBinding(L,D)}function f(L,P){let D=s[L.id];D===void 0&&(C(L),D=g(L),s[L.id]=D,L.addEventListener("dispose",A));const z=P.program;r.updateUBOMapping(L,z);const U=e.render.frame;o[L.id]!==U&&(b(L),o[L.id]=U)}function g(L){const P=y();L.__bindingPointIndex=P;const D=n.createBuffer(),z=L.__size,U=L.usage;return n.bindBuffer(35345,D),n.bufferData(35345,z,U),n.bindBuffer(35345,null),n.bindBufferBase(35345,P,D),D}function y(){for(let L=0;L0){U=D%z;const Z=z-U;U!==0&&Z-le.boundary<0&&(D+=z-U,oe.__offset=D)}D+=le.storage}return U=D%z,U>0&&(D+=z-U),L.__size=D,L.__cache={},this}function M(L){const P=L.value,D={boundary:0,storage:0};return typeof P=="number"?(D.boundary=4,D.storage=4):P.isVector2?(D.boundary=8,D.storage=8):P.isVector3||P.isColor?(D.boundary=16,D.storage=12):P.isVector4?(D.boundary=16,D.storage=16):P.isMatrix3?(D.boundary=48,D.storage=48):P.isMatrix4?(D.boundary=64,D.storage=64):P.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",P),D}function A(L){const P=L.target;P.removeEventListener("dispose",A);const D=l.indexOf(P.__bindingPointIndex);l.splice(D,1),n.deleteBuffer(s[P.id]),delete s[P.id],delete o[P.id]}function k(){for(const L in s)n.deleteBuffer(s[L]);l=[],s={},o={}}return{bind:h,update:f,dispose:k}}function S$e(){const n=W$("canvas");return n.style.display="block",n}function n4(n={}){this.isWebGLRenderer=!0;const e=n.canvas!==void 0?n.canvas:S$e(),t=n.context!==void 0?n.context:null,r=n.depth!==void 0?n.depth:!0,s=n.stencil!==void 0?n.stencil:!0,o=n.antialias!==void 0?n.antialias:!1,l=n.premultipliedAlpha!==void 0?n.premultipliedAlpha:!0,u=n.preserveDrawingBuffer!==void 0?n.preserveDrawingBuffer:!1,h=n.powerPreference!==void 0?n.powerPreference:"default",f=n.failIfMajorPerformanceCaveat!==void 0?n.failIfMajorPerformanceCaveat:!1;let g;t!==null?g=t.getContextAttributes().alpha:g=n.alpha!==void 0?n.alpha:!1;let y=null,b=null;const w=[],C=[];this.domElement=e,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=xg,this.physicallyCorrectLights=!1,this.toneMapping=l0,this.toneMappingExposure=1,Object.defineProperties(this,{gammaFactor:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaFactor has been removed."),2},set:function(){console.warn("THREE.WebGLRenderer: .gammaFactor has been removed.")}}});const M=this;let A=!1,k=0,L=0,P=null,D=-1,z=null;const U=new Ts,V=new Ts;let H=null,oe=e.width,le=e.height,Z=1,q=null,he=null;const ae=new Ts(0,0,oe,le),ue=new Ts(0,0,oe,le);let ge=!1;const we=new o2;let J=!1,re=!1,ie=null;const fe=new Qr,Te=new jt,Fe=new Ae,Ie={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function Je(){return P===null?Z:1}let Re=t;function Qe(Pe,gt){for(let Ct=0;Ct0?b=C[C.length-1]:b=null,w.pop(),w.length>0?y=w[w.length-1]:y=null};function Ei(Pe,gt,Ct,bt){if(Pe.visible===!1)return;if(Pe.layers.test(gt.layers)){if(Pe.isGroup)Ct=Pe.renderOrder;else if(Pe.isLOD)Pe.autoUpdate===!0&&Pe.update(gt);else if(Pe.isLight)b.pushLight(Pe),Pe.castShadow&&b.pushShadow(Pe);else if(Pe.isSprite){if(!Pe.frustumCulled||we.intersectsSprite(Pe)){bt&&Fe.setFromMatrixPosition(Pe.matrixWorld).applyMatrix4(fe);const Wn=vt.update(Pe),rr=Pe.material;rr.visible&&y.push(Pe,Wn,rr,Ct,Fe.z,null)}}else if((Pe.isMesh||Pe.isLine||Pe.isPoints)&&(Pe.isSkinnedMesh&&Pe.skeleton.frame!==ze.render.frame&&(Pe.skeleton.update(),Pe.skeleton.frame=ze.render.frame),!Pe.frustumCulled||we.intersectsObject(Pe))){bt&&Fe.setFromMatrixPosition(Pe.matrixWorld).applyMatrix4(fe);const Wn=vt.update(Pe),rr=Pe.material;if(Array.isArray(rr)){const _r=Wn.groups;for(let $r=0,si=_r.length;$r0&&mr(Vt,gt,Ct),bt&<.viewport(U.copy(bt)),Vt.length>0&&ne(Vt,gt,Ct),Wn.length>0&&ne(Wn,gt,Ct),rr.length>0&&ne(rr,gt,Ct),lt.buffers.depth.setTest(!0),lt.buffers.depth.setMask(!0),lt.buffers.color.setMask(!0),lt.setPolygonOffset(!1)}function mr(Pe,gt,Ct){const bt=ft.isWebGL2;ie===null&&(ie=new Nc(1,1,{generateMipmaps:!0,type:nt.has("EXT_color_buffer_half_float")?Q1:af,minFilter:uT,samples:bt&&o===!0?4:0})),M.getDrawingBufferSize(Te),bt?ie.setSize(Te.x,Te.y):ie.setSize(SR(Te.x),SR(Te.y));const Vt=M.getRenderTarget();M.setRenderTarget(ie),M.clear();const Wn=M.toneMapping;M.toneMapping=l0,ne(Pe,gt,Ct),M.toneMapping=Wn,He.updateMultisampleRenderTarget(ie),He.updateRenderTargetMipmap(ie),M.setRenderTarget(Vt)}function ne(Pe,gt,Ct){const bt=gt.isScene===!0?gt.overrideMaterial:null;for(let Vt=0,Wn=Pe.length;Vt0&&He.useMultisampledRTT(Pe)===!1?Vt=Ce.get(Pe).__webglMultisampledFramebuffer:Vt=$r,U.copy(Pe.viewport),V.copy(Pe.scissor),H=Pe.scissorTest}else U.copy(ae).multiplyScalar(Z).floor(),V.copy(ue).multiplyScalar(Z).floor(),H=ge;if(lt.bindFramebuffer(36160,Vt)&&ft.drawBuffers&&bt&<.drawBuffers(Pe,Vt),lt.viewport(U),lt.scissor(V),lt.setScissorTest(H),Wn){const _r=Ce.get(Pe.texture);Re.framebufferTexture2D(36160,36064,34069+gt,_r.__webglTexture,Ct)}else if(rr){const _r=Ce.get(Pe.texture),$r=gt||0;Re.framebufferTextureLayer(36160,36064,_r.__webglTexture,Ct||0,$r)}D=-1},this.readRenderTargetPixels=function(Pe,gt,Ct,bt,Vt,Wn,rr){if(!(Pe&&Pe.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let _r=Ce.get(Pe).__webglFramebuffer;if(Pe.isWebGLCubeRenderTarget&&rr!==void 0&&(_r=_r[rr]),_r){lt.bindFramebuffer(36160,_r);try{const $r=Pe.texture,si=$r.format,Br=$r.type;if(si!==jp&&Ke.convert(si)!==Re.getParameter(35739)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const Yr=Br===Q1&&(nt.has("EXT_color_buffer_half_float")||ft.isWebGL2&&nt.has("EXT_color_buffer_float"));if(Br!==af&&Ke.convert(Br)!==Re.getParameter(35738)&&!(Br===r_&&(ft.isWebGL2||nt.has("OES_texture_float")||nt.has("WEBGL_color_buffer_float")))&&!Yr){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}gt>=0&><=Pe.width-bt&&Ct>=0&&Ct<=Pe.height-Vt&&Re.readPixels(gt,Ct,bt,Vt,Ke.convert(si),Ke.convert(Br),Wn)}finally{const $r=P!==null?Ce.get(P).__webglFramebuffer:null;lt.bindFramebuffer(36160,$r)}}},this.copyFramebufferToTexture=function(Pe,gt,Ct=0){const bt=Math.pow(2,-Ct),Vt=Math.floor(gt.image.width*bt),Wn=Math.floor(gt.image.height*bt);He.setTexture2D(gt,0),Re.copyTexSubImage2D(3553,Ct,0,0,Pe.x,Pe.y,Vt,Wn),lt.unbindTexture()},this.copyTextureToTexture=function(Pe,gt,Ct,bt=0){const Vt=gt.image.width,Wn=gt.image.height,rr=Ke.convert(Ct.format),_r=Ke.convert(Ct.type);He.setTexture2D(Ct,0),Re.pixelStorei(37440,Ct.flipY),Re.pixelStorei(37441,Ct.premultiplyAlpha),Re.pixelStorei(3317,Ct.unpackAlignment),gt.isDataTexture?Re.texSubImage2D(3553,bt,Pe.x,Pe.y,Vt,Wn,rr,_r,gt.image.data):gt.isCompressedTexture?Re.compressedTexSubImage2D(3553,bt,Pe.x,Pe.y,gt.mipmaps[0].width,gt.mipmaps[0].height,rr,gt.mipmaps[0].data):Re.texSubImage2D(3553,bt,Pe.x,Pe.y,rr,_r,gt.image),bt===0&&Ct.generateMipmaps&&Re.generateMipmap(3553),lt.unbindTexture()},this.copyTextureToTexture3D=function(Pe,gt,Ct,bt,Vt=0){if(M.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const Wn=Pe.max.x-Pe.min.x+1,rr=Pe.max.y-Pe.min.y+1,_r=Pe.max.z-Pe.min.z+1,$r=Ke.convert(bt.format),si=Ke.convert(bt.type);let Br;if(bt.isData3DTexture)He.setTexture3D(bt,0),Br=32879;else if(bt.isDataArrayTexture)He.setTexture2DArray(bt,0),Br=35866;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}Re.pixelStorei(37440,bt.flipY),Re.pixelStorei(37441,bt.premultiplyAlpha),Re.pixelStorei(3317,bt.unpackAlignment);const Yr=Re.getParameter(3314),Ss=Re.getParameter(32878),Oa=Re.getParameter(3316),Eo=Re.getParameter(3315),Yl=Re.getParameter(32877),nn=Ct.isCompressedTexture?Ct.mipmaps[0]:Ct.image;Re.pixelStorei(3314,nn.width),Re.pixelStorei(32878,nn.height),Re.pixelStorei(3316,Pe.min.x),Re.pixelStorei(3315,Pe.min.y),Re.pixelStorei(32877,Pe.min.z),Ct.isDataTexture||Ct.isData3DTexture?Re.texSubImage3D(Br,Vt,gt.x,gt.y,gt.z,Wn,rr,_r,$r,si,nn.data):Ct.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),Re.compressedTexSubImage3D(Br,Vt,gt.x,gt.y,gt.z,Wn,rr,_r,$r,nn.data)):Re.texSubImage3D(Br,Vt,gt.x,gt.y,gt.z,Wn,rr,_r,$r,si,nn),Re.pixelStorei(3314,Yr),Re.pixelStorei(32878,Ss),Re.pixelStorei(3316,Oa),Re.pixelStorei(3315,Eo),Re.pixelStorei(32877,Yl),Vt===0&&bt.generateMipmaps&&Re.generateMipmap(Br),lt.unbindTexture()},this.initTexture=function(Pe){Pe.isCubeTexture?He.setTextureCube(Pe,0):Pe.isData3DTexture?He.setTexture3D(Pe,0):Pe.isDataArrayTexture?He.setTexture2DArray(Pe,0):He.setTexture2D(Pe,0),lt.unbindTexture()},this.resetState=function(){k=0,L=0,P=null,lt.reset(),Le.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}class NQ extends n4{}NQ.prototype.isWebGL1Renderer=!0;class u2{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new Fn(e),this.density=t}clone(){return new u2(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}class c2{constructor(e,t=1,r=1e3){this.isFog=!0,this.name="",this.color=new Fn(e),this.near=t,this.far=r}clone(){return new c2(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}class V$ extends ro{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),t}}class h2{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=H$,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=Pm()}onUploadCallback(){}set needsUpdate(e){e===!0&&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,r){e*=this.stride,r*=t.stride;for(let s=0,o=this.stride;se.far||t.push({distance:h,point:cx.clone(),uv:Im.getUV(cx,lA,dx,uA,KG,zL,JG,new jt),face:null,object:this})}copy(e,t){return super.copy(e,t),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}function cA(n,e,t,r,s,o){RS.subVectors(n,t).addScalar(.5).multiply(r),s!==void 0?(hx.x=o*RS.x-s*RS.y,hx.y=s*RS.x+o*RS.y):hx.copy(RS),n.copy(e),n.x+=hx.x,n.y+=hx.y,n.applyMatrix4(DQ)}const hA=new Ae,qG=new Ae;class BQ extends ro{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 r=0,s=t.length;r0){let r,s;for(r=1,s=t.length;r0){hA.setFromMatrixPosition(this.matrixWorld);const r=e.ray.origin.distanceTo(hA);this.getObjectForDistance(r).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){hA.setFromMatrixPosition(e.matrixWorld),qG.setFromMatrixPosition(this.matrixWorld);const r=hA.distanceTo(qG)/e.zoom;t[0].object.visible=!0;let s,o;for(s=1,o=t.length;s=t[s].distance;s++)t[s-1].object.visible=!1,t[s].object.visible=!0;for(this._currentLevel=s-1;sh)continue;b.applyMatrix4(this.matrixWorld);const U=e.ray.origin.distanceTo(b);Ue.far||t.push({distance:U,point:y.clone().applyMatrix4(this.matrixWorld),index:L,face:null,faceIndex:null,object:this})}}else{const A=Math.max(0,l.start),k=Math.min(M.count,l.start+l.count);for(let L=A,P=k-1;Lh)continue;b.applyMatrix4(this.matrixWorld);const D=e.ray.origin.distanceTo(b);De.far||t.push({distance:D,point:y.clone().applyMatrix4(this.matrixWorld),index:L,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){const r=e[t[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;s0){const r=e[t[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;ss.far)return;o.push({distance:f,distanceToRay:Math.sqrt(u),point:h,index:e,face:null,object:l})}}class x$e extends dc{constructor(e,t,r,s,o,l,u,h,f){super(e,t,r,s,o,l,u,h,f),this.isVideoTexture=!0,this.minFilter=l!==void 0?l:wl,this.magFilter=o!==void 0?o:wl,this.generateMipmaps=!1;const g=this;function y(){g.needsUpdate=!0,e.requestVideoFrameCallback(y)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(y)}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;!("requestVideoFrameCallback"in e)&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class $$e extends dc{constructor(e,t,r){super({width:e,height:t}),this.isFramebufferTexture=!0,this.format=r,this.magFilter=Wl,this.minFilter=Wl,this.generateMipmaps=!1,this.needsUpdate=!0}}class GQ extends dc{constructor(e,t,r,s,o,l,u,h,f,g,y,b){super(null,l,u,h,f,g,s,o,y,b),this.isCompressedTexture=!0,this.image={width:t,height:r},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class C$e extends dc{constructor(e,t,r,s,o,l,u,h,f){super(e,t,r,s,o,l,u,h,f),this.isCanvasTexture=!0,this.needsUpdate=!0}}class p0{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){const r=this.getUtoTmapping(e);return this.getPoint(r,t)}getPoints(e=5){const t=[];for(let r=0;r<=e;r++)t.push(this.getPoint(r/e));return t}getSpacedPoints(e=5){const t=[];for(let r=0;r<=e;r++)t.push(this.getPointAt(r/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 r,s=this.getPoint(0),o=0;t.push(0);for(let l=1;l<=e;l++)r=this.getPoint(l/e),o+=r.distanceTo(s),t.push(o),s=r;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){const r=this.getLengths();let s=0;const o=r.length;let l;t?l=t:l=e*r[o-1];let u=0,h=o-1,f;for(;u<=h;)if(s=Math.floor(u+(h-u)/2),f=r[s]-l,f<0)u=s+1;else if(f>0)h=s-1;else{h=s;break}if(s=h,r[s]===l)return s/(o-1);const g=r[s],y=r[s+1]-g,b=(l-g)/y;return(s+b)/(o-1)}getTangent(e,t){let r=e-1e-4,s=e+1e-4;r<0&&(r=0),s>1&&(s=1);const o=this.getPoint(r),l=this.getPoint(s),u=t||(o.isVector2?new jt:new Ae);return u.copy(l).sub(o).normalize(),u}getTangentAt(e,t){const r=this.getUtoTmapping(e);return this.getTangent(r,t)}computeFrenetFrames(e,t){const r=new Ae,s=[],o=[],l=[],u=new Ae,h=new Qr;for(let w=0;w<=e;w++){const C=w/e;s[w]=this.getTangentAt(C,new Ae)}o[0]=new Ae,l[0]=new Ae;let f=Number.MAX_VALUE;const g=Math.abs(s[0].x),y=Math.abs(s[0].y),b=Math.abs(s[0].z);g<=f&&(f=g,r.set(1,0,0)),y<=f&&(f=y,r.set(0,1,0)),b<=f&&r.set(0,0,1),u.crossVectors(s[0],r).normalize(),o[0].crossVectors(s[0],u),l[0].crossVectors(s[0],o[0]);for(let w=1;w<=e;w++){if(o[w]=o[w-1].clone(),l[w]=l[w-1].clone(),u.crossVectors(s[w-1],s[w]),u.length()>Number.EPSILON){u.normalize();const C=Math.acos(hh(s[w-1].dot(s[w]),-1,1));o[w].applyMatrix4(h.makeRotationAxis(u,C))}l[w].crossVectors(s[w],o[w])}if(t===!0){let w=Math.acos(hh(o[0].dot(o[e]),-1,1));w/=e,s[0].dot(u.crossVectors(o[0],o[e]))>0&&(w=-w);for(let C=1;C<=e;C++)o[C].applyMatrix4(h.makeRotationAxis(s[C],w*C)),l[C].crossVectors(s[C],o[C])}return{tangents:s,normals:o,binormals:l}}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 p2 extends p0{constructor(e=0,t=0,r=1,s=1,o=0,l=Math.PI*2,u=!1,h=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=r,this.yRadius=s,this.aStartAngle=o,this.aEndAngle=l,this.aClockwise=u,this.aRotation=h}getPoint(e,t){const r=t||new jt,s=Math.PI*2;let o=this.aEndAngle-this.aStartAngle;const l=Math.abs(o)s;)o-=s;o0?0:(Math.floor(Math.abs(u)/o)+1)*o:h===0&&u===o-1&&(u=o-2,h=1);let f,g;this.closed||u>0?f=s[(u-1)%o]:(gA.subVectors(s[0],s[1]).add(s[0]),f=gA);const y=s[u%o],b=s[(u+1)%o];if(this.closed||u+2s.length-2?s.length-1:l+1],y=s[l>s.length-3?s.length-1:l+2];return r.set(d6(u,h.x,f.x,g.x,y.x),d6(u,h.y,f.y,g.y,y.y)),r}copy(e){super.copy(e),this.points=[];for(let t=0,r=e.points.length;t=r){const l=s[o]-r,u=this.curves[o],h=u.getLength(),f=h===0?0:1-l/h;return u.getPointAt(f,t)}o++}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 r=0,s=this.curves.length;r1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,r=e.curves.length;t0){const y=f.getPoint(0);y.equals(this.currentPoint)||this.lineTo(y.x,y.y)}this.curves.push(f);const g=f.getPoint(1);return this.currentPoint.copy(g),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 eT extends ui{constructor(e=[new jt(0,-.5),new jt(.5,0),new jt(0,.5)],t=12,r=0,s=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:r,phiLength:s},t=Math.floor(t),s=hh(s,0,Math.PI*2);const o=[],l=[],u=[],h=[],f=[],g=1/t,y=new Ae,b=new jt,w=new Ae,C=new Ae,M=new Ae;let A=0,k=0;for(let L=0;L<=e.length-1;L++)switch(L){case 0:A=e[L+1].x-e[L].x,k=e[L+1].y-e[L].y,w.x=k*1,w.y=-A,w.z=k*0,M.copy(w),w.normalize(),h.push(w.x,w.y,w.z);break;case e.length-1:h.push(M.x,M.y,M.z);break;default:A=e[L+1].x-e[L].x,k=e[L+1].y-e[L].y,w.x=k*1,w.y=-A,w.z=k*0,C.copy(w),w.x+=M.x,w.y+=M.y,w.z+=M.z,w.normalize(),h.push(w.x,w.y,w.z),M.copy(C)}for(let L=0;L<=t;L++){const P=r+L*g*s,D=Math.sin(P),z=Math.cos(P);for(let U=0;U<=e.length-1;U++){y.x=e[U].x*D,y.y=e[U].y,y.z=e[U].x*z,l.push(y.x,y.y,y.z),b.x=L/t,b.y=U/(e.length-1),u.push(b.x,b.y);const V=h[3*U+0]*D,H=h[3*U+1],oe=h[3*U+0]*z;f.push(V,H,oe)}}for(let L=0;L0&&P(!0),t>0&&P(!1)),this.setIndex(g),this.setAttribute("position",new ar(y,3)),this.setAttribute("normal",new ar(b,3)),this.setAttribute("uv",new ar(w,2));function L(){const D=new Ae,z=new Ae;let U=0;const V=(t-e)/r;for(let H=0;H<=o;H++){const oe=[],le=H/o,Z=le*(t-e)+e;for(let q=0;q<=s;q++){const he=q/s,ae=he*h+u,ue=Math.sin(ae),ge=Math.cos(ae);z.x=Z*ue,z.y=-le*r+A,z.z=Z*ge,y.push(z.x,z.y,z.z),D.set(ue,V,ge).normalize(),b.push(D.x,D.y,D.z),w.push(he,1-le),oe.push(C++)}M.push(oe)}for(let H=0;H.9&&V<.1&&(P<.2&&(l[L+0]+=1),D<.2&&(l[L+2]+=1),z<.2&&(l[L+4]+=1))}}function b(L){o.push(L.x,L.y,L.z)}function w(L,P){const D=L*3;P.x=e[D+0],P.y=e[D+1],P.z=e[D+2]}function C(){const L=new Ae,P=new Ae,D=new Ae,z=new Ae,U=new jt,V=new jt,H=new jt;for(let oe=0,le=0;oe80*t){u=f=n[0],h=g=n[1];for(let C=t;Cf&&(f=y),b>g&&(g=b);w=Math.max(f-u,g-h),w=w!==0?1/w:0}return Y$(o,l,t,u,h,w),l}};function JQ(n,e,t,r,s){let o,l;if(s===q$e(n,e,t,r)>0)for(o=e;o=e;o-=r)l=f6(o,n[o],n[o+1],l);return l&&g2(l,l.next)&&(K$(l),l=l.next),l}function jy(n,e){if(!n)return n;e||(e=n);let t=n,r;do if(r=!1,!t.steiner&&(g2(t,t.next)||lc(t.prev,t,t.next)===0)){if(K$(t),t=e=t.prev,t===t.next)break;r=!0}else t=t.next;while(r||t!==e);return e}function Y$(n,e,t,r,s,o,l){if(!n)return;!l&&o&&V$e(n,r,s,o);let u=n,h,f;for(;n.prev!==n.next;){if(h=n.prev,f=n.next,o?P$e(n,r,s,o):D$e(n)){e.push(h.i/t),e.push(n.i/t),e.push(f.i/t),K$(n),n=f.next,u=f.next;continue}if(n=f,n===u){l?l===1?(n=B$e(jy(n),e,t),Y$(n,e,t,r,s,o,2)):l===2&&F$e(n,e,t,r,s,o):Y$(jy(n),e,t,r,s,o,1);break}}}function D$e(n){const e=n.prev,t=n,r=n.next;if(lc(e,t,r)>=0)return!1;let s=n.next.next;for(;s!==n.prev;){if(tw(e.x,e.y,t.x,t.y,r.x,r.y,s.x,s.y)&&lc(s.prev,s,s.next)>=0)return!1;s=s.next}return!0}function P$e(n,e,t,r){const s=n.prev,o=n,l=n.next;if(lc(s,o,l)>=0)return!1;const u=s.xo.x?s.x>l.x?s.x:l.x:o.x>l.x?o.x:l.x,g=s.y>o.y?s.y>l.y?s.y:l.y:o.y>l.y?o.y:l.y,y=IP(u,h,e,t,r),b=IP(f,g,e,t,r);let w=n.prevZ,C=n.nextZ;for(;w&&w.z>=y&&C&&C.z<=b;){if(w!==n.prev&&w!==n.next&&tw(s.x,s.y,o.x,o.y,l.x,l.y,w.x,w.y)&&lc(w.prev,w,w.next)>=0||(w=w.prevZ,C!==n.prev&&C!==n.next&&tw(s.x,s.y,o.x,o.y,l.x,l.y,C.x,C.y)&&lc(C.prev,C,C.next)>=0))return!1;C=C.nextZ}for(;w&&w.z>=y;){if(w!==n.prev&&w!==n.next&&tw(s.x,s.y,o.x,o.y,l.x,l.y,w.x,w.y)&&lc(w.prev,w,w.next)>=0)return!1;w=w.prevZ}for(;C&&C.z<=b;){if(C!==n.prev&&C!==n.next&&tw(s.x,s.y,o.x,o.y,l.x,l.y,C.x,C.y)&&lc(C.prev,C,C.next)>=0)return!1;C=C.nextZ}return!0}function B$e(n,e,t){let r=n;do{const s=r.prev,o=r.next.next;!g2(s,o)&&qQ(s,r,r.next,o)&&X$(s,o)&&X$(o,s)&&(e.push(s.i/t),e.push(r.i/t),e.push(o.i/t),K$(r),K$(r.next),r=n=o),r=r.next}while(r!==n);return jy(r)}function F$e(n,e,t,r,s,o){let l=n;do{let u=l.next.next;for(;u!==l.prev;){if(l.i!==u.i&&X$e(l,u)){let h=QQ(l,u);l=jy(l,l.next),h=jy(h,h.next),Y$(l,e,t,r,s,o),Y$(h,e,t,r,s,o);return}u=u.next}l=l.next}while(l!==n)}function z$e(n,e,t,r){const s=[];let o,l,u,h,f;for(o=0,l=e.length;o=t.next.y&&t.next.y!==t.y){const b=t.x+(s-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(b<=r&&b>o){if(o=b,b===r){if(s===t.y)return t;if(s===t.next.y)return t.next}l=t.x=t.x&&t.x>=h&&r!==t.x&&tw(sl.x||t.x===l.x&&W$e(l,t)))&&(l=t,g=y)),t=t.next;while(t!==u);return l}function W$e(n,e){return lc(n.prev,n,e.prev)<0&&lc(e.next,n,n.next)<0}function V$e(n,e,t,r){let s=n;do s.z===null&&(s.z=IP(s.x,s.y,e,t,r)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next;while(s!==n);s.prevZ.nextZ=null,s.prevZ=null,j$e(s)}function j$e(n){let e,t,r,s,o,l,u,h,f=1;do{for(t=n,n=null,o=null,l=0;t;){for(l++,r=t,u=0,e=0;e0||h>0&&r;)u!==0&&(h===0||!r||t.z<=r.z)?(s=t,t=t.nextZ,u--):(s=r,r=r.nextZ,h--),o?o.nextZ=s:n=s,s.prevZ=o,o=s;t=r}o.nextZ=null,f*=2}while(l>1);return n}function IP(n,e,t,r,s){return n=32767*(n-t)*s,e=32767*(e-r)*s,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,n|e<<1}function Y$e(n){let e=n,t=n;do(e.x=0&&(n-l)*(r-u)-(t-l)*(e-u)>=0&&(t-l)*(o-u)-(s-l)*(r-u)>=0}function X$e(n,e){return n.next.i!==e.i&&n.prev.i!==e.i&&!K$e(n,e)&&(X$(n,e)&&X$(e,n)&&J$e(n,e)&&(lc(n.prev,n,e.prev)||lc(n,e.prev,e))||g2(n,e)&&lc(n.prev,n,n.next)>0&&lc(e.prev,e,e.next)>0)}function lc(n,e,t){return(e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y)}function g2(n,e){return n.x===e.x&&n.y===e.y}function qQ(n,e,t,r){const s=TA(lc(n,e,t)),o=TA(lc(n,e,r)),l=TA(lc(t,r,n)),u=TA(lc(t,r,e));return!!(s!==o&&l!==u||s===0&&bA(n,t,e)||o===0&&bA(n,r,e)||l===0&&bA(t,n,r)||u===0&&bA(t,e,r))}function bA(n,e,t){return e.x<=Math.max(n.x,t.x)&&e.x>=Math.min(n.x,t.x)&&e.y<=Math.max(n.y,t.y)&&e.y>=Math.min(n.y,t.y)}function TA(n){return n>0?1:n<0?-1:0}function K$e(n,e){let t=n;do{if(t.i!==n.i&&t.next.i!==n.i&&t.i!==e.i&&t.next.i!==e.i&&qQ(t,t.next,n,e))return!0;t=t.next}while(t!==n);return!1}function X$(n,e){return lc(n.prev,n,n.next)<0?lc(n,e,n.next)>=0&&lc(n,n.prev,e)>=0:lc(n,e,n.prev)<0||lc(n,n.next,e)<0}function J$e(n,e){let t=n,r=!1;const s=(n.x+e.x)/2,o=(n.y+e.y)/2;do t.y>o!=t.next.y>o&&t.next.y!==t.y&&s<(t.next.x-t.x)*(o-t.y)/(t.next.y-t.y)+t.x&&(r=!r),t=t.next;while(t!==n);return r}function QQ(n,e){const t=new RP(n.i,n.x,n.y),r=new RP(e.i,e.x,e.y),s=n.next,o=e.prev;return n.next=e,e.prev=n,t.next=s,s.prev=t,r.next=t,t.prev=r,o.next=r,r.prev=o,r}function f6(n,e,t,r){const s=new RP(n,e,t);return r?(s.next=r.next,s.prev=r,r.next.prev=s,r.next=s):(s.prev=s,s.next=s),s}function K$(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function RP(n,e,t){this.i=n,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function q$e(n,e,t,r){let s=0;for(let o=e,l=t-r;o2&&n[e-1].equals(n[0])&&n.pop()}function m6(n,e){for(let t=0;tNumber.EPSILON){const se=Math.sqrt(mt),$e=Math.sqrt(Mt*Mt+At*At),ht=Ce.x-vt/se,St=Ce.y+kt/se,It=He.x-At/$e,pt=He.y+Mt/$e,Ke=((It-ht)*At-(pt-St)*Mt)/(kt*At-vt*Mt);rt=ht+kt*Ke-ze.x,it=St+vt*Ke-ze.y;const Le=rt*rt+it*it;if(Le<=2)return new jt(rt,it);Nt=Math.sqrt(Le/2)}else{let se=!1;kt>Number.EPSILON?Mt>Number.EPSILON&&(se=!0):kt<-Number.EPSILON?Mt<-Number.EPSILON&&(se=!0):Math.sign(vt)===Math.sign(At)&&(se=!0),se?(rt=-vt,it=kt,Nt=Math.sqrt(mt)):(rt=kt,it=vt,Nt=Math.sqrt(mt/2))}return new jt(rt/Nt,it/Nt)}const J=[];for(let ze=0,Ce=he.length,He=Ce-1,rt=ze+1;ze=0;ze--){const Ce=ze/A,He=w*Math.cos(Ce*Math.PI/2),rt=C*Math.sin(Ce*Math.PI/2)+M;for(let it=0,Nt=he.length;it=0;){const rt=He;let it=He-1;it<0&&(it=ze.length-1);for(let Nt=0,kt=g+A*2;Nt0)&&w.push(P,D,U),(k!==r-1||h0!=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 iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=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.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class nZ extends hd{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new Fn(16777215),this.specular=new Fn(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Fn(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=cT,this.normalScale=new jt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=IC,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.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.fog=e.fog,this}}class rZ extends hd{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Fn(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Fn(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=cT,this.normalScale=new jt(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.fog=!0,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.fog=e.fog,this}}class d4 extends hd{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=cT,this.normalScale=new jt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=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}}class iZ extends hd{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new Fn(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Fn(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=IC,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.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.fog=e.fog,this}}class sZ extends hd{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Fn(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=cT,this.normalScale=new jt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,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.fog=e.fog,this}}class oZ extends Pf{constructor(e){super(),this.isLineDashedMaterial=!0,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}}function dg(n,e,t){return f4(n)?new n.constructor(n.subarray(e,t!==void 0?t:n.length)):n.slice(e,t)}function M1(n,e,t){return!n||!t&&n.constructor===e?n:typeof e.BYTES_PER_ELEMENT=="number"?new e(n):Array.prototype.slice.call(n)}function f4(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function aZ(n){function e(s,o){return n[s]-n[o]}const t=n.length,r=new Array(t);for(let s=0;s!==t;++s)r[s]=s;return r.sort(e),r}function kP(n,e,t){const r=n.length,s=new n.constructor(r);for(let o=0,l=0;l!==r;++o){const u=t[o]*e;for(let h=0;h!==e;++h)s[l++]=n[u+h]}return s}function p4(n,e,t,r){let s=1,o=n[0];for(;o!==void 0&&o[r]===void 0;)o=n[s++];if(o===void 0)return;let l=o[r];if(l!==void 0)if(Array.isArray(l))do l=o[r],l!==void 0&&(e.push(o.time),t.push.apply(t,l)),o=n[s++];while(o!==void 0);else if(l.toArray!==void 0)do l=o[r],l!==void 0&&(e.push(o.time),l.toArray(t,t.length)),o=n[s++];while(o!==void 0);else do l=o[r],l!==void 0&&(e.push(o.time),t.push(l)),o=n[s++];while(o!==void 0)}function tCe(n,e,t,r,s=30){const o=n.clone();o.name=e;const l=[];for(let h=0;h=r)){y.push(f.times[w]);for(let M=0;Mo.tracks[h].times[0]&&(u=o.tracks[h].times[0]);for(let h=0;h=u.times[C]){const k=C*y+g,L=k+y-g;M=dg(u.values,k,L)}else{const k=u.createInterpolant(),L=g,P=y-g;k.evaluate(o),M=dg(k.resultBuffer,L,P)}h==="quaternion"&&new Sl().fromArray(M).normalize().conjugate().toArray(M);const A=f.times.length;for(let k=0;k=o)){const u=t[1];e=o)break t}l=r,r=0;break n}break e}for(;r>>1;et;)--l;if(++l,o!==0||l!==s){o>=l&&(l=Math.max(l,1),o=l-1);const u=this.getValueSize();this.times=dg(r,o,l),this.values=dg(this.values,o*u,l*u)}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 r=this.times,s=this.values,o=r.length;o===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let l=null;for(let u=0;u!==o;u++){const h=r[u];if(typeof h=="number"&&isNaN(h)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,u,h),e=!1;break}if(l!==null&&l>h){console.error("THREE.KeyframeTrack: Out of order keys.",this,u,h,l),e=!1;break}l=h}if(s!==void 0&&f4(s))for(let u=0,h=s.length;u!==h;++u){const f=s[u];if(isNaN(f)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,u,f),e=!1;break}}return e}optimize(){const e=dg(this.times),t=dg(this.values),r=this.getValueSize(),s=this.getInterpolation()===bI,o=e.length-1;let l=1;for(let u=1;u0){e[l]=e[o];for(let u=o*r,h=l*r,f=0;f!==r;++f)t[h+f]=t[u+f];++l}return l!==e.length?(this.times=dg(e,0,l),this.values=dg(t,0,l*r)):(this.times=e,this.values=t),this}clone(){const e=dg(this.times,0),t=dg(this.values,0),r=this.constructor,s=new r(this.name,e,t);return s.createInterpolant=this.createInterpolant,s}}m0.prototype.TimeBufferType=Float32Array;m0.prototype.ValueBufferType=Float32Array;m0.prototype.DefaultInterpolation=z$;class dT extends m0{}dT.prototype.ValueTypeName="bool";dT.prototype.ValueBufferType=Array;dT.prototype.DefaultInterpolation=F$;dT.prototype.InterpolantFactoryMethodLinear=void 0;dT.prototype.InterpolantFactoryMethodSmooth=void 0;class g4 extends m0{}g4.prototype.ValueTypeName="color";class q$ extends m0{}q$.prototype.ValueTypeName="number";class cZ extends DC{constructor(e,t,r,s){super(e,t,r,s)}interpolate_(e,t,r,s){const o=this.resultBuffer,l=this.sampleValues,u=this.valueSize,h=(r-t)/(s-t);let f=e*u;for(let g=f+u;f!==g;f+=4)Sl.slerpFlat(o,0,l,f-u,l,f,h);return o}}class mE extends m0{InterpolantFactoryMethodLinear(e){return new cZ(this.times,this.values,this.getValueSize(),e)}}mE.prototype.ValueTypeName="quaternion";mE.prototype.DefaultInterpolation=z$;mE.prototype.InterpolantFactoryMethodSmooth=void 0;class fT extends m0{}fT.prototype.ValueTypeName="string";fT.prototype.ValueBufferType=Array;fT.prototype.DefaultInterpolation=F$;fT.prototype.InterpolantFactoryMethodLinear=void 0;fT.prototype.InterpolantFactoryMethodSmooth=void 0;class Q$ extends m0{}Q$.prototype.ValueTypeName="vector";class Z${constructor(e,t=-1,r,s=i2){this.name=e,this.tracks=r,this.duration=t,this.blendMode=s,this.uuid=Pm(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],r=e.tracks,s=1/(e.fps||1);for(let l=0,u=r.length;l!==u;++l)t.push(sCe(r[l]).scale(s));const o=new this(e.name,e.duration,t,e.blendMode);return o.uuid=e.uuid,o}static toJSON(e){const t=[],r=e.tracks,s={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let o=0,l=r.length;o!==l;++o)t.push(m0.toJSON(r[o]));return s}static CreateFromMorphTargetSequence(e,t,r,s){const o=t.length,l=[];for(let u=0;u1){const y=g[1];let b=s[y];b||(s[y]=b=[]),b.push(f)}}const l=[];for(const u in s)l.push(this.CreateFromMorphTargetSequence(u,s[u],t,r));return l}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const r=function(g,y,b,w,C){if(b.length!==0){const M=[],A=[];p4(b,M,A,w),M.length!==0&&C.push(new g(y,M,A))}},s=[],o=e.name||"default",l=e.fps||30,u=e.blendMode;let h=e.length||-1;const f=e.hierarchy||[];for(let g=0;g{t&&t(o),this.manager.itemEnd(e)},0),o;if(nv[e]!==void 0){nv[e].push({onLoad:t,onProgress:r,onError:s});return}nv[e]=[],nv[e].push({onLoad:t,onProgress:r,onError:s});const l=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),u=this.mimeType,h=this.responseType;fetch(l).then(f=>{if(f.status===200||f.status===0){if(f.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||f.body===void 0||f.body.getReader===void 0)return f;const g=nv[e],y=f.body.getReader(),b=f.headers.get("Content-Length"),w=b?parseInt(b):0,C=w!==0;let M=0;const A=new ReadableStream({start(k){L();function L(){y.read().then(({done:P,value:D})=>{if(P)k.close();else{M+=D.byteLength;const z=new ProgressEvent("progress",{lengthComputable:C,loaded:M,total:w});for(let U=0,V=g.length;U{switch(h){case"arraybuffer":return f.arrayBuffer();case"blob":return f.blob();case"document":return f.text().then(g=>new DOMParser().parseFromString(g,u));case"json":return f.json();default:if(u===void 0)return f.text();{const g=/charset="?([^;"\s]*)"?/i.exec(u),y=g&&g[1]?g[1].toLowerCase():void 0,b=new TextDecoder(y);return f.arrayBuffer().then(w=>b.decode(w))}}}).then(f=>{tT.add(e,f);const g=nv[e];delete nv[e];for(let y=0,b=g.length;y{const g=nv[e];if(g===void 0)throw this.manager.itemError(e),f;delete nv[e];for(let y=0,b=g.length;y{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class aCe extends Ym{constructor(e){super(e)}load(e,t,r,s){const o=this,l=new bv(this.manager);l.setPath(this.path),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(e,function(u){try{t(o.parse(JSON.parse(u)))}catch(h){s?s(h):console.error(h),o.manager.itemError(e)}},r,s)}parse(e){const t=[];for(let r=0;r0:s.vertexColors=e.vertexColors),e.uniforms!==void 0)for(const o in e.uniforms){const l=e.uniforms[o];switch(s.uniforms[o]={},l.type){case"t":s.uniforms[o].value=r(l.value);break;case"c":s.uniforms[o].value=new Fn().setHex(l.value);break;case"v2":s.uniforms[o].value=new jt().fromArray(l.value);break;case"v3":s.uniforms[o].value=new Ae().fromArray(l.value);break;case"v4":s.uniforms[o].value=new Ts().fromArray(l.value);break;case"m3":s.uniforms[o].value=new up().fromArray(l.value);break;case"m4":s.uniforms[o].value=new Qr().fromArray(l.value);break;default:s.uniforms[o].value=l.value}}if(e.defines!==void 0&&(s.defines=e.defines),e.vertexShader!==void 0&&(s.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(s.fragmentShader=e.fragmentShader),e.extensions!==void 0)for(const o in e.extensions)s.extensions[o]=e.extensions[o];if(e.shading!==void 0&&(s.flatShading=e.shading===1),e.size!==void 0&&(s.size=e.size),e.sizeAttenuation!==void 0&&(s.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(s.map=r(e.map)),e.matcap!==void 0&&(s.matcap=r(e.matcap)),e.alphaMap!==void 0&&(s.alphaMap=r(e.alphaMap)),e.bumpMap!==void 0&&(s.bumpMap=r(e.bumpMap)),e.bumpScale!==void 0&&(s.bumpScale=e.bumpScale),e.normalMap!==void 0&&(s.normalMap=r(e.normalMap)),e.normalMapType!==void 0&&(s.normalMapType=e.normalMapType),e.normalScale!==void 0){let o=e.normalScale;Array.isArray(o)===!1&&(o=[o,o]),s.normalScale=new jt().fromArray(o)}return e.displacementMap!==void 0&&(s.displacementMap=r(e.displacementMap)),e.displacementScale!==void 0&&(s.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(s.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(s.roughnessMap=r(e.roughnessMap)),e.metalnessMap!==void 0&&(s.metalnessMap=r(e.metalnessMap)),e.emissiveMap!==void 0&&(s.emissiveMap=r(e.emissiveMap)),e.emissiveIntensity!==void 0&&(s.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(s.specularMap=r(e.specularMap)),e.specularIntensityMap!==void 0&&(s.specularIntensityMap=r(e.specularIntensityMap)),e.specularColorMap!==void 0&&(s.specularColorMap=r(e.specularColorMap)),e.envMap!==void 0&&(s.envMap=r(e.envMap)),e.envMapIntensity!==void 0&&(s.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(s.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(s.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(s.lightMap=r(e.lightMap)),e.lightMapIntensity!==void 0&&(s.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(s.aoMap=r(e.aoMap)),e.aoMapIntensity!==void 0&&(s.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(s.gradientMap=r(e.gradientMap)),e.clearcoatMap!==void 0&&(s.clearcoatMap=r(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(s.clearcoatRoughnessMap=r(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(s.clearcoatNormalMap=r(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(s.clearcoatNormalScale=new jt().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(s.iridescenceMap=r(e.iridescenceMap)),e.iridescenceThicknessMap!==void 0&&(s.iridescenceThicknessMap=r(e.iridescenceThicknessMap)),e.transmissionMap!==void 0&&(s.transmissionMap=r(e.transmissionMap)),e.thicknessMap!==void 0&&(s.thicknessMap=r(e.thicknessMap)),e.sheenColorMap!==void 0&&(s.sheenColorMap=r(e.sheenColorMap)),e.sheenRoughnessMap!==void 0&&(s.sheenRoughnessMap=r(e.sheenRoughnessMap)),s}setTextures(e){return this.textures=e,this}static createMaterialFromType(e){const t={ShadowMaterial:ZQ,SpriteMaterial:r4,RawShaderMaterial:eZ,ShaderMaterial:xd,PointsMaterial:f2,MeshPhysicalMaterial:tZ,MeshStandardMaterial:J$,MeshPhongMaterial:nZ,MeshToonMaterial:rZ,MeshNormalMaterial:d4,MeshLambertMaterial:iZ,MeshDepthMaterial:NC,MeshDistanceMaterial:l2,MeshBasicMaterial:f0,MeshMatcapMaterial:sZ,LineDashedMaterial:oZ,LineBasicMaterial:Pf,Material:hd};return new t[e]}}class OP{static decodeText(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let r=0,s=e.length;r0){const h=new _4(t);o=new eC(h),o.setCrossOrigin(this.crossOrigin);for(let f=0,g=e.length;f0){s=new eC(this.manager),s.setCrossOrigin(this.crossOrigin);for(let l=0,u=e.length;l"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,r,s){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const o=this,l=tT.get(e);if(l!==void 0)return o.manager.itemStart(e),setTimeout(function(){t&&t(l),o.manager.itemEnd(e)},0),l;const u={};u.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",u.headers=this.requestHeader,fetch(e,u).then(function(h){return h.blob()}).then(function(h){return createImageBitmap(h,Object.assign(o.options,{colorSpaceConversion:"none"}))}).then(function(h){tT.add(e,h),t&&t(h),o.manager.itemEnd(e)}).catch(function(h){s&&s(h),o.manager.itemError(e),o.manager.itemEnd(e)}),o.manager.itemStart(e)}}let SA;const y4={getContext:function(){return SA===void 0&&(SA=new(window.AudioContext||window.webkitAudioContext)),SA},setContext:function(n){SA=n}};class vCe extends Ym{constructor(e){super(e)}load(e,t,r,s){const o=this,l=new bv(this.manager);l.setResponseType("arraybuffer"),l.setPath(this.path),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(e,function(u){try{const h=u.slice(0);y4.getContext().decodeAudioData(h,function(f){t(f)})}catch(h){s?s(h):console.error(h),o.manager.itemError(e)}},r,s)}}class yCe extends _2{constructor(e,t,r=1){super(void 0,r),this.isHemisphereLightProbe=!0;const s=new Fn().set(e),o=new Fn().set(t),l=new Ae(s.r,s.g,s.b),u=new Ae(o.r,o.g,o.b),h=Math.sqrt(Math.PI),f=h*Math.sqrt(.75);this.sh.coefficients[0].copy(l).add(u).multiplyScalar(h),this.sh.coefficients[1].copy(l).sub(u).multiplyScalar(f)}}class bCe extends _2{constructor(e,t=1){super(void 0,t),this.isAmbientLightProbe=!0;const r=new Fn().set(e);this.sh.coefficients[0].set(r.r,r.g,r.b).multiplyScalar(2*Math.sqrt(Math.PI))}}const E6=new Qr,x6=new Qr,Yb=new Qr;class TCe{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Za,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Za,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,Yb.copy(e.projectionMatrix);const r=t.eyeSep/2,s=r*t.near/t.focus,o=t.near*Math.tan(D1*t.fov*.5)/t.zoom;let l,u;x6.elements[12]=-r,E6.elements[12]=r,l=-o*t.aspect+s,u=o*t.aspect+s,Yb.elements[0]=2*t.near/(u-l),Yb.elements[8]=(u+l)/(u-l),this.cameraL.projectionMatrix.copy(Yb),l=-o*t.aspect-s,u=o*t.aspect-s,Yb.elements[0]=2*t.near/(u-l),Yb.elements[8]=(u+l)/(u-l),this.cameraR.projectionMatrix.copy(Yb)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(x6),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(E6)}}class b4{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=$6(),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=$6();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function $6(){return(typeof performance>"u"?Date:performance).now()}const Xb=new Ae,C6=new Sl,SCe=new Ae,Kb=new Ae;class wCe extends ro{constructor(){super(),this.type="AudioListener",this.context=y4.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new b4}getInput(){return this.gain}removeFilter(){return this.filter!==null&&(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 this.filter!==null?(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,r=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(Xb,C6,SCe),Kb.set(0,0,-1).applyQuaternion(C6),t.positionX){const s=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(Xb.x,s),t.positionY.linearRampToValueAtTime(Xb.y,s),t.positionZ.linearRampToValueAtTime(Xb.z,s),t.forwardX.linearRampToValueAtTime(Kb.x,s),t.forwardY.linearRampToValueAtTime(Kb.y,s),t.forwardZ.linearRampToValueAtTime(Kb.z,s),t.upX.linearRampToValueAtTime(r.x,s),t.upY.linearRampToValueAtTime(r.y,s),t.upZ.linearRampToValueAtTime(r.z,s)}else t.setPosition(Xb.x,Xb.y,Xb.z),t.setOrientation(Kb.x,Kb.y,Kb.z,r.x,r.y,r.z)}}class bZ extends ro{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(this.isPlaying===!0){console.warn("THREE.Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}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(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this._progress=0,this.source.stop(),this.source.onended=null,this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e0&&this._mixBufferRegionAdditive(r,s,this._addIndex*t,1,t);for(let h=t,f=t+t;h!==f;++h)if(r[h]!==r[h+t]){u.setValue(r,s);break}}saveOriginalState(){const e=this.binding,t=this.buffer,r=this.valueSize,s=r*this._origIndex;e.getValue(t,s);for(let o=r,l=s;o!==l;++o)t[o]=t[s+o%r];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let r=e;r=.5)for(let l=0;l!==o;++l)e[t+l]=e[r+l]}_slerp(e,t,r,s){Sl.slerpFlat(e,t,e,t,e,r,s)}_slerpAdditive(e,t,r,s,o){const l=this._workIndex*o;Sl.multiplyQuaternionsFlat(e,l,e,t,e,r),Sl.slerpFlat(e,t,e,t,e,l,s)}_lerp(e,t,r,s,o){const l=1-s;for(let u=0;u!==o;++u){const h=t+u;e[h]=e[h]*l+e[r+u]*s}}_lerpAdditive(e,t,r,s,o){for(let l=0;l!==o;++l){const u=t+l;e[u]=e[u]+e[r+l]*s}}}const T4="\\[\\]\\.:\\/",CCe=new RegExp("["+T4+"]","g"),S4="[^"+T4+"]",MCe="[^"+T4.replace("\\.","")+"]",ACe=/((?:WC+[\/:])*)/.source.replace("WC",S4),ICe=/(WCOD+)?/.source.replace("WCOD",MCe),RCe=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",S4),kCe=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",S4),OCe=new RegExp("^"+ACe+ICe+RCe+kCe+"$"),LCe=["material","materials","bones"];class NCe{constructor(e,t,r){const s=r||So.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,s)}getValue(e,t){this.bind();const r=this._targetGroup.nCachedObjects_,s=this._bindings[r];s!==void 0&&s.getValue(e,t)}setValue(e,t){const r=this._bindings;for(let s=this._targetGroup.nCachedObjects_,o=r.length;s!==o;++s)r[s].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,r=e.length;t!==r;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,r=e.length;t!==r;++t)e[t].unbind()}}class So{constructor(e,t,r){this.path=t,this.parsedPath=r||So.parseTrackName(t),this.node=So.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,r){return e&&e.isAnimationObjectGroup?new So.Composite(e,t,r):new So(e,t,r)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(CCe,"")}static parseTrackName(e){const t=OCe.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const r={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},s=r.nodeName&&r.nodeName.lastIndexOf(".");if(s!==void 0&&s!==-1){const o=r.nodeName.substring(s+1);LCe.indexOf(o)!==-1&&(r.nodeName=r.nodeName.substring(0,s),r.objectName=o)}if(r.propertyName===null||r.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return r}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const r=e.skeleton.getBoneByName(t);if(r!==void 0)return r}if(e.children){const r=function(o){for(let l=0;l=o){const y=o++,b=e[y];t[b.uuid]=g,e[g]=b,t[f]=y,e[y]=h;for(let w=0,C=s;w!==C;++w){const M=r[w],A=M[y],k=M[g];M[g]=A,M[y]=k}}}this.nCachedObjects_=o}uncache(){const e=this._objects,t=this._indicesByUUID,r=this._bindings,s=r.length;let o=this.nCachedObjects_,l=e.length;for(let u=0,h=arguments.length;u!==h;++u){const f=arguments[u],g=f.uuid,y=t[g];if(y!==void 0)if(delete t[g],y0&&(t[w.uuid]=y),e[y]=w,e.pop();for(let C=0,M=s;C!==M;++C){const A=r[C];A[y]=A[b],A.pop()}}}this.nCachedObjects_=o}subscribe_(e,t){const r=this._bindingsIndicesByPath;let s=r[e];const o=this._bindings;if(s!==void 0)return o[s];const l=this._paths,u=this._parsedPaths,h=this._objects,f=h.length,g=this.nCachedObjects_,y=new Array(f);s=o.length,r[e]=s,l.push(e),u.push(t),o.push(y);for(let b=g,w=h.length;b!==w;++b){const C=h[b];y[b]=new So(C,e,t)}return y}unsubscribe_(e){const t=this._bindingsIndicesByPath,r=t[e];if(r!==void 0){const s=this._paths,o=this._parsedPaths,l=this._bindings,u=l.length-1,h=l[u],f=e[u];t[f]=r,l[r]=h,l.pop(),o[r]=o[u],o.pop(),s[r]=s[u],s.pop()}}}class PCe{constructor(e,t,r=null,s=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=r,this.blendMode=s;const o=t.tracks,l=o.length,u=new Array(l),h={endingStart:x1,endingEnd:x1};for(let f=0;f!==l;++f){const g=o[f].createInterpolant(null);u[f]=g,g.settings=h}this._interpolantSettings=h,this._interpolants=u,this._propertyBindings=new Array(l),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=_Q,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&&this.timeScale!==0&&this._startTime===null&&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,r){if(e.fadeOut(t),this.fadeIn(t),r){const s=this._clip.duration,o=e._clip.duration,l=o/s,u=s/o;e.warp(1,l,t),this.warp(u,1,t)}return this}crossFadeTo(e,t,r){return e.crossFadeFrom(this,t,r)}stopFading(){const e=this._weightInterpolant;return e!==null&&(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,r){const s=this._mixer,o=s.time,l=this.timeScale;let u=this._timeScaleInterpolant;u===null&&(u=s._lendControlInterpolant(),this._timeScaleInterpolant=u);const h=u.parameterPositions,f=u.sampleValues;return h[0]=o,h[1]=o+r,f[0]=e/l,f[1]=t/l,this}stopWarping(){const e=this._timeScaleInterpolant;return e!==null&&(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,r,s){if(!this.enabled){this._updateWeight(e);return}const o=this._startTime;if(o!==null){const h=(e-o)*r;if(h<0||r===0)return;this._startTime=null,t=r*h}t*=this._updateTimeScale(e);const l=this._updateTime(t),u=this._updateWeight(e);if(u>0){const h=this._interpolants,f=this._propertyBindings;switch(this.blendMode){case KF:for(let g=0,y=h.length;g!==y;++g)h[g].evaluate(l),f[g].accumulateAdditive(u);break;case i2:default:for(let g=0,y=h.length;g!==y;++g)h[g].evaluate(l),f[g].accumulate(s,u)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const r=this._weightInterpolant;if(r!==null){const s=r.evaluate(e)[0];t*=s,e>r.parameterPositions[1]&&(this.stopFading(),s===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const r=this._timeScaleInterpolant;r!==null&&(t*=r.evaluate(e)[0],e>r.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t))}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,r=this.loop;let s=this.time+e,o=this._loopCount;const l=r===vQ;if(e===0)return o===-1?s:l&&(o&1)===1?t-s:s;if(r===gQ){o===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(s>=t)s=t;else if(s<0)s=0;else{this.time=s;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=s,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(o===-1&&(e>=0?(o=0,this._setEndings(!0,this.repetitions===0,l)):this._setEndings(this.repetitions===0,!0,l)),s>=t||s<0){const u=Math.floor(s/t);s-=t*u,o+=Math.abs(u);const h=this.repetitions-o;if(h<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,s=e>0?t:0,this.time=s,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(h===1){const f=e<0;this._setEndings(f,!f,l)}else this._setEndings(!1,!1,l);this._loopCount=o,this.time=s,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:u})}}else this.time=s;if(l&&(o&1)===1)return t-s}return s}_setEndings(e,t,r){const s=this._interpolantSettings;r?(s.endingStart=$1,s.endingEnd=$1):(e?s.endingStart=this.zeroSlopeAtStart?$1:x1:s.endingStart=U$,t?s.endingEnd=this.zeroSlopeAtEnd?$1:x1:s.endingEnd=U$)}_scheduleFading(e,t,r){const s=this._mixer,o=s.time;let l=this._weightInterpolant;l===null&&(l=s._lendControlInterpolant(),this._weightInterpolant=l);const u=l.parameterPositions,h=l.sampleValues;return u[0]=o,h[0]=t,u[1]=o+e,h[1]=r,this}}const BCe=new Float32Array(1);class FCe extends jm{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const r=e._localRoot||this._root,s=e._clip.tracks,o=s.length,l=e._propertyBindings,u=e._interpolants,h=r.uuid,f=this._bindingsByRootAndName;let g=f[h];g===void 0&&(g={},f[h]=g);for(let y=0;y!==o;++y){const b=s[y],w=b.name;let C=g[w];if(C!==void 0)++C.referenceCount,l[y]=C;else{if(C=l[y],C!==void 0){C._cacheIndex===null&&(++C.referenceCount,this._addInactiveBinding(C,h,w));continue}const M=t&&t._propertyBindings[y].binding.parsedPath;C=new TZ(So.create(r,w,M),b.ValueTypeName,b.getValueSize()),++C.referenceCount,this._addInactiveBinding(C,h,w),l[y]=C}u[y].resultBuffer=C.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const r=(e._localRoot||this._root).uuid,s=e._clip.uuid,o=this._actionsByClip[s];this._bindAction(e,o&&o.knownActions[0]),this._addInactiveAction(e,s,r)}const t=e._propertyBindings;for(let r=0,s=t.length;r!==s;++r){const o=t[r];o.useCount++===0&&(this._lendBinding(o),o.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let r=0,s=t.length;r!==s;++r){const o=t[r];--o.useCount===0&&(o.restoreOriginalState(),this._takeBackBinding(o))}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 t!==null&&t=0;--r)e[r].stop();return this}update(e){e*=this.timeScale;const t=this._actions,r=this._nActiveActions,s=this.time+=e,o=Math.sign(e),l=this._accuIndex^=1;for(let f=0;f!==r;++f)t[f]._update(s,e,o,l);const u=this._bindings,h=this._nActiveBindings;for(let f=0;f!==h;++f)u[f].apply(l);return this}setTime(e){this.time=0;for(let t=0;tthis.max.x||e.ythis.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.xthis.max.x||e.max.ythis.max.y)}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return I6.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)}}const R6=new Ae,wA=new Ae;class E4{constructor(e=new Ae,t=new Ae){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){R6.subVectors(e,this.start),wA.subVectors(this.end,this.start);const r=wA.dot(wA);let s=wA.dot(R6)/r;return t&&(s=hh(s,0,1)),s}closestPointToPoint(e,t,r){const s=this.closestPointToPointParameter(e,t);return this.delta(r).multiplyScalar(s).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 k6=new Ae;class VCe extends ro{constructor(e,t){super(),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;const r=new ui,s=[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 l=0,u=1,h=32;l.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{P6.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(P6,t)}}setLength(e,t=e*.2,r=t*.2){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(r,t,r),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 iMe extends T_{constructor(e=1){const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],r=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],s=new ui;s.setAttribute("position",new ar(t,3)),s.setAttribute("color",new ar(r,3));const o=new Pf({vertexColors:!0,toneMapped:!1});super(s,o),this.type="AxesHelper"}setColors(e,t,r){const s=new Fn,o=this.geometry.attributes.color.array;return s.set(e),s.toArray(o,0),s.toArray(o,3),s.set(t),s.toArray(o,6),s.toArray(o,9),s.set(r),s.toArray(o,12),s.toArray(o,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class sMe{constructor(){this.type="ShapePath",this.color=new Fn,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new j$,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,r,s){return this.currentPath.quadraticCurveTo(e,t,r,s),this}bezierCurveTo(e,t,r,s,o,l){return this.currentPath.bezierCurveTo(e,t,r,s,o,l),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e,t){function r(L){const P=[];for(let D=0,z=L.length;DNumber.EPSILON){if(Z<0&&(H=P[V],le=-le,oe=P[U],Z=-Z),L.yoe.y)continue;if(L.y===H.y){if(L.x===H.x)return!0}else{const q=Z*(L.x-H.x)-le*(L.y-H.y);if(q===0)return!0;if(q<0)continue;z=!z}}else{if(L.y!==H.y)continue;if(oe.x<=L.x&&L.x<=H.x||H.x<=L.x&&L.x<=oe.x)return!0}}return z}const o=c_.isClockWise,l=this.subPaths;if(l.length===0)return[];if(t===!0)return r(l);let u,h,f;const g=[];if(l.length===1)return h=l[0],f=new F1,f.curves=h.curves,g.push(f),g;let y=!o(l[0].getPoints());y=e?!y:y;const b=[],w=[];let C=[],M=0,A;w[M]=void 0,C[M]=[];for(let L=0,P=l.length;L1){let L=!1,P=0;for(let D=0,z=w.length;D0&&L===!1&&(C=b)}let k;for(let L=0,P=w.length;L>-f-14,r[h|256]=1024>>-f-14|32768,s[h]=-f-1,s[h|256]=-f-1):f<=15?(r[h]=f+15<<10,r[h|256]=f+15<<10|32768,s[h]=13,s[h|256]=13):f<128?(r[h]=31744,r[h|256]=64512,s[h]=24,s[h|256]=24):(r[h]=31744,r[h|256]=64512,s[h]=13,s[h|256]=13)}const o=new Uint32Array(2048),l=new Uint32Array(64),u=new Uint32Array(64);for(let h=1;h<1024;++h){let f=h<<13,g=0;for(;!(f&8388608);)f<<=1,g-=8388608;f&=-8388609,g+=947912704,o[h]=f|g}for(let h=1024;h<2048;++h)o[h]=939524096+(h-1024<<13);for(let h=1;h<31;++h)l[h]=h<<23;l[31]=1199570944,l[32]=2147483648;for(let h=33;h<63;++h)l[h]=2147483648+(h-32<<23);l[63]=3347054592;for(let h=1;h<64;++h)h!==32&&(u[h]=1024);return{floatView:e,uint32View:t,baseTable:r,shiftTable:s,mantissaTable:o,exponentTable:l,offsetTable:u}}function aMe(n){Math.abs(n)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),n=hh(n,-65504,65504),lv.floatView[0]=n;const e=lv.uint32View[0],t=e>>23&511;return lv.baseTable[t]+((e&8388607)>>lv.shiftTable[t])}function lMe(n){const e=n>>10;return lv.uint32View[0]=lv.mantissaTable[lv.offsetTable[e]+(n&1023)]+lv.exponentTable[e],lv.floatView[0]}var uMe=Object.freeze({__proto__:null,toHalfFloat:aMe,fromHalfFloat:lMe});class cMe extends ui{constructor(){console.error("THREE.ParametricGeometry has been moved to /examples/jsm/geometries/ParametricGeometry.js"),super()}}class hMe extends ui{constructor(){console.error("THREE.TextGeometry has been moved to /examples/jsm/geometries/TextGeometry.js"),super()}}function dMe(){console.error("THREE.FontLoader has been moved to /examples/jsm/loaders/FontLoader.js")}function fMe(){console.error("THREE.Font has been moved to /examples/jsm/loaders/FontLoader.js")}function pMe(){console.error("THREE.ImmediateRenderObject has been removed.")}class mMe extends Nc{constructor(e,t,r){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,r),this.samples=4}}class gMe extends RC{constructor(e,t,r,s){console.warn("THREE.DataTexture2DArray has been renamed to DataArrayTexture."),super(e,t,r,s)}}class _Me extends s2{constructor(e,t,r,s){console.warn("THREE.DataTexture3D has been renamed to Data3DTexture."),super(e,t,r,s)}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:hE}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=hE);const vMe=Object.freeze(Object.defineProperty({__proto__:null,ACESFilmicToneMapping:jF,AddEquation:p1,AddOperation:Jq,AdditiveAnimationBlendMode:KF,AdditiveBlending:_R,AlphaFormat:oQ,AlwaysDepth:Gq,AlwaysStencilFunc:bQ,AmbientLight:gZ,AmbientLightProbe:bCe,AnimationClip:Z$,AnimationLoader:aCe,AnimationMixer:FCe,AnimationObjectGroup:DCe,AnimationUtils:rCe,ArcCurve:WQ,ArrayCamera:LQ,ArrowHelper:rMe,Audio:bZ,AudioAnalyser:$Ce,AudioContext:y4,AudioListener:wCe,AudioLoader:vCe,AxesHelper:iMe,BackSide:cd,BasicDepthPacking:nb,BasicShadowMap:Aq,Bone:i4,BooleanKeyframeTrack:dT,Box2:WCe,Box3:d0,Box3Helper:tMe,BoxBufferGeometry:pu,BoxGeometry:pu,BoxHelper:eMe,BufferAttribute:Do,BufferGeometry:ui,BufferGeometryLoader:yZ,ByteType:tQ,Cache:tT,Camera:fE,CameraHelper:ZCe,CanvasTexture:C$e,CapsuleBufferGeometry:Pw,CapsuleGeometry:Pw,CatmullRomCurve3:VQ,CineonToneMapping:Zq,CircleBufferGeometry:Bw,CircleGeometry:Bw,ClampToEdgeWrapping:ap,Clock:b4,Color:Fn,ColorKeyframeTrack:g4,ColorManagement:ug,CompressedTexture:GQ,CompressedTextureLoader:lCe,ConeBufferGeometry:Fw,ConeGeometry:Fw,CubeCamera:xQ,CubeReflectionMapping:Gy,CubeRefractionMapping:Wy,CubeTexture:LC,CubeTextureLoader:uCe,CubeUVReflectionMapping:dE,CubicBezierCurve:o4,CubicBezierCurve3:jQ,CubicInterpolant:lZ,CullFaceBack:ZD,CullFaceFront:Mq,CullFaceFrontBack:k1e,CullFaceNone:Cq,Curve:p0,CurvePath:XQ,CustomBlending:Rq,CustomToneMapping:eQ,CylinderBufferGeometry:Gl,CylinderGeometry:Gl,Cylindrical:GCe,Data3DTexture:s2,DataArrayTexture:RC,DataTexture:vw,DataTexture2DArray:gMe,DataTexture3D:_Me,DataTextureLoader:cCe,DataUtils:uMe,DecrementStencilOp:V1e,DecrementWrapStencilOp:Y1e,DefaultLoadingManager:hZ,DepthFormat:By,DepthStencilFormat:Vy,DepthTexture:t4,DirectionalLight:mZ,DirectionalLightHelper:QCe,DiscreteInterpolant:uZ,DodecahedronBufferGeometry:zw,DodecahedronGeometry:zw,DoubleSide:lp,DstAlphaFactor:Pq,DstColorFactor:Fq,DynamicCopyUsage:aTe,DynamicDrawUsage:N1,DynamicReadUsage:iTe,EdgesGeometry:KQ,EllipseCurve:p2,EqualDepth:Vq,EqualStencilFunc:q1e,EquirectangularReflectionMapping:D$,EquirectangularRefractionMapping:P$,Euler:hT,EventDispatcher:jm,ExtrudeBufferGeometry:Uw,ExtrudeGeometry:Uw,FileLoader:bv,FlatShading:Iq,Float16BufferAttribute:GTe,Float32BufferAttribute:ar,Float64BufferAttribute:WTe,FloatType:r_,Fog:c2,FogExp2:u2,Font:fMe,FontLoader:dMe,FramebufferTexture:$$e,FrontSide:p_,Frustum:o2,GLBufferAttribute:HCe,GLSL1:uTe,GLSL3:xP,GreaterDepth:Yq,GreaterEqualDepth:jq,GreaterEqualStencilFunc:tTe,GreaterStencilFunc:Z1e,GridHelper:JCe,Group:ew,HalfFloatType:Q1,HemisphereLight:dZ,HemisphereLightHelper:KCe,HemisphereLightProbe:yCe,IcosahedronBufferGeometry:Hw,IcosahedronGeometry:Hw,ImageBitmapLoader:_Ce,ImageLoader:eC,ImageUtils:qF,ImmediateRenderObject:pMe,IncrementStencilOp:W1e,IncrementWrapStencilOp:j1e,InstancedBufferAttribute:Z1,InstancedBufferGeometry:y2,InstancedInterleavedBuffer:wR,InstancedMesh:zQ,Int16BufferAttribute:UTe,Int32BufferAttribute:HTe,Int8BufferAttribute:BTe,IntType:rQ,InterleavedBuffer:h2,InterleavedBufferAttribute:km,Interpolant:DC,InterpolateDiscrete:F$,InterpolateLinear:z$,InterpolateSmooth:bI,InvertStencilOp:X1e,KeepStencilOp:TI,KeyframeTrack:m0,LOD:BQ,LatheBufferGeometry:eT,LatheGeometry:eT,Layers:B1,LessDepth:Wq,LessEqualDepth:vR,LessEqualStencilFunc:Q1e,LessStencilFunc:J1e,Light:rb,LightProbe:_2,Line:Rf,Line3:E4,LineBasicMaterial:Pf,LineCurve:m2,LineCurve3:YQ,LineDashedMaterial:oZ,LineLoop:UQ,LineSegments:T_,LinearEncoding:xg,LinearFilter:wl,LinearInterpolant:m4,LinearMipMapLinearFilter:P1e,LinearMipMapNearestFilter:D1e,LinearMipmapLinearFilter:uT,LinearMipmapNearestFilter:YF,LinearSRGBColorSpace:xy,LinearToneMapping:qq,Loader:Ym,LoaderUtils:OP,LoadingManager:_4,LoopOnce:gQ,LoopPingPong:vQ,LoopRepeat:_Q,LuminanceAlphaFormat:uQ,LuminanceFormat:lQ,MOUSE:l1,Material:hd,MaterialLoader:v2,MathUtils:SQ,Matrix3:up,Matrix4:Qr,MaxEquation:rP,Mesh:Hn,MeshBasicMaterial:f0,MeshDepthMaterial:NC,MeshDistanceMaterial:l2,MeshLambertMaterial:iZ,MeshMatcapMaterial:sZ,MeshNormalMaterial:d4,MeshPhongMaterial:nZ,MeshPhysicalMaterial:tZ,MeshStandardMaterial:J$,MeshToonMaterial:rZ,MinEquation:nP,MirroredRepeatWrapping:B$,MixOperation:Kq,MultiplyBlending:tP,MultiplyOperation:IC,NearestFilter:Wl,NearestMipMapLinearFilter:N1e,NearestMipMapNearestFilter:L1e,NearestMipmapLinearFilter:bR,NearestMipmapNearestFilter:yR,NeverDepth:Hq,NeverStencilFunc:K1e,NoBlending:pp,NoColorSpace:U1e,NoToneMapping:l0,NormalAnimationBlendMode:i2,NormalBlending:mv,NotEqualDepth:Xq,NotEqualStencilFunc:eTe,NumberKeyframeTrack:q$,Object3D:ro,ObjectLoader:mCe,ObjectSpaceNormalMap:yQ,OctahedronBufferGeometry:i0,OctahedronGeometry:i0,OneFactor:Lq,OneMinusDstAlphaFactor:Bq,OneMinusDstColorFactor:zq,OneMinusSrcAlphaFactor:n2,OneMinusSrcColorFactor:Dq,OrthographicCamera:u_,PCFShadowMap:e2,PCFSoftShadowMap:Zx,PMREMGenerator:CP,ParametricGeometry:cMe,Path:j$,PerspectiveCamera:Za,Plane:ov,PlaneBufferGeometry:c0,PlaneGeometry:c0,PlaneHelper:nMe,PointLight:pZ,PointLightHelper:YCe,Points:HQ,PointsMaterial:f2,PolarGridHelper:qCe,PolyhedronBufferGeometry:m_,PolyhedronGeometry:m_,PositionalAudio:xCe,PropertyBinding:So,PropertyMixer:TZ,QuadraticBezierCurve:a4,QuadraticBezierCurve3:l4,Quaternion:Sl,QuaternionKeyframeTrack:mE,QuaternionLinearInterpolant:cZ,REVISION:hE,RGBADepthPacking:Nw,RGBAFormat:jp,RGBAIntegerFormat:pQ,RGBA_ASTC_10x10_Format:TP,RGBA_ASTC_10x5_Format:vP,RGBA_ASTC_10x6_Format:yP,RGBA_ASTC_10x8_Format:bP,RGBA_ASTC_12x10_Format:SP,RGBA_ASTC_12x12_Format:wP,RGBA_ASTC_4x4_Format:cP,RGBA_ASTC_5x4_Format:hP,RGBA_ASTC_5x5_Format:dP,RGBA_ASTC_6x5_Format:fP,RGBA_ASTC_6x6_Format:pP,RGBA_ASTC_8x5_Format:mP,RGBA_ASTC_8x6_Format:gP,RGBA_ASTC_8x8_Format:_P,RGBA_BPTC_Format:EP,RGBA_ETC2_EAC_Format:uP,RGBA_PVRTC_2BPPV1_Format:aP,RGBA_PVRTC_4BPPV1_Format:oP,RGBA_S3TC_DXT1_Format:_I,RGBA_S3TC_DXT3_Format:vI,RGBA_S3TC_DXT5_Format:yI,RGBFormat:aQ,RGB_ETC1_Format:mQ,RGB_ETC2_Format:lP,RGB_PVRTC_2BPPV1_Format:sP,RGB_PVRTC_4BPPV1_Format:iP,RGB_S3TC_DXT1_Format:gI,RGFormat:dQ,RGIntegerFormat:fQ,RawShaderMaterial:eZ,Ray:kC,Raycaster:w4,RectAreaLight:_Z,RedFormat:cQ,RedIntegerFormat:hQ,ReinhardToneMapping:Qq,RepeatWrapping:Lw,ReplaceStencilOp:G1e,ReverseSubtractEquation:VF,RingBufferGeometry:Gw,RingGeometry:Gw,SRGBColorSpace:J0,Scene:V$,ShaderChunk:ps,ShaderLib:op,ShaderMaterial:xd,ShadowMaterial:ZQ,Shape:F1,ShapeBufferGeometry:Ww,ShapeGeometry:Ww,ShapePath:sMe,ShapeUtils:c_,ShortType:nQ,Skeleton:d2,SkeletonHelper:jCe,SkinnedMesh:FQ,SmoothShading:O1e,Source:C1,Sphere:b_,SphereBufferGeometry:h0,SphereGeometry:h0,Spherical:NP,SphericalHarmonics3:vZ,SplineCurve:u4,SpotLight:fZ,SpotLightHelper:VCe,Sprite:PQ,SpriteMaterial:r4,SrcAlphaFactor:t2,SrcAlphaSaturateFactor:Uq,SrcColorFactor:Nq,StaticCopyUsage:oTe,StaticDrawUsage:H$,StaticReadUsage:rTe,StereoCamera:TCe,StreamCopyUsage:lTe,StreamDrawUsage:nTe,StreamReadUsage:sTe,StringKeyframeTrack:fT,SubtractEquation:kq,SubtractiveBlending:eP,TOUCH:u1,TangentSpaceNormalMap:cT,TetrahedronBufferGeometry:Vw,TetrahedronGeometry:Vw,TextGeometry:hMe,Texture:dc,TextureLoader:hCe,TorusBufferGeometry:t0,TorusGeometry:t0,TorusKnotBufferGeometry:jw,TorusKnotGeometry:jw,Triangle:Im,TriangleFanDrawMode:z1e,TriangleStripDrawMode:F1e,TrianglesDrawMode:B1e,TubeBufferGeometry:Yw,TubeGeometry:Yw,UVMapping:r2,Uint16BufferAttribute:QF,Uint32BufferAttribute:ZF,Uint8BufferAttribute:FTe,Uint8ClampedBufferAttribute:zTe,Uniform:no,UniformsGroup:UCe,UniformsLib:Xn,UniformsUtils:OC,UnsignedByteType:af,UnsignedInt248Type:Py,UnsignedIntType:dv,UnsignedShort4444Type:iQ,UnsignedShort5551Type:sQ,UnsignedShortType:XF,VSMShadowMap:E1,Vector2:jt,Vector3:Ae,Vector4:Ts,VectorKeyframeTrack:Q$,VideoTexture:x$e,WebGL1Renderer:NQ,WebGL3DRenderTarget:MTe,WebGLArrayRenderTarget:CTe,WebGLCubeRenderTarget:$Q,WebGLMultipleRenderTargets:ATe,WebGLMultisampleRenderTarget:mMe,WebGLRenderTarget:Nc,WebGLRenderer:n4,WebGLUtils:OQ,WireframeGeometry:h4,WrapAroundEnding:U$,ZeroCurvatureEnding:x1,ZeroFactor:Oq,ZeroSlopeEnding:$1,ZeroStencilOp:H1e,_SRGBAFormat:TR,sRGBEncoding:ms},Symbol.toStringTag,{value:"Module"}));var uv=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function wZ(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var A1={exports:{}},Qb={};/** +}`;function m$e(n,e,t){let r=new o2;const s=new Vt,o=new Vt,l=new Ts,u=new NC({depthPacking:Nw}),h=new l2,f={},g=t.maxTextureSize,y={0:cd,1:p_,2:lp},b=new xd({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Vt},radius:{value:4}},vertexShader:f$e,fragmentShader:p$e}),w=b.clone();w.defines.HORIZONTAL_PASS=1;const C=new ui;C.setAttribute("position",new Do(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const M=new Hn(C,b),A=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=e2,this.render=function(D,z,U){if(A.enabled===!1||A.autoUpdate===!1&&A.needsUpdate===!1||D.length===0)return;const V=n.getRenderTarget(),H=n.getActiveCubeFace(),oe=n.getActiveMipmapLevel(),le=n.state;le.setBlending(pp),le.buffers.color.setClear(1,1,1,1),le.buffers.depth.setTest(!0),le.setScissorTest(!1);for(let Z=0,q=D.length;Zg||s.y>g)&&(s.x>g&&(o.x=Math.floor(g/ue.x),s.x=o.x*ue.x,ae.mapSize.x=o.x),s.y>g&&(o.y=Math.floor(g/ue.y),s.y=o.y*ue.y,ae.mapSize.y=o.y)),ae.map===null){const we=this.type!==x1?{minFilter:Wl,magFilter:Wl}:{};ae.map=new Nc(s.x,s.y,we),ae.map.texture.name=he.name+".shadowMap",ae.camera.updateProjectionMatrix()}n.setRenderTarget(ae.map),n.clear();const ge=ae.getViewportCount();for(let we=0;we0){const q=le.uuid,he=z.uuid;let ae=f[q];ae===void 0&&(ae={},f[q]=ae);let ue=ae[he];ue===void 0&&(ue=le.clone(),ae[he]=ue),le=ue}return le.visible=z.visible,le.wireframe=z.wireframe,oe===x1?le.side=z.shadowSide!==null?z.shadowSide:z.side:le.side=z.shadowSide!==null?z.shadowSide:y[z.side],le.alphaMap=z.alphaMap,le.alphaTest=z.alphaTest,le.clipShadows=z.clipShadows,le.clippingPlanes=z.clippingPlanes,le.clipIntersection=z.clipIntersection,le.displacementMap=z.displacementMap,le.displacementScale=z.displacementScale,le.displacementBias=z.displacementBias,le.wireframeLinewidth=z.wireframeLinewidth,le.linewidth=z.linewidth,U.isPointLight===!0&&le.isMeshDistanceMaterial===!0&&(le.referencePosition.setFromMatrixPosition(U.matrixWorld),le.nearDistance=V,le.farDistance=H),le}function P(D,z,U,V,H){if(D.visible===!1)return;if(D.layers.test(z.layers)&&(D.isMesh||D.isLine||D.isPoints)&&(D.castShadow||D.receiveShadow&&H===x1)&&(!D.frustumCulled||r.intersectsObject(D))){D.modelViewMatrix.multiplyMatrices(U.matrixWorldInverse,D.matrixWorld);const le=e.update(D),Z=D.material;if(Array.isArray(Z)){const q=le.groups;for(let he=0,ae=q.length;he=1):J.indexOf("OpenGL ES")!==-1&&(we=parseFloat(/^OpenGL ES (\d)/.exec(J)[1]),ge=we>=2);let re=null,se={};const fe=n.getParameter(3088),Te=n.getParameter(2978),Fe=new Ts().fromArray(fe),Ie=new Ts().fromArray(Te);function qe(Ge,qt,pt){const Jt=new Uint8Array(4),Xt=n.createTexture();n.bindTexture(Ge,Xt),n.texParameteri(Ge,10241,9728),n.texParameteri(Ge,10240,9728);for(let xn=0;xnYe||xe.height>Ye)&&(St=Ye/Math.max(xe.width,xe.height)),St<1||ie===!0)if(typeof HTMLImageElement<"u"&&xe instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&xe instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&xe instanceof ImageBitmap){const It=ie?SR:Math.floor,mt=It(St*xe.width),Ke=It(St*xe.height);M===void 0&&(M=L(mt,Ke));const Oe=Pe?L(mt,Ke):M;return Oe.width=mt,Oe.height=Ke,Oe.getContext("2d").drawImage(xe,0,0,mt,Ke),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+xe.width+"x"+xe.height+") to ("+mt+"x"+Ke+")."),Oe}else return"data"in xe&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+xe.width+"x"+xe.height+")."),xe;return xe}function D(xe){return $P(xe.width)&&$P(xe.height)}function z(xe){return u?!1:xe.wrapS!==ap||xe.wrapT!==ap||xe.minFilter!==Wl&&xe.minFilter!==wl}function U(xe,ie){return xe.generateMipmaps&&ie&&xe.minFilter!==Wl&&xe.minFilter!==wl}function V(xe){n.generateMipmap(xe)}function H(xe,ie,Pe,Ye,St=!1){if(u===!1)return ie;if(xe!==null){if(n[xe]!==void 0)return n[xe];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+xe+"'")}let It=ie;return ie===6403&&(Pe===5126&&(It=33326),Pe===5131&&(It=33325),Pe===5121&&(It=33321)),ie===33319&&(Pe===5126&&(It=33328),Pe===5131&&(It=33327),Pe===5121&&(It=33323)),ie===6408&&(Pe===5126&&(It=34836),Pe===5131&&(It=34842),Pe===5121&&(It=Ye===ms&&St===!1?35907:32856),Pe===32819&&(It=32854),Pe===32820&&(It=32855)),(It===33325||It===33326||It===33327||It===33328||It===34842||It===34836)&&e.get("EXT_color_buffer_float"),It}function oe(xe,ie,Pe){return U(xe,Pe)===!0||xe.isFramebufferTexture&&xe.minFilter!==Wl&&xe.minFilter!==wl?Math.log2(Math.max(ie.width,ie.height))+1:xe.mipmaps!==void 0&&xe.mipmaps.length>0?xe.mipmaps.length:xe.isCompressedTexture&&Array.isArray(xe.image)?ie.mipmaps.length:1}function le(xe){return xe===Wl||xe===yR||xe===bR?9728:9729}function Z(xe){const ie=xe.target;ie.removeEventListener("dispose",Z),he(ie),ie.isVideoTexture&&C.delete(ie)}function q(xe){const ie=xe.target;ie.removeEventListener("dispose",q),ue(ie)}function he(xe){const ie=r.get(xe);if(ie.__webglInit===void 0)return;const Pe=xe.source,Ye=A.get(Pe);if(Ye){const St=Ye[ie.__cacheKey];St.usedTimes--,St.usedTimes===0&&ae(xe),Object.keys(Ye).length===0&&A.delete(Pe)}r.remove(xe)}function ae(xe){const ie=r.get(xe);n.deleteTexture(ie.__webglTexture);const Pe=xe.source,Ye=A.get(Pe);delete Ye[ie.__cacheKey],l.memory.textures--}function ue(xe){const ie=xe.texture,Pe=r.get(xe),Ye=r.get(ie);if(Ye.__webglTexture!==void 0&&(n.deleteTexture(Ye.__webglTexture),l.memory.textures--),xe.depthTexture&&xe.depthTexture.dispose(),xe.isWebGLCubeRenderTarget)for(let St=0;St<6;St++)n.deleteFramebuffer(Pe.__webglFramebuffer[St]),Pe.__webglDepthbuffer&&n.deleteRenderbuffer(Pe.__webglDepthbuffer[St]);else{if(n.deleteFramebuffer(Pe.__webglFramebuffer),Pe.__webglDepthbuffer&&n.deleteRenderbuffer(Pe.__webglDepthbuffer),Pe.__webglMultisampledFramebuffer&&n.deleteFramebuffer(Pe.__webglMultisampledFramebuffer),Pe.__webglColorRenderbuffer)for(let St=0;St=h&&console.warn("THREE.WebGLTextures: Trying to use "+xe+" texture units while this GPU supports only "+h),ge+=1,xe}function re(xe){const ie=[];return ie.push(xe.wrapS),ie.push(xe.wrapT),ie.push(xe.magFilter),ie.push(xe.minFilter),ie.push(xe.anisotropy),ie.push(xe.internalFormat),ie.push(xe.format),ie.push(xe.type),ie.push(xe.generateMipmaps),ie.push(xe.premultiplyAlpha),ie.push(xe.flipY),ie.push(xe.unpackAlignment),ie.push(xe.encoding),ie.join()}function se(xe,ie){const Pe=r.get(xe);if(xe.isVideoTexture&&At(xe),xe.isRenderTargetTexture===!1&&xe.version>0&&Pe.__version!==xe.version){const Ye=xe.image;if(Ye===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(Ye.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{rt(Pe,xe,ie);return}}t.activeTexture(33984+ie),t.bindTexture(3553,Pe.__webglTexture)}function fe(xe,ie){const Pe=r.get(xe);if(xe.version>0&&Pe.__version!==xe.version){rt(Pe,xe,ie);return}t.activeTexture(33984+ie),t.bindTexture(35866,Pe.__webglTexture)}function Te(xe,ie){const Pe=r.get(xe);if(xe.version>0&&Pe.__version!==xe.version){rt(Pe,xe,ie);return}t.activeTexture(33984+ie),t.bindTexture(32879,Pe.__webglTexture)}function Fe(xe,ie){const Pe=r.get(xe);if(xe.version>0&&Pe.__version!==xe.version){ft(Pe,xe,ie);return}t.activeTexture(33984+ie),t.bindTexture(34067,Pe.__webglTexture)}const Ie={[Lw]:10497,[ap]:33071,[B$]:33648},qe={[Wl]:9728,[yR]:9984,[bR]:9986,[wl]:9729,[YF]:9985,[cT]:9987};function Re(xe,ie,Pe){if(Pe?(n.texParameteri(xe,10242,Ie[ie.wrapS]),n.texParameteri(xe,10243,Ie[ie.wrapT]),(xe===32879||xe===35866)&&n.texParameteri(xe,32882,Ie[ie.wrapR]),n.texParameteri(xe,10240,qe[ie.magFilter]),n.texParameteri(xe,10241,qe[ie.minFilter])):(n.texParameteri(xe,10242,33071),n.texParameteri(xe,10243,33071),(xe===32879||xe===35866)&&n.texParameteri(xe,32882,33071),(ie.wrapS!==ap||ie.wrapT!==ap)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),n.texParameteri(xe,10240,le(ie.magFilter)),n.texParameteri(xe,10241,le(ie.minFilter)),ie.minFilter!==Wl&&ie.minFilter!==wl&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),e.has("EXT_texture_filter_anisotropic")===!0){const Ye=e.get("EXT_texture_filter_anisotropic");if(ie.type===r_&&e.has("OES_texture_float_linear")===!1||u===!1&&ie.type===Z1&&e.has("OES_texture_half_float_linear")===!1)return;(ie.anisotropy>1||r.get(ie).__currentAnisotropy)&&(n.texParameterf(xe,Ye.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(ie.anisotropy,s.getMaxAnisotropy())),r.get(ie).__currentAnisotropy=ie.anisotropy)}}function Ze(xe,ie){let Pe=!1;xe.__webglInit===void 0&&(xe.__webglInit=!0,ie.addEventListener("dispose",Z));const Ye=ie.source;let St=A.get(Ye);St===void 0&&(St={},A.set(Ye,St));const It=re(ie);if(It!==xe.__cacheKey){St[It]===void 0&&(St[It]={texture:n.createTexture(),usedTimes:0},l.memory.textures++,Pe=!0),St[It].usedTimes++;const mt=St[xe.__cacheKey];mt!==void 0&&(St[xe.__cacheKey].usedTimes--,mt.usedTimes===0&&ae(ie)),xe.__cacheKey=It,xe.__webglTexture=St[It].texture}return Pe}function rt(xe,ie,Pe){let Ye=3553;ie.isDataArrayTexture&&(Ye=35866),ie.isData3DTexture&&(Ye=32879);const St=Ze(xe,ie),It=ie.source;if(t.activeTexture(33984+Pe),t.bindTexture(Ye,xe.__webglTexture),It.version!==It.__currentVersion||St===!0){n.pixelStorei(37440,ie.flipY),n.pixelStorei(37441,ie.premultiplyAlpha),n.pixelStorei(3317,ie.unpackAlignment),n.pixelStorei(37443,0);const mt=z(ie)&&D(ie.image)===!1;let Ke=P(ie.image,mt,!1,g);Ke=gt(ie,Ke);const Oe=D(Ke)||u,Q=o.convert(ie.format,ie.encoding);let te=o.convert(ie.type),pe=H(ie.internalFormat,Q,te,ie.encoding,ie.isVideoTexture);Re(Ye,ie,Oe);let Ae;const Je=ie.mipmaps,jt=u&&ie.isVideoTexture!==!0,Ge=It.__currentVersion===void 0||St===!0,qt=oe(ie,Ke,Oe);if(ie.isDepthTexture)pe=6402,u?ie.type===r_?pe=36012:ie.type===dv?pe=33190:ie.type===Py?pe=35056:pe=33189:ie.type===r_&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),ie.format===By&&pe===6402&&ie.type!==XF&&ie.type!==dv&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),ie.type=dv,te=o.convert(ie.type)),ie.format===Vy&&pe===6402&&(pe=34041,ie.type!==Py&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),ie.type=Py,te=o.convert(ie.type))),Ge&&(jt?t.texStorage2D(3553,1,pe,Ke.width,Ke.height):t.texImage2D(3553,0,pe,Ke.width,Ke.height,0,Q,te,null));else if(ie.isDataTexture)if(Je.length>0&&Oe){jt&&Ge&&t.texStorage2D(3553,qt,pe,Je[0].width,Je[0].height);for(let pt=0,Jt=Je.length;pt>=1,Jt>>=1}}else if(Je.length>0&&Oe){jt&&Ge&&t.texStorage2D(3553,qt,pe,Je[0].width,Je[0].height);for(let pt=0,Jt=Je.length;pt0&&Ge++,t.texStorage2D(34067,Ge,Ae,Ke[0].width,Ke[0].height));for(let pt=0;pt<6;pt++)if(mt){Je?t.texSubImage2D(34069+pt,0,0,0,Ke[pt].width,Ke[pt].height,te,pe,Ke[pt].data):t.texImage2D(34069+pt,0,Ae,Ke[pt].width,Ke[pt].height,0,te,pe,Ke[pt].data);for(let Jt=0;Jt0&&Ct(xe)===!1){const Ke=It?ie:[ie];Pe.__webglMultisampledFramebuffer=n.createFramebuffer(),Pe.__webglColorRenderbuffer=[],t.bindFramebuffer(36160,Pe.__webglMultisampledFramebuffer);for(let Oe=0;Oe0&&Ct(xe)===!1){const ie=xe.isWebGLMultipleRenderTargets?xe.texture:[xe.texture],Pe=xe.width,Ye=xe.height;let St=16384;const It=[],mt=xe.stencilBuffer?33306:36096,Ke=r.get(xe),Oe=xe.isWebGLMultipleRenderTargets===!0;if(Oe)for(let Q=0;Q0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&ie.__useRenderToTexture!==!1}function At(xe){const ie=l.render.frame;C.get(xe)!==ie&&(C.set(xe,ie),xe.update())}function gt(xe,ie){const Pe=xe.encoding,Ye=xe.format,St=xe.type;return xe.isCompressedTexture===!0||xe.isVideoTexture===!0||xe.format===TR||Pe!==xg&&(Pe===ms?u===!1?e.has("EXT_sRGB")===!0&&Ye===jp?(xe.format=TR,xe.minFilter=wl,xe.generateMipmaps=!1):ie=qF.sRGBToLinear(ie):(Ye!==jp||St!==af)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture encoding:",Pe)),ie}this.allocateTextureUnit=J,this.resetTextureUnits=we,this.setTexture2D=se,this.setTexture2DArray=fe,this.setTexture3D=Te,this.setTextureCube=Fe,this.rebindTextures=it,this.setupRenderTarget=st,this.updateRenderTargetMipmap=Nt,this.updateMultisampleRenderTarget=kt,this.setupDepthRenderbuffer=He,this.setupFrameBufferTexture=ut,this.useMultisampledRTT=Ct}function LQ(n,e,t){const r=t.isWebGL2;function s(o,l=null){let u;if(o===af)return 5121;if(o===sQ)return 32819;if(o===oQ)return 32820;if(o===nQ)return 5120;if(o===rQ)return 5122;if(o===XF)return 5123;if(o===iQ)return 5124;if(o===dv)return 5125;if(o===r_)return 5126;if(o===Z1)return r?5131:(u=e.get("OES_texture_half_float"),u!==null?u.HALF_FLOAT_OES:null);if(o===aQ)return 6406;if(o===jp)return 6408;if(o===uQ)return 6409;if(o===cQ)return 6410;if(o===By)return 6402;if(o===Vy)return 34041;if(o===hQ)return 6403;if(o===lQ)return console.warn("THREE.WebGLRenderer: THREE.RGBFormat has been removed. Use THREE.RGBAFormat instead. https://github.com/mrdoob/three.js/pull/23228"),6408;if(o===TR)return u=e.get("EXT_sRGB"),u!==null?u.SRGB_ALPHA_EXT:null;if(o===dQ)return 36244;if(o===fQ)return 33319;if(o===pQ)return 33320;if(o===mQ)return 36249;if(o===gI||o===_I||o===vI||o===yI)if(l===ms)if(u=e.get("WEBGL_compressed_texture_s3tc_srgb"),u!==null){if(o===gI)return u.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(o===_I)return u.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(o===vI)return u.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(o===yI)return u.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(u=e.get("WEBGL_compressed_texture_s3tc"),u!==null){if(o===gI)return u.COMPRESSED_RGB_S3TC_DXT1_EXT;if(o===_I)return u.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(o===vI)return u.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(o===yI)return u.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(o===iP||o===sP||o===oP||o===aP)if(u=e.get("WEBGL_compressed_texture_pvrtc"),u!==null){if(o===iP)return u.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(o===sP)return u.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(o===oP)return u.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(o===aP)return u.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(o===gQ)return u=e.get("WEBGL_compressed_texture_etc1"),u!==null?u.COMPRESSED_RGB_ETC1_WEBGL:null;if(o===lP||o===uP)if(u=e.get("WEBGL_compressed_texture_etc"),u!==null){if(o===lP)return l===ms?u.COMPRESSED_SRGB8_ETC2:u.COMPRESSED_RGB8_ETC2;if(o===uP)return l===ms?u.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:u.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(o===cP||o===hP||o===dP||o===fP||o===pP||o===mP||o===gP||o===_P||o===vP||o===yP||o===bP||o===TP||o===SP||o===wP)if(u=e.get("WEBGL_compressed_texture_astc"),u!==null){if(o===cP)return l===ms?u.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:u.COMPRESSED_RGBA_ASTC_4x4_KHR;if(o===hP)return l===ms?u.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:u.COMPRESSED_RGBA_ASTC_5x4_KHR;if(o===dP)return l===ms?u.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:u.COMPRESSED_RGBA_ASTC_5x5_KHR;if(o===fP)return l===ms?u.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:u.COMPRESSED_RGBA_ASTC_6x5_KHR;if(o===pP)return l===ms?u.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:u.COMPRESSED_RGBA_ASTC_6x6_KHR;if(o===mP)return l===ms?u.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:u.COMPRESSED_RGBA_ASTC_8x5_KHR;if(o===gP)return l===ms?u.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:u.COMPRESSED_RGBA_ASTC_8x6_KHR;if(o===_P)return l===ms?u.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:u.COMPRESSED_RGBA_ASTC_8x8_KHR;if(o===vP)return l===ms?u.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:u.COMPRESSED_RGBA_ASTC_10x5_KHR;if(o===yP)return l===ms?u.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:u.COMPRESSED_RGBA_ASTC_10x6_KHR;if(o===bP)return l===ms?u.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:u.COMPRESSED_RGBA_ASTC_10x8_KHR;if(o===TP)return l===ms?u.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:u.COMPRESSED_RGBA_ASTC_10x10_KHR;if(o===SP)return l===ms?u.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:u.COMPRESSED_RGBA_ASTC_12x10_KHR;if(o===wP)return l===ms?u.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:u.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(o===EP)if(u=e.get("EXT_texture_compression_bptc"),u!==null){if(o===EP)return l===ms?u.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:u.COMPRESSED_RGBA_BPTC_UNORM_EXT}else return null;return o===Py?r?34042:(u=e.get("WEBGL_depth_texture"),u!==null?u.UNSIGNED_INT_24_8_WEBGL:null):n[o]!==void 0?n[o]:null}return{convert:s}}class NQ extends Za{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class ew extends ro{constructor(){super(),this.isGroup=!0,this.type="Group"}}const v$e={type:"move"};class FL{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new ew,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new ew,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new Me,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new Me),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new ew,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new Me,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new Me),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,r){let s=null,o=null,l=null;const u=this._targetRay,h=this._grip,f=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(f&&e.hand){l=!0;for(const M of e.hand.values()){const A=t.getJointPose(M,r);if(f.joints[M.jointName]===void 0){const L=new ew;L.matrixAutoUpdate=!1,L.visible=!1,f.joints[M.jointName]=L,f.add(L)}const k=f.joints[M.jointName];A!==null&&(k.matrix.fromArray(A.transform.matrix),k.matrix.decompose(k.position,k.rotation,k.scale),k.jointRadius=A.radius),k.visible=A!==null}const g=f.joints["index-finger-tip"],y=f.joints["thumb-tip"],b=g.position.distanceTo(y.position),w=.02,C=.005;f.inputState.pinching&&b>w+C?(f.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!f.inputState.pinching&&b<=w-C&&(f.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else h!==null&&e.gripSpace&&(o=t.getPose(e.gripSpace,r),o!==null&&(h.matrix.fromArray(o.transform.matrix),h.matrix.decompose(h.position,h.rotation,h.scale),o.linearVelocity?(h.hasLinearVelocity=!0,h.linearVelocity.copy(o.linearVelocity)):h.hasLinearVelocity=!1,o.angularVelocity?(h.hasAngularVelocity=!0,h.angularVelocity.copy(o.angularVelocity)):h.hasAngularVelocity=!1));u!==null&&(s=t.getPose(e.targetRaySpace,r),s===null&&o!==null&&(s=o),s!==null&&(u.matrix.fromArray(s.transform.matrix),u.matrix.decompose(u.position,u.rotation,u.scale),s.linearVelocity?(u.hasLinearVelocity=!0,u.linearVelocity.copy(s.linearVelocity)):u.hasLinearVelocity=!1,s.angularVelocity?(u.hasAngularVelocity=!0,u.angularVelocity.copy(s.angularVelocity)):u.hasAngularVelocity=!1,this.dispatchEvent(v$e)))}return u!==null&&(u.visible=s!==null),h!==null&&(h.visible=o!==null),f!==null&&(f.visible=l!==null),this}}class t4 extends dc{constructor(e,t,r,s,o,l,u,h,f,g){if(g=g!==void 0?g:By,g!==By&&g!==Vy)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");r===void 0&&g===By&&(r=dv),r===void 0&&g===Vy&&(r=Py),super(null,s,o,l,u,h,g,r,f),this.isDepthTexture=!0,this.image={width:e,height:t},this.magFilter=u!==void 0?u:Wl,this.minFilter=h!==void 0?h:Wl,this.flipY=!1,this.generateMipmaps=!1}}class y$e extends jm{constructor(e,t){super();const r=this;let s=null,o=1,l=null,u="local-floor",h=null,f=null,g=null,y=null,b=null,w=null;const C=t.getContextAttributes();let M=null,A=null;const k=[],L=[],P=new Za;P.layers.enable(1),P.viewport=new Ts;const D=new Za;D.layers.enable(2),D.viewport=new Ts;const z=[P,D],U=new NQ;U.layers.enable(1),U.layers.enable(2);let V=null,H=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(re){let se=k[re];return se===void 0&&(se=new FL,k[re]=se),se.getTargetRaySpace()},this.getControllerGrip=function(re){let se=k[re];return se===void 0&&(se=new FL,k[re]=se),se.getGripSpace()},this.getHand=function(re){let se=k[re];return se===void 0&&(se=new FL,k[re]=se),se.getHandSpace()};function oe(re){const se=L.indexOf(re.inputSource);if(se===-1)return;const fe=k[se];fe!==void 0&&fe.dispatchEvent({type:re.type,data:re.inputSource})}function le(){s.removeEventListener("select",oe),s.removeEventListener("selectstart",oe),s.removeEventListener("selectend",oe),s.removeEventListener("squeeze",oe),s.removeEventListener("squeezestart",oe),s.removeEventListener("squeezeend",oe),s.removeEventListener("end",le),s.removeEventListener("inputsourceschange",Z);for(let re=0;re=0&&(L[Te]=null,k[Te].dispatchEvent({type:"disconnected",data:fe}))}for(let se=0;se=L.length){L.push(fe),Te=Ie;break}else if(L[Ie]===null){L[Ie]=fe,Te=Ie;break}if(Te===-1)break}const Fe=k[Te];Fe&&Fe.dispatchEvent({type:"connected",data:fe})}}const q=new Me,he=new Me;function ae(re,se,fe){q.setFromMatrixPosition(se.matrixWorld),he.setFromMatrixPosition(fe.matrixWorld);const Te=q.distanceTo(he),Fe=se.projectionMatrix.elements,Ie=fe.projectionMatrix.elements,qe=Fe[14]/(Fe[10]-1),Re=Fe[14]/(Fe[10]+1),Ze=(Fe[9]+1)/Fe[5],rt=(Fe[9]-1)/Fe[5],ft=(Fe[8]-1)/Fe[0],ut=(Ie[8]+1)/Ie[0],ze=qe*ft,$e=qe*ut,He=Te/(-ft+ut),it=He*-ft;se.matrixWorld.decompose(re.position,re.quaternion,re.scale),re.translateX(it),re.translateZ(He),re.matrixWorld.compose(re.position,re.quaternion,re.scale),re.matrixWorldInverse.copy(re.matrixWorld).invert();const st=qe+He,Nt=Re+He,kt=ze-it,vt=$e+(Te-it),Ct=Ze*Re/Nt*st,At=rt*Re/Nt*st;re.projectionMatrix.makePerspective(kt,vt,Ct,At,st,Nt)}function ue(re,se){se===null?re.matrixWorld.copy(re.matrix):re.matrixWorld.multiplyMatrices(se.matrixWorld,re.matrix),re.matrixWorldInverse.copy(re.matrixWorld).invert()}this.updateCamera=function(re){if(s===null)return;U.near=D.near=P.near=re.near,U.far=D.far=P.far=re.far,(V!==U.near||H!==U.far)&&(s.updateRenderState({depthNear:U.near,depthFar:U.far}),V=U.near,H=U.far);const se=re.parent,fe=U.cameras;ue(U,se);for(let Fe=0;Fe0&&(M.alphaTest.value=A.alphaTest);const k=e.get(A).envMap;if(k&&(M.envMap.value=k,M.flipEnvMap.value=k.isCubeTexture&&k.isRenderTargetTexture===!1?-1:1,M.reflectivity.value=A.reflectivity,M.ior.value=A.ior,M.refractionRatio.value=A.refractionRatio),A.lightMap){M.lightMap.value=A.lightMap;const D=n.physicallyCorrectLights!==!0?Math.PI:1;M.lightMapIntensity.value=A.lightMapIntensity*D}A.aoMap&&(M.aoMap.value=A.aoMap,M.aoMapIntensity.value=A.aoMapIntensity);let L;A.map?L=A.map:A.specularMap?L=A.specularMap:A.displacementMap?L=A.displacementMap:A.normalMap?L=A.normalMap:A.bumpMap?L=A.bumpMap:A.roughnessMap?L=A.roughnessMap:A.metalnessMap?L=A.metalnessMap:A.alphaMap?L=A.alphaMap:A.emissiveMap?L=A.emissiveMap:A.clearcoatMap?L=A.clearcoatMap:A.clearcoatNormalMap?L=A.clearcoatNormalMap:A.clearcoatRoughnessMap?L=A.clearcoatRoughnessMap:A.iridescenceMap?L=A.iridescenceMap:A.iridescenceThicknessMap?L=A.iridescenceThicknessMap:A.specularIntensityMap?L=A.specularIntensityMap:A.specularColorMap?L=A.specularColorMap:A.transmissionMap?L=A.transmissionMap:A.thicknessMap?L=A.thicknessMap:A.sheenColorMap?L=A.sheenColorMap:A.sheenRoughnessMap&&(L=A.sheenRoughnessMap),L!==void 0&&(L.isWebGLRenderTarget&&(L=L.texture),L.matrixAutoUpdate===!0&&L.updateMatrix(),M.uvTransform.value.copy(L.matrix));let P;A.aoMap?P=A.aoMap:A.lightMap&&(P=A.lightMap),P!==void 0&&(P.isWebGLRenderTarget&&(P=P.texture),P.matrixAutoUpdate===!0&&P.updateMatrix(),M.uv2Transform.value.copy(P.matrix))}function o(M,A){M.diffuse.value.copy(A.color),M.opacity.value=A.opacity}function l(M,A){M.dashSize.value=A.dashSize,M.totalSize.value=A.dashSize+A.gapSize,M.scale.value=A.scale}function u(M,A,k,L){M.diffuse.value.copy(A.color),M.opacity.value=A.opacity,M.size.value=A.size*k,M.scale.value=L*.5,A.map&&(M.map.value=A.map),A.alphaMap&&(M.alphaMap.value=A.alphaMap),A.alphaTest>0&&(M.alphaTest.value=A.alphaTest);let P;A.map?P=A.map:A.alphaMap&&(P=A.alphaMap),P!==void 0&&(P.matrixAutoUpdate===!0&&P.updateMatrix(),M.uvTransform.value.copy(P.matrix))}function h(M,A){M.diffuse.value.copy(A.color),M.opacity.value=A.opacity,M.rotation.value=A.rotation,A.map&&(M.map.value=A.map),A.alphaMap&&(M.alphaMap.value=A.alphaMap),A.alphaTest>0&&(M.alphaTest.value=A.alphaTest);let k;A.map?k=A.map:A.alphaMap&&(k=A.alphaMap),k!==void 0&&(k.matrixAutoUpdate===!0&&k.updateMatrix(),M.uvTransform.value.copy(k.matrix))}function f(M,A){M.specular.value.copy(A.specular),M.shininess.value=Math.max(A.shininess,1e-4)}function g(M,A){A.gradientMap&&(M.gradientMap.value=A.gradientMap)}function y(M,A){M.roughness.value=A.roughness,M.metalness.value=A.metalness,A.roughnessMap&&(M.roughnessMap.value=A.roughnessMap),A.metalnessMap&&(M.metalnessMap.value=A.metalnessMap),e.get(A).envMap&&(M.envMapIntensity.value=A.envMapIntensity)}function b(M,A,k){M.ior.value=A.ior,A.sheen>0&&(M.sheenColor.value.copy(A.sheenColor).multiplyScalar(A.sheen),M.sheenRoughness.value=A.sheenRoughness,A.sheenColorMap&&(M.sheenColorMap.value=A.sheenColorMap),A.sheenRoughnessMap&&(M.sheenRoughnessMap.value=A.sheenRoughnessMap)),A.clearcoat>0&&(M.clearcoat.value=A.clearcoat,M.clearcoatRoughness.value=A.clearcoatRoughness,A.clearcoatMap&&(M.clearcoatMap.value=A.clearcoatMap),A.clearcoatRoughnessMap&&(M.clearcoatRoughnessMap.value=A.clearcoatRoughnessMap),A.clearcoatNormalMap&&(M.clearcoatNormalScale.value.copy(A.clearcoatNormalScale),M.clearcoatNormalMap.value=A.clearcoatNormalMap,A.side===cd&&M.clearcoatNormalScale.value.negate())),A.iridescence>0&&(M.iridescence.value=A.iridescence,M.iridescenceIOR.value=A.iridescenceIOR,M.iridescenceThicknessMinimum.value=A.iridescenceThicknessRange[0],M.iridescenceThicknessMaximum.value=A.iridescenceThicknessRange[1],A.iridescenceMap&&(M.iridescenceMap.value=A.iridescenceMap),A.iridescenceThicknessMap&&(M.iridescenceThicknessMap.value=A.iridescenceThicknessMap)),A.transmission>0&&(M.transmission.value=A.transmission,M.transmissionSamplerMap.value=k.texture,M.transmissionSamplerSize.value.set(k.width,k.height),A.transmissionMap&&(M.transmissionMap.value=A.transmissionMap),M.thickness.value=A.thickness,A.thicknessMap&&(M.thicknessMap.value=A.thicknessMap),M.attenuationDistance.value=A.attenuationDistance,M.attenuationColor.value.copy(A.attenuationColor)),M.specularIntensity.value=A.specularIntensity,M.specularColor.value.copy(A.specularColor),A.specularIntensityMap&&(M.specularIntensityMap.value=A.specularIntensityMap),A.specularColorMap&&(M.specularColorMap.value=A.specularColorMap)}function w(M,A){A.matcap&&(M.matcap.value=A.matcap)}function C(M,A){M.referencePosition.value.copy(A.referencePosition),M.nearDistance.value=A.nearDistance,M.farDistance.value=A.farDistance}return{refreshFogUniforms:t,refreshMaterialUniforms:r}}function T$e(n,e,t,r){let s={},o={},l=[];const u=t.isWebGL2?n.getParameter(35375):0;function h(L,P){const D=P.program;r.uniformBlockBinding(L,D)}function f(L,P){let D=s[L.id];D===void 0&&(C(L),D=g(L),s[L.id]=D,L.addEventListener("dispose",A));const z=P.program;r.updateUBOMapping(L,z);const U=e.render.frame;o[L.id]!==U&&(b(L),o[L.id]=U)}function g(L){const P=y();L.__bindingPointIndex=P;const D=n.createBuffer(),z=L.__size,U=L.usage;return n.bindBuffer(35345,D),n.bufferData(35345,z,U),n.bindBuffer(35345,null),n.bindBufferBase(35345,P,D),D}function y(){for(let L=0;L0){U=D%z;const Z=z-U;U!==0&&Z-le.boundary<0&&(D+=z-U,oe.__offset=D)}D+=le.storage}return U=D%z,U>0&&(D+=z-U),L.__size=D,L.__cache={},this}function M(L){const P=L.value,D={boundary:0,storage:0};return typeof P=="number"?(D.boundary=4,D.storage=4):P.isVector2?(D.boundary=8,D.storage=8):P.isVector3||P.isColor?(D.boundary=16,D.storage=12):P.isVector4?(D.boundary=16,D.storage=16):P.isMatrix3?(D.boundary=48,D.storage=48):P.isMatrix4?(D.boundary=64,D.storage=64):P.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",P),D}function A(L){const P=L.target;P.removeEventListener("dispose",A);const D=l.indexOf(P.__bindingPointIndex);l.splice(D,1),n.deleteBuffer(s[P.id]),delete s[P.id],delete o[P.id]}function k(){for(const L in s)n.deleteBuffer(s[L]);l=[],s={},o={}}return{bind:h,update:f,dispose:k}}function S$e(){const n=W$("canvas");return n.style.display="block",n}function n4(n={}){this.isWebGLRenderer=!0;const e=n.canvas!==void 0?n.canvas:S$e(),t=n.context!==void 0?n.context:null,r=n.depth!==void 0?n.depth:!0,s=n.stencil!==void 0?n.stencil:!0,o=n.antialias!==void 0?n.antialias:!1,l=n.premultipliedAlpha!==void 0?n.premultipliedAlpha:!0,u=n.preserveDrawingBuffer!==void 0?n.preserveDrawingBuffer:!1,h=n.powerPreference!==void 0?n.powerPreference:"default",f=n.failIfMajorPerformanceCaveat!==void 0?n.failIfMajorPerformanceCaveat:!1;let g;t!==null?g=t.getContextAttributes().alpha:g=n.alpha!==void 0?n.alpha:!1;let y=null,b=null;const w=[],C=[];this.domElement=e,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=xg,this.physicallyCorrectLights=!1,this.toneMapping=l0,this.toneMappingExposure=1,Object.defineProperties(this,{gammaFactor:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaFactor has been removed."),2},set:function(){console.warn("THREE.WebGLRenderer: .gammaFactor has been removed.")}}});const M=this;let A=!1,k=0,L=0,P=null,D=-1,z=null;const U=new Ts,V=new Ts;let H=null,oe=e.width,le=e.height,Z=1,q=null,he=null;const ae=new Ts(0,0,oe,le),ue=new Ts(0,0,oe,le);let ge=!1;const we=new o2;let J=!1,re=!1,se=null;const fe=new Qr,Te=new Vt,Fe=new Me,Ie={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function qe(){return P===null?Z:1}let Re=t;function Ze(De,_t){for(let Mt=0;Mt0?b=C[C.length-1]:b=null,w.pop(),w.length>0?y=w[w.length-1]:y=null};function Ei(De,_t,Mt,bt){if(De.visible===!1)return;if(De.layers.test(_t.layers)){if(De.isGroup)Mt=De.renderOrder;else if(De.isLOD)De.autoUpdate===!0&&De.update(_t);else if(De.isLight)b.pushLight(De),De.castShadow&&b.pushShadow(De);else if(De.isSprite){if(!De.frustumCulled||we.intersectsSprite(De)){bt&&Fe.setFromMatrixPosition(De.matrixWorld).applyMatrix4(fe);const Wn=vt.update(De),rr=De.material;rr.visible&&y.push(De,Wn,rr,Mt,Fe.z,null)}}else if((De.isMesh||De.isLine||De.isPoints)&&(De.isSkinnedMesh&&De.skeleton.frame!==ze.render.frame&&(De.skeleton.update(),De.skeleton.frame=ze.render.frame),!De.frustumCulled||we.intersectsObject(De))){bt&&Fe.setFromMatrixPosition(De.matrixWorld).applyMatrix4(fe);const Wn=vt.update(De),rr=De.material;if(Array.isArray(rr)){const _r=Wn.groups;for(let $r=0,si=_r.length;$r0&&mr(Wt,_t,Mt),bt&&ut.viewport(U.copy(bt)),Wt.length>0&&ne(Wt,_t,Mt),Wn.length>0&&ne(Wn,_t,Mt),rr.length>0&&ne(rr,_t,Mt),ut.buffers.depth.setTest(!0),ut.buffers.depth.setMask(!0),ut.buffers.color.setMask(!0),ut.setPolygonOffset(!1)}function mr(De,_t,Mt){const bt=ft.isWebGL2;se===null&&(se=new Nc(1,1,{generateMipmaps:!0,type:rt.has("EXT_color_buffer_half_float")?Z1:af,minFilter:cT,samples:bt&&o===!0?4:0})),M.getDrawingBufferSize(Te),bt?se.setSize(Te.x,Te.y):se.setSize(SR(Te.x),SR(Te.y));const Wt=M.getRenderTarget();M.setRenderTarget(se),M.clear();const Wn=M.toneMapping;M.toneMapping=l0,ne(De,_t,Mt),M.toneMapping=Wn,He.updateMultisampleRenderTarget(se),He.updateRenderTargetMipmap(se),M.setRenderTarget(Wt)}function ne(De,_t,Mt){const bt=_t.isScene===!0?_t.overrideMaterial:null;for(let Wt=0,Wn=De.length;Wt0&&He.useMultisampledRTT(De)===!1?Wt=$e.get(De).__webglMultisampledFramebuffer:Wt=$r,U.copy(De.viewport),V.copy(De.scissor),H=De.scissorTest}else U.copy(ae).multiplyScalar(Z).floor(),V.copy(ue).multiplyScalar(Z).floor(),H=ge;if(ut.bindFramebuffer(36160,Wt)&&ft.drawBuffers&&bt&&ut.drawBuffers(De,Wt),ut.viewport(U),ut.scissor(V),ut.setScissorTest(H),Wn){const _r=$e.get(De.texture);Re.framebufferTexture2D(36160,36064,34069+_t,_r.__webglTexture,Mt)}else if(rr){const _r=$e.get(De.texture),$r=_t||0;Re.framebufferTextureLayer(36160,36064,_r.__webglTexture,Mt||0,$r)}D=-1},this.readRenderTargetPixels=function(De,_t,Mt,bt,Wt,Wn,rr){if(!(De&&De.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let _r=$e.get(De).__webglFramebuffer;if(De.isWebGLCubeRenderTarget&&rr!==void 0&&(_r=_r[rr]),_r){ut.bindFramebuffer(36160,_r);try{const $r=De.texture,si=$r.format,Br=$r.type;if(si!==jp&&Ke.convert(si)!==Re.getParameter(35739)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const Yr=Br===Z1&&(rt.has("EXT_color_buffer_half_float")||ft.isWebGL2&&rt.has("EXT_color_buffer_float"));if(Br!==af&&Ke.convert(Br)!==Re.getParameter(35738)&&!(Br===r_&&(ft.isWebGL2||rt.has("OES_texture_float")||rt.has("WEBGL_color_buffer_float")))&&!Yr){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}_t>=0&&_t<=De.width-bt&&Mt>=0&&Mt<=De.height-Wt&&Re.readPixels(_t,Mt,bt,Wt,Ke.convert(si),Ke.convert(Br),Wn)}finally{const $r=P!==null?$e.get(P).__webglFramebuffer:null;ut.bindFramebuffer(36160,$r)}}},this.copyFramebufferToTexture=function(De,_t,Mt=0){const bt=Math.pow(2,-Mt),Wt=Math.floor(_t.image.width*bt),Wn=Math.floor(_t.image.height*bt);He.setTexture2D(_t,0),Re.copyTexSubImage2D(3553,Mt,0,0,De.x,De.y,Wt,Wn),ut.unbindTexture()},this.copyTextureToTexture=function(De,_t,Mt,bt=0){const Wt=_t.image.width,Wn=_t.image.height,rr=Ke.convert(Mt.format),_r=Ke.convert(Mt.type);He.setTexture2D(Mt,0),Re.pixelStorei(37440,Mt.flipY),Re.pixelStorei(37441,Mt.premultiplyAlpha),Re.pixelStorei(3317,Mt.unpackAlignment),_t.isDataTexture?Re.texSubImage2D(3553,bt,De.x,De.y,Wt,Wn,rr,_r,_t.image.data):_t.isCompressedTexture?Re.compressedTexSubImage2D(3553,bt,De.x,De.y,_t.mipmaps[0].width,_t.mipmaps[0].height,rr,_t.mipmaps[0].data):Re.texSubImage2D(3553,bt,De.x,De.y,rr,_r,_t.image),bt===0&&Mt.generateMipmaps&&Re.generateMipmap(3553),ut.unbindTexture()},this.copyTextureToTexture3D=function(De,_t,Mt,bt,Wt=0){if(M.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const Wn=De.max.x-De.min.x+1,rr=De.max.y-De.min.y+1,_r=De.max.z-De.min.z+1,$r=Ke.convert(bt.format),si=Ke.convert(bt.type);let Br;if(bt.isData3DTexture)He.setTexture3D(bt,0),Br=32879;else if(bt.isDataArrayTexture)He.setTexture2DArray(bt,0),Br=35866;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}Re.pixelStorei(37440,bt.flipY),Re.pixelStorei(37441,bt.premultiplyAlpha),Re.pixelStorei(3317,bt.unpackAlignment);const Yr=Re.getParameter(3314),Ss=Re.getParameter(32878),Oa=Re.getParameter(3316),Eo=Re.getParameter(3315),Yl=Re.getParameter(32877),nn=Mt.isCompressedTexture?Mt.mipmaps[0]:Mt.image;Re.pixelStorei(3314,nn.width),Re.pixelStorei(32878,nn.height),Re.pixelStorei(3316,De.min.x),Re.pixelStorei(3315,De.min.y),Re.pixelStorei(32877,De.min.z),Mt.isDataTexture||Mt.isData3DTexture?Re.texSubImage3D(Br,Wt,_t.x,_t.y,_t.z,Wn,rr,_r,$r,si,nn.data):Mt.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),Re.compressedTexSubImage3D(Br,Wt,_t.x,_t.y,_t.z,Wn,rr,_r,$r,nn.data)):Re.texSubImage3D(Br,Wt,_t.x,_t.y,_t.z,Wn,rr,_r,$r,si,nn),Re.pixelStorei(3314,Yr),Re.pixelStorei(32878,Ss),Re.pixelStorei(3316,Oa),Re.pixelStorei(3315,Eo),Re.pixelStorei(32877,Yl),Wt===0&&bt.generateMipmaps&&Re.generateMipmap(Br),ut.unbindTexture()},this.initTexture=function(De){De.isCubeTexture?He.setTextureCube(De,0):De.isData3DTexture?He.setTexture3D(De,0):De.isDataArrayTexture?He.setTexture2DArray(De,0):He.setTexture2D(De,0),ut.unbindTexture()},this.resetState=function(){k=0,L=0,P=null,ut.reset(),Oe.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}class DQ extends n4{}DQ.prototype.isWebGL1Renderer=!0;class u2{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new Fn(e),this.density=t}clone(){return new u2(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}class c2{constructor(e,t=1,r=1e3){this.isFog=!0,this.name="",this.color=new Fn(e),this.near=t,this.far=r}clone(){return new c2(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}class V$ extends ro{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),t}}class h2{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=H$,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=Pm()}onUploadCallback(){}set needsUpdate(e){e===!0&&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,r){e*=this.stride,r*=t.stride;for(let s=0,o=this.stride;se.far||t.push({distance:h,point:cx.clone(),uv:Im.getUV(cx,lA,dx,uA,JG,zL,qG,new Vt),face:null,object:this})}copy(e,t){return super.copy(e,t),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}function cA(n,e,t,r,s,o){RS.subVectors(n,t).addScalar(.5).multiply(r),s!==void 0?(hx.x=o*RS.x-s*RS.y,hx.y=s*RS.x+o*RS.y):hx.copy(RS),n.copy(e),n.x+=hx.x,n.y+=hx.y,n.applyMatrix4(PQ)}const hA=new Me,QG=new Me;class FQ extends ro{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 r=0,s=t.length;r0){let r,s;for(r=1,s=t.length;r0){hA.setFromMatrixPosition(this.matrixWorld);const r=e.ray.origin.distanceTo(hA);this.getObjectForDistance(r).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){hA.setFromMatrixPosition(e.matrixWorld),QG.setFromMatrixPosition(this.matrixWorld);const r=hA.distanceTo(QG)/e.zoom;t[0].object.visible=!0;let s,o;for(s=1,o=t.length;s=t[s].distance;s++)t[s-1].object.visible=!1,t[s].object.visible=!0;for(this._currentLevel=s-1;sh)continue;b.applyMatrix4(this.matrixWorld);const U=e.ray.origin.distanceTo(b);Ue.far||t.push({distance:U,point:y.clone().applyMatrix4(this.matrixWorld),index:L,face:null,faceIndex:null,object:this})}}else{const A=Math.max(0,l.start),k=Math.min(M.count,l.start+l.count);for(let L=A,P=k-1;Lh)continue;b.applyMatrix4(this.matrixWorld);const D=e.ray.origin.distanceTo(b);De.far||t.push({distance:D,point:y.clone().applyMatrix4(this.matrixWorld),index:L,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){const r=e[t[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;s0){const r=e[t[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;ss.far)return;o.push({distance:f,distanceToRay:Math.sqrt(u),point:h,index:e,face:null,object:l})}}class x$e extends dc{constructor(e,t,r,s,o,l,u,h,f){super(e,t,r,s,o,l,u,h,f),this.isVideoTexture=!0,this.minFilter=l!==void 0?l:wl,this.magFilter=o!==void 0?o:wl,this.generateMipmaps=!1;const g=this;function y(){g.needsUpdate=!0,e.requestVideoFrameCallback(y)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(y)}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;!("requestVideoFrameCallback"in e)&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class $$e extends dc{constructor(e,t,r){super({width:e,height:t}),this.isFramebufferTexture=!0,this.format=r,this.magFilter=Wl,this.minFilter=Wl,this.generateMipmaps=!1,this.needsUpdate=!0}}class WQ extends dc{constructor(e,t,r,s,o,l,u,h,f,g,y,b){super(null,l,u,h,f,g,s,o,y,b),this.isCompressedTexture=!0,this.image={width:t,height:r},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class C$e extends dc{constructor(e,t,r,s,o,l,u,h,f){super(e,t,r,s,o,l,u,h,f),this.isCanvasTexture=!0,this.needsUpdate=!0}}class p0{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){const r=this.getUtoTmapping(e);return this.getPoint(r,t)}getPoints(e=5){const t=[];for(let r=0;r<=e;r++)t.push(this.getPoint(r/e));return t}getSpacedPoints(e=5){const t=[];for(let r=0;r<=e;r++)t.push(this.getPointAt(r/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 r,s=this.getPoint(0),o=0;t.push(0);for(let l=1;l<=e;l++)r=this.getPoint(l/e),o+=r.distanceTo(s),t.push(o),s=r;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){const r=this.getLengths();let s=0;const o=r.length;let l;t?l=t:l=e*r[o-1];let u=0,h=o-1,f;for(;u<=h;)if(s=Math.floor(u+(h-u)/2),f=r[s]-l,f<0)u=s+1;else if(f>0)h=s-1;else{h=s;break}if(s=h,r[s]===l)return s/(o-1);const g=r[s],y=r[s+1]-g,b=(l-g)/y;return(s+b)/(o-1)}getTangent(e,t){let r=e-1e-4,s=e+1e-4;r<0&&(r=0),s>1&&(s=1);const o=this.getPoint(r),l=this.getPoint(s),u=t||(o.isVector2?new Vt:new Me);return u.copy(l).sub(o).normalize(),u}getTangentAt(e,t){const r=this.getUtoTmapping(e);return this.getTangent(r,t)}computeFrenetFrames(e,t){const r=new Me,s=[],o=[],l=[],u=new Me,h=new Qr;for(let w=0;w<=e;w++){const C=w/e;s[w]=this.getTangentAt(C,new Me)}o[0]=new Me,l[0]=new Me;let f=Number.MAX_VALUE;const g=Math.abs(s[0].x),y=Math.abs(s[0].y),b=Math.abs(s[0].z);g<=f&&(f=g,r.set(1,0,0)),y<=f&&(f=y,r.set(0,1,0)),b<=f&&r.set(0,0,1),u.crossVectors(s[0],r).normalize(),o[0].crossVectors(s[0],u),l[0].crossVectors(s[0],o[0]);for(let w=1;w<=e;w++){if(o[w]=o[w-1].clone(),l[w]=l[w-1].clone(),u.crossVectors(s[w-1],s[w]),u.length()>Number.EPSILON){u.normalize();const C=Math.acos(hh(s[w-1].dot(s[w]),-1,1));o[w].applyMatrix4(h.makeRotationAxis(u,C))}l[w].crossVectors(s[w],o[w])}if(t===!0){let w=Math.acos(hh(o[0].dot(o[e]),-1,1));w/=e,s[0].dot(u.crossVectors(o[0],o[e]))>0&&(w=-w);for(let C=1;C<=e;C++)o[C].applyMatrix4(h.makeRotationAxis(s[C],w*C)),l[C].crossVectors(s[C],o[C])}return{tangents:s,normals:o,binormals:l}}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 p2 extends p0{constructor(e=0,t=0,r=1,s=1,o=0,l=Math.PI*2,u=!1,h=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=r,this.yRadius=s,this.aStartAngle=o,this.aEndAngle=l,this.aClockwise=u,this.aRotation=h}getPoint(e,t){const r=t||new Vt,s=Math.PI*2;let o=this.aEndAngle-this.aStartAngle;const l=Math.abs(o)s;)o-=s;o0?0:(Math.floor(Math.abs(u)/o)+1)*o:h===0&&u===o-1&&(u=o-2,h=1);let f,g;this.closed||u>0?f=s[(u-1)%o]:(gA.subVectors(s[0],s[1]).add(s[0]),f=gA);const y=s[u%o],b=s[(u+1)%o];if(this.closed||u+2s.length-2?s.length-1:l+1],y=s[l>s.length-3?s.length-1:l+2];return r.set(f6(u,h.x,f.x,g.x,y.x),f6(u,h.y,f.y,g.y,y.y)),r}copy(e){super.copy(e),this.points=[];for(let t=0,r=e.points.length;t=r){const l=s[o]-r,u=this.curves[o],h=u.getLength(),f=h===0?0:1-l/h;return u.getPointAt(f,t)}o++}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 r=0,s=this.curves.length;r1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,r=e.curves.length;t0){const y=f.getPoint(0);y.equals(this.currentPoint)||this.lineTo(y.x,y.y)}this.curves.push(f);const g=f.getPoint(1);return this.currentPoint.copy(g),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 tT extends ui{constructor(e=[new Vt(0,-.5),new Vt(.5,0),new Vt(0,.5)],t=12,r=0,s=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:r,phiLength:s},t=Math.floor(t),s=hh(s,0,Math.PI*2);const o=[],l=[],u=[],h=[],f=[],g=1/t,y=new Me,b=new Vt,w=new Me,C=new Me,M=new Me;let A=0,k=0;for(let L=0;L<=e.length-1;L++)switch(L){case 0:A=e[L+1].x-e[L].x,k=e[L+1].y-e[L].y,w.x=k*1,w.y=-A,w.z=k*0,M.copy(w),w.normalize(),h.push(w.x,w.y,w.z);break;case e.length-1:h.push(M.x,M.y,M.z);break;default:A=e[L+1].x-e[L].x,k=e[L+1].y-e[L].y,w.x=k*1,w.y=-A,w.z=k*0,C.copy(w),w.x+=M.x,w.y+=M.y,w.z+=M.z,w.normalize(),h.push(w.x,w.y,w.z),M.copy(C)}for(let L=0;L<=t;L++){const P=r+L*g*s,D=Math.sin(P),z=Math.cos(P);for(let U=0;U<=e.length-1;U++){y.x=e[U].x*D,y.y=e[U].y,y.z=e[U].x*z,l.push(y.x,y.y,y.z),b.x=L/t,b.y=U/(e.length-1),u.push(b.x,b.y);const V=h[3*U+0]*D,H=h[3*U+1],oe=h[3*U+0]*z;f.push(V,H,oe)}}for(let L=0;L0&&P(!0),t>0&&P(!1)),this.setIndex(g),this.setAttribute("position",new ar(y,3)),this.setAttribute("normal",new ar(b,3)),this.setAttribute("uv",new ar(w,2));function L(){const D=new Me,z=new Me;let U=0;const V=(t-e)/r;for(let H=0;H<=o;H++){const oe=[],le=H/o,Z=le*(t-e)+e;for(let q=0;q<=s;q++){const he=q/s,ae=he*h+u,ue=Math.sin(ae),ge=Math.cos(ae);z.x=Z*ue,z.y=-le*r+A,z.z=Z*ge,y.push(z.x,z.y,z.z),D.set(ue,V,ge).normalize(),b.push(D.x,D.y,D.z),w.push(he,1-le),oe.push(C++)}M.push(oe)}for(let H=0;H.9&&V<.1&&(P<.2&&(l[L+0]+=1),D<.2&&(l[L+2]+=1),z<.2&&(l[L+4]+=1))}}function b(L){o.push(L.x,L.y,L.z)}function w(L,P){const D=L*3;P.x=e[D+0],P.y=e[D+1],P.z=e[D+2]}function C(){const L=new Me,P=new Me,D=new Me,z=new Me,U=new Vt,V=new Vt,H=new Vt;for(let oe=0,le=0;oe80*t){u=f=n[0],h=g=n[1];for(let C=t;Cf&&(f=y),b>g&&(g=b);w=Math.max(f-u,g-h),w=w!==0?1/w:0}return Y$(o,l,t,u,h,w),l}};function qQ(n,e,t,r,s){let o,l;if(s===q$e(n,e,t,r)>0)for(o=e;o=e;o-=r)l=p6(o,n[o],n[o+1],l);return l&&g2(l,l.next)&&(K$(l),l=l.next),l}function jy(n,e){if(!n)return n;e||(e=n);let t=n,r;do if(r=!1,!t.steiner&&(g2(t,t.next)||lc(t.prev,t,t.next)===0)){if(K$(t),t=e=t.prev,t===t.next)break;r=!0}else t=t.next;while(r||t!==e);return e}function Y$(n,e,t,r,s,o,l){if(!n)return;!l&&o&&V$e(n,r,s,o);let u=n,h,f;for(;n.prev!==n.next;){if(h=n.prev,f=n.next,o?P$e(n,r,s,o):D$e(n)){e.push(h.i/t),e.push(n.i/t),e.push(f.i/t),K$(n),n=f.next,u=f.next;continue}if(n=f,n===u){l?l===1?(n=B$e(jy(n),e,t),Y$(n,e,t,r,s,o,2)):l===2&&F$e(n,e,t,r,s,o):Y$(jy(n),e,t,r,s,o,1);break}}}function D$e(n){const e=n.prev,t=n,r=n.next;if(lc(e,t,r)>=0)return!1;let s=n.next.next;for(;s!==n.prev;){if(tw(e.x,e.y,t.x,t.y,r.x,r.y,s.x,s.y)&&lc(s.prev,s,s.next)>=0)return!1;s=s.next}return!0}function P$e(n,e,t,r){const s=n.prev,o=n,l=n.next;if(lc(s,o,l)>=0)return!1;const u=s.xo.x?s.x>l.x?s.x:l.x:o.x>l.x?o.x:l.x,g=s.y>o.y?s.y>l.y?s.y:l.y:o.y>l.y?o.y:l.y,y=IP(u,h,e,t,r),b=IP(f,g,e,t,r);let w=n.prevZ,C=n.nextZ;for(;w&&w.z>=y&&C&&C.z<=b;){if(w!==n.prev&&w!==n.next&&tw(s.x,s.y,o.x,o.y,l.x,l.y,w.x,w.y)&&lc(w.prev,w,w.next)>=0||(w=w.prevZ,C!==n.prev&&C!==n.next&&tw(s.x,s.y,o.x,o.y,l.x,l.y,C.x,C.y)&&lc(C.prev,C,C.next)>=0))return!1;C=C.nextZ}for(;w&&w.z>=y;){if(w!==n.prev&&w!==n.next&&tw(s.x,s.y,o.x,o.y,l.x,l.y,w.x,w.y)&&lc(w.prev,w,w.next)>=0)return!1;w=w.prevZ}for(;C&&C.z<=b;){if(C!==n.prev&&C!==n.next&&tw(s.x,s.y,o.x,o.y,l.x,l.y,C.x,C.y)&&lc(C.prev,C,C.next)>=0)return!1;C=C.nextZ}return!0}function B$e(n,e,t){let r=n;do{const s=r.prev,o=r.next.next;!g2(s,o)&&QQ(s,r,r.next,o)&&X$(s,o)&&X$(o,s)&&(e.push(s.i/t),e.push(r.i/t),e.push(o.i/t),K$(r),K$(r.next),r=n=o),r=r.next}while(r!==n);return jy(r)}function F$e(n,e,t,r,s,o){let l=n;do{let u=l.next.next;for(;u!==l.prev;){if(l.i!==u.i&&X$e(l,u)){let h=ZQ(l,u);l=jy(l,l.next),h=jy(h,h.next),Y$(l,e,t,r,s,o),Y$(h,e,t,r,s,o);return}u=u.next}l=l.next}while(l!==n)}function z$e(n,e,t,r){const s=[];let o,l,u,h,f;for(o=0,l=e.length;o=t.next.y&&t.next.y!==t.y){const b=t.x+(s-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(b<=r&&b>o){if(o=b,b===r){if(s===t.y)return t;if(s===t.next.y)return t.next}l=t.x=t.x&&t.x>=h&&r!==t.x&&tw(sl.x||t.x===l.x&&W$e(l,t)))&&(l=t,g=y)),t=t.next;while(t!==u);return l}function W$e(n,e){return lc(n.prev,n,e.prev)<0&&lc(e.next,n,n.next)<0}function V$e(n,e,t,r){let s=n;do s.z===null&&(s.z=IP(s.x,s.y,e,t,r)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next;while(s!==n);s.prevZ.nextZ=null,s.prevZ=null,j$e(s)}function j$e(n){let e,t,r,s,o,l,u,h,f=1;do{for(t=n,n=null,o=null,l=0;t;){for(l++,r=t,u=0,e=0;e0||h>0&&r;)u!==0&&(h===0||!r||t.z<=r.z)?(s=t,t=t.nextZ,u--):(s=r,r=r.nextZ,h--),o?o.nextZ=s:n=s,s.prevZ=o,o=s;t=r}o.nextZ=null,f*=2}while(l>1);return n}function IP(n,e,t,r,s){return n=32767*(n-t)*s,e=32767*(e-r)*s,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,n|e<<1}function Y$e(n){let e=n,t=n;do(e.x=0&&(n-l)*(r-u)-(t-l)*(e-u)>=0&&(t-l)*(o-u)-(s-l)*(r-u)>=0}function X$e(n,e){return n.next.i!==e.i&&n.prev.i!==e.i&&!K$e(n,e)&&(X$(n,e)&&X$(e,n)&&J$e(n,e)&&(lc(n.prev,n,e.prev)||lc(n,e.prev,e))||g2(n,e)&&lc(n.prev,n,n.next)>0&&lc(e.prev,e,e.next)>0)}function lc(n,e,t){return(e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y)}function g2(n,e){return n.x===e.x&&n.y===e.y}function QQ(n,e,t,r){const s=TA(lc(n,e,t)),o=TA(lc(n,e,r)),l=TA(lc(t,r,n)),u=TA(lc(t,r,e));return!!(s!==o&&l!==u||s===0&&bA(n,t,e)||o===0&&bA(n,r,e)||l===0&&bA(t,n,r)||u===0&&bA(t,e,r))}function bA(n,e,t){return e.x<=Math.max(n.x,t.x)&&e.x>=Math.min(n.x,t.x)&&e.y<=Math.max(n.y,t.y)&&e.y>=Math.min(n.y,t.y)}function TA(n){return n>0?1:n<0?-1:0}function K$e(n,e){let t=n;do{if(t.i!==n.i&&t.next.i!==n.i&&t.i!==e.i&&t.next.i!==e.i&&QQ(t,t.next,n,e))return!0;t=t.next}while(t!==n);return!1}function X$(n,e){return lc(n.prev,n,n.next)<0?lc(n,e,n.next)>=0&&lc(n,n.prev,e)>=0:lc(n,e,n.prev)<0||lc(n,n.next,e)<0}function J$e(n,e){let t=n,r=!1;const s=(n.x+e.x)/2,o=(n.y+e.y)/2;do t.y>o!=t.next.y>o&&t.next.y!==t.y&&s<(t.next.x-t.x)*(o-t.y)/(t.next.y-t.y)+t.x&&(r=!r),t=t.next;while(t!==n);return r}function ZQ(n,e){const t=new RP(n.i,n.x,n.y),r=new RP(e.i,e.x,e.y),s=n.next,o=e.prev;return n.next=e,e.prev=n,t.next=s,s.prev=t,r.next=t,t.prev=r,o.next=r,r.prev=o,r}function p6(n,e,t,r){const s=new RP(n,e,t);return r?(s.next=r.next,s.prev=r,r.next.prev=s,r.next=s):(s.prev=s,s.next=s),s}function K$(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function RP(n,e,t){this.i=n,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function q$e(n,e,t,r){let s=0;for(let o=e,l=t-r;o2&&n[e-1].equals(n[0])&&n.pop()}function g6(n,e){for(let t=0;tNumber.EPSILON){const ie=Math.sqrt(gt),Pe=Math.sqrt(Ct*Ct+At*At),Ye=$e.x-vt/ie,St=$e.y+kt/ie,It=He.x-At/Pe,mt=He.y+Ct/Pe,Ke=((It-Ye)*At-(mt-St)*Ct)/(kt*At-vt*Ct);it=Ye+kt*Ke-ze.x,st=St+vt*Ke-ze.y;const Oe=it*it+st*st;if(Oe<=2)return new Vt(it,st);Nt=Math.sqrt(Oe/2)}else{let ie=!1;kt>Number.EPSILON?Ct>Number.EPSILON&&(ie=!0):kt<-Number.EPSILON?Ct<-Number.EPSILON&&(ie=!0):Math.sign(vt)===Math.sign(At)&&(ie=!0),ie?(it=-vt,st=kt,Nt=Math.sqrt(gt)):(it=kt,st=vt,Nt=Math.sqrt(gt/2))}return new Vt(it/Nt,st/Nt)}const J=[];for(let ze=0,$e=he.length,He=$e-1,it=ze+1;ze<$e;ze++,He++,it++)He===$e&&(He=0),it===$e&&(it=0),J[ze]=we(he[ze],he[He],he[it]);const re=[];let se,fe=J.concat();for(let ze=0,$e=Z.length;ze<$e;ze++){const He=Z[ze];se=[];for(let it=0,st=He.length,Nt=st-1,kt=it+1;it=0;ze--){const $e=ze/A,He=w*Math.cos($e*Math.PI/2),it=C*Math.sin($e*Math.PI/2)+M;for(let st=0,Nt=he.length;st=0;){const it=He;let st=He-1;st<0&&(st=ze.length-1);for(let Nt=0,kt=g+A*2;Nt0)&&w.push(P,D,U),(k!==r-1||h0!=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 iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=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.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class rZ extends hd{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new Fn(16777215),this.specular=new Fn(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Fn(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=hT,this.normalScale=new Vt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=IC,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.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.fog=e.fog,this}}class iZ extends hd{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Fn(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Fn(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=hT,this.normalScale=new Vt(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.fog=!0,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.fog=e.fog,this}}class d4 extends hd{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=hT,this.normalScale=new Vt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=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}}class sZ extends hd{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new Fn(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Fn(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=IC,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.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.fog=e.fog,this}}class oZ extends hd{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Fn(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=hT,this.normalScale=new Vt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,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.fog=e.fog,this}}class aZ extends Pf{constructor(e){super(),this.isLineDashedMaterial=!0,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}}function dg(n,e,t){return f4(n)?new n.constructor(n.subarray(e,t!==void 0?t:n.length)):n.slice(e,t)}function A1(n,e,t){return!n||!t&&n.constructor===e?n:typeof e.BYTES_PER_ELEMENT=="number"?new e(n):Array.prototype.slice.call(n)}function f4(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function lZ(n){function e(s,o){return n[s]-n[o]}const t=n.length,r=new Array(t);for(let s=0;s!==t;++s)r[s]=s;return r.sort(e),r}function kP(n,e,t){const r=n.length,s=new n.constructor(r);for(let o=0,l=0;l!==r;++o){const u=t[o]*e;for(let h=0;h!==e;++h)s[l++]=n[u+h]}return s}function p4(n,e,t,r){let s=1,o=n[0];for(;o!==void 0&&o[r]===void 0;)o=n[s++];if(o===void 0)return;let l=o[r];if(l!==void 0)if(Array.isArray(l))do l=o[r],l!==void 0&&(e.push(o.time),t.push.apply(t,l)),o=n[s++];while(o!==void 0);else if(l.toArray!==void 0)do l=o[r],l!==void 0&&(e.push(o.time),l.toArray(t,t.length)),o=n[s++];while(o!==void 0);else do l=o[r],l!==void 0&&(e.push(o.time),t.push(l)),o=n[s++];while(o!==void 0)}function tCe(n,e,t,r,s=30){const o=n.clone();o.name=e;const l=[];for(let h=0;h=r)){y.push(f.times[w]);for(let M=0;Mo.tracks[h].times[0]&&(u=o.tracks[h].times[0]);for(let h=0;h=u.times[C]){const k=C*y+g,L=k+y-g;M=dg(u.values,k,L)}else{const k=u.createInterpolant(),L=g,P=y-g;k.evaluate(o),M=dg(k.resultBuffer,L,P)}h==="quaternion"&&new Sl().fromArray(M).normalize().conjugate().toArray(M);const A=f.times.length;for(let k=0;k=o)){const u=t[1];e=o)break t}l=r,r=0;break n}break e}for(;r>>1;et;)--l;if(++l,o!==0||l!==s){o>=l&&(l=Math.max(l,1),o=l-1);const u=this.getValueSize();this.times=dg(r,o,l),this.values=dg(this.values,o*u,l*u)}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 r=this.times,s=this.values,o=r.length;o===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let l=null;for(let u=0;u!==o;u++){const h=r[u];if(typeof h=="number"&&isNaN(h)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,u,h),e=!1;break}if(l!==null&&l>h){console.error("THREE.KeyframeTrack: Out of order keys.",this,u,h,l),e=!1;break}l=h}if(s!==void 0&&f4(s))for(let u=0,h=s.length;u!==h;++u){const f=s[u];if(isNaN(f)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,u,f),e=!1;break}}return e}optimize(){const e=dg(this.times),t=dg(this.values),r=this.getValueSize(),s=this.getInterpolation()===bI,o=e.length-1;let l=1;for(let u=1;u0){e[l]=e[o];for(let u=o*r,h=l*r,f=0;f!==r;++f)t[h+f]=t[u+f];++l}return l!==e.length?(this.times=dg(e,0,l),this.values=dg(t,0,l*r)):(this.times=e,this.values=t),this}clone(){const e=dg(this.times,0),t=dg(this.values,0),r=this.constructor,s=new r(this.name,e,t);return s.createInterpolant=this.createInterpolant,s}}m0.prototype.TimeBufferType=Float32Array;m0.prototype.ValueBufferType=Float32Array;m0.prototype.DefaultInterpolation=z$;class fT extends m0{}fT.prototype.ValueTypeName="bool";fT.prototype.ValueBufferType=Array;fT.prototype.DefaultInterpolation=F$;fT.prototype.InterpolantFactoryMethodLinear=void 0;fT.prototype.InterpolantFactoryMethodSmooth=void 0;class g4 extends m0{}g4.prototype.ValueTypeName="color";class q$ extends m0{}q$.prototype.ValueTypeName="number";class hZ extends DC{constructor(e,t,r,s){super(e,t,r,s)}interpolate_(e,t,r,s){const o=this.resultBuffer,l=this.sampleValues,u=this.valueSize,h=(r-t)/(s-t);let f=e*u;for(let g=f+u;f!==g;f+=4)Sl.slerpFlat(o,0,l,f-u,l,f,h);return o}}class mE extends m0{InterpolantFactoryMethodLinear(e){return new hZ(this.times,this.values,this.getValueSize(),e)}}mE.prototype.ValueTypeName="quaternion";mE.prototype.DefaultInterpolation=z$;mE.prototype.InterpolantFactoryMethodSmooth=void 0;class pT extends m0{}pT.prototype.ValueTypeName="string";pT.prototype.ValueBufferType=Array;pT.prototype.DefaultInterpolation=F$;pT.prototype.InterpolantFactoryMethodLinear=void 0;pT.prototype.InterpolantFactoryMethodSmooth=void 0;class Q$ extends m0{}Q$.prototype.ValueTypeName="vector";class Z${constructor(e,t=-1,r,s=i2){this.name=e,this.tracks=r,this.duration=t,this.blendMode=s,this.uuid=Pm(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],r=e.tracks,s=1/(e.fps||1);for(let l=0,u=r.length;l!==u;++l)t.push(sCe(r[l]).scale(s));const o=new this(e.name,e.duration,t,e.blendMode);return o.uuid=e.uuid,o}static toJSON(e){const t=[],r=e.tracks,s={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let o=0,l=r.length;o!==l;++o)t.push(m0.toJSON(r[o]));return s}static CreateFromMorphTargetSequence(e,t,r,s){const o=t.length,l=[];for(let u=0;u1){const y=g[1];let b=s[y];b||(s[y]=b=[]),b.push(f)}}const l=[];for(const u in s)l.push(this.CreateFromMorphTargetSequence(u,s[u],t,r));return l}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const r=function(g,y,b,w,C){if(b.length!==0){const M=[],A=[];p4(b,M,A,w),M.length!==0&&C.push(new g(y,M,A))}},s=[],o=e.name||"default",l=e.fps||30,u=e.blendMode;let h=e.length||-1;const f=e.hierarchy||[];for(let g=0;g{t&&t(o),this.manager.itemEnd(e)},0),o;if(nv[e]!==void 0){nv[e].push({onLoad:t,onProgress:r,onError:s});return}nv[e]=[],nv[e].push({onLoad:t,onProgress:r,onError:s});const l=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),u=this.mimeType,h=this.responseType;fetch(l).then(f=>{if(f.status===200||f.status===0){if(f.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||f.body===void 0||f.body.getReader===void 0)return f;const g=nv[e],y=f.body.getReader(),b=f.headers.get("Content-Length"),w=b?parseInt(b):0,C=w!==0;let M=0;const A=new ReadableStream({start(k){L();function L(){y.read().then(({done:P,value:D})=>{if(P)k.close();else{M+=D.byteLength;const z=new ProgressEvent("progress",{lengthComputable:C,loaded:M,total:w});for(let U=0,V=g.length;U{switch(h){case"arraybuffer":return f.arrayBuffer();case"blob":return f.blob();case"document":return f.text().then(g=>new DOMParser().parseFromString(g,u));case"json":return f.json();default:if(u===void 0)return f.text();{const g=/charset="?([^;"\s]*)"?/i.exec(u),y=g&&g[1]?g[1].toLowerCase():void 0,b=new TextDecoder(y);return f.arrayBuffer().then(w=>b.decode(w))}}}).then(f=>{nT.add(e,f);const g=nv[e];delete nv[e];for(let y=0,b=g.length;y{const g=nv[e];if(g===void 0)throw this.manager.itemError(e),f;delete nv[e];for(let y=0,b=g.length;y{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class aCe extends Ym{constructor(e){super(e)}load(e,t,r,s){const o=this,l=new bv(this.manager);l.setPath(this.path),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(e,function(u){try{t(o.parse(JSON.parse(u)))}catch(h){s?s(h):console.error(h),o.manager.itemError(e)}},r,s)}parse(e){const t=[];for(let r=0;r0:s.vertexColors=e.vertexColors),e.uniforms!==void 0)for(const o in e.uniforms){const l=e.uniforms[o];switch(s.uniforms[o]={},l.type){case"t":s.uniforms[o].value=r(l.value);break;case"c":s.uniforms[o].value=new Fn().setHex(l.value);break;case"v2":s.uniforms[o].value=new Vt().fromArray(l.value);break;case"v3":s.uniforms[o].value=new Me().fromArray(l.value);break;case"v4":s.uniforms[o].value=new Ts().fromArray(l.value);break;case"m3":s.uniforms[o].value=new up().fromArray(l.value);break;case"m4":s.uniforms[o].value=new Qr().fromArray(l.value);break;default:s.uniforms[o].value=l.value}}if(e.defines!==void 0&&(s.defines=e.defines),e.vertexShader!==void 0&&(s.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(s.fragmentShader=e.fragmentShader),e.extensions!==void 0)for(const o in e.extensions)s.extensions[o]=e.extensions[o];if(e.shading!==void 0&&(s.flatShading=e.shading===1),e.size!==void 0&&(s.size=e.size),e.sizeAttenuation!==void 0&&(s.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(s.map=r(e.map)),e.matcap!==void 0&&(s.matcap=r(e.matcap)),e.alphaMap!==void 0&&(s.alphaMap=r(e.alphaMap)),e.bumpMap!==void 0&&(s.bumpMap=r(e.bumpMap)),e.bumpScale!==void 0&&(s.bumpScale=e.bumpScale),e.normalMap!==void 0&&(s.normalMap=r(e.normalMap)),e.normalMapType!==void 0&&(s.normalMapType=e.normalMapType),e.normalScale!==void 0){let o=e.normalScale;Array.isArray(o)===!1&&(o=[o,o]),s.normalScale=new Vt().fromArray(o)}return e.displacementMap!==void 0&&(s.displacementMap=r(e.displacementMap)),e.displacementScale!==void 0&&(s.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(s.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(s.roughnessMap=r(e.roughnessMap)),e.metalnessMap!==void 0&&(s.metalnessMap=r(e.metalnessMap)),e.emissiveMap!==void 0&&(s.emissiveMap=r(e.emissiveMap)),e.emissiveIntensity!==void 0&&(s.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(s.specularMap=r(e.specularMap)),e.specularIntensityMap!==void 0&&(s.specularIntensityMap=r(e.specularIntensityMap)),e.specularColorMap!==void 0&&(s.specularColorMap=r(e.specularColorMap)),e.envMap!==void 0&&(s.envMap=r(e.envMap)),e.envMapIntensity!==void 0&&(s.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(s.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(s.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(s.lightMap=r(e.lightMap)),e.lightMapIntensity!==void 0&&(s.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(s.aoMap=r(e.aoMap)),e.aoMapIntensity!==void 0&&(s.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(s.gradientMap=r(e.gradientMap)),e.clearcoatMap!==void 0&&(s.clearcoatMap=r(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(s.clearcoatRoughnessMap=r(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(s.clearcoatNormalMap=r(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(s.clearcoatNormalScale=new Vt().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(s.iridescenceMap=r(e.iridescenceMap)),e.iridescenceThicknessMap!==void 0&&(s.iridescenceThicknessMap=r(e.iridescenceThicknessMap)),e.transmissionMap!==void 0&&(s.transmissionMap=r(e.transmissionMap)),e.thicknessMap!==void 0&&(s.thicknessMap=r(e.thicknessMap)),e.sheenColorMap!==void 0&&(s.sheenColorMap=r(e.sheenColorMap)),e.sheenRoughnessMap!==void 0&&(s.sheenRoughnessMap=r(e.sheenRoughnessMap)),s}setTextures(e){return this.textures=e,this}static createMaterialFromType(e){const t={ShadowMaterial:eZ,SpriteMaterial:r4,RawShaderMaterial:tZ,ShaderMaterial:xd,PointsMaterial:f2,MeshPhysicalMaterial:nZ,MeshStandardMaterial:J$,MeshPhongMaterial:rZ,MeshToonMaterial:iZ,MeshNormalMaterial:d4,MeshLambertMaterial:sZ,MeshDepthMaterial:NC,MeshDistanceMaterial:l2,MeshBasicMaterial:f0,MeshMatcapMaterial:oZ,LineDashedMaterial:aZ,LineBasicMaterial:Pf,Material:hd};return new t[e]}}class OP{static decodeText(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let r=0,s=e.length;r0){const h=new _4(t);o=new eC(h),o.setCrossOrigin(this.crossOrigin);for(let f=0,g=e.length;f0){s=new eC(this.manager),s.setCrossOrigin(this.crossOrigin);for(let l=0,u=e.length;l"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,r,s){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const o=this,l=nT.get(e);if(l!==void 0)return o.manager.itemStart(e),setTimeout(function(){t&&t(l),o.manager.itemEnd(e)},0),l;const u={};u.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",u.headers=this.requestHeader,fetch(e,u).then(function(h){return h.blob()}).then(function(h){return createImageBitmap(h,Object.assign(o.options,{colorSpaceConversion:"none"}))}).then(function(h){nT.add(e,h),t&&t(h),o.manager.itemEnd(e)}).catch(function(h){s&&s(h),o.manager.itemError(e),o.manager.itemEnd(e)}),o.manager.itemStart(e)}}let SA;const y4={getContext:function(){return SA===void 0&&(SA=new(window.AudioContext||window.webkitAudioContext)),SA},setContext:function(n){SA=n}};class vCe extends Ym{constructor(e){super(e)}load(e,t,r,s){const o=this,l=new bv(this.manager);l.setResponseType("arraybuffer"),l.setPath(this.path),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(e,function(u){try{const h=u.slice(0);y4.getContext().decodeAudioData(h,function(f){t(f)})}catch(h){s?s(h):console.error(h),o.manager.itemError(e)}},r,s)}}class yCe extends _2{constructor(e,t,r=1){super(void 0,r),this.isHemisphereLightProbe=!0;const s=new Fn().set(e),o=new Fn().set(t),l=new Me(s.r,s.g,s.b),u=new Me(o.r,o.g,o.b),h=Math.sqrt(Math.PI),f=h*Math.sqrt(.75);this.sh.coefficients[0].copy(l).add(u).multiplyScalar(h),this.sh.coefficients[1].copy(l).sub(u).multiplyScalar(f)}}class bCe extends _2{constructor(e,t=1){super(void 0,t),this.isAmbientLightProbe=!0;const r=new Fn().set(e);this.sh.coefficients[0].set(r.r,r.g,r.b).multiplyScalar(2*Math.sqrt(Math.PI))}}const x6=new Qr,$6=new Qr,Xb=new Qr;class TCe{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Za,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Za,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,Xb.copy(e.projectionMatrix);const r=t.eyeSep/2,s=r*t.near/t.focus,o=t.near*Math.tan(P1*t.fov*.5)/t.zoom;let l,u;$6.elements[12]=-r,x6.elements[12]=r,l=-o*t.aspect+s,u=o*t.aspect+s,Xb.elements[0]=2*t.near/(u-l),Xb.elements[8]=(u+l)/(u-l),this.cameraL.projectionMatrix.copy(Xb),l=-o*t.aspect-s,u=o*t.aspect-s,Xb.elements[0]=2*t.near/(u-l),Xb.elements[8]=(u+l)/(u-l),this.cameraR.projectionMatrix.copy(Xb)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply($6),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(x6)}}class b4{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=C6(),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=C6();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function C6(){return(typeof performance>"u"?Date:performance).now()}const Kb=new Me,M6=new Sl,SCe=new Me,Jb=new Me;class wCe extends ro{constructor(){super(),this.type="AudioListener",this.context=y4.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new b4}getInput(){return this.gain}removeFilter(){return this.filter!==null&&(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 this.filter!==null?(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,r=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(Kb,M6,SCe),Jb.set(0,0,-1).applyQuaternion(M6),t.positionX){const s=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(Kb.x,s),t.positionY.linearRampToValueAtTime(Kb.y,s),t.positionZ.linearRampToValueAtTime(Kb.z,s),t.forwardX.linearRampToValueAtTime(Jb.x,s),t.forwardY.linearRampToValueAtTime(Jb.y,s),t.forwardZ.linearRampToValueAtTime(Jb.z,s),t.upX.linearRampToValueAtTime(r.x,s),t.upY.linearRampToValueAtTime(r.y,s),t.upZ.linearRampToValueAtTime(r.z,s)}else t.setPosition(Kb.x,Kb.y,Kb.z),t.setOrientation(Jb.x,Jb.y,Jb.z,r.x,r.y,r.z)}}class TZ extends ro{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(this.isPlaying===!0){console.warn("THREE.Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}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(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this._progress=0,this.source.stop(),this.source.onended=null,this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e0&&this._mixBufferRegionAdditive(r,s,this._addIndex*t,1,t);for(let h=t,f=t+t;h!==f;++h)if(r[h]!==r[h+t]){u.setValue(r,s);break}}saveOriginalState(){const e=this.binding,t=this.buffer,r=this.valueSize,s=r*this._origIndex;e.getValue(t,s);for(let o=r,l=s;o!==l;++o)t[o]=t[s+o%r];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let r=e;r=.5)for(let l=0;l!==o;++l)e[t+l]=e[r+l]}_slerp(e,t,r,s){Sl.slerpFlat(e,t,e,t,e,r,s)}_slerpAdditive(e,t,r,s,o){const l=this._workIndex*o;Sl.multiplyQuaternionsFlat(e,l,e,t,e,r),Sl.slerpFlat(e,t,e,t,e,l,s)}_lerp(e,t,r,s,o){const l=1-s;for(let u=0;u!==o;++u){const h=t+u;e[h]=e[h]*l+e[r+u]*s}}_lerpAdditive(e,t,r,s,o){for(let l=0;l!==o;++l){const u=t+l;e[u]=e[u]+e[r+l]*s}}}const T4="\\[\\]\\.:\\/",CCe=new RegExp("["+T4+"]","g"),S4="[^"+T4+"]",MCe="[^"+T4.replace("\\.","")+"]",ACe=/((?:WC+[\/:])*)/.source.replace("WC",S4),ICe=/(WCOD+)?/.source.replace("WCOD",MCe),RCe=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",S4),kCe=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",S4),OCe=new RegExp("^"+ACe+ICe+RCe+kCe+"$"),LCe=["material","materials","bones"];class NCe{constructor(e,t,r){const s=r||So.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,s)}getValue(e,t){this.bind();const r=this._targetGroup.nCachedObjects_,s=this._bindings[r];s!==void 0&&s.getValue(e,t)}setValue(e,t){const r=this._bindings;for(let s=this._targetGroup.nCachedObjects_,o=r.length;s!==o;++s)r[s].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,r=e.length;t!==r;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,r=e.length;t!==r;++t)e[t].unbind()}}class So{constructor(e,t,r){this.path=t,this.parsedPath=r||So.parseTrackName(t),this.node=So.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,r){return e&&e.isAnimationObjectGroup?new So.Composite(e,t,r):new So(e,t,r)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(CCe,"")}static parseTrackName(e){const t=OCe.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const r={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},s=r.nodeName&&r.nodeName.lastIndexOf(".");if(s!==void 0&&s!==-1){const o=r.nodeName.substring(s+1);LCe.indexOf(o)!==-1&&(r.nodeName=r.nodeName.substring(0,s),r.objectName=o)}if(r.propertyName===null||r.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return r}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const r=e.skeleton.getBoneByName(t);if(r!==void 0)return r}if(e.children){const r=function(o){for(let l=0;l=o){const y=o++,b=e[y];t[b.uuid]=g,e[g]=b,t[f]=y,e[y]=h;for(let w=0,C=s;w!==C;++w){const M=r[w],A=M[y],k=M[g];M[g]=A,M[y]=k}}}this.nCachedObjects_=o}uncache(){const e=this._objects,t=this._indicesByUUID,r=this._bindings,s=r.length;let o=this.nCachedObjects_,l=e.length;for(let u=0,h=arguments.length;u!==h;++u){const f=arguments[u],g=f.uuid,y=t[g];if(y!==void 0)if(delete t[g],y0&&(t[w.uuid]=y),e[y]=w,e.pop();for(let C=0,M=s;C!==M;++C){const A=r[C];A[y]=A[b],A.pop()}}}this.nCachedObjects_=o}subscribe_(e,t){const r=this._bindingsIndicesByPath;let s=r[e];const o=this._bindings;if(s!==void 0)return o[s];const l=this._paths,u=this._parsedPaths,h=this._objects,f=h.length,g=this.nCachedObjects_,y=new Array(f);s=o.length,r[e]=s,l.push(e),u.push(t),o.push(y);for(let b=g,w=h.length;b!==w;++b){const C=h[b];y[b]=new So(C,e,t)}return y}unsubscribe_(e){const t=this._bindingsIndicesByPath,r=t[e];if(r!==void 0){const s=this._paths,o=this._parsedPaths,l=this._bindings,u=l.length-1,h=l[u],f=e[u];t[f]=r,l[r]=h,l.pop(),o[r]=o[u],o.pop(),s[r]=s[u],s.pop()}}}class PCe{constructor(e,t,r=null,s=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=r,this.blendMode=s;const o=t.tracks,l=o.length,u=new Array(l),h={endingStart:$1,endingEnd:$1};for(let f=0;f!==l;++f){const g=o[f].createInterpolant(null);u[f]=g,g.settings=h}this._interpolantSettings=h,this._interpolants=u,this._propertyBindings=new Array(l),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=vQ,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&&this.timeScale!==0&&this._startTime===null&&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,r){if(e.fadeOut(t),this.fadeIn(t),r){const s=this._clip.duration,o=e._clip.duration,l=o/s,u=s/o;e.warp(1,l,t),this.warp(u,1,t)}return this}crossFadeTo(e,t,r){return e.crossFadeFrom(this,t,r)}stopFading(){const e=this._weightInterpolant;return e!==null&&(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,r){const s=this._mixer,o=s.time,l=this.timeScale;let u=this._timeScaleInterpolant;u===null&&(u=s._lendControlInterpolant(),this._timeScaleInterpolant=u);const h=u.parameterPositions,f=u.sampleValues;return h[0]=o,h[1]=o+r,f[0]=e/l,f[1]=t/l,this}stopWarping(){const e=this._timeScaleInterpolant;return e!==null&&(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,r,s){if(!this.enabled){this._updateWeight(e);return}const o=this._startTime;if(o!==null){const h=(e-o)*r;if(h<0||r===0)return;this._startTime=null,t=r*h}t*=this._updateTimeScale(e);const l=this._updateTime(t),u=this._updateWeight(e);if(u>0){const h=this._interpolants,f=this._propertyBindings;switch(this.blendMode){case KF:for(let g=0,y=h.length;g!==y;++g)h[g].evaluate(l),f[g].accumulateAdditive(u);break;case i2:default:for(let g=0,y=h.length;g!==y;++g)h[g].evaluate(l),f[g].accumulate(s,u)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const r=this._weightInterpolant;if(r!==null){const s=r.evaluate(e)[0];t*=s,e>r.parameterPositions[1]&&(this.stopFading(),s===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const r=this._timeScaleInterpolant;r!==null&&(t*=r.evaluate(e)[0],e>r.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t))}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,r=this.loop;let s=this.time+e,o=this._loopCount;const l=r===yQ;if(e===0)return o===-1?s:l&&(o&1)===1?t-s:s;if(r===_Q){o===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(s>=t)s=t;else if(s<0)s=0;else{this.time=s;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=s,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(o===-1&&(e>=0?(o=0,this._setEndings(!0,this.repetitions===0,l)):this._setEndings(this.repetitions===0,!0,l)),s>=t||s<0){const u=Math.floor(s/t);s-=t*u,o+=Math.abs(u);const h=this.repetitions-o;if(h<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,s=e>0?t:0,this.time=s,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(h===1){const f=e<0;this._setEndings(f,!f,l)}else this._setEndings(!1,!1,l);this._loopCount=o,this.time=s,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:u})}}else this.time=s;if(l&&(o&1)===1)return t-s}return s}_setEndings(e,t,r){const s=this._interpolantSettings;r?(s.endingStart=C1,s.endingEnd=C1):(e?s.endingStart=this.zeroSlopeAtStart?C1:$1:s.endingStart=U$,t?s.endingEnd=this.zeroSlopeAtEnd?C1:$1:s.endingEnd=U$)}_scheduleFading(e,t,r){const s=this._mixer,o=s.time;let l=this._weightInterpolant;l===null&&(l=s._lendControlInterpolant(),this._weightInterpolant=l);const u=l.parameterPositions,h=l.sampleValues;return u[0]=o,h[0]=t,u[1]=o+e,h[1]=r,this}}const BCe=new Float32Array(1);class FCe extends jm{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const r=e._localRoot||this._root,s=e._clip.tracks,o=s.length,l=e._propertyBindings,u=e._interpolants,h=r.uuid,f=this._bindingsByRootAndName;let g=f[h];g===void 0&&(g={},f[h]=g);for(let y=0;y!==o;++y){const b=s[y],w=b.name;let C=g[w];if(C!==void 0)++C.referenceCount,l[y]=C;else{if(C=l[y],C!==void 0){C._cacheIndex===null&&(++C.referenceCount,this._addInactiveBinding(C,h,w));continue}const M=t&&t._propertyBindings[y].binding.parsedPath;C=new SZ(So.create(r,w,M),b.ValueTypeName,b.getValueSize()),++C.referenceCount,this._addInactiveBinding(C,h,w),l[y]=C}u[y].resultBuffer=C.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const r=(e._localRoot||this._root).uuid,s=e._clip.uuid,o=this._actionsByClip[s];this._bindAction(e,o&&o.knownActions[0]),this._addInactiveAction(e,s,r)}const t=e._propertyBindings;for(let r=0,s=t.length;r!==s;++r){const o=t[r];o.useCount++===0&&(this._lendBinding(o),o.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let r=0,s=t.length;r!==s;++r){const o=t[r];--o.useCount===0&&(o.restoreOriginalState(),this._takeBackBinding(o))}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 t!==null&&t=0;--r)e[r].stop();return this}update(e){e*=this.timeScale;const t=this._actions,r=this._nActiveActions,s=this.time+=e,o=Math.sign(e),l=this._accuIndex^=1;for(let f=0;f!==r;++f)t[f]._update(s,e,o,l);const u=this._bindings,h=this._nActiveBindings;for(let f=0;f!==h;++f)u[f].apply(l);return this}setTime(e){this.time=0;for(let t=0;tthis.max.x||e.ythis.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.xthis.max.x||e.max.ythis.max.y)}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return R6.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)}}const k6=new Me,wA=new Me;class E4{constructor(e=new Me,t=new Me){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){k6.subVectors(e,this.start),wA.subVectors(this.end,this.start);const r=wA.dot(wA);let s=wA.dot(k6)/r;return t&&(s=hh(s,0,1)),s}closestPointToPoint(e,t,r){const s=this.closestPointToPointParameter(e,t);return this.delta(r).multiplyScalar(s).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 O6=new Me;class VCe extends ro{constructor(e,t){super(),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;const r=new ui,s=[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 l=0,u=1,h=32;l.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{B6.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(B6,t)}}setLength(e,t=e*.2,r=t*.2){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(r,t,r),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 iMe extends T_{constructor(e=1){const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],r=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],s=new ui;s.setAttribute("position",new ar(t,3)),s.setAttribute("color",new ar(r,3));const o=new Pf({vertexColors:!0,toneMapped:!1});super(s,o),this.type="AxesHelper"}setColors(e,t,r){const s=new Fn,o=this.geometry.attributes.color.array;return s.set(e),s.toArray(o,0),s.toArray(o,3),s.set(t),s.toArray(o,6),s.toArray(o,9),s.set(r),s.toArray(o,12),s.toArray(o,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class sMe{constructor(){this.type="ShapePath",this.color=new Fn,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new j$,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,r,s){return this.currentPath.quadraticCurveTo(e,t,r,s),this}bezierCurveTo(e,t,r,s,o,l){return this.currentPath.bezierCurveTo(e,t,r,s,o,l),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e,t){function r(L){const P=[];for(let D=0,z=L.length;DNumber.EPSILON){if(Z<0&&(H=P[V],le=-le,oe=P[U],Z=-Z),L.yoe.y)continue;if(L.y===H.y){if(L.x===H.x)return!0}else{const q=Z*(L.x-H.x)-le*(L.y-H.y);if(q===0)return!0;if(q<0)continue;z=!z}}else{if(L.y!==H.y)continue;if(oe.x<=L.x&&L.x<=H.x||H.x<=L.x&&L.x<=oe.x)return!0}}return z}const o=c_.isClockWise,l=this.subPaths;if(l.length===0)return[];if(t===!0)return r(l);let u,h,f;const g=[];if(l.length===1)return h=l[0],f=new z1,f.curves=h.curves,g.push(f),g;let y=!o(l[0].getPoints());y=e?!y:y;const b=[],w=[];let C=[],M=0,A;w[M]=void 0,C[M]=[];for(let L=0,P=l.length;L1){let L=!1,P=0;for(let D=0,z=w.length;D0&&L===!1&&(C=b)}let k;for(let L=0,P=w.length;L>-f-14,r[h|256]=1024>>-f-14|32768,s[h]=-f-1,s[h|256]=-f-1):f<=15?(r[h]=f+15<<10,r[h|256]=f+15<<10|32768,s[h]=13,s[h|256]=13):f<128?(r[h]=31744,r[h|256]=64512,s[h]=24,s[h|256]=24):(r[h]=31744,r[h|256]=64512,s[h]=13,s[h|256]=13)}const o=new Uint32Array(2048),l=new Uint32Array(64),u=new Uint32Array(64);for(let h=1;h<1024;++h){let f=h<<13,g=0;for(;!(f&8388608);)f<<=1,g-=8388608;f&=-8388609,g+=947912704,o[h]=f|g}for(let h=1024;h<2048;++h)o[h]=939524096+(h-1024<<13);for(let h=1;h<31;++h)l[h]=h<<23;l[31]=1199570944,l[32]=2147483648;for(let h=33;h<63;++h)l[h]=2147483648+(h-32<<23);l[63]=3347054592;for(let h=1;h<64;++h)h!==32&&(u[h]=1024);return{floatView:e,uint32View:t,baseTable:r,shiftTable:s,mantissaTable:o,exponentTable:l,offsetTable:u}}function aMe(n){Math.abs(n)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),n=hh(n,-65504,65504),lv.floatView[0]=n;const e=lv.uint32View[0],t=e>>23&511;return lv.baseTable[t]+((e&8388607)>>lv.shiftTable[t])}function lMe(n){const e=n>>10;return lv.uint32View[0]=lv.mantissaTable[lv.offsetTable[e]+(n&1023)]+lv.exponentTable[e],lv.floatView[0]}var uMe=Object.freeze({__proto__:null,toHalfFloat:aMe,fromHalfFloat:lMe});class cMe extends ui{constructor(){console.error("THREE.ParametricGeometry has been moved to /examples/jsm/geometries/ParametricGeometry.js"),super()}}class hMe extends ui{constructor(){console.error("THREE.TextGeometry has been moved to /examples/jsm/geometries/TextGeometry.js"),super()}}function dMe(){console.error("THREE.FontLoader has been moved to /examples/jsm/loaders/FontLoader.js")}function fMe(){console.error("THREE.Font has been moved to /examples/jsm/loaders/FontLoader.js")}function pMe(){console.error("THREE.ImmediateRenderObject has been removed.")}class mMe extends Nc{constructor(e,t,r){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,r),this.samples=4}}class gMe extends RC{constructor(e,t,r,s){console.warn("THREE.DataTexture2DArray has been renamed to DataArrayTexture."),super(e,t,r,s)}}class _Me extends s2{constructor(e,t,r,s){console.warn("THREE.DataTexture3D has been renamed to Data3DTexture."),super(e,t,r,s)}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:hE}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=hE);const vMe=Object.freeze(Object.defineProperty({__proto__:null,ACESFilmicToneMapping:jF,AddEquation:m1,AddOperation:qq,AdditiveAnimationBlendMode:KF,AdditiveBlending:_R,AlphaFormat:aQ,AlwaysDepth:Wq,AlwaysStencilFunc:TQ,AmbientLight:_Z,AmbientLightProbe:bCe,AnimationClip:Z$,AnimationLoader:aCe,AnimationMixer:FCe,AnimationObjectGroup:DCe,AnimationUtils:rCe,ArcCurve:VQ,ArrayCamera:NQ,ArrowHelper:rMe,Audio:TZ,AudioAnalyser:$Ce,AudioContext:y4,AudioListener:wCe,AudioLoader:vCe,AxesHelper:iMe,BackSide:cd,BasicDepthPacking:nb,BasicShadowMap:Iq,Bone:i4,BooleanKeyframeTrack:fT,Box2:WCe,Box3:d0,Box3Helper:tMe,BoxBufferGeometry:pu,BoxGeometry:pu,BoxHelper:eMe,BufferAttribute:Do,BufferGeometry:ui,BufferGeometryLoader:bZ,ByteType:nQ,Cache:nT,Camera:fE,CameraHelper:ZCe,CanvasTexture:C$e,CapsuleBufferGeometry:Pw,CapsuleGeometry:Pw,CatmullRomCurve3:jQ,CineonToneMapping:eQ,CircleBufferGeometry:Bw,CircleGeometry:Bw,ClampToEdgeWrapping:ap,Clock:b4,Color:Fn,ColorKeyframeTrack:g4,ColorManagement:ug,CompressedTexture:WQ,CompressedTextureLoader:lCe,ConeBufferGeometry:Fw,ConeGeometry:Fw,CubeCamera:$Q,CubeReflectionMapping:Gy,CubeRefractionMapping:Wy,CubeTexture:LC,CubeTextureLoader:uCe,CubeUVReflectionMapping:dE,CubicBezierCurve:o4,CubicBezierCurve3:YQ,CubicInterpolant:uZ,CullFaceBack:ZD,CullFaceFront:Aq,CullFaceFrontBack:k1e,CullFaceNone:Mq,Curve:p0,CurvePath:KQ,CustomBlending:kq,CustomToneMapping:tQ,CylinderBufferGeometry:Gl,CylinderGeometry:Gl,Cylindrical:GCe,Data3DTexture:s2,DataArrayTexture:RC,DataTexture:vw,DataTexture2DArray:gMe,DataTexture3D:_Me,DataTextureLoader:cCe,DataUtils:uMe,DecrementStencilOp:V1e,DecrementWrapStencilOp:Y1e,DefaultLoadingManager:dZ,DepthFormat:By,DepthStencilFormat:Vy,DepthTexture:t4,DirectionalLight:gZ,DirectionalLightHelper:QCe,DiscreteInterpolant:cZ,DodecahedronBufferGeometry:zw,DodecahedronGeometry:zw,DoubleSide:lp,DstAlphaFactor:Bq,DstColorFactor:zq,DynamicCopyUsage:aTe,DynamicDrawUsage:D1,DynamicReadUsage:iTe,EdgesGeometry:JQ,EllipseCurve:p2,EqualDepth:jq,EqualStencilFunc:q1e,EquirectangularReflectionMapping:D$,EquirectangularRefractionMapping:P$,Euler:dT,EventDispatcher:jm,ExtrudeBufferGeometry:Uw,ExtrudeGeometry:Uw,FileLoader:bv,FlatShading:Rq,Float16BufferAttribute:GTe,Float32BufferAttribute:ar,Float64BufferAttribute:WTe,FloatType:r_,Fog:c2,FogExp2:u2,Font:fMe,FontLoader:dMe,FramebufferTexture:$$e,FrontSide:p_,Frustum:o2,GLBufferAttribute:HCe,GLSL1:uTe,GLSL3:xP,GreaterDepth:Xq,GreaterEqualDepth:Yq,GreaterEqualStencilFunc:tTe,GreaterStencilFunc:Z1e,GridHelper:JCe,Group:ew,HalfFloatType:Z1,HemisphereLight:fZ,HemisphereLightHelper:KCe,HemisphereLightProbe:yCe,IcosahedronBufferGeometry:Hw,IcosahedronGeometry:Hw,ImageBitmapLoader:_Ce,ImageLoader:eC,ImageUtils:qF,ImmediateRenderObject:pMe,IncrementStencilOp:W1e,IncrementWrapStencilOp:j1e,InstancedBufferAttribute:eT,InstancedBufferGeometry:y2,InstancedInterleavedBuffer:wR,InstancedMesh:UQ,Int16BufferAttribute:UTe,Int32BufferAttribute:HTe,Int8BufferAttribute:BTe,IntType:iQ,InterleavedBuffer:h2,InterleavedBufferAttribute:km,Interpolant:DC,InterpolateDiscrete:F$,InterpolateLinear:z$,InterpolateSmooth:bI,InvertStencilOp:X1e,KeepStencilOp:TI,KeyframeTrack:m0,LOD:FQ,LatheBufferGeometry:tT,LatheGeometry:tT,Layers:F1,LessDepth:Vq,LessEqualDepth:vR,LessEqualStencilFunc:Q1e,LessStencilFunc:J1e,Light:rb,LightProbe:_2,Line:Rf,Line3:E4,LineBasicMaterial:Pf,LineCurve:m2,LineCurve3:XQ,LineDashedMaterial:aZ,LineLoop:HQ,LineSegments:T_,LinearEncoding:xg,LinearFilter:wl,LinearInterpolant:m4,LinearMipMapLinearFilter:P1e,LinearMipMapNearestFilter:D1e,LinearMipmapLinearFilter:cT,LinearMipmapNearestFilter:YF,LinearSRGBColorSpace:xy,LinearToneMapping:Qq,Loader:Ym,LoaderUtils:OP,LoadingManager:_4,LoopOnce:_Q,LoopPingPong:yQ,LoopRepeat:vQ,LuminanceAlphaFormat:cQ,LuminanceFormat:uQ,MOUSE:u1,Material:hd,MaterialLoader:v2,MathUtils:wQ,Matrix3:up,Matrix4:Qr,MaxEquation:rP,Mesh:Hn,MeshBasicMaterial:f0,MeshDepthMaterial:NC,MeshDistanceMaterial:l2,MeshLambertMaterial:sZ,MeshMatcapMaterial:oZ,MeshNormalMaterial:d4,MeshPhongMaterial:rZ,MeshPhysicalMaterial:nZ,MeshStandardMaterial:J$,MeshToonMaterial:iZ,MinEquation:nP,MirroredRepeatWrapping:B$,MixOperation:Jq,MultiplyBlending:tP,MultiplyOperation:IC,NearestFilter:Wl,NearestMipMapLinearFilter:N1e,NearestMipMapNearestFilter:L1e,NearestMipmapLinearFilter:bR,NearestMipmapNearestFilter:yR,NeverDepth:Gq,NeverStencilFunc:K1e,NoBlending:pp,NoColorSpace:U1e,NoToneMapping:l0,NormalAnimationBlendMode:i2,NormalBlending:mv,NotEqualDepth:Kq,NotEqualStencilFunc:eTe,NumberKeyframeTrack:q$,Object3D:ro,ObjectLoader:mCe,ObjectSpaceNormalMap:bQ,OctahedronBufferGeometry:i0,OctahedronGeometry:i0,OneFactor:Nq,OneMinusDstAlphaFactor:Fq,OneMinusDstColorFactor:Uq,OneMinusSrcAlphaFactor:n2,OneMinusSrcColorFactor:Pq,OrthographicCamera:u_,PCFShadowMap:e2,PCFSoftShadowMap:Zx,PMREMGenerator:CP,ParametricGeometry:cMe,Path:j$,PerspectiveCamera:Za,Plane:ov,PlaneBufferGeometry:c0,PlaneGeometry:c0,PlaneHelper:nMe,PointLight:mZ,PointLightHelper:YCe,Points:GQ,PointsMaterial:f2,PolarGridHelper:qCe,PolyhedronBufferGeometry:m_,PolyhedronGeometry:m_,PositionalAudio:xCe,PropertyBinding:So,PropertyMixer:SZ,QuadraticBezierCurve:a4,QuadraticBezierCurve3:l4,Quaternion:Sl,QuaternionKeyframeTrack:mE,QuaternionLinearInterpolant:hZ,REVISION:hE,RGBADepthPacking:Nw,RGBAFormat:jp,RGBAIntegerFormat:mQ,RGBA_ASTC_10x10_Format:TP,RGBA_ASTC_10x5_Format:vP,RGBA_ASTC_10x6_Format:yP,RGBA_ASTC_10x8_Format:bP,RGBA_ASTC_12x10_Format:SP,RGBA_ASTC_12x12_Format:wP,RGBA_ASTC_4x4_Format:cP,RGBA_ASTC_5x4_Format:hP,RGBA_ASTC_5x5_Format:dP,RGBA_ASTC_6x5_Format:fP,RGBA_ASTC_6x6_Format:pP,RGBA_ASTC_8x5_Format:mP,RGBA_ASTC_8x6_Format:gP,RGBA_ASTC_8x8_Format:_P,RGBA_BPTC_Format:EP,RGBA_ETC2_EAC_Format:uP,RGBA_PVRTC_2BPPV1_Format:aP,RGBA_PVRTC_4BPPV1_Format:oP,RGBA_S3TC_DXT1_Format:_I,RGBA_S3TC_DXT3_Format:vI,RGBA_S3TC_DXT5_Format:yI,RGBFormat:lQ,RGB_ETC1_Format:gQ,RGB_ETC2_Format:lP,RGB_PVRTC_2BPPV1_Format:sP,RGB_PVRTC_4BPPV1_Format:iP,RGB_S3TC_DXT1_Format:gI,RGFormat:fQ,RGIntegerFormat:pQ,RawShaderMaterial:tZ,Ray:kC,Raycaster:w4,RectAreaLight:vZ,RedFormat:hQ,RedIntegerFormat:dQ,ReinhardToneMapping:Zq,RepeatWrapping:Lw,ReplaceStencilOp:G1e,ReverseSubtractEquation:VF,RingBufferGeometry:Gw,RingGeometry:Gw,SRGBColorSpace:J0,Scene:V$,ShaderChunk:ps,ShaderLib:op,ShaderMaterial:xd,ShadowMaterial:eZ,Shape:z1,ShapeBufferGeometry:Ww,ShapeGeometry:Ww,ShapePath:sMe,ShapeUtils:c_,ShortType:rQ,Skeleton:d2,SkeletonHelper:jCe,SkinnedMesh:zQ,SmoothShading:O1e,Source:M1,Sphere:b_,SphereBufferGeometry:h0,SphereGeometry:h0,Spherical:NP,SphericalHarmonics3:yZ,SplineCurve:u4,SpotLight:pZ,SpotLightHelper:VCe,Sprite:BQ,SpriteMaterial:r4,SrcAlphaFactor:t2,SrcAlphaSaturateFactor:Hq,SrcColorFactor:Dq,StaticCopyUsage:oTe,StaticDrawUsage:H$,StaticReadUsage:rTe,StereoCamera:TCe,StreamCopyUsage:lTe,StreamDrawUsage:nTe,StreamReadUsage:sTe,StringKeyframeTrack:pT,SubtractEquation:Oq,SubtractiveBlending:eP,TOUCH:c1,TangentSpaceNormalMap:hT,TetrahedronBufferGeometry:Vw,TetrahedronGeometry:Vw,TextGeometry:hMe,Texture:dc,TextureLoader:hCe,TorusBufferGeometry:t0,TorusGeometry:t0,TorusKnotBufferGeometry:jw,TorusKnotGeometry:jw,Triangle:Im,TriangleFanDrawMode:z1e,TriangleStripDrawMode:F1e,TrianglesDrawMode:B1e,TubeBufferGeometry:Yw,TubeGeometry:Yw,UVMapping:r2,Uint16BufferAttribute:QF,Uint32BufferAttribute:ZF,Uint8BufferAttribute:FTe,Uint8ClampedBufferAttribute:zTe,Uniform:no,UniformsGroup:UCe,UniformsLib:Xn,UniformsUtils:OC,UnsignedByteType:af,UnsignedInt248Type:Py,UnsignedIntType:dv,UnsignedShort4444Type:sQ,UnsignedShort5551Type:oQ,UnsignedShortType:XF,VSMShadowMap:x1,Vector2:Vt,Vector3:Me,Vector4:Ts,VectorKeyframeTrack:Q$,VideoTexture:x$e,WebGL1Renderer:DQ,WebGL3DRenderTarget:MTe,WebGLArrayRenderTarget:CTe,WebGLCubeRenderTarget:CQ,WebGLMultipleRenderTargets:ATe,WebGLMultisampleRenderTarget:mMe,WebGLRenderTarget:Nc,WebGLRenderer:n4,WebGLUtils:LQ,WireframeGeometry:h4,WrapAroundEnding:U$,ZeroCurvatureEnding:$1,ZeroFactor:Lq,ZeroSlopeEnding:C1,ZeroStencilOp:H1e,_SRGBAFormat:TR,sRGBEncoding:ms},Symbol.toStringTag,{value:"Module"}));var uv=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function EZ(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var I1={exports:{}},Zb={};/** * @license React * react-reconciler-constants.production.min.js * @@ -4887,7 +4887,7 @@ void main() { * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var B6;function yMe(){return B6||(B6=1,Qb.ConcurrentRoot=1,Qb.ContinuousEventPriority=4,Qb.DefaultEventPriority=16,Qb.DiscreteEventPriority=1,Qb.IdleEventPriority=536870912,Qb.LegacyRoot=0),Qb}(function(n){n.exports=yMe()})(A1);function bMe(n){let e;const t=new Set,r=(u,h)=>{const f=typeof u=="function"?u(e):u;if(f!==e){const g=e;e=h?f:Object.assign({},e,f),t.forEach(y=>y(e,g))}},s=()=>e,o=(u,h=s,f=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let g=h(e);function y(){const b=h(e);if(!f(g,b)){const w=g;u(g=b,w)}}return t.add(y),()=>t.delete(y)},l={setState:r,getState:s,subscribe:(u,h,f)=>h||f?o(u,h,f):(t.add(u),()=>t.delete(u)),destroy:()=>t.clear()};return e=n(r,s,l),l}const TMe=typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),F6=TMe?pe.useEffect:pe.useLayoutEffect;function SMe(n){const e=typeof n=="function"?bMe(n):n,t=(r=e.getState,s=Object.is)=>{const[,o]=pe.useReducer(A=>A+1,0),l=e.getState(),u=pe.useRef(l),h=pe.useRef(r),f=pe.useRef(s),g=pe.useRef(!1),y=pe.useRef();y.current===void 0&&(y.current=r(l));let b,w=!1;(u.current!==l||h.current!==r||f.current!==s||g.current)&&(b=r(l),w=!s(y.current,b)),F6(()=>{w&&(y.current=b),u.current=l,h.current=r,f.current=s,g.current=!1});const C=pe.useRef(l);F6(()=>{const A=()=>{try{const L=e.getState(),P=h.current(L);f.current(y.current,P)||(u.current=L,y.current=P,o())}catch{g.current=!0,o()}},k=e.subscribe(A);return e.getState()!==C.current&&A(),k},[]);const M=w?b:y.current;return pe.useDebugValue(M),M};return Object.assign(t,e),t[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");const r=[t,e];return{next(){const s=r.length<=0;return{value:r.shift(),done:s}}}},t}var EZ={exports:{}},ER={exports:{}},z6={};/** + */var F6;function yMe(){return F6||(F6=1,Zb.ConcurrentRoot=1,Zb.ContinuousEventPriority=4,Zb.DefaultEventPriority=16,Zb.DiscreteEventPriority=1,Zb.IdleEventPriority=536870912,Zb.LegacyRoot=0),Zb}(function(n){n.exports=yMe()})(I1);function bMe(n){let e;const t=new Set,r=(u,h)=>{const f=typeof u=="function"?u(e):u;if(f!==e){const g=e;e=h?f:Object.assign({},e,f),t.forEach(y=>y(e,g))}},s=()=>e,o=(u,h=s,f=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let g=h(e);function y(){const b=h(e);if(!f(g,b)){const w=g;u(g=b,w)}}return t.add(y),()=>t.delete(y)},l={setState:r,getState:s,subscribe:(u,h,f)=>h||f?o(u,h,f):(t.add(u),()=>t.delete(u)),destroy:()=>t.clear()};return e=n(r,s,l),l}const TMe=typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),z6=TMe?me.useEffect:me.useLayoutEffect;function SMe(n){const e=typeof n=="function"?bMe(n):n,t=(r=e.getState,s=Object.is)=>{const[,o]=me.useReducer(A=>A+1,0),l=e.getState(),u=me.useRef(l),h=me.useRef(r),f=me.useRef(s),g=me.useRef(!1),y=me.useRef();y.current===void 0&&(y.current=r(l));let b,w=!1;(u.current!==l||h.current!==r||f.current!==s||g.current)&&(b=r(l),w=!s(y.current,b)),z6(()=>{w&&(y.current=b),u.current=l,h.current=r,f.current=s,g.current=!1});const C=me.useRef(l);z6(()=>{const A=()=>{try{const L=e.getState(),P=h.current(L);f.current(y.current,P)||(u.current=L,y.current=P,o())}catch{g.current=!0,o()}},k=e.subscribe(A);return e.getState()!==C.current&&A(),k},[]);const M=w?b:y.current;return me.useDebugValue(M),M};return Object.assign(t,e),t[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");const r=[t,e];return{next(){const s=r.length<=0;return{value:r.shift(),done:s}}}},t}var xZ={exports:{}},ER={exports:{}},U6={};/** * @license React * scheduler.production.min.js * @@ -4895,7 +4895,7 @@ void main() { * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var U6;function wMe(){return U6||(U6=1,function(n){function e(J,re){var ie=J.length;J.push(re);e:for(;0>>1,Te=J[fe];if(0>>1;fes(Je,ie))Res(Qe,Je)?(J[fe]=Qe,J[Re]=ie,fe=Re):(J[fe]=Je,J[Ie]=ie,fe=Ie);else if(Res(Qe,ie))J[fe]=Qe,J[Re]=ie,fe=Re;else break e}}return re}function s(J,re){var ie=J.sortIndex-re.sortIndex;return ie!==0?ie:J.id-re.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;n.unstable_now=function(){return o.now()}}else{var l=Date,u=l.now();n.unstable_now=function(){return l.now()-u}}var h=[],f=[],g=1,y=null,b=3,w=!1,C=!1,M=!1,A=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,L=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function P(J){for(var re=t(f);re!==null;){if(re.callback===null)r(f);else if(re.startTime<=J)r(f),re.sortIndex=re.expirationTime,e(h,re);else break;re=t(f)}}function D(J){if(M=!1,P(J),!C)if(t(h)!==null)C=!0,ge(z);else{var re=t(f);re!==null&&we(D,re.startTime-J)}}function z(J,re){C=!1,M&&(M=!1,k(H),H=-1),w=!0;var ie=b;try{for(P(re),y=t(h);y!==null&&(!(y.expirationTime>re)||J&&!Z());){var fe=y.callback;if(typeof fe=="function"){y.callback=null,b=y.priorityLevel;var Te=fe(y.expirationTime<=re);re=n.unstable_now(),typeof Te=="function"?y.callback=Te:y===t(h)&&r(h),P(re)}else r(h);y=t(h)}if(y!==null)var Fe=!0;else{var Ie=t(f);Ie!==null&&we(D,Ie.startTime-re),Fe=!1}return Fe}finally{y=null,b=ie,w=!1}}var U=!1,V=null,H=-1,oe=5,le=-1;function Z(){return!(n.unstable_now()-leJ||125fe?(J.sortIndex=ie,e(f,J),t(h)===null&&J===t(f)&&(M?(k(H),H=-1):M=!0,we(D,ie-fe))):(J.sortIndex=Te,e(h,J),C||w||(C=!0,ge(z))),J},n.unstable_shouldYield=Z,n.unstable_wrapCallback=function(J){var re=b;return function(){var ie=b;b=re;try{return J.apply(this,arguments)}finally{b=ie}}}}(z6)),z6}(function(n){n.exports=wMe()})(ER);/** + */var H6;function wMe(){return H6||(H6=1,function(n){function e(J,re){var se=J.length;J.push(re);e:for(;0>>1,Te=J[fe];if(0>>1;fes(qe,se))Res(Ze,qe)?(J[fe]=Ze,J[Re]=se,fe=Re):(J[fe]=qe,J[Ie]=se,fe=Ie);else if(Res(Ze,se))J[fe]=Ze,J[Re]=se,fe=Re;else break e}}return re}function s(J,re){var se=J.sortIndex-re.sortIndex;return se!==0?se:J.id-re.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;n.unstable_now=function(){return o.now()}}else{var l=Date,u=l.now();n.unstable_now=function(){return l.now()-u}}var h=[],f=[],g=1,y=null,b=3,w=!1,C=!1,M=!1,A=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,L=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function P(J){for(var re=t(f);re!==null;){if(re.callback===null)r(f);else if(re.startTime<=J)r(f),re.sortIndex=re.expirationTime,e(h,re);else break;re=t(f)}}function D(J){if(M=!1,P(J),!C)if(t(h)!==null)C=!0,ge(z);else{var re=t(f);re!==null&&we(D,re.startTime-J)}}function z(J,re){C=!1,M&&(M=!1,k(H),H=-1),w=!0;var se=b;try{for(P(re),y=t(h);y!==null&&(!(y.expirationTime>re)||J&&!Z());){var fe=y.callback;if(typeof fe=="function"){y.callback=null,b=y.priorityLevel;var Te=fe(y.expirationTime<=re);re=n.unstable_now(),typeof Te=="function"?y.callback=Te:y===t(h)&&r(h),P(re)}else r(h);y=t(h)}if(y!==null)var Fe=!0;else{var Ie=t(f);Ie!==null&&we(D,Ie.startTime-re),Fe=!1}return Fe}finally{y=null,b=se,w=!1}}var U=!1,V=null,H=-1,oe=5,le=-1;function Z(){return!(n.unstable_now()-leJ||125fe?(J.sortIndex=se,e(f,J),t(h)===null&&J===t(f)&&(M?(k(H),H=-1):M=!0,we(D,se-fe))):(J.sortIndex=Te,e(h,J),C||w||(C=!0,ge(z))),J},n.unstable_shouldYield=Z,n.unstable_wrapCallback=function(J){var re=b;return function(){var se=b;b=re;try{return J.apply(this,arguments)}finally{b=se}}}}(U6)),U6}(function(n){n.exports=wMe()})(ER);/** * @license React * react-reconciler.production.min.js * @@ -4903,17 +4903,17 @@ void main() { * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var H6,G6;function EMe(){return G6||(G6=1,H6=function(n){var e={},t=yt,r=ER.exports,s=Object.assign;function o(x){for(var d="https://reactjs.org/docs/error-decoder.html?invariant="+x,_=1;_de||I[W]!==B[de]){var Oe=` -`+I[W].replace(" at new "," at ");return x.displayName&&Oe.includes("")&&(Oe=Oe.replace("",x.displayName)),Oe}while(1<=W&&0<=de);break}}}finally{Rr=!1,Error.prepareStackTrace=_}return(x=x?x.displayName||x.name:"")?nn(x):""}var La=Object.prototype.hasOwnProperty,Fs=[],zs=-1;function Di(x){return{current:x}}function kr(x){0>zs||(x.current=Fs[zs],Fs[zs]=null,zs--)}function An(x,d){zs++,Fs[zs]=x.current,x.current=d}var Ir={},Gr=Di(Ir),yr=Di(!1),Pi=Ir;function ws(x,d){var _=x.type.contextTypes;if(!_)return Ir;var $=x.stateNode;if($&&$.__reactInternalMemoizedUnmaskedChildContext===d)return $.__reactInternalMemoizedMaskedChildContext;var I={},B;for(B in _)I[B]=d[B];return $&&(x=x.stateNode,x.__reactInternalMemoizedUnmaskedChildContext=d,x.__reactInternalMemoizedMaskedChildContext=I),I}function fi(x){return x=x.childContextTypes,x!=null}function gs(){kr(yr),kr(Gr)}function tl(x,d,_){if(Gr.current!==Ir)throw Error(o(168));An(Gr,d),An(yr,_)}function Na(x,d,_){var $=x.stateNode;if(d=d.childContextTypes,typeof $.getChildContext!="function")return _;$=$.getChildContext();for(var I in $)if(!(I in d))throw Error(o(108,V(x)||"Unknown",I));return s({},_,$)}function fc(x){return x=(x=x.stateNode)&&x.__reactInternalMemoizedMergedChildContext||Ir,Pi=Gr.current,An(Gr,x),An(yr,yr.current),!0}function pc(x,d,_){var $=x.stateNode;if(!$)throw Error(o(169));_?(x=Na(x,d,Pi),$.__reactInternalMemoizedMergedChildContext=x,kr(yr),kr(Gr),An(Gr,x)):kr(yr),An(yr,_)}var Xs=Math.clz32?Math.clz32:gu,Jo=Math.log,Xl=Math.LN2;function gu(x){return x>>>=0,x===0?32:31-(Jo(x)/Xl|0)|0}var mh=64,qo=4194304;function vr(x){switch(x&-x){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 x&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return x&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return x}}function xi(x,d){var _=x.pendingLanes;if(_===0)return 0;var $=0,I=x.suspendedLanes,B=x.pingedLanes,W=_&268435455;if(W!==0){var de=W&~I;de!==0?$=vr(de):(B&=W,B!==0&&($=vr(B)))}else W=_&~I,W!==0?$=vr(W):B!==0&&($=vr(B));if($===0)return 0;if(d!==0&&d!==$&&!(d&I)&&(I=$&-$,B=d&-d,I>=B||I===16&&(B&4194240)!==0))return d;if($&4&&($|=_&16),d=x.entangledLanes,d!==0)for(x=x.entanglements,d&=$;0_;_++)d.push(x);return d}function _u(x,d,_){x.pendingLanes|=d,d!==536870912&&(x.suspendedLanes=0,x.pingedLanes=0),x=x.eventTimes,d=31-Xs(d),x[d]=_}function xl(x,d){var _=x.pendingLanes&~d;x.pendingLanes=d,x.suspendedLanes=0,x.pingedLanes=0,x.expiredLanes&=d,x.mutableReadLanes&=d,x.entangledLanes&=d,d=x.entanglements;var $=x.eventTimes;for(x=x.expirationTimes;0<_;){var I=31-Xs(_),B=1<>=W,I-=W,oo=1<<32-Xs(d)+I|_<Rn?(zn=En,En=null):zn=En.sibling;var cr=cn(Tt,En,Ne[Rn],st);if(cr===null){En===null&&(En=zn);break}x&&En&&cr.alternate===null&&d(Tt,En),Me=B(cr,Me,Rn),on===null?Ht=cr:on.sibling=cr,on=cr,En=zn}if(Rn===Ne.length)return _(Tt,En),Sr&&Bo(Tt,Rn),Ht;if(En===null){for(;RnRn?(zn=En,En=null):zn=En.sibling;var Mr=cn(Tt,En,cr.value,st);if(Mr===null){En===null&&(En=zn);break}x&&En&&Mr.alternate===null&&d(Tt,En),Me=B(Mr,Me,Rn),on===null?Ht=Mr:on.sibling=Mr,on=Mr,En=zn}if(cr.done)return _(Tt,En),Sr&&Bo(Tt,Rn),Ht;if(En===null){for(;!cr.done;Rn++,cr=Ne.next())cr=Qt(Tt,cr.value,st),cr!==null&&(Me=B(cr,Me,Rn),on===null?Ht=cr:on.sibling=cr,on=cr);return Sr&&Bo(Tt,Rn),Ht}for(En=$(Tt,En);!cr.done;Rn++,cr=Ne.next())cr=bn(En,Tt,Rn,cr.value,st),cr!==null&&(x&&cr.alternate!==null&&En.delete(cr.key===null?Rn:cr.key),Me=B(cr,Me,Rn),on===null?Ht=cr:on.sibling=cr,on=cr);return x&&En.forEach(function(Bl){return d(Tt,Bl)}),Sr&&Bo(Tt,Rn),Ht}function Dr(Tt,Me,Ne,st){if(typeof Ne=="object"&&Ne!==null&&Ne.type===f&&Ne.key===null&&(Ne=Ne.props.children),typeof Ne=="object"&&Ne!==null){switch(Ne.$$typeof){case u:e:{for(var Ht=Ne.key,on=Me;on!==null;){if(on.key===Ht){if(Ht=Ne.type,Ht===f){if(on.tag===7){_(Tt,on.sibling),Me=I(on,Ne.props.children),Me.return=Tt,Tt=Me;break e}}else if(on.elementType===Ht||typeof Ht=="object"&&Ht!==null&&Ht.$$typeof===L&&Us(Ht)===on.type){_(Tt,on.sibling),Me=I(on,Ne.props),Me.ref=Vu(Tt,on,Ne),Me.return=Tt,Tt=Me;break e}_(Tt,on);break}else d(Tt,on);on=on.sibling}Ne.type===f?(Me=Pl(Ne.props.children,Tt.mode,st,Ne.key),Me.return=Tt,Tt=Me):(st=vo(Ne.type,Ne.key,Ne.props,null,Tt.mode,st),st.ref=Vu(Tt,Me,Ne),st.return=Tt,Tt=st)}return W(Tt);case h:e:{for(on=Ne.key;Me!==null;){if(Me.key===on)if(Me.tag===4&&Me.stateNode.containerInfo===Ne.containerInfo&&Me.stateNode.implementation===Ne.implementation){_(Tt,Me.sibling),Me=I(Me,Ne.children||[]),Me.return=Tt,Tt=Me;break e}else{_(Tt,Me);break}else d(Tt,Me);Me=Me.sibling}Me=ni(Ne,Tt.mode,st),Me.return=Tt,Tt=Me}return W(Tt);case L:return on=Ne._init,Dr(Tt,Me,on(Ne._payload),st)}if(ae(Ne))return Tn(Tt,Me,Ne,st);if(z(Ne))return gn(Tt,Me,Ne,st);Zl(Tt,Ne)}return typeof Ne=="string"&&Ne!==""||typeof Ne=="number"?(Ne=""+Ne,Me!==null&&Me.tag===6?(_(Tt,Me.sibling),Me=I(Me,Ne),Me.return=Tt,Tt=Me):(_(Tt,Me),Me=uu(Ne,Tt.mode,st),Me.return=Tt,Tt=Me),W(Tt)):_(Tt,Me)}return Dr}var Uh=eu(!0),zc=eu(!1),Uc={},is=Di(Uc),Fr=Di(Uc),Cl=Di(Uc);function za(x){if(x===Uc)throw Error(o(174));return x}function tu(x,d){An(Cl,d),An(Fr,x),An(is,Uc),x=ge(d),kr(is),An(is,x)}function xu(){kr(is),kr(Fr),kr(Cl)}function bh(x){var d=za(Cl.current),_=za(is.current);d=we(_,x.type,d),_!==d&&(An(Fr,x),An(is,d))}function Ad(x){Fr.current===x&&(kr(is),kr(Fr))}var pi=Di(0);function ye(x){for(var d=x;d!==null;){if(d.tag===13){var _=d.memoizedState;if(_!==null&&(_=_.dehydrated,_===null||zt(_)||sn(_)))return d}else if(d.tag===19&&d.memoizedProps.revealOrder!==void 0){if(d.flags&128)return d}else if(d.child!==null){d.child.return=d,d=d.child;continue}if(d===x)break;for(;d.sibling===null;){if(d.return===null||d.return===x)return null;d=d.return}d.sibling.return=d.return,d=d.sibling}return null}var je=[];function Be(){for(var x=0;x_?_:4,x(!0);var $=rn.transition;rn.transition={};try{x(!1),d()}finally{br=_,rn.transition=$}}function Rd(){return Ks().memoizedState}function jh(x,d,_){var $=bs(x);_={lane:$,action:_,hasEagerState:!1,eagerState:null,next:null},Ii(x)?Sp(d,_):(Ff(x,d,_),_=Or(),x=Os(x,$,_),x!==null&&Il(x,d,$))}function ei(x,d,_){var $=bs(x),I={lane:$,action:_,hasEagerState:!1,eagerState:null,next:null};if(Ii(x))Sp(d,I);else{Ff(x,d,I);var B=x.alternate;if(x.lanes===0&&(B===null||B.lanes===0)&&(B=d.lastRenderedReducer,B!==null))try{var W=d.lastRenderedState,de=B(W,_);if(I.hasEagerState=!0,I.eagerState=de,Gn(de,W))return}catch{}finally{}_=Or(),x=Os(x,$,_),x!==null&&Il(x,d,$)}}function Ii(x){var d=x.alternate;return x===Jn||d!==null&&d===Jn}function Sp(x,d){Ti=ao=!0;var _=x.pending;_===null?d.next=d:(d.next=_.next,_.next=d),x.pending=d}function Ff(x,d,_){tr!==null&&x.mode&1&&!(Pn&2)?(x=d.interleaved,x===null?(_.next=_,Vn===null?Vn=[d]:Vn.push(d)):(_.next=x.next,x.next=_),d.interleaved=_):(x=d.pending,x===null?_.next=_:(_.next=x.next,x.next=_),d.pending=_)}function Il(x,d,_){if(_&4194240){var $=d.lanes;$&=x.pendingLanes,_|=$,d.lanes=_,$l(x,_)}}var ru={readContext:Ci,useCallback:Fi,useContext:Fi,useEffect:Fi,useImperativeHandle:Fi,useInsertionEffect:Fi,useLayoutEffect:Fi,useMemo:Fi,useReducer:Fi,useRef:Fi,useState:Fi,useDebugValue:Fi,useDeferredValue:Fi,useTransition:Fi,useMutableSource:Fi,useSyncExternalStore:Fi,useId:Fi,unstable_isNewReconciler:!1},Xu={readContext:Ci,useCallback:function(x,d){return pa().memoizedState=[x,d===void 0?null:d],x},useContext:Ci,useEffect:uo,useImperativeHandle:function(x,d,_){return _=_!=null?_.concat([x]):null,md(4194308,4,gd.bind(null,d,x),_)},useLayoutEffect:function(x,d){return md(4194308,4,x,d)},useInsertionEffect:function(x,d){return md(4,2,x,d)},useMemo:function(x,d){var _=pa();return d=d===void 0?null:d,x=x(),_.memoizedState=[x,d],x},useReducer:function(x,d,_){var $=pa();return d=_!==void 0?_(d):d,$.memoizedState=$.baseState=d,x={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:x,lastRenderedState:d},$.queue=x,x=x.dispatch=jh.bind(null,Jn,x),[$.memoizedState,x]},useRef:function(x){var d=pa();return x={current:x},d.memoizedState=x},useState:Wh,useDebugValue:nu,useDeferredValue:function(x){var d=Wh(x),_=d[0],$=d[1];return uo(function(){var I=rn.transition;rn.transition={};try{$(x)}finally{rn.transition=I}},[x]),_},useTransition:function(){var x=Wh(!1),d=x[0];return x=Al.bind(null,x[1]),pa().memoizedState=x,[d,x]},useMutableSource:function(){},useSyncExternalStore:function(x,d,_){var $=Jn,I=pa();if(Sr){if(_===void 0)throw Error(o(407));_=_()}else{if(_=d(),tr===null)throw Error(o(349));In&30||Zo($,d,_)}I.memoizedState=_;var B={value:_,getSnapshot:d};return I.queue=B,uo(Gh.bind(null,$,B,x),[x]),$.flags|=2048,gc(9,Hc.bind(null,$,B,_,d),void 0,null),_},useId:function(){var x=pa(),d=tr.identifierPrefix;if(Sr){var _=Fa,$=oo;_=($&~(1<<32-Xs($)-1)).toString(32)+_,d=":"+d+"R"+_,_=lo++,0<_&&(d+="H"+_.toString(32)),d+=":"}else _=al++,d=":"+d+"r"+_.toString(32)+":";return x.memoizedState=d},unstable_isNewReconciler:!1},Ku={readContext:Ci,useCallback:Gc,useContext:Ci,useEffect:Ml,useImperativeHandle:Yu,useInsertionEffect:Vh,useLayoutEffect:zi,useMemo:Id,useReducer:Ua,useRef:ju,useState:function(){return Ua(Hs)},useDebugValue:nu,useDeferredValue:function(x){var d=Ua(Hs),_=d[0],$=d[1];return Ml(function(){var I=rn.transition;rn.transition={};try{$(x)}finally{rn.transition=I}},[x]),_},useTransition:function(){var x=Ua(Hs)[0],d=Ks().memoizedState;return[x,d]},useMutableSource:Th,useSyncExternalStore:mc,useId:Rd,unstable_isNewReconciler:!1},Sh={readContext:Ci,useCallback:Gc,useContext:Ci,useEffect:Ml,useImperativeHandle:Yu,useInsertionEffect:Vh,useLayoutEffect:zi,useMemo:Id,useReducer:Hh,useRef:ju,useState:function(){return Hh(Hs)},useDebugValue:nu,useDeferredValue:function(x){var d=Hh(Hs),_=d[0],$=d[1];return Ml(function(){var I=rn.transition;rn.transition={};try{$(x)}finally{rn.transition=I}},[x]),_},useTransition:function(){var x=Hh(Hs)[0],d=Ks().memoizedState;return[x,d]},useMutableSource:Th,useSyncExternalStore:mc,useId:Rd,unstable_isNewReconciler:!1};function ll(x,d){try{var _="",$=d;do _+=wr($),$=$.return;while($);var I=_}catch(B){I=` +`),W=I.length-1,de=B.length-1;1<=W&&0<=de&&I[W]!==B[de];)de--;for(;1<=W&&0<=de;W--,de--)if(I[W]!==B[de]){if(W!==1||de!==1)do if(W--,de--,0>de||I[W]!==B[de]){var ke=` +`+I[W].replace(" at new "," at ");return x.displayName&&ke.includes("")&&(ke=ke.replace("",x.displayName)),ke}while(1<=W&&0<=de);break}}}finally{Rr=!1,Error.prepareStackTrace=_}return(x=x?x.displayName||x.name:"")?nn(x):""}var La=Object.prototype.hasOwnProperty,Fs=[],zs=-1;function Di(x){return{current:x}}function kr(x){0>zs||(x.current=Fs[zs],Fs[zs]=null,zs--)}function In(x,d){zs++,Fs[zs]=x.current,x.current=d}var Ir={},Gr=Di(Ir),yr=Di(!1),Pi=Ir;function ws(x,d){var _=x.type.contextTypes;if(!_)return Ir;var $=x.stateNode;if($&&$.__reactInternalMemoizedUnmaskedChildContext===d)return $.__reactInternalMemoizedMaskedChildContext;var I={},B;for(B in _)I[B]=d[B];return $&&(x=x.stateNode,x.__reactInternalMemoizedUnmaskedChildContext=d,x.__reactInternalMemoizedMaskedChildContext=I),I}function fi(x){return x=x.childContextTypes,x!=null}function gs(){kr(yr),kr(Gr)}function tl(x,d,_){if(Gr.current!==Ir)throw Error(o(168));In(Gr,d),In(yr,_)}function Na(x,d,_){var $=x.stateNode;if(d=d.childContextTypes,typeof $.getChildContext!="function")return _;$=$.getChildContext();for(var I in $)if(!(I in d))throw Error(o(108,V(x)||"Unknown",I));return s({},_,$)}function fc(x){return x=(x=x.stateNode)&&x.__reactInternalMemoizedMergedChildContext||Ir,Pi=Gr.current,In(Gr,x),In(yr,yr.current),!0}function pc(x,d,_){var $=x.stateNode;if(!$)throw Error(o(169));_?(x=Na(x,d,Pi),$.__reactInternalMemoizedMergedChildContext=x,kr(yr),kr(Gr),In(Gr,x)):kr(yr),In(yr,_)}var Xs=Math.clz32?Math.clz32:gu,Jo=Math.log,Xl=Math.LN2;function gu(x){return x>>>=0,x===0?32:31-(Jo(x)/Xl|0)|0}var mh=64,qo=4194304;function vr(x){switch(x&-x){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 x&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return x&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return x}}function xi(x,d){var _=x.pendingLanes;if(_===0)return 0;var $=0,I=x.suspendedLanes,B=x.pingedLanes,W=_&268435455;if(W!==0){var de=W&~I;de!==0?$=vr(de):(B&=W,B!==0&&($=vr(B)))}else W=_&~I,W!==0?$=vr(W):B!==0&&($=vr(B));if($===0)return 0;if(d!==0&&d!==$&&!(d&I)&&(I=$&-$,B=d&-d,I>=B||I===16&&(B&4194240)!==0))return d;if($&4&&($|=_&16),d=x.entangledLanes,d!==0)for(x=x.entanglements,d&=$;0_;_++)d.push(x);return d}function _u(x,d,_){x.pendingLanes|=d,d!==536870912&&(x.suspendedLanes=0,x.pingedLanes=0),x=x.eventTimes,d=31-Xs(d),x[d]=_}function xl(x,d){var _=x.pendingLanes&~d;x.pendingLanes=d,x.suspendedLanes=0,x.pingedLanes=0,x.expiredLanes&=d,x.mutableReadLanes&=d,x.entangledLanes&=d,d=x.entanglements;var $=x.eventTimes;for(x=x.expirationTimes;0<_;){var I=31-Xs(_),B=1<>=W,I-=W,oo=1<<32-Xs(d)+I|_<kn?(zn=En,En=null):zn=En.sibling;var cr=cn(Tt,En,Le[kn],ot);if(cr===null){En===null&&(En=zn);break}x&&En&&cr.alternate===null&&d(Tt,En),Ce=B(cr,Ce,kn),on===null?Ht=cr:on.sibling=cr,on=cr,En=zn}if(kn===Le.length)return _(Tt,En),Sr&&Bo(Tt,kn),Ht;if(En===null){for(;knkn?(zn=En,En=null):zn=En.sibling;var Mr=cn(Tt,En,cr.value,ot);if(Mr===null){En===null&&(En=zn);break}x&&En&&Mr.alternate===null&&d(Tt,En),Ce=B(Mr,Ce,kn),on===null?Ht=Mr:on.sibling=Mr,on=Mr,En=zn}if(cr.done)return _(Tt,En),Sr&&Bo(Tt,kn),Ht;if(En===null){for(;!cr.done;kn++,cr=Le.next())cr=Zt(Tt,cr.value,ot),cr!==null&&(Ce=B(cr,Ce,kn),on===null?Ht=cr:on.sibling=cr,on=cr);return Sr&&Bo(Tt,kn),Ht}for(En=$(Tt,En);!cr.done;kn++,cr=Le.next())cr=bn(En,Tt,kn,cr.value,ot),cr!==null&&(x&&cr.alternate!==null&&En.delete(cr.key===null?kn:cr.key),Ce=B(cr,Ce,kn),on===null?Ht=cr:on.sibling=cr,on=cr);return x&&En.forEach(function(Bl){return d(Tt,Bl)}),Sr&&Bo(Tt,kn),Ht}function Dr(Tt,Ce,Le,ot){if(typeof Le=="object"&&Le!==null&&Le.type===f&&Le.key===null&&(Le=Le.props.children),typeof Le=="object"&&Le!==null){switch(Le.$$typeof){case u:e:{for(var Ht=Le.key,on=Ce;on!==null;){if(on.key===Ht){if(Ht=Le.type,Ht===f){if(on.tag===7){_(Tt,on.sibling),Ce=I(on,Le.props.children),Ce.return=Tt,Tt=Ce;break e}}else if(on.elementType===Ht||typeof Ht=="object"&&Ht!==null&&Ht.$$typeof===L&&Us(Ht)===on.type){_(Tt,on.sibling),Ce=I(on,Le.props),Ce.ref=Vu(Tt,on,Le),Ce.return=Tt,Tt=Ce;break e}_(Tt,on);break}else d(Tt,on);on=on.sibling}Le.type===f?(Ce=Pl(Le.props.children,Tt.mode,ot,Le.key),Ce.return=Tt,Tt=Ce):(ot=vo(Le.type,Le.key,Le.props,null,Tt.mode,ot),ot.ref=Vu(Tt,Ce,Le),ot.return=Tt,Tt=ot)}return W(Tt);case h:e:{for(on=Le.key;Ce!==null;){if(Ce.key===on)if(Ce.tag===4&&Ce.stateNode.containerInfo===Le.containerInfo&&Ce.stateNode.implementation===Le.implementation){_(Tt,Ce.sibling),Ce=I(Ce,Le.children||[]),Ce.return=Tt,Tt=Ce;break e}else{_(Tt,Ce);break}else d(Tt,Ce);Ce=Ce.sibling}Ce=ni(Le,Tt.mode,ot),Ce.return=Tt,Tt=Ce}return W(Tt);case L:return on=Le._init,Dr(Tt,Ce,on(Le._payload),ot)}if(ae(Le))return Tn(Tt,Ce,Le,ot);if(z(Le))return gn(Tt,Ce,Le,ot);Zl(Tt,Le)}return typeof Le=="string"&&Le!==""||typeof Le=="number"?(Le=""+Le,Ce!==null&&Ce.tag===6?(_(Tt,Ce.sibling),Ce=I(Ce,Le),Ce.return=Tt,Tt=Ce):(_(Tt,Ce),Ce=uu(Le,Tt.mode,ot),Ce.return=Tt,Tt=Ce),W(Tt)):_(Tt,Ce)}return Dr}var Uh=eu(!0),zc=eu(!1),Uc={},is=Di(Uc),Fr=Di(Uc),Cl=Di(Uc);function za(x){if(x===Uc)throw Error(o(174));return x}function tu(x,d){In(Cl,d),In(Fr,x),In(is,Uc),x=ge(d),kr(is),In(is,x)}function xu(){kr(is),kr(Fr),kr(Cl)}function bh(x){var d=za(Cl.current),_=za(is.current);d=we(_,x.type,d),_!==d&&(In(Fr,x),In(is,d))}function Ad(x){Fr.current===x&&(kr(is),kr(Fr))}var pi=Di(0);function ye(x){for(var d=x;d!==null;){if(d.tag===13){var _=d.memoizedState;if(_!==null&&(_=_.dehydrated,_===null||zt(_)||sn(_)))return d}else if(d.tag===19&&d.memoizedProps.revealOrder!==void 0){if(d.flags&128)return d}else if(d.child!==null){d.child.return=d,d=d.child;continue}if(d===x)break;for(;d.sibling===null;){if(d.return===null||d.return===x)return null;d=d.return}d.sibling.return=d.return,d=d.sibling}return null}var je=[];function Be(){for(var x=0;x_?_:4,x(!0);var $=rn.transition;rn.transition={};try{x(!1),d()}finally{br=_,rn.transition=$}}function Rd(){return Ks().memoizedState}function jh(x,d,_){var $=bs(x);_={lane:$,action:_,hasEagerState:!1,eagerState:null,next:null},Ii(x)?Sp(d,_):(Ff(x,d,_),_=Or(),x=Os(x,$,_),x!==null&&Il(x,d,$))}function ei(x,d,_){var $=bs(x),I={lane:$,action:_,hasEagerState:!1,eagerState:null,next:null};if(Ii(x))Sp(d,I);else{Ff(x,d,I);var B=x.alternate;if(x.lanes===0&&(B===null||B.lanes===0)&&(B=d.lastRenderedReducer,B!==null))try{var W=d.lastRenderedState,de=B(W,_);if(I.hasEagerState=!0,I.eagerState=de,Gn(de,W))return}catch{}finally{}_=Or(),x=Os(x,$,_),x!==null&&Il(x,d,$)}}function Ii(x){var d=x.alternate;return x===Jn||d!==null&&d===Jn}function Sp(x,d){Ti=ao=!0;var _=x.pending;_===null?d.next=d:(d.next=_.next,_.next=d),x.pending=d}function Ff(x,d,_){tr!==null&&x.mode&1&&!(Pn&2)?(x=d.interleaved,x===null?(_.next=_,Vn===null?Vn=[d]:Vn.push(d)):(_.next=x.next,x.next=_),d.interleaved=_):(x=d.pending,x===null?_.next=_:(_.next=x.next,x.next=_),d.pending=_)}function Il(x,d,_){if(_&4194240){var $=d.lanes;$&=x.pendingLanes,_|=$,d.lanes=_,$l(x,_)}}var ru={readContext:Ci,useCallback:Fi,useContext:Fi,useEffect:Fi,useImperativeHandle:Fi,useInsertionEffect:Fi,useLayoutEffect:Fi,useMemo:Fi,useReducer:Fi,useRef:Fi,useState:Fi,useDebugValue:Fi,useDeferredValue:Fi,useTransition:Fi,useMutableSource:Fi,useSyncExternalStore:Fi,useId:Fi,unstable_isNewReconciler:!1},Xu={readContext:Ci,useCallback:function(x,d){return pa().memoizedState=[x,d===void 0?null:d],x},useContext:Ci,useEffect:uo,useImperativeHandle:function(x,d,_){return _=_!=null?_.concat([x]):null,md(4194308,4,gd.bind(null,d,x),_)},useLayoutEffect:function(x,d){return md(4194308,4,x,d)},useInsertionEffect:function(x,d){return md(4,2,x,d)},useMemo:function(x,d){var _=pa();return d=d===void 0?null:d,x=x(),_.memoizedState=[x,d],x},useReducer:function(x,d,_){var $=pa();return d=_!==void 0?_(d):d,$.memoizedState=$.baseState=d,x={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:x,lastRenderedState:d},$.queue=x,x=x.dispatch=jh.bind(null,Jn,x),[$.memoizedState,x]},useRef:function(x){var d=pa();return x={current:x},d.memoizedState=x},useState:Wh,useDebugValue:nu,useDeferredValue:function(x){var d=Wh(x),_=d[0],$=d[1];return uo(function(){var I=rn.transition;rn.transition={};try{$(x)}finally{rn.transition=I}},[x]),_},useTransition:function(){var x=Wh(!1),d=x[0];return x=Al.bind(null,x[1]),pa().memoizedState=x,[d,x]},useMutableSource:function(){},useSyncExternalStore:function(x,d,_){var $=Jn,I=pa();if(Sr){if(_===void 0)throw Error(o(407));_=_()}else{if(_=d(),tr===null)throw Error(o(349));Rn&30||Zo($,d,_)}I.memoizedState=_;var B={value:_,getSnapshot:d};return I.queue=B,uo(Gh.bind(null,$,B,x),[x]),$.flags|=2048,gc(9,Hc.bind(null,$,B,_,d),void 0,null),_},useId:function(){var x=pa(),d=tr.identifierPrefix;if(Sr){var _=Fa,$=oo;_=($&~(1<<32-Xs($)-1)).toString(32)+_,d=":"+d+"R"+_,_=lo++,0<_&&(d+="H"+_.toString(32)),d+=":"}else _=al++,d=":"+d+"r"+_.toString(32)+":";return x.memoizedState=d},unstable_isNewReconciler:!1},Ku={readContext:Ci,useCallback:Gc,useContext:Ci,useEffect:Ml,useImperativeHandle:Yu,useInsertionEffect:Vh,useLayoutEffect:zi,useMemo:Id,useReducer:Ua,useRef:ju,useState:function(){return Ua(Hs)},useDebugValue:nu,useDeferredValue:function(x){var d=Ua(Hs),_=d[0],$=d[1];return Ml(function(){var I=rn.transition;rn.transition={};try{$(x)}finally{rn.transition=I}},[x]),_},useTransition:function(){var x=Ua(Hs)[0],d=Ks().memoizedState;return[x,d]},useMutableSource:Th,useSyncExternalStore:mc,useId:Rd,unstable_isNewReconciler:!1},Sh={readContext:Ci,useCallback:Gc,useContext:Ci,useEffect:Ml,useImperativeHandle:Yu,useInsertionEffect:Vh,useLayoutEffect:zi,useMemo:Id,useReducer:Hh,useRef:ju,useState:function(){return Hh(Hs)},useDebugValue:nu,useDeferredValue:function(x){var d=Hh(Hs),_=d[0],$=d[1];return Ml(function(){var I=rn.transition;rn.transition={};try{$(x)}finally{rn.transition=I}},[x]),_},useTransition:function(){var x=Hh(Hs)[0],d=Ks().memoizedState;return[x,d]},useMutableSource:Th,useSyncExternalStore:mc,useId:Rd,unstable_isNewReconciler:!1};function ll(x,d){try{var _="",$=d;do _+=wr($),$=$.return;while($);var I=_}catch(B){I=` Error generating stack: `+B.message+` -`+B.stack}return{value:x,source:d,stack:I}}function ta(x,d){try{console.error(d.value)}catch(_){setTimeout(function(){throw _})}}var Rl=typeof WeakMap=="function"?WeakMap:Map;function Wc(x,d,_){_=wu(-1,_),_.tag=3,_.payload={element:null};var $=d.value;return _.callback=function(){Mu||(Mu=!0,Au=$),ta(x,d)},_}function kl(x,d,_){_=wu(-1,_),_.tag=3;var $=x.type.getDerivedStateFromError;if(typeof $=="function"){var I=d.value;_.payload=function(){return $(I)},_.callback=function(){ta(x,d)}}var B=x.stateNode;return B!==null&&typeof B.componentDidCatch=="function"&&(_.callback=function(){ta(x,d),typeof $!="function"&&(fo===null?fo=new Set([this]):fo.add(this));var W=d.stack;this.componentDidCatch(d.value,{componentStack:W!==null?W:""})}),_}function Vc(x,d,_){var $=x.pingCache;if($===null){$=x.pingCache=new Rl;var I=new Set;$.set(d,I)}else I=$.get(d),I===void 0&&(I=new Set,$.set(d,I));I.has(_)||(I.add(_),x=Qs.bind(null,x,d,_),d.then(x,x))}function _c(x){do{var d;if((d=x.tag===13)&&(d=x.memoizedState,d=d!==null?d.dehydrated!==null:!0),d)return x;x=x.return}while(x!==null);return null}function kd(x,d,_,$,I){return x.mode&1?(x.flags|=65536,x.lanes=I,x):(x===d?x.flags|=65536:(x.flags|=128,_.flags|=131072,_.flags&=-52805,_.tag===1&&(_.alternate===null?_.tag=17:(d=wu(-1,1),d.tag=2,Vi(_,d))),_.lanes|=1),x)}function Ga(x){x.flags|=4}function Vr(x,d){if(x!==null&&x.child===d.child)return!0;if(d.flags&16)return!1;for(x=d.child;x!==null;){if(x.flags&12854||x.subtreeFlags&12854)return!1;x=x.sibling}return!0}var ul,Zi,ma,X;if(lt)ul=function(x,d){for(var _=d.child;_!==null;){if(_.tag===5||_.tag===6)fe(x,_.stateNode);else if(_.tag!==4&&_.child!==null){_.child.return=_,_=_.child;continue}if(_===d)break;for(;_.sibling===null;){if(_.return===null||_.return===d)return;_=_.return}_.sibling.return=_.return,_=_.sibling}},Zi=function(){},ma=function(x,d,_,$,I){if(x=x.memoizedProps,x!==$){var B=d.stateNode,W=za(is.current);_=Fe(B,_,x,$,I,W),(d.updateQueue=_)&&Ga(d)}},X=function(x,d,_,$){_!==$&&Ga(d)};else if(ze){ul=function(x,d,_,$){for(var I=d.child;I!==null;){if(I.tag===5){var B=I.stateNode;_&&$&&(B=mr(B,I.type,I.memoizedProps,I)),fe(x,B)}else if(I.tag===6)B=I.stateNode,_&&$&&(B=ne(B,I.memoizedProps,I)),fe(x,B);else if(I.tag!==4){if(I.tag===22&&I.memoizedState!==null)B=I.child,B!==null&&(B.return=I),ul(x,I,!0,!0);else if(I.child!==null){I.child.return=I,I=I.child;continue}}if(I===d)break;for(;I.sibling===null;){if(I.return===null||I.return===d)return;I=I.return}I.sibling.return=I.return,I=I.sibling}};var xs=function(x,d,_,$){for(var I=d.child;I!==null;){if(I.tag===5){var B=I.stateNode;_&&$&&(B=mr(B,I.type,I.memoizedProps,I)),Pr(x,B)}else if(I.tag===6)B=I.stateNode,_&&$&&(B=ne(B,I.memoizedProps,I)),Pr(x,B);else if(I.tag!==4){if(I.tag===22&&I.memoizedState!==null)B=I.child,B!==null&&(B.return=I),xs(x,I,!0,!0);else if(I.child!==null){I.child.return=I,I=I.child;continue}}if(I===d)break;for(;I.sibling===null;){if(I.return===null||I.return===d)return;I=I.return}I.sibling.return=I.return,I=I.sibling}};Zi=function(x,d){var _=d.stateNode;if(!Vr(x,d)){x=_.containerInfo;var $=ii(x);xs($,d,!1,!1),_.pendingChildren=$,Ga(d),Ei(x,$)}},ma=function(x,d,_,$,I){var B=x.stateNode,W=x.memoizedProps;if((x=Vr(x,d))&&W===$)d.stateNode=B;else{var de=d.stateNode,Oe=za(is.current),Ze=null;W!==$&&(Ze=Fe(de,_,W,$,I,Oe)),x&&Ze===null?d.stateNode=B:(B=On(B,Ze,_,W,$,d,x,de),Te(B,_,$,I,Oe)&&Ga(d),d.stateNode=B,x?Ga(d):ul(B,d,!1,!1))}},X=function(x,d,_,$){_!==$?(x=za(Cl.current),_=za(is.current),d.stateNode=Je($,x,_,d),Ga(d)):d.stateNode=x.stateNode}}else Zi=function(){},ma=function(){},X=function(){};function ga(x,d){if(!Sr)switch(x.tailMode){case"hidden":d=x.tail;for(var _=null;d!==null;)d.alternate!==null&&(_=d),d=d.sibling;_===null?x.tail=null:_.sibling=null;break;case"collapsed":_=x.tail;for(var $=null;_!==null;)_.alternate!==null&&($=_),_=_.sibling;$===null?d||x.tail===null?x.tail=null:x.tail.sibling=null:$.sibling=null}}function Cr(x){var d=x.alternate!==null&&x.alternate.child===x.child,_=0,$=0;if(d)for(var I=x.child;I!==null;)_|=I.lanes|I.childLanes,$|=I.subtreeFlags&14680064,$|=I.flags&14680064,I.return=x,I=I.sibling;else for(I=x.child;I!==null;)_|=I.lanes|I.childLanes,$|=I.subtreeFlags,$|=I.flags,I.return=x,I=I.sibling;return x.subtreeFlags|=$,x.childLanes=_,d}function mn(x,d,_){var $=d.pendingProps;switch(Fh(d),d.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Cr(d),null;case 1:return fi(d.type)&&gs(),Cr(d),null;case 3:return $=d.stateNode,xu(),kr(yr),kr(Gr),Be(),$.pendingContext&&($.context=$.pendingContext,$.pendingContext=null),(x===null||x.child===null)&&(ol(d)?Ga(d):x===null||x.memoizedState.isDehydrated&&!(d.flags&256)||(d.flags|=1024,fa!==null&&(wn(fa),fa=null))),Zi(x,d),Cr(d),null;case 5:Ad(d),_=za(Cl.current);var I=d.type;if(x!==null&&d.stateNode!=null)ma(x,d,I,$,_),x.ref!==d.ref&&(d.flags|=512,d.flags|=2097152);else{if(!$){if(d.stateNode===null)throw Error(o(166));return Cr(d),null}if(x=za(is.current),ol(d)){if(!Ce)throw Error(o(175));x=Vt(d.stateNode,d.type,d.memoizedProps,_,x,d,!ji),d.updateQueue=x,x!==null&&Ga(d)}else{var B=ie(I,$,_,x,d);ul(B,d,!1,!1),d.stateNode=B,Te(B,I,$,_,x)&&Ga(d)}d.ref!==null&&(d.flags|=512,d.flags|=2097152)}return Cr(d),null;case 6:if(x&&d.stateNode!=null)X(x,d,x.memoizedProps,$);else{if(typeof $!="string"&&d.stateNode===null)throw Error(o(166));if(x=za(Cl.current),_=za(is.current),ol(d)){if(!Ce)throw Error(o(176));if(x=d.stateNode,$=d.memoizedProps,(_=Wn(x,$,d,!ji))&&(I=Wr,I!==null))switch(B=(I.mode&1)!==0,I.tag){case 3:Oa(I.stateNode.containerInfo,x,$,B);break;case 5:Eo(I.type,I.memoizedProps,I.stateNode,x,$,B)}_&&Ga(d)}else d.stateNode=Je($,x,_,d)}return Cr(d),null;case 13:if(kr(pi),$=d.memoizedState,Sr&&Ai!==null&&(d.mode&1)!==0&&(d.flags&128)===0){for(x=Ai;x;)x=Pe(x);return Fc(),d.flags|=98560,d}if($!==null&&$.dehydrated!==null){if($=ol(d),x===null){if(!$)throw Error(o(318));if(!Ce)throw Error(o(344));if(x=d.memoizedState,x=x!==null?x.dehydrated:null,!x)throw Error(o(317));rr(x,d)}else Fc(),!(d.flags&128)&&(d.memoizedState=null),d.flags|=4;return Cr(d),null}return fa!==null&&(wn(fa),fa=null),d.flags&128?(d.lanes=_,d):($=$!==null,_=!1,x===null?ol(d):_=x.memoizedState!==null,$&&!_&&(d.child.flags|=8192,d.mode&1&&(x===null||pi.current&1?us===0&&(us=3):Jh())),d.updateQueue!==null&&(d.flags|=4),Cr(d),null);case 4:return xu(),Zi(x,d),x===null&&rt(d.stateNode.containerInfo),Cr(d),null;case 10:return Su(d.type._context),Cr(d),null;case 17:return fi(d.type)&&gs(),Cr(d),null;case 19:if(kr(pi),I=d.memoizedState,I===null)return Cr(d),null;if($=(d.flags&128)!==0,B=I.rendering,B===null)if($)ga(I,!1);else{if(us!==0||x!==null&&x.flags&128)for(x=d.child;x!==null;){if(B=ye(x),B!==null){for(d.flags|=128,ga(I,!1),x=B.updateQueue,x!==null&&(d.updateQueue=x,d.flags|=4),d.subtreeFlags=0,x=_,$=d.child;$!==null;)_=$,I=x,_.flags&=14680066,B=_.alternate,B===null?(_.childLanes=0,_.lanes=I,_.child=null,_.subtreeFlags=0,_.memoizedProps=null,_.memoizedState=null,_.updateQueue=null,_.dependencies=null,_.stateNode=null):(_.childLanes=B.childLanes,_.lanes=B.lanes,_.child=B.child,_.subtreeFlags=0,_.deletions=null,_.memoizedProps=B.memoizedProps,_.memoizedState=B.memoizedState,_.updateQueue=B.updateQueue,_.type=B.type,I=B.dependencies,_.dependencies=I===null?null:{lanes:I.lanes,firstContext:I.firstContext}),$=$.sibling;return An(pi,pi.current&1|2),d.child}x=x.sibling}I.tail!==null&&Qi()>vd&&(d.flags|=128,$=!0,ga(I,!1),d.lanes=4194304)}else{if(!$)if(x=ye(B),x!==null){if(d.flags|=128,$=!0,x=x.updateQueue,x!==null&&(d.updateQueue=x,d.flags|=4),ga(I,!0),I.tail===null&&I.tailMode==="hidden"&&!B.alternate&&!Sr)return Cr(d),null}else 2*Qi()-I.renderingStartTime>vd&&_!==1073741824&&(d.flags|=128,$=!0,ga(I,!1),d.lanes=4194304);I.isBackwards?(B.sibling=d.child,d.child=B):(x=I.last,x!==null?x.sibling=B:d.child=B,I.last=B)}return I.tail!==null?(d=I.tail,I.rendering=d,I.tail=d.sibling,I.renderingStartTime=Qi(),d.sibling=null,x=pi.current,An(pi,$?x&1|2:x&1),d):(Cr(d),null);case 22:case 23:return Ft(),$=d.memoizedState!==null,x!==null&&x.memoizedState!==null!==$&&(d.flags|=8192),$&&d.mode&1?qr&1073741824&&(Cr(d),lt&&d.subtreeFlags&6&&(d.flags|=8192)):Cr(d),null;case 24:return null;case 25:return null}throw Error(o(156,d.tag))}var zf=l.ReactCurrentOwner,cl=!1;function Ri(x,d,_,$){d.child=x===null?zc(d,null,_,$):Uh(d,x.child,_,$)}function hi(x,d,_,$,I){_=_.render;var B=d.ref;return Bi(d,I),$=$u(x,d,_,$,B,I),_=qn(),x!==null&&!cl?(d.updateQueue=x.updateQueue,d.flags&=-2053,x.lanes&=~I,mi(x,d,I)):(Sr&&_&&Ql(d),d.flags|=1,Ri(x,d,$,I),d.child)}function es(x,d,_,$,I){if(x===null){var B=_.type;return typeof B=="function"&&!_o(B)&&B.defaultProps===void 0&&_.compare===null&&_.defaultProps===void 0?(d.tag=15,d.type=B,ss(x,d,B,$,I)):(x=vo(_.type,null,$,d,d.mode,I),x.ref=d.ref,x.return=d,d.child=x)}if(B=x.child,(x.lanes&I)===0){var W=B.memoizedProps;if(_=_.compare,_=_!==null?_:Hu,_(W,$)&&x.ref===d.ref)return mi(x,d,I)}return d.flags|=1,x=Dl(B,$),x.ref=d.ref,x.return=d,d.child=x}function ss(x,d,_,$,I){if(x!==null&&Hu(x.memoizedProps,$)&&x.ref===d.ref)if(cl=!1,(x.lanes&I)!==0)x.flags&131072&&(cl=!0);else return d.lanes=x.lanes,mi(x,d,I);return va(x,d,_,$,I)}function jc(x,d,_){var $=d.pendingProps,I=$.children,B=x!==null?x.memoizedState:null;if($.mode==="hidden")if(!(d.mode&1))d.memoizedState={baseLanes:0,cachePool:null},An(Mo,qr),qr|=_;else if(_&1073741824)d.memoizedState={baseLanes:0,cachePool:null},$=B!==null?B.baseLanes:_,An(Mo,qr),qr|=$;else return x=B!==null?B.baseLanes|_:_,d.lanes=d.childLanes=1073741824,d.memoizedState={baseLanes:x,cachePool:null},d.updateQueue=null,An(Mo,qr),qr|=x,null;else B!==null?($=B.baseLanes|_,d.memoizedState=null):$=_,An(Mo,qr),qr|=$;return Ri(x,d,I,_),d.child}function _a(x,d){var _=d.ref;(x===null&&_!==null||x!==null&&x.ref!==_)&&(d.flags|=512,d.flags|=2097152)}function va(x,d,_,$,I){var B=fi(_)?Pi:Gr.current;return B=ws(d,B),Bi(d,I),_=$u(x,d,_,$,B,I),$=qn(),x!==null&&!cl?(d.updateQueue=x.updateQueue,d.flags&=-2053,x.lanes&=~I,mi(x,d,I)):(Sr&&$&&Ql(d),d.flags|=1,Ri(x,d,_,I),d.child)}function os(x,d,_,$,I){if(fi(_)){var B=!0;fc(d)}else B=!1;if(Bi(d,I),d.stateNode===null)x!==null&&(x.alternate=null,d.alternate=null,d.flags|=2),Bf(d,_,$),Md(d,_,$,I),$=!0;else if(x===null){var W=d.stateNode,de=d.memoizedProps;W.props=de;var Oe=W.context,Ze=_.contextType;typeof Ze=="object"&&Ze!==null?Ze=Ci(Ze):(Ze=fi(_)?Pi:Gr.current,Ze=ws(d,Ze));var wt=_.getDerivedStateFromProps,Qt=typeof wt=="function"||typeof W.getSnapshotBeforeUpdate=="function";Qt||typeof W.UNSAFE_componentWillReceiveProps!="function"&&typeof W.componentWillReceiveProps!="function"||(de!==$||Oe!==Ze)&&Tp(d,W,$,Ze),Mi=!1;var cn=d.memoizedState;W.state=cn,hr(d,$,W,I),Oe=d.memoizedState,de!==$||cn!==Oe||yr.current||Mi?(typeof wt=="function"&&(lf(d,_,wt,$),Oe=d.memoizedState),(de=Mi||uf(d,_,de,$,cn,Oe,Ze))?(Qt||typeof W.UNSAFE_componentWillMount!="function"&&typeof W.componentWillMount!="function"||(typeof W.componentWillMount=="function"&&W.componentWillMount(),typeof W.UNSAFE_componentWillMount=="function"&&W.UNSAFE_componentWillMount()),typeof W.componentDidMount=="function"&&(d.flags|=4194308)):(typeof W.componentDidMount=="function"&&(d.flags|=4194308),d.memoizedProps=$,d.memoizedState=Oe),W.props=$,W.state=Oe,W.context=Ze,$=de):(typeof W.componentDidMount=="function"&&(d.flags|=4194308),$=!1)}else{W=d.stateNode,dd(x,d),de=d.memoizedProps,Ze=d.type===d.elementType?de:Rs(d.type,de),W.props=Ze,Qt=d.pendingProps,cn=W.context,Oe=_.contextType,typeof Oe=="object"&&Oe!==null?Oe=Ci(Oe):(Oe=fi(_)?Pi:Gr.current,Oe=ws(d,Oe));var bn=_.getDerivedStateFromProps;(wt=typeof bn=="function"||typeof W.getSnapshotBeforeUpdate=="function")||typeof W.UNSAFE_componentWillReceiveProps!="function"&&typeof W.componentWillReceiveProps!="function"||(de!==Qt||cn!==Oe)&&Tp(d,W,$,Oe),Mi=!1,cn=d.memoizedState,W.state=cn,hr(d,$,W,I);var Tn=d.memoizedState;de!==Qt||cn!==Tn||yr.current||Mi?(typeof bn=="function"&&(lf(d,_,bn,$),Tn=d.memoizedState),(Ze=Mi||uf(d,_,Ze,$,cn,Tn,Oe)||!1)?(wt||typeof W.UNSAFE_componentWillUpdate!="function"&&typeof W.componentWillUpdate!="function"||(typeof W.componentWillUpdate=="function"&&W.componentWillUpdate($,Tn,Oe),typeof W.UNSAFE_componentWillUpdate=="function"&&W.UNSAFE_componentWillUpdate($,Tn,Oe)),typeof W.componentDidUpdate=="function"&&(d.flags|=4),typeof W.getSnapshotBeforeUpdate=="function"&&(d.flags|=1024)):(typeof W.componentDidUpdate!="function"||de===x.memoizedProps&&cn===x.memoizedState||(d.flags|=4),typeof W.getSnapshotBeforeUpdate!="function"||de===x.memoizedProps&&cn===x.memoizedState||(d.flags|=1024),d.memoizedProps=$,d.memoizedState=Tn),W.props=$,W.state=Tn,W.context=Oe,$=Ze):(typeof W.componentDidUpdate!="function"||de===x.memoizedProps&&cn===x.memoizedState||(d.flags|=4),typeof W.getSnapshotBeforeUpdate!="function"||de===x.memoizedProps&&cn===x.memoizedState||(d.flags|=1024),$=!1)}return Yc(x,d,_,$,B,I)}function Yc(x,d,_,$,I,B){_a(x,d);var W=(d.flags&128)!==0;if(!$&&!W)return I&&pc(d,_,!1),mi(x,d,B);$=d.stateNode,zf.current=d;var de=W&&typeof _.getDerivedStateFromError!="function"?null:$.render();return d.flags|=1,x!==null&&W?(d.child=Uh(d,x.child,null,B),d.child=Uh(d,null,de,B)):Ri(x,d,de,B),d.memoizedState=$.state,I&&pc(d,_,!0),d.child}function na(x){var d=x.stateNode;d.pendingContext?tl(x,d.pendingContext,d.pendingContext!==d.context):d.context&&tl(x,d.context,!1),tu(x,d.containerInfo)}function Od(x,d,_,$,I){return Fc(),zh(I),d.flags|=256,Ri(x,d,_,$),d.child}var Ld={dehydrated:null,treeContext:null,retryLane:0};function Yh(x){return{baseLanes:x,cachePool:null}}function Gs(x,d,_){var $=d.pendingProps,I=pi.current,B=!1,W=(d.flags&128)!==0,de;if((de=W)||(de=x!==null&&x.memoizedState===null?!1:(I&2)!==0),de?(B=!0,d.flags&=-129):(x===null||x.memoizedState!==null)&&(I|=1),An(pi,I&1),x===null)return pd(d),x=d.memoizedState,x!==null&&(x=x.dehydrated,x!==null)?(d.mode&1?sn(x)?d.lanes=8:d.lanes=1073741824:d.lanes=1,null):(I=$.children,x=$.fallback,B?($=d.mode,B=d.child,I={mode:"hidden",children:I},!($&1)&&B!==null?(B.childLanes=0,B.pendingProps=I):B=Xa(I,$,0,null),x=Pl(x,$,_,null),B.return=d,x.return=d,B.sibling=x,d.child=B,d.child.memoizedState=Yh(_),d.memoizedState=Ld,x):Kn(d,I));if(I=x.memoizedState,I!==null){if(de=I.dehydrated,de!==null){if(W)return d.flags&256?(d.flags&=-257,Ui(x,d,_,Error(o(422)))):d.memoizedState!==null?(d.child=x.child,d.flags|=128,null):(B=$.fallback,I=d.mode,$=Xa({mode:"visible",children:$.children},I,0,null),B=Pl(B,I,_,null),B.flags|=2,$.return=d,B.return=d,$.sibling=B,d.child=$,d.mode&1&&Uh(d,x.child,null,_),d.child.memoizedState=Yh(_),d.memoizedState=Ld,B);if(!(d.mode&1))d=Ui(x,d,_,null);else if(sn(de))d=Ui(x,d,_,Error(o(419)));else if($=(_&x.childLanes)!==0,cl||$){if($=tr,$!==null){switch(_&-_){case 4:B=2;break;case 16:B=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:B=32;break;case 536870912:B=268435456;break;default:B=0}$=B&($.suspendedLanes|_)?0:B,$!==0&&$!==I.retryLane&&(I.retryLane=$,Os(x,$,-1))}Jh(),d=Ui(x,d,_,Error(o(421)))}else zt(de)?(d.flags|=128,d.child=x.child,d=Ch.bind(null,x),Nn(de,d),d=null):(_=I.treeContext,Ce&&(Ai=bt(de),Wr=d,Sr=!0,fa=null,ji=!1,_!==null&&(Ba[ci++]=oo,Ba[ci++]=Fa,Ba[ci++]=Er,oo=_.id,Fa=_.overflow,Er=d)),d=Kn(d,d.pendingProps.children),d.flags|=4096);return d}return B?($=Js(x,d,$.children,$.fallback,_),B=d.child,I=x.child.memoizedState,B.memoizedState=I===null?Yh(_):{baseLanes:I.baseLanes|_,cachePool:null},B.childLanes=x.childLanes&~_,d.memoizedState=Ld,$):(_=Ws(x,d,$.children,_),d.memoizedState=null,_)}return B?($=Js(x,d,$.children,$.fallback,_),B=d.child,I=x.child.memoizedState,B.memoizedState=I===null?Yh(_):{baseLanes:I.baseLanes|_,cachePool:null},B.childLanes=x.childLanes&~_,d.memoizedState=Ld,$):(_=Ws(x,d,$.children,_),d.memoizedState=null,_)}function Kn(x,d){return d=Xa({mode:"visible",children:d},x.mode,0,null),d.return=x,x.child=d}function Ws(x,d,_,$){var I=x.child;return x=I.sibling,_=Dl(I,{mode:"visible",children:_}),!(d.mode&1)&&(_.lanes=$),_.return=d,_.sibling=null,x!==null&&($=d.deletions,$===null?(d.deletions=[x],d.flags|=16):$.push(x)),d.child=_}function Js(x,d,_,$,I){var B=d.mode;x=x.child;var W=x.sibling,de={mode:"hidden",children:_};return!(B&1)&&d.child!==x?(_=d.child,_.childLanes=0,_.pendingProps=de,d.deletions=null):(_=Dl(x,de),_.subtreeFlags=x.subtreeFlags&14680064),W!==null?$=Dl(W,$):($=Pl($,B,I,null),$.flags|=2),$.return=d,_.return=d,_.sibling=$,d.child=_,$}function Ui(x,d,_,$){return $!==null&&zh($),Uh(d,x.child,null,_),x=Kn(d,d.pendingProps.children),x.flags|=2,d.memoizedState=null,x}function iu(x,d,_){x.lanes|=d;var $=x.alternate;$!==null&&($.lanes|=d),sl(x.return,d,_)}function Fo(x,d,_,$,I){var B=x.memoizedState;B===null?x.memoizedState={isBackwards:d,rendering:null,renderingStartTime:0,last:$,tail:_,tailMode:I}:(B.isBackwards=d,B.rendering=null,B.renderingStartTime=0,B.last=$,B.tail=_,B.tailMode=I)}function xn(x,d,_){var $=d.pendingProps,I=$.revealOrder,B=$.tail;if(Ri(x,d,$.children,_),$=pi.current,($&2)!==0)$=$&1|2,d.flags|=128;else{if(x!==null&&x.flags&128)e:for(x=d.child;x!==null;){if(x.tag===13)x.memoizedState!==null&&iu(x,_,d);else if(x.tag===19)iu(x,_,d);else if(x.child!==null){x.child.return=x,x=x.child;continue}if(x===d)break e;for(;x.sibling===null;){if(x.return===null||x.return===d)break e;x=x.return}x.sibling.return=x.return,x=x.sibling}$&=1}if(An(pi,$),(d.mode&1)===0)d.memoizedState=null;else switch(I){case"forwards":for(_=d.child,I=null;_!==null;)x=_.alternate,x!==null&&ye(x)===null&&(I=_),_=_.sibling;_=I,_===null?(I=d.child,d.child=null):(I=_.sibling,_.sibling=null),Fo(d,!1,I,_,B);break;case"backwards":for(_=null,I=d.child,d.child=null;I!==null;){if(x=I.alternate,x!==null&&ye(x)===null){d.child=I;break}x=I.sibling,I.sibling=_,_=I,I=x}Fo(d,!0,_,null,B);break;case"together":Fo(d,!1,null,null,void 0);break;default:d.memoizedState=null}return d.child}function mi(x,d,_){if(x!==null&&(d.dependencies=x.dependencies),au|=d.lanes,(_&d.childLanes)===0)return null;if(x!==null&&d.child!==x.child)throw Error(o(153));if(d.child!==null){for(x=d.child,_=Dl(x,x.pendingProps),d.child=_,_.return=d;x.sibling!==null;)x=x.sibling,_=_.sibling=Dl(x,x.pendingProps),_.return=d;_.sibling=null}return d.child}function gi(x,d,_){switch(d.tag){case 3:na(d),Fc();break;case 5:bh(d);break;case 1:fi(d.type)&&fc(d);break;case 4:tu(d,d.stateNode.containerInfo);break;case 10:xo(d,d.type._context,d.memoizedProps.value);break;case 13:var $=d.memoizedState;if($!==null)return $.dehydrated!==null?(An(pi,pi.current&1),d.flags|=128,null):_&d.child.childLanes?Gs(x,d,_):(An(pi,pi.current&1),x=mi(x,d,_),x!==null?x.sibling:null);An(pi,pi.current&1);break;case 19:if($=(_&d.childLanes)!==0,(x.flags&128)!==0){if($)return xn(x,d,_);d.flags|=128}var I=d.memoizedState;if(I!==null&&(I.rendering=null,I.tail=null,I.lastEffect=null),An(pi,pi.current),$)break;return null;case 22:case 23:return d.lanes=0,jc(x,d,_)}return mi(x,d,_)}function Uf(x,d){switch(Fh(d),d.tag){case 1:return fi(d.type)&&gs(),x=d.flags,x&65536?(d.flags=x&-65537|128,d):null;case 3:return xu(),kr(yr),kr(Gr),Be(),x=d.flags,x&65536&&!(x&128)?(d.flags=x&-65537|128,d):null;case 5:return Ad(d),null;case 13:if(kr(pi),x=d.memoizedState,x!==null&&x.dehydrated!==null){if(d.alternate===null)throw Error(o(340));Fc()}return x=d.flags,x&65536?(d.flags=x&-65537|128,d):null;case 19:return kr(pi),null;case 4:return xu(),null;case 10:return Su(d.type._context),null;case 22:case 23:return Ft(),null;case 24:return null;default:return null}}var wh=!1,co=!1,ya=typeof WeakSet=="function"?WeakSet:Set,Cn=null;function yn(x,d){var _=x.ref;if(_!==null)if(typeof _=="function")try{_(null)}catch($){Ao(x,d,$)}else _.current=null}function hl(x,d,_){try{_()}catch($){Ao(x,d,$)}}var vc=!1;function wp(x,d){for(J(x.containerInfo),Cn=d;Cn!==null;)if(x=Cn,d=x.child,(x.subtreeFlags&1028)!==0&&d!==null)d.return=x,Cn=d;else for(;Cn!==null;){x=Cn;try{var _=x.alternate;if(x.flags&1024)switch(x.tag){case 0:case 11:case 15:break;case 1:if(_!==null){var $=_.memoizedProps,I=_.memoizedState,B=x.stateNode,W=B.getSnapshotBeforeUpdate(x.elementType===x.type?$:Rs(x.type,$),I);B.__reactInternalSnapshotBeforeUpdate=W}break;case 3:lt&&Kt(x.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(o(163))}}catch(de){Ao(x,x.return,de)}if(d=x.sibling,d!==null){d.return=x.return,Cn=d;break}Cn=x.return}return _=vc,vc=!1,_}function su(x,d,_){var $=d.updateQueue;if($=$!==null?$.lastEffect:null,$!==null){var I=$=$.next;do{if((I.tag&x)===x){var B=I.destroy;I.destroy=void 0,B!==void 0&&hl(d,_,B)}I=I.next}while(I!==$)}}function $o(x,d){if(d=d.updateQueue,d=d!==null?d.lastEffect:null,d!==null){var _=d=d.next;do{if((_.tag&x)===x){var $=_.create;_.destroy=$()}_=_.next}while(_!==d)}}function ys(x){var d=x.ref;if(d!==null){var _=x.stateNode;switch(x.tag){case 5:x=ue(_);break;default:x=_}typeof d=="function"?d(x):d.current=x}}function dl(x,d,_){if(ca&&typeof ca.onCommitFiberUnmount=="function")try{ca.onCommitFiberUnmount(zu,d)}catch{}switch(d.tag){case 0:case 11:case 14:case 15:if(x=d.updateQueue,x!==null&&(x=x.lastEffect,x!==null)){var $=x=x.next;do{var I=$,B=I.destroy;I=I.tag,B!==void 0&&(I&2||I&4)&&hl(d,_,B),$=$.next}while($!==x)}break;case 1:if(yn(d,_),x=d.stateNode,typeof x.componentWillUnmount=="function")try{x.props=d.memoizedProps,x.state=d.memoizedState,x.componentWillUnmount()}catch(W){Ao(d,_,W)}break;case 5:yn(d,_);break;case 4:lt?Xc(x,d,_):ze&&ze&&(d=d.stateNode.containerInfo,_=ii(d),xr(d,_))}}function as(x,d,_){for(var $=d;;)if(dl(x,$,_),$.child===null||lt&&$.tag===4){if($===d)break;for(;$.sibling===null;){if($.return===null||$.return===d)return;$=$.return}$.sibling.return=$.return,$=$.sibling}else $.child.return=$,$=$.child}function fl(x){var d=x.alternate;d!==null&&(x.alternate=null,fl(d)),x.child=null,x.deletions=null,x.sibling=null,x.tag===5&&(d=x.stateNode,d!==null&&Nt(d)),x.stateNode=null,x.return=null,x.dependencies=null,x.memoizedProps=null,x.memoizedState=null,x.pendingProps=null,x.stateNode=null,x.updateQueue=null}function zo(x){return x.tag===5||x.tag===3||x.tag===4}function Xh(x){e:for(;;){for(;x.sibling===null;){if(x.return===null||zo(x.return))return null;x=x.return}for(x.sibling.return=x.return,x=x.sibling;x.tag!==5&&x.tag!==6&&x.tag!==18;){if(x.flags&2||x.child===null||x.tag===4)continue e;x.child.return=x,x=x.child}if(!(x.flags&2))return x.stateNode}}function Wa(x){if(lt){e:{for(var d=x.return;d!==null;){if(zo(d))break e;d=d.return}throw Error(o(160))}var _=d;switch(_.tag){case 5:d=_.stateNode,_.flags&32&&(Wt(d),_.flags&=-33),_=Xh(x),Nd(x,_,d);break;case 3:case 4:d=_.stateNode.containerInfo,_=Xh(x),ki(x,_,d);break;default:throw Error(o(161))}}}function ki(x,d,_){var $=x.tag;if($===5||$===6)x=x.stateNode,d?me(_,x,d):pt(_,x);else if($!==4&&(x=x.child,x!==null))for(ki(x,d,_),x=x.sibling;x!==null;)ki(x,d,_),x=x.sibling}function Nd(x,d,_){var $=x.tag;if($===5||$===6)x=x.stateNode,d?te(_,x,d):It(_,x);else if($!==4&&(x=x.child,x!==null))for(Nd(x,d,_),x=x.sibling;x!==null;)Nd(x,d,_),x=x.sibling}function Xc(x,d,_){for(var $=d,I=!1,B,W;;){if(!I){I=$.return;e:for(;;){if(I===null)throw Error(o(160));switch(B=I.stateNode,I.tag){case 5:W=!1;break e;case 3:B=B.containerInfo,W=!0;break e;case 4:B=B.containerInfo,W=!0;break e}I=I.return}I=!0}if($.tag===5||$.tag===6)as(x,$,_),W?Xe(B,$.stateNode):ke(B,$.stateNode);else if($.tag===18)W?Yr(B,$.stateNode):Br(B,$.stateNode);else if($.tag===4){if($.child!==null){B=$.stateNode.containerInfo,W=!0,$.child.return=$,$=$.child;continue}}else if(dl(x,$,_),$.child!==null){$.child.return=$,$=$.child;continue}if($===d)break;for(;$.sibling===null;){if($.return===null||$.return===d)return;$=$.return,$.tag===4&&(I=!1)}$.sibling.return=$.return,$=$.sibling}}function Kh(x,d){if(lt){switch(d.tag){case 0:case 11:case 14:case 15:su(3,d,d.return),$o(3,d),su(5,d,d.return);return;case 1:return;case 5:var _=d.stateNode;if(_!=null){var $=d.memoizedProps;x=x!==null?x.memoizedProps:$;var I=d.type,B=d.updateQueue;d.updateQueue=null,B!==null&&Q(_,B,I,x,$,d)}return;case 6:if(d.stateNode===null)throw Error(o(162));_=d.memoizedProps,Ke(d.stateNode,x!==null?x.memoizedProps:_,_);return;case 3:Ce&&x!==null&&x.memoizedState.isDehydrated&&$r(d.stateNode.containerInfo);return;case 12:return;case 13:Uo(d);return;case 19:Uo(d);return;case 17:return}throw Error(o(163))}switch(d.tag){case 0:case 11:case 14:case 15:su(3,d,d.return),$o(3,d),su(5,d,d.return);return;case 12:return;case 13:Uo(d);return;case 19:Uo(d);return;case 3:Ce&&x!==null&&x.memoizedState.isDehydrated&&$r(d.stateNode.containerInfo);break;case 22:case 23:return}e:if(ze){switch(d.tag){case 1:case 5:case 6:break e;case 3:case 4:d=d.stateNode,xr(d.containerInfo,d.pendingChildren);break e}throw Error(o(163))}}function Uo(x){var d=x.updateQueue;if(d!==null){x.updateQueue=null;var _=x.stateNode;_===null&&(_=x.stateNode=new ya),d.forEach(function($){var I=go.bind(null,x,$);_.has($)||(_.add($),$.then(I,I))})}}function Co(x,d){for(Cn=d;Cn!==null;){d=Cn;var _=d.deletions;if(_!==null)for(var $=0;$<_.length;$++){var I=_[$];try{var B=x;lt?Xc(B,I,d):as(B,I,d);var W=I.alternate;W!==null&&(W.return=null),I.return=null}catch(Ht){Ao(I,d,Ht)}}if(_=d.child,(d.subtreeFlags&12854)!==0&&_!==null)_.return=d,Cn=_;else for(;Cn!==null;){d=Cn;try{var de=d.flags;if(de&32&<&&Wt(d.stateNode),de&512){var Oe=d.alternate;if(Oe!==null){var Ze=Oe.ref;Ze!==null&&(typeof Ze=="function"?Ze(null):Ze.current=null)}}if(de&8192)switch(d.tag){case 13:if(d.memoizedState!==null){var wt=d.alternate;(wt===null||wt.memoizedState===null)&&(ho=Qi())}break;case 22:var Qt=d.memoizedState!==null,cn=d.alternate,bn=cn!==null&&cn.memoizedState!==null;if(_=d,lt){e:if($=_,I=Qt,B=null,lt)for(var Tn=$;;){if(Tn.tag===5){if(B===null){B=Tn;var gn=Tn.stateNode;I?Ge(gn):_t(Tn.stateNode,Tn.memoizedProps)}}else if(Tn.tag===6){if(B===null){var Dr=Tn.stateNode;I?tn(Dr):Jt(Dr,Tn.memoizedProps)}}else if((Tn.tag!==22&&Tn.tag!==23||Tn.memoizedState===null||Tn===$)&&Tn.child!==null){Tn.child.return=Tn,Tn=Tn.child;continue}if(Tn===$)break;for(;Tn.sibling===null;){if(Tn.return===null||Tn.return===$)break e;B===Tn&&(B=null),Tn=Tn.return}B===Tn&&(B=null),Tn.sibling.return=Tn.return,Tn=Tn.sibling}}if(Qt&&!bn&&_.mode&1){Cn=_;for(var Tt=_.child;Tt!==null;){for(_=Cn=Tt;Cn!==null;){$=Cn;var Me=$.child;switch($.tag){case 0:case 11:case 14:case 15:su(4,$,$.return);break;case 1:yn($,$.return);var Ne=$.stateNode;if(typeof Ne.componentWillUnmount=="function"){var st=$.return;try{Ne.props=$.memoizedProps,Ne.state=$.memoizedState,Ne.componentWillUnmount()}catch(Ht){Ao($,st,Ht)}}break;case 5:yn($,$.return);break;case 22:if($.memoizedState!==null){_d(_);continue}}Me!==null?(Me.return=$,Cn=Me):_d(_)}Tt=Tt.sibling}}}switch(de&4102){case 2:Wa(d),d.flags&=-3;break;case 6:Wa(d),d.flags&=-3,Kh(d.alternate,d);break;case 4096:d.flags&=-4097;break;case 4100:d.flags&=-4097,Kh(d.alternate,d);break;case 4:Kh(d.alternate,d)}}catch(Ht){Ao(d,d.return,Ht)}if(_=d.sibling,_!==null){_.return=d.return,Cn=_;break}Cn=d.return}}}function df(x,d,_){Cn=x,Cu(x)}function Cu(x,d,_){for(var $=(x.mode&1)!==0;Cn!==null;){var I=Cn,B=I.child;if(I.tag===22&&$){var W=I.memoizedState!==null||wh;if(!W){var de=I.alternate,Oe=de!==null&&de.memoizedState!==null||co;de=wh;var Ze=co;if(wh=W,(co=Oe)&&!Ze)for(Cn=I;Cn!==null;)W=Cn,Oe=W.child,W.tag===22&&W.memoizedState!==null?yc(I):Oe!==null?(Oe.return=W,Cn=Oe):yc(I);for(;B!==null;)Cn=B,Cu(B),B=B.sibling;Cn=I,wh=de,co=Ze}Ol(x)}else I.subtreeFlags&8772&&B!==null?(B.return=I,Cn=B):Ol(x)}}function Ol(x){for(;Cn!==null;){var d=Cn;if(d.flags&8772){var _=d.alternate;try{if(d.flags&8772)switch(d.tag){case 0:case 11:case 15:co||$o(5,d);break;case 1:var $=d.stateNode;if(d.flags&4&&!co)if(_===null)$.componentDidMount();else{var I=d.elementType===d.type?_.memoizedProps:Rs(d.type,_.memoizedProps);$.componentDidUpdate(I,_.memoizedState,$.__reactInternalSnapshotBeforeUpdate)}var B=d.updateQueue;B!==null&&Qo(d,B,$);break;case 3:var W=d.updateQueue;if(W!==null){if(_=null,d.child!==null)switch(d.child.tag){case 5:_=ue(d.child.stateNode);break;case 1:_=d.child.stateNode}Qo(d,W,_)}break;case 5:var de=d.stateNode;_===null&&d.flags&4&&Le(de,d.type,d.memoizedProps,d);break;case 6:break;case 4:break;case 12:break;case 13:if(Ce&&d.memoizedState===null){var Oe=d.alternate;if(Oe!==null){var Ze=Oe.memoizedState;if(Ze!==null){var wt=Ze.dehydrated;wt!==null&&si(wt)}}}break;case 19:case 17:case 21:case 22:case 23:break;default:throw Error(o(163))}co||d.flags&512&&ys(d)}catch(Qt){Ao(d,d.return,Qt)}}if(d===x){Cn=null;break}if(_=d.sibling,_!==null){_.return=d.return,Cn=_;break}Cn=d.return}}function _d(x){for(;Cn!==null;){var d=Cn;if(d===x){Cn=null;break}var _=d.sibling;if(_!==null){_.return=d.return,Cn=_;break}Cn=d.return}}function yc(x){for(;Cn!==null;){var d=Cn;try{switch(d.tag){case 0:case 11:case 15:var _=d.return;try{$o(4,d)}catch(Oe){Ao(d,_,Oe)}break;case 1:var $=d.stateNode;if(typeof $.componentDidMount=="function"){var I=d.return;try{$.componentDidMount()}catch(Oe){Ao(d,I,Oe)}}var B=d.return;try{ys(d)}catch(Oe){Ao(d,B,Oe)}break;case 5:var W=d.return;try{ys(d)}catch(Oe){Ao(d,W,Oe)}}}catch(Oe){Ao(d,d.return,Oe)}if(d===x){Cn=null;break}var de=d.sibling;if(de!==null){de.return=d.return,Cn=de;break}Cn=d.return}}var Kr=0,ou=1,Ju=2,ls=3,Va=4;if(typeof Symbol=="function"&&Symbol.for){var $s=Symbol.for;Kr=$s("selector.component"),ou=$s("selector.has_pseudo_class"),Ju=$s("selector.role"),ls=$s("selector.test_id"),Va=$s("selector.text")}function Cs(x){var d=He(x);if(d!=null){if(typeof d.memoizedProps["data-testname"]!="string")throw Error(o(364));return d}if(x=At(x),x===null)throw Error(o(362));return x.stateNode.current}function Kc(x,d){switch(d.$$typeof){case Kr:if(x.type===d.value)return!0;break;case ou:e:{d=d.value,x=[x,0];for(var _=0;_";case ou:return":has("+(_i(x)||"")+")";case Ju:return'[role="'+x.value+'"]';case Va:return'"'+x.value+'"';case ls:return'[data-testname="'+x.value+'"]';default:throw Error(o(365))}}function ja(x,d){var _=[];x=[x,0];for(var $=0;$I&&(I=W),$&=~B}if($=I,$=Qi()-$,$=(120>$?120:480>$?480:1080>$?1080:1920>$?1920:3e3>$?3e3:4320>$?4320:1960*ff($/1960))-$,10<$){x.timeoutHandle=Re(ml.bind(null,x,qs),$);break}ml(x,qs);break;case 5:ml(x,qs);break;default:throw Error(o(329))}}}return Vs(x,Qi()),x.callbackNode===_?fn.bind(null,x):null}function Jc(x,d){var _=Qu;return x.current.memoizedState.isDehydrated&&(pl(x,d).flags|=256),x=qc(x,d),x!==2&&(d=qs,qs=_,d!==null&&wn(d)),x}function wn(x){qs===null?qs=x:qs.push.apply(qs,x)}function vi(x){for(var d=x;;){if(d.flags&16384){var _=d.updateQueue;if(_!==null&&(_=_.stores,_!==null))for(var $=0;$<_.length;$++){var I=_[$],B=I.getSnapshot;I=I.value;try{if(!Gn(B(),I))return!1}catch{return!1}}}if(_=d.child,d.subtreeFlags&16384&&_!==null)_.return=d,d=_;else{if(d===x)break;for(;d.sibling===null;){if(d.return===null||d.return===x)return!0;d=d.return}d.sibling.return=d.return,d=d.sibling}}return!0}function Ms(x,d){for(d&=~Tc,d&=~qu,x.suspendedLanes|=d,x.pingedLanes&=~d,x=x.expirationTimes;0x?16:x,Ll===null)var $=!1;else{if(x=Ll,Ll=null,Ho=0,(Pn&6)!==0)throw Error(o(331));var I=Pn;for(Pn|=4,Cn=x.current;Cn!==null;){var B=Cn,W=B.child;if(Cn.flags&16){var de=B.deletions;if(de!==null){for(var Oe=0;OeQi()-ho?pl(x,0):Tc|=_),Vs(x,d)}function ia(x,d){d===0&&(x.mode&1?(d=qo,qo<<=1,!(qo&130023424)&&(qo=4194304)):d=1);var _=Or();x=Ya(x,d),x!==null&&(_u(x,d,_),Vs(x,_))}function Ch(x){var d=x.memoizedState,_=0;d!==null&&(_=d.retryLane),ia(x,_)}function go(x,d){var _=0;switch(x.tag){case 13:var $=x.stateNode,I=x.memoizedState;I!==null&&(_=I.retryLane);break;case 19:$=x.stateNode;break;default:throw Error(o(314))}$!==null&&$.delete(d),ia(x,_)}var Iu;Iu=function(x,d,_){if(x!==null)if(x.memoizedProps!==d.pendingProps||yr.current)cl=!0;else{if(!(x.lanes&_)&&!(d.flags&128))return cl=!1,gi(x,d,_);cl=(x.flags&131072)!==0}else cl=!1,Sr&&d.flags&1048576&&ql(d,yh,d.index);switch(d.lanes=0,d.tag){case 2:var $=d.type;x!==null&&(x.alternate=null,d.alternate=null,d.flags|=2),x=d.pendingProps;var I=ws(d,Gr.current);Bi(d,_),I=$u(null,d,$,x,I,_);var B=qn();return d.flags|=1,typeof I=="object"&&I!==null&&typeof I.render=="function"&&I.$$typeof===void 0?(d.tag=1,d.memoizedState=null,d.updateQueue=null,fi($)?(B=!0,fc(d)):B=!1,d.memoizedState=I.state!==null&&I.state!==void 0?I.state:null,Xr(d),I.updater=Bc,d.stateNode=I,I._reactInternals=d,Md(d,$,x,_),d=Yc(null,d,$,!0,B,_)):(d.tag=0,Sr&&B&&Ql(d),Ri(null,d,I,_),d=d.child),d;case 16:$=d.elementType;e:{switch(x!==null&&(x.alternate=null,d.alternate=null,d.flags|=2),x=d.pendingProps,I=$._init,$=I($._payload),d.type=$,I=d.tag=rc($),x=Rs($,x),I){case 0:d=va(null,d,$,x,_);break e;case 1:d=os(null,d,$,x,_);break e;case 11:d=hi(null,d,$,x,_);break e;case 14:d=es(null,d,$,Rs($.type,x),_);break e}throw Error(o(306,$,""))}return d;case 0:return $=d.type,I=d.pendingProps,I=d.elementType===$?I:Rs($,I),va(x,d,$,I,_);case 1:return $=d.type,I=d.pendingProps,I=d.elementType===$?I:Rs($,I),os(x,d,$,I,_);case 3:e:{if(na(d),x===null)throw Error(o(387));$=d.pendingProps,B=d.memoizedState,I=B.element,dd(x,d),hr(d,$,null,_);var W=d.memoizedState;if($=W.element,Ce&&B.isDehydrated)if(B={element:$,isDehydrated:!1,cache:W.cache,transitions:W.transitions},d.updateQueue.baseState=B,d.memoizedState=B,d.flags&256){I=Error(o(423)),d=Od(x,d,$,_,I);break e}else if($!==I){I=Error(o(424)),d=Od(x,d,$,_,I);break e}else for(Ce&&(Ai=Ct(d.stateNode.containerInfo),Wr=d,Sr=!0,fa=null,ji=!1),_=zc(d,null,$,_),d.child=_;_;)_.flags=_.flags&-3|4096,_=_.sibling;else{if(Fc(),$===I){d=mi(x,d,_);break e}Ri(x,d,$,_)}d=d.child}return d;case 5:return bh(d),x===null&&pd(d),$=d.type,I=d.pendingProps,B=x!==null?x.memoizedProps:null,W=I.children,Ie($,I)?W=null:B!==null&&Ie($,B)&&(d.flags|=32),_a(x,d),Ri(x,d,W,_),d.child;case 6:return x===null&&pd(d),null;case 13:return Gs(x,d,_);case 4:return tu(d,d.stateNode.containerInfo),$=d.pendingProps,x===null?d.child=Uh(d,null,$,_):Ri(x,d,$,_),d.child;case 11:return $=d.type,I=d.pendingProps,I=d.elementType===$?I:Rs($,I),hi(x,d,$,I,_);case 7:return Ri(x,d,d.pendingProps,_),d.child;case 8:return Ri(x,d,d.pendingProps.children,_),d.child;case 12:return Ri(x,d,d.pendingProps.children,_),d.child;case 10:e:{if($=d.type._context,I=d.pendingProps,B=d.memoizedProps,W=I.value,xo(d,$,W),B!==null)if(Gn(B.value,W)){if(B.children===I.children&&!yr.current){d=mi(x,d,_);break e}}else for(B=d.child,B!==null&&(B.return=d);B!==null;){var de=B.dependencies;if(de!==null){W=B.child;for(var Oe=de.firstContext;Oe!==null;){if(Oe.context===$){if(B.tag===1){Oe=wu(-1,_&-_),Oe.tag=2;var Ze=B.updateQueue;if(Ze!==null){Ze=Ze.shared;var wt=Ze.pending;wt===null?Oe.next=Oe:(Oe.next=wt.next,wt.next=Oe),Ze.pending=Oe}}B.lanes|=_,Oe=B.alternate,Oe!==null&&(Oe.lanes|=_),sl(B.return,_,d),de.lanes|=_;break}Oe=Oe.next}}else if(B.tag===10)W=B.type===d.type?null:B.child;else if(B.tag===18){if(W=B.return,W===null)throw Error(o(341));W.lanes|=_,de=W.alternate,de!==null&&(de.lanes|=_),sl(W,_,d),W=B.sibling}else W=B.child;if(W!==null)W.return=B;else for(W=B;W!==null;){if(W===d){W=null;break}if(B=W.sibling,B!==null){B.return=W.return,W=B;break}W=W.return}B=W}Ri(x,d,I.children,_),d=d.child}return d;case 9:return I=d.type,$=d.pendingProps.children,Bi(d,_),I=Ci(I),$=$(I),d.flags|=1,Ri(x,d,$,_),d.child;case 14:return $=d.type,I=Rs($,d.pendingProps),I=Rs($.type,I),es(x,d,$,I,_);case 15:return ss(x,d,d.type,d.pendingProps,_);case 17:return $=d.type,I=d.pendingProps,I=d.elementType===$?I:Rs($,I),x!==null&&(x.alternate=null,d.alternate=null,d.flags|=2),d.tag=1,fi($)?(x=!0,fc(d)):x=!1,Bi(d,_),Bf(d,$,I),Md(d,$,I,_),Yc(null,d,$,!0,x,_);case 19:return xn(x,d,_);case 22:return jc(x,d,_)}throw Error(o(156,d.tag))};function eh(x,d){return Kl(x,d)}function wc(x,d,_,$){this.tag=x,this.key=_,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=d,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=$,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Go(x,d,_,$){return new wc(x,d,_,$)}function _o(x){return x=x.prototype,!(!x||!x.isReactComponent)}function rc(x){if(typeof x=="function")return _o(x)?1:0;if(x!=null){if(x=x.$$typeof,x===C)return 11;if(x===k)return 14}return 2}function Dl(x,d){var _=x.alternate;return _===null?(_=Go(x.tag,d,x.key,x.mode),_.elementType=x.elementType,_.type=x.type,_.stateNode=x.stateNode,_.alternate=x,x.alternate=_):(_.pendingProps=d,_.type=x.type,_.flags=0,_.subtreeFlags=0,_.deletions=null),_.flags=x.flags&14680064,_.childLanes=x.childLanes,_.lanes=x.lanes,_.child=x.child,_.memoizedProps=x.memoizedProps,_.memoizedState=x.memoizedState,_.updateQueue=x.updateQueue,d=x.dependencies,_.dependencies=d===null?null:{lanes:d.lanes,firstContext:d.firstContext},_.sibling=x.sibling,_.index=x.index,_.ref=x.ref,_}function vo(x,d,_,$,I,B){var W=2;if($=x,typeof x=="function")_o(x)&&(W=1);else if(typeof x=="string")W=5;else e:switch(x){case f:return Pl(_.children,I,B,d);case g:W=8,I|=8;break;case y:return x=Go(12,_,d,I|2),x.elementType=y,x.lanes=B,x;case M:return x=Go(13,_,d,I),x.elementType=M,x.lanes=B,x;case A:return x=Go(19,_,d,I),x.elementType=A,x.lanes=B,x;case P:return Xa(_,I,B,d);default:if(typeof x=="object"&&x!==null)switch(x.$$typeof){case b:W=10;break e;case w:W=9;break e;case C:W=11;break e;case k:W=14;break e;case L:W=16,$=null;break e}throw Error(o(130,x==null?x:typeof x,""))}return d=Go(W,_,d,I),d.elementType=x,d.type=$,d.lanes=B,d}function Pl(x,d,_,$){return x=Go(7,x,$,d),x.lanes=_,x}function Xa(x,d,_,$){return x=Go(22,x,$,d),x.elementType=P,x.lanes=_,x.stateNode={},x}function uu(x,d,_){return x=Go(6,x,null,d),x.lanes=_,x}function ni(x,d,_){return d=Go(4,x.children!==null?x.children:[],x.key,d),d.lanes=_,d.stateNode={containerInfo:x.containerInfo,pendingChildren:null,implementation:x.implementation},d}function cs(x,d,_,$,I){this.tag=d,this.containerInfo=x,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=nt,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=El(0),this.expirationTimes=El(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=El(0),this.identifierPrefix=$,this.onRecoverableError=I,Ce&&(this.mutableSourceEagerHydrationData=null)}function qh(x,d,_,$,I,B,W,de,Oe){return x=new cs(x,d,_,de,Oe),d===1?(d=1,B===!0&&(d|=8)):d=0,B=Go(3,null,null,d),x.current=B,B.stateNode=x,B.memoizedState={element:$,isDehydrated:_,cache:null,transitions:null},Xr(B),x}function yd(x){if(!x)return Ir;x=x._reactInternals;e:{if(H(x)!==x||x.tag!==1)throw Error(o(170));var d=x;do{switch(d.tag){case 3:d=d.stateNode.context;break e;case 1:if(fi(d.type)){d=d.stateNode.__reactInternalMemoizedMergedChildContext;break e}}d=d.return}while(d!==null);throw Error(o(171))}if(x.tag===1){var _=x.type;if(fi(_))return Na(x,_,d)}return d}function Ta(x){var d=x._reactInternals;if(d===void 0)throw typeof x.render=="function"?Error(o(188)):(x=Object.keys(x).join(","),Error(o(268,x)));return x=Z(d),x===null?null:x.stateNode}function Sa(x,d){if(x=x.memoizedState,x!==null&&x.dehydrated!==null){var _=x.retryLane;x.retryLane=_!==0&&_=Ze&&B>=Qt&&I<=wt&&W<=cn){x.splice(d,1);break}else if($!==Ze||_.width!==Oe.width||cnW){if(!(B!==Qt||_.height!==Oe.height||wt<$||Ze>I)){Ze>$&&(Oe.width+=Ze-$,Oe.x=$),wtB&&(Oe.height+=Qt-B,Oe.y=B),cn_&&(_=W)),Wvd&&(d.flags|=128,$=!0,ga(I,!1),d.lanes=4194304)}else{if(!$)if(x=ye(B),x!==null){if(d.flags|=128,$=!0,x=x.updateQueue,x!==null&&(d.updateQueue=x,d.flags|=4),ga(I,!0),I.tail===null&&I.tailMode==="hidden"&&!B.alternate&&!Sr)return Cr(d),null}else 2*Qi()-I.renderingStartTime>vd&&_!==1073741824&&(d.flags|=128,$=!0,ga(I,!1),d.lanes=4194304);I.isBackwards?(B.sibling=d.child,d.child=B):(x=I.last,x!==null?x.sibling=B:d.child=B,I.last=B)}return I.tail!==null?(d=I.tail,I.rendering=d,I.tail=d.sibling,I.renderingStartTime=Qi(),d.sibling=null,x=pi.current,In(pi,$?x&1|2:x&1),d):(Cr(d),null);case 22:case 23:return Ft(),$=d.memoizedState!==null,x!==null&&x.memoizedState!==null!==$&&(d.flags|=8192),$&&d.mode&1?qr&1073741824&&(Cr(d),ut&&d.subtreeFlags&6&&(d.flags|=8192)):Cr(d),null;case 24:return null;case 25:return null}throw Error(o(156,d.tag))}var zf=l.ReactCurrentOwner,cl=!1;function Ri(x,d,_,$){d.child=x===null?zc(d,null,_,$):Uh(d,x.child,_,$)}function hi(x,d,_,$,I){_=_.render;var B=d.ref;return Bi(d,I),$=$u(x,d,_,$,B,I),_=qn(),x!==null&&!cl?(d.updateQueue=x.updateQueue,d.flags&=-2053,x.lanes&=~I,mi(x,d,I)):(Sr&&_&&Ql(d),d.flags|=1,Ri(x,d,$,I),d.child)}function es(x,d,_,$,I){if(x===null){var B=_.type;return typeof B=="function"&&!_o(B)&&B.defaultProps===void 0&&_.compare===null&&_.defaultProps===void 0?(d.tag=15,d.type=B,ss(x,d,B,$,I)):(x=vo(_.type,null,$,d,d.mode,I),x.ref=d.ref,x.return=d,d.child=x)}if(B=x.child,(x.lanes&I)===0){var W=B.memoizedProps;if(_=_.compare,_=_!==null?_:Hu,_(W,$)&&x.ref===d.ref)return mi(x,d,I)}return d.flags|=1,x=Dl(B,$),x.ref=d.ref,x.return=d,d.child=x}function ss(x,d,_,$,I){if(x!==null&&Hu(x.memoizedProps,$)&&x.ref===d.ref)if(cl=!1,(x.lanes&I)!==0)x.flags&131072&&(cl=!0);else return d.lanes=x.lanes,mi(x,d,I);return va(x,d,_,$,I)}function jc(x,d,_){var $=d.pendingProps,I=$.children,B=x!==null?x.memoizedState:null;if($.mode==="hidden")if(!(d.mode&1))d.memoizedState={baseLanes:0,cachePool:null},In(Mo,qr),qr|=_;else if(_&1073741824)d.memoizedState={baseLanes:0,cachePool:null},$=B!==null?B.baseLanes:_,In(Mo,qr),qr|=$;else return x=B!==null?B.baseLanes|_:_,d.lanes=d.childLanes=1073741824,d.memoizedState={baseLanes:x,cachePool:null},d.updateQueue=null,In(Mo,qr),qr|=x,null;else B!==null?($=B.baseLanes|_,d.memoizedState=null):$=_,In(Mo,qr),qr|=$;return Ri(x,d,I,_),d.child}function _a(x,d){var _=d.ref;(x===null&&_!==null||x!==null&&x.ref!==_)&&(d.flags|=512,d.flags|=2097152)}function va(x,d,_,$,I){var B=fi(_)?Pi:Gr.current;return B=ws(d,B),Bi(d,I),_=$u(x,d,_,$,B,I),$=qn(),x!==null&&!cl?(d.updateQueue=x.updateQueue,d.flags&=-2053,x.lanes&=~I,mi(x,d,I)):(Sr&&$&&Ql(d),d.flags|=1,Ri(x,d,_,I),d.child)}function os(x,d,_,$,I){if(fi(_)){var B=!0;fc(d)}else B=!1;if(Bi(d,I),d.stateNode===null)x!==null&&(x.alternate=null,d.alternate=null,d.flags|=2),Bf(d,_,$),Md(d,_,$,I),$=!0;else if(x===null){var W=d.stateNode,de=d.memoizedProps;W.props=de;var ke=W.context,et=_.contextType;typeof et=="object"&&et!==null?et=Ci(et):(et=fi(_)?Pi:Gr.current,et=ws(d,et));var wt=_.getDerivedStateFromProps,Zt=typeof wt=="function"||typeof W.getSnapshotBeforeUpdate=="function";Zt||typeof W.UNSAFE_componentWillReceiveProps!="function"&&typeof W.componentWillReceiveProps!="function"||(de!==$||ke!==et)&&Tp(d,W,$,et),Mi=!1;var cn=d.memoizedState;W.state=cn,hr(d,$,W,I),ke=d.memoizedState,de!==$||cn!==ke||yr.current||Mi?(typeof wt=="function"&&(lf(d,_,wt,$),ke=d.memoizedState),(de=Mi||uf(d,_,de,$,cn,ke,et))?(Zt||typeof W.UNSAFE_componentWillMount!="function"&&typeof W.componentWillMount!="function"||(typeof W.componentWillMount=="function"&&W.componentWillMount(),typeof W.UNSAFE_componentWillMount=="function"&&W.UNSAFE_componentWillMount()),typeof W.componentDidMount=="function"&&(d.flags|=4194308)):(typeof W.componentDidMount=="function"&&(d.flags|=4194308),d.memoizedProps=$,d.memoizedState=ke),W.props=$,W.state=ke,W.context=et,$=de):(typeof W.componentDidMount=="function"&&(d.flags|=4194308),$=!1)}else{W=d.stateNode,dd(x,d),de=d.memoizedProps,et=d.type===d.elementType?de:Rs(d.type,de),W.props=et,Zt=d.pendingProps,cn=W.context,ke=_.contextType,typeof ke=="object"&&ke!==null?ke=Ci(ke):(ke=fi(_)?Pi:Gr.current,ke=ws(d,ke));var bn=_.getDerivedStateFromProps;(wt=typeof bn=="function"||typeof W.getSnapshotBeforeUpdate=="function")||typeof W.UNSAFE_componentWillReceiveProps!="function"&&typeof W.componentWillReceiveProps!="function"||(de!==Zt||cn!==ke)&&Tp(d,W,$,ke),Mi=!1,cn=d.memoizedState,W.state=cn,hr(d,$,W,I);var Tn=d.memoizedState;de!==Zt||cn!==Tn||yr.current||Mi?(typeof bn=="function"&&(lf(d,_,bn,$),Tn=d.memoizedState),(et=Mi||uf(d,_,et,$,cn,Tn,ke)||!1)?(wt||typeof W.UNSAFE_componentWillUpdate!="function"&&typeof W.componentWillUpdate!="function"||(typeof W.componentWillUpdate=="function"&&W.componentWillUpdate($,Tn,ke),typeof W.UNSAFE_componentWillUpdate=="function"&&W.UNSAFE_componentWillUpdate($,Tn,ke)),typeof W.componentDidUpdate=="function"&&(d.flags|=4),typeof W.getSnapshotBeforeUpdate=="function"&&(d.flags|=1024)):(typeof W.componentDidUpdate!="function"||de===x.memoizedProps&&cn===x.memoizedState||(d.flags|=4),typeof W.getSnapshotBeforeUpdate!="function"||de===x.memoizedProps&&cn===x.memoizedState||(d.flags|=1024),d.memoizedProps=$,d.memoizedState=Tn),W.props=$,W.state=Tn,W.context=ke,$=et):(typeof W.componentDidUpdate!="function"||de===x.memoizedProps&&cn===x.memoizedState||(d.flags|=4),typeof W.getSnapshotBeforeUpdate!="function"||de===x.memoizedProps&&cn===x.memoizedState||(d.flags|=1024),$=!1)}return Yc(x,d,_,$,B,I)}function Yc(x,d,_,$,I,B){_a(x,d);var W=(d.flags&128)!==0;if(!$&&!W)return I&&pc(d,_,!1),mi(x,d,B);$=d.stateNode,zf.current=d;var de=W&&typeof _.getDerivedStateFromError!="function"?null:$.render();return d.flags|=1,x!==null&&W?(d.child=Uh(d,x.child,null,B),d.child=Uh(d,null,de,B)):Ri(x,d,de,B),d.memoizedState=$.state,I&&pc(d,_,!0),d.child}function na(x){var d=x.stateNode;d.pendingContext?tl(x,d.pendingContext,d.pendingContext!==d.context):d.context&&tl(x,d.context,!1),tu(x,d.containerInfo)}function Od(x,d,_,$,I){return Fc(),zh(I),d.flags|=256,Ri(x,d,_,$),d.child}var Ld={dehydrated:null,treeContext:null,retryLane:0};function Yh(x){return{baseLanes:x,cachePool:null}}function Gs(x,d,_){var $=d.pendingProps,I=pi.current,B=!1,W=(d.flags&128)!==0,de;if((de=W)||(de=x!==null&&x.memoizedState===null?!1:(I&2)!==0),de?(B=!0,d.flags&=-129):(x===null||x.memoizedState!==null)&&(I|=1),In(pi,I&1),x===null)return pd(d),x=d.memoizedState,x!==null&&(x=x.dehydrated,x!==null)?(d.mode&1?sn(x)?d.lanes=8:d.lanes=1073741824:d.lanes=1,null):(I=$.children,x=$.fallback,B?($=d.mode,B=d.child,I={mode:"hidden",children:I},!($&1)&&B!==null?(B.childLanes=0,B.pendingProps=I):B=Xa(I,$,0,null),x=Pl(x,$,_,null),B.return=d,x.return=d,B.sibling=x,d.child=B,d.child.memoizedState=Yh(_),d.memoizedState=Ld,x):Kn(d,I));if(I=x.memoizedState,I!==null){if(de=I.dehydrated,de!==null){if(W)return d.flags&256?(d.flags&=-257,Ui(x,d,_,Error(o(422)))):d.memoizedState!==null?(d.child=x.child,d.flags|=128,null):(B=$.fallback,I=d.mode,$=Xa({mode:"visible",children:$.children},I,0,null),B=Pl(B,I,_,null),B.flags|=2,$.return=d,B.return=d,$.sibling=B,d.child=$,d.mode&1&&Uh(d,x.child,null,_),d.child.memoizedState=Yh(_),d.memoizedState=Ld,B);if(!(d.mode&1))d=Ui(x,d,_,null);else if(sn(de))d=Ui(x,d,_,Error(o(419)));else if($=(_&x.childLanes)!==0,cl||$){if($=tr,$!==null){switch(_&-_){case 4:B=2;break;case 16:B=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:B=32;break;case 536870912:B=268435456;break;default:B=0}$=B&($.suspendedLanes|_)?0:B,$!==0&&$!==I.retryLane&&(I.retryLane=$,Os(x,$,-1))}Jh(),d=Ui(x,d,_,Error(o(421)))}else zt(de)?(d.flags|=128,d.child=x.child,d=Ch.bind(null,x),Nn(de,d),d=null):(_=I.treeContext,$e&&(Ai=bt(de),Wr=d,Sr=!0,fa=null,ji=!1,_!==null&&(Ba[ci++]=oo,Ba[ci++]=Fa,Ba[ci++]=Er,oo=_.id,Fa=_.overflow,Er=d)),d=Kn(d,d.pendingProps.children),d.flags|=4096);return d}return B?($=Js(x,d,$.children,$.fallback,_),B=d.child,I=x.child.memoizedState,B.memoizedState=I===null?Yh(_):{baseLanes:I.baseLanes|_,cachePool:null},B.childLanes=x.childLanes&~_,d.memoizedState=Ld,$):(_=Ws(x,d,$.children,_),d.memoizedState=null,_)}return B?($=Js(x,d,$.children,$.fallback,_),B=d.child,I=x.child.memoizedState,B.memoizedState=I===null?Yh(_):{baseLanes:I.baseLanes|_,cachePool:null},B.childLanes=x.childLanes&~_,d.memoizedState=Ld,$):(_=Ws(x,d,$.children,_),d.memoizedState=null,_)}function Kn(x,d){return d=Xa({mode:"visible",children:d},x.mode,0,null),d.return=x,x.child=d}function Ws(x,d,_,$){var I=x.child;return x=I.sibling,_=Dl(I,{mode:"visible",children:_}),!(d.mode&1)&&(_.lanes=$),_.return=d,_.sibling=null,x!==null&&($=d.deletions,$===null?(d.deletions=[x],d.flags|=16):$.push(x)),d.child=_}function Js(x,d,_,$,I){var B=d.mode;x=x.child;var W=x.sibling,de={mode:"hidden",children:_};return!(B&1)&&d.child!==x?(_=d.child,_.childLanes=0,_.pendingProps=de,d.deletions=null):(_=Dl(x,de),_.subtreeFlags=x.subtreeFlags&14680064),W!==null?$=Dl(W,$):($=Pl($,B,I,null),$.flags|=2),$.return=d,_.return=d,_.sibling=$,d.child=_,$}function Ui(x,d,_,$){return $!==null&&zh($),Uh(d,x.child,null,_),x=Kn(d,d.pendingProps.children),x.flags|=2,d.memoizedState=null,x}function iu(x,d,_){x.lanes|=d;var $=x.alternate;$!==null&&($.lanes|=d),sl(x.return,d,_)}function Fo(x,d,_,$,I){var B=x.memoizedState;B===null?x.memoizedState={isBackwards:d,rendering:null,renderingStartTime:0,last:$,tail:_,tailMode:I}:(B.isBackwards=d,B.rendering=null,B.renderingStartTime=0,B.last=$,B.tail=_,B.tailMode=I)}function $n(x,d,_){var $=d.pendingProps,I=$.revealOrder,B=$.tail;if(Ri(x,d,$.children,_),$=pi.current,($&2)!==0)$=$&1|2,d.flags|=128;else{if(x!==null&&x.flags&128)e:for(x=d.child;x!==null;){if(x.tag===13)x.memoizedState!==null&&iu(x,_,d);else if(x.tag===19)iu(x,_,d);else if(x.child!==null){x.child.return=x,x=x.child;continue}if(x===d)break e;for(;x.sibling===null;){if(x.return===null||x.return===d)break e;x=x.return}x.sibling.return=x.return,x=x.sibling}$&=1}if(In(pi,$),(d.mode&1)===0)d.memoizedState=null;else switch(I){case"forwards":for(_=d.child,I=null;_!==null;)x=_.alternate,x!==null&&ye(x)===null&&(I=_),_=_.sibling;_=I,_===null?(I=d.child,d.child=null):(I=_.sibling,_.sibling=null),Fo(d,!1,I,_,B);break;case"backwards":for(_=null,I=d.child,d.child=null;I!==null;){if(x=I.alternate,x!==null&&ye(x)===null){d.child=I;break}x=I.sibling,I.sibling=_,_=I,I=x}Fo(d,!0,_,null,B);break;case"together":Fo(d,!1,null,null,void 0);break;default:d.memoizedState=null}return d.child}function mi(x,d,_){if(x!==null&&(d.dependencies=x.dependencies),au|=d.lanes,(_&d.childLanes)===0)return null;if(x!==null&&d.child!==x.child)throw Error(o(153));if(d.child!==null){for(x=d.child,_=Dl(x,x.pendingProps),d.child=_,_.return=d;x.sibling!==null;)x=x.sibling,_=_.sibling=Dl(x,x.pendingProps),_.return=d;_.sibling=null}return d.child}function gi(x,d,_){switch(d.tag){case 3:na(d),Fc();break;case 5:bh(d);break;case 1:fi(d.type)&&fc(d);break;case 4:tu(d,d.stateNode.containerInfo);break;case 10:xo(d,d.type._context,d.memoizedProps.value);break;case 13:var $=d.memoizedState;if($!==null)return $.dehydrated!==null?(In(pi,pi.current&1),d.flags|=128,null):_&d.child.childLanes?Gs(x,d,_):(In(pi,pi.current&1),x=mi(x,d,_),x!==null?x.sibling:null);In(pi,pi.current&1);break;case 19:if($=(_&d.childLanes)!==0,(x.flags&128)!==0){if($)return $n(x,d,_);d.flags|=128}var I=d.memoizedState;if(I!==null&&(I.rendering=null,I.tail=null,I.lastEffect=null),In(pi,pi.current),$)break;return null;case 22:case 23:return d.lanes=0,jc(x,d,_)}return mi(x,d,_)}function Uf(x,d){switch(Fh(d),d.tag){case 1:return fi(d.type)&&gs(),x=d.flags,x&65536?(d.flags=x&-65537|128,d):null;case 3:return xu(),kr(yr),kr(Gr),Be(),x=d.flags,x&65536&&!(x&128)?(d.flags=x&-65537|128,d):null;case 5:return Ad(d),null;case 13:if(kr(pi),x=d.memoizedState,x!==null&&x.dehydrated!==null){if(d.alternate===null)throw Error(o(340));Fc()}return x=d.flags,x&65536?(d.flags=x&-65537|128,d):null;case 19:return kr(pi),null;case 4:return xu(),null;case 10:return Su(d.type._context),null;case 22:case 23:return Ft(),null;case 24:return null;default:return null}}var wh=!1,co=!1,ya=typeof WeakSet=="function"?WeakSet:Set,Mn=null;function yn(x,d){var _=x.ref;if(_!==null)if(typeof _=="function")try{_(null)}catch($){Ao(x,d,$)}else _.current=null}function hl(x,d,_){try{_()}catch($){Ao(x,d,$)}}var vc=!1;function wp(x,d){for(J(x.containerInfo),Mn=d;Mn!==null;)if(x=Mn,d=x.child,(x.subtreeFlags&1028)!==0&&d!==null)d.return=x,Mn=d;else for(;Mn!==null;){x=Mn;try{var _=x.alternate;if(x.flags&1024)switch(x.tag){case 0:case 11:case 15:break;case 1:if(_!==null){var $=_.memoizedProps,I=_.memoizedState,B=x.stateNode,W=B.getSnapshotBeforeUpdate(x.elementType===x.type?$:Rs(x.type,$),I);B.__reactInternalSnapshotBeforeUpdate=W}break;case 3:ut&&Xt(x.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(o(163))}}catch(de){Ao(x,x.return,de)}if(d=x.sibling,d!==null){d.return=x.return,Mn=d;break}Mn=x.return}return _=vc,vc=!1,_}function su(x,d,_){var $=d.updateQueue;if($=$!==null?$.lastEffect:null,$!==null){var I=$=$.next;do{if((I.tag&x)===x){var B=I.destroy;I.destroy=void 0,B!==void 0&&hl(d,_,B)}I=I.next}while(I!==$)}}function $o(x,d){if(d=d.updateQueue,d=d!==null?d.lastEffect:null,d!==null){var _=d=d.next;do{if((_.tag&x)===x){var $=_.create;_.destroy=$()}_=_.next}while(_!==d)}}function ys(x){var d=x.ref;if(d!==null){var _=x.stateNode;switch(x.tag){case 5:x=ue(_);break;default:x=_}typeof d=="function"?d(x):d.current=x}}function dl(x,d,_){if(ca&&typeof ca.onCommitFiberUnmount=="function")try{ca.onCommitFiberUnmount(zu,d)}catch{}switch(d.tag){case 0:case 11:case 14:case 15:if(x=d.updateQueue,x!==null&&(x=x.lastEffect,x!==null)){var $=x=x.next;do{var I=$,B=I.destroy;I=I.tag,B!==void 0&&(I&2||I&4)&&hl(d,_,B),$=$.next}while($!==x)}break;case 1:if(yn(d,_),x=d.stateNode,typeof x.componentWillUnmount=="function")try{x.props=d.memoizedProps,x.state=d.memoizedState,x.componentWillUnmount()}catch(W){Ao(d,_,W)}break;case 5:yn(d,_);break;case 4:ut?Xc(x,d,_):ze&&ze&&(d=d.stateNode.containerInfo,_=ii(d),xr(d,_))}}function as(x,d,_){for(var $=d;;)if(dl(x,$,_),$.child===null||ut&&$.tag===4){if($===d)break;for(;$.sibling===null;){if($.return===null||$.return===d)return;$=$.return}$.sibling.return=$.return,$=$.sibling}else $.child.return=$,$=$.child}function fl(x){var d=x.alternate;d!==null&&(x.alternate=null,fl(d)),x.child=null,x.deletions=null,x.sibling=null,x.tag===5&&(d=x.stateNode,d!==null&&Nt(d)),x.stateNode=null,x.return=null,x.dependencies=null,x.memoizedProps=null,x.memoizedState=null,x.pendingProps=null,x.stateNode=null,x.updateQueue=null}function zo(x){return x.tag===5||x.tag===3||x.tag===4}function Xh(x){e:for(;;){for(;x.sibling===null;){if(x.return===null||zo(x.return))return null;x=x.return}for(x.sibling.return=x.return,x=x.sibling;x.tag!==5&&x.tag!==6&&x.tag!==18;){if(x.flags&2||x.child===null||x.tag===4)continue e;x.child.return=x,x=x.child}if(!(x.flags&2))return x.stateNode}}function Wa(x){if(ut){e:{for(var d=x.return;d!==null;){if(zo(d))break e;d=d.return}throw Error(o(160))}var _=d;switch(_.tag){case 5:d=_.stateNode,_.flags&32&&(jt(d),_.flags&=-33),_=Xh(x),Nd(x,_,d);break;case 3:case 4:d=_.stateNode.containerInfo,_=Xh(x),ki(x,_,d);break;default:throw Error(o(161))}}}function ki(x,d,_){var $=x.tag;if($===5||$===6)x=x.stateNode,d?pe(_,x,d):mt(_,x);else if($!==4&&(x=x.child,x!==null))for(ki(x,d,_),x=x.sibling;x!==null;)ki(x,d,_),x=x.sibling}function Nd(x,d,_){var $=x.tag;if($===5||$===6)x=x.stateNode,d?te(_,x,d):It(_,x);else if($!==4&&(x=x.child,x!==null))for(Nd(x,d,_),x=x.sibling;x!==null;)Nd(x,d,_),x=x.sibling}function Xc(x,d,_){for(var $=d,I=!1,B,W;;){if(!I){I=$.return;e:for(;;){if(I===null)throw Error(o(160));switch(B=I.stateNode,I.tag){case 5:W=!1;break e;case 3:B=B.containerInfo,W=!0;break e;case 4:B=B.containerInfo,W=!0;break e}I=I.return}I=!0}if($.tag===5||$.tag===6)as(x,$,_),W?Je(B,$.stateNode):Ae(B,$.stateNode);else if($.tag===18)W?Yr(B,$.stateNode):Br(B,$.stateNode);else if($.tag===4){if($.child!==null){B=$.stateNode.containerInfo,W=!0,$.child.return=$,$=$.child;continue}}else if(dl(x,$,_),$.child!==null){$.child.return=$,$=$.child;continue}if($===d)break;for(;$.sibling===null;){if($.return===null||$.return===d)return;$=$.return,$.tag===4&&(I=!1)}$.sibling.return=$.return,$=$.sibling}}function Kh(x,d){if(ut){switch(d.tag){case 0:case 11:case 14:case 15:su(3,d,d.return),$o(3,d),su(5,d,d.return);return;case 1:return;case 5:var _=d.stateNode;if(_!=null){var $=d.memoizedProps;x=x!==null?x.memoizedProps:$;var I=d.type,B=d.updateQueue;d.updateQueue=null,B!==null&&Q(_,B,I,x,$,d)}return;case 6:if(d.stateNode===null)throw Error(o(162));_=d.memoizedProps,Ke(d.stateNode,x!==null?x.memoizedProps:_,_);return;case 3:$e&&x!==null&&x.memoizedState.isDehydrated&&$r(d.stateNode.containerInfo);return;case 12:return;case 13:Uo(d);return;case 19:Uo(d);return;case 17:return}throw Error(o(163))}switch(d.tag){case 0:case 11:case 14:case 15:su(3,d,d.return),$o(3,d),su(5,d,d.return);return;case 12:return;case 13:Uo(d);return;case 19:Uo(d);return;case 3:$e&&x!==null&&x.memoizedState.isDehydrated&&$r(d.stateNode.containerInfo);break;case 22:case 23:return}e:if(ze){switch(d.tag){case 1:case 5:case 6:break e;case 3:case 4:d=d.stateNode,xr(d.containerInfo,d.pendingChildren);break e}throw Error(o(163))}}function Uo(x){var d=x.updateQueue;if(d!==null){x.updateQueue=null;var _=x.stateNode;_===null&&(_=x.stateNode=new ya),d.forEach(function($){var I=go.bind(null,x,$);_.has($)||(_.add($),$.then(I,I))})}}function Co(x,d){for(Mn=d;Mn!==null;){d=Mn;var _=d.deletions;if(_!==null)for(var $=0;$<_.length;$++){var I=_[$];try{var B=x;ut?Xc(B,I,d):as(B,I,d);var W=I.alternate;W!==null&&(W.return=null),I.return=null}catch(Ht){Ao(I,d,Ht)}}if(_=d.child,(d.subtreeFlags&12854)!==0&&_!==null)_.return=d,Mn=_;else for(;Mn!==null;){d=Mn;try{var de=d.flags;if(de&32&&ut&&jt(d.stateNode),de&512){var ke=d.alternate;if(ke!==null){var et=ke.ref;et!==null&&(typeof et=="function"?et(null):et.current=null)}}if(de&8192)switch(d.tag){case 13:if(d.memoizedState!==null){var wt=d.alternate;(wt===null||wt.memoizedState===null)&&(ho=Qi())}break;case 22:var Zt=d.memoizedState!==null,cn=d.alternate,bn=cn!==null&&cn.memoizedState!==null;if(_=d,ut){e:if($=_,I=Zt,B=null,ut)for(var Tn=$;;){if(Tn.tag===5){if(B===null){B=Tn;var gn=Tn.stateNode;I?Ge(gn):pt(Tn.stateNode,Tn.memoizedProps)}}else if(Tn.tag===6){if(B===null){var Dr=Tn.stateNode;I?qt(Dr):Jt(Dr,Tn.memoizedProps)}}else if((Tn.tag!==22&&Tn.tag!==23||Tn.memoizedState===null||Tn===$)&&Tn.child!==null){Tn.child.return=Tn,Tn=Tn.child;continue}if(Tn===$)break;for(;Tn.sibling===null;){if(Tn.return===null||Tn.return===$)break e;B===Tn&&(B=null),Tn=Tn.return}B===Tn&&(B=null),Tn.sibling.return=Tn.return,Tn=Tn.sibling}}if(Zt&&!bn&&_.mode&1){Mn=_;for(var Tt=_.child;Tt!==null;){for(_=Mn=Tt;Mn!==null;){$=Mn;var Ce=$.child;switch($.tag){case 0:case 11:case 14:case 15:su(4,$,$.return);break;case 1:yn($,$.return);var Le=$.stateNode;if(typeof Le.componentWillUnmount=="function"){var ot=$.return;try{Le.props=$.memoizedProps,Le.state=$.memoizedState,Le.componentWillUnmount()}catch(Ht){Ao($,ot,Ht)}}break;case 5:yn($,$.return);break;case 22:if($.memoizedState!==null){_d(_);continue}}Ce!==null?(Ce.return=$,Mn=Ce):_d(_)}Tt=Tt.sibling}}}switch(de&4102){case 2:Wa(d),d.flags&=-3;break;case 6:Wa(d),d.flags&=-3,Kh(d.alternate,d);break;case 4096:d.flags&=-4097;break;case 4100:d.flags&=-4097,Kh(d.alternate,d);break;case 4:Kh(d.alternate,d)}}catch(Ht){Ao(d,d.return,Ht)}if(_=d.sibling,_!==null){_.return=d.return,Mn=_;break}Mn=d.return}}}function df(x,d,_){Mn=x,Cu(x)}function Cu(x,d,_){for(var $=(x.mode&1)!==0;Mn!==null;){var I=Mn,B=I.child;if(I.tag===22&&$){var W=I.memoizedState!==null||wh;if(!W){var de=I.alternate,ke=de!==null&&de.memoizedState!==null||co;de=wh;var et=co;if(wh=W,(co=ke)&&!et)for(Mn=I;Mn!==null;)W=Mn,ke=W.child,W.tag===22&&W.memoizedState!==null?yc(I):ke!==null?(ke.return=W,Mn=ke):yc(I);for(;B!==null;)Mn=B,Cu(B),B=B.sibling;Mn=I,wh=de,co=et}Ol(x)}else I.subtreeFlags&8772&&B!==null?(B.return=I,Mn=B):Ol(x)}}function Ol(x){for(;Mn!==null;){var d=Mn;if(d.flags&8772){var _=d.alternate;try{if(d.flags&8772)switch(d.tag){case 0:case 11:case 15:co||$o(5,d);break;case 1:var $=d.stateNode;if(d.flags&4&&!co)if(_===null)$.componentDidMount();else{var I=d.elementType===d.type?_.memoizedProps:Rs(d.type,_.memoizedProps);$.componentDidUpdate(I,_.memoizedState,$.__reactInternalSnapshotBeforeUpdate)}var B=d.updateQueue;B!==null&&Qo(d,B,$);break;case 3:var W=d.updateQueue;if(W!==null){if(_=null,d.child!==null)switch(d.child.tag){case 5:_=ue(d.child.stateNode);break;case 1:_=d.child.stateNode}Qo(d,W,_)}break;case 5:var de=d.stateNode;_===null&&d.flags&4&&Oe(de,d.type,d.memoizedProps,d);break;case 6:break;case 4:break;case 12:break;case 13:if($e&&d.memoizedState===null){var ke=d.alternate;if(ke!==null){var et=ke.memoizedState;if(et!==null){var wt=et.dehydrated;wt!==null&&si(wt)}}}break;case 19:case 17:case 21:case 22:case 23:break;default:throw Error(o(163))}co||d.flags&512&&ys(d)}catch(Zt){Ao(d,d.return,Zt)}}if(d===x){Mn=null;break}if(_=d.sibling,_!==null){_.return=d.return,Mn=_;break}Mn=d.return}}function _d(x){for(;Mn!==null;){var d=Mn;if(d===x){Mn=null;break}var _=d.sibling;if(_!==null){_.return=d.return,Mn=_;break}Mn=d.return}}function yc(x){for(;Mn!==null;){var d=Mn;try{switch(d.tag){case 0:case 11:case 15:var _=d.return;try{$o(4,d)}catch(ke){Ao(d,_,ke)}break;case 1:var $=d.stateNode;if(typeof $.componentDidMount=="function"){var I=d.return;try{$.componentDidMount()}catch(ke){Ao(d,I,ke)}}var B=d.return;try{ys(d)}catch(ke){Ao(d,B,ke)}break;case 5:var W=d.return;try{ys(d)}catch(ke){Ao(d,W,ke)}}}catch(ke){Ao(d,d.return,ke)}if(d===x){Mn=null;break}var de=d.sibling;if(de!==null){de.return=d.return,Mn=de;break}Mn=d.return}}var Kr=0,ou=1,Ju=2,ls=3,Va=4;if(typeof Symbol=="function"&&Symbol.for){var $s=Symbol.for;Kr=$s("selector.component"),ou=$s("selector.has_pseudo_class"),Ju=$s("selector.role"),ls=$s("selector.test_id"),Va=$s("selector.text")}function Cs(x){var d=He(x);if(d!=null){if(typeof d.memoizedProps["data-testname"]!="string")throw Error(o(364));return d}if(x=At(x),x===null)throw Error(o(362));return x.stateNode.current}function Kc(x,d){switch(d.$$typeof){case Kr:if(x.type===d.value)return!0;break;case ou:e:{d=d.value,x=[x,0];for(var _=0;_";case ou:return":has("+(_i(x)||"")+")";case Ju:return'[role="'+x.value+'"]';case Va:return'"'+x.value+'"';case ls:return'[data-testname="'+x.value+'"]';default:throw Error(o(365))}}function ja(x,d){var _=[];x=[x,0];for(var $=0;$I&&(I=W),$&=~B}if($=I,$=Qi()-$,$=(120>$?120:480>$?480:1080>$?1080:1920>$?1920:3e3>$?3e3:4320>$?4320:1960*ff($/1960))-$,10<$){x.timeoutHandle=Re(ml.bind(null,x,qs),$);break}ml(x,qs);break;case 5:ml(x,qs);break;default:throw Error(o(329))}}}return Vs(x,Qi()),x.callbackNode===_?fn.bind(null,x):null}function Jc(x,d){var _=Qu;return x.current.memoizedState.isDehydrated&&(pl(x,d).flags|=256),x=qc(x,d),x!==2&&(d=qs,qs=_,d!==null&&wn(d)),x}function wn(x){qs===null?qs=x:qs.push.apply(qs,x)}function vi(x){for(var d=x;;){if(d.flags&16384){var _=d.updateQueue;if(_!==null&&(_=_.stores,_!==null))for(var $=0;$<_.length;$++){var I=_[$],B=I.getSnapshot;I=I.value;try{if(!Gn(B(),I))return!1}catch{return!1}}}if(_=d.child,d.subtreeFlags&16384&&_!==null)_.return=d,d=_;else{if(d===x)break;for(;d.sibling===null;){if(d.return===null||d.return===x)return!0;d=d.return}d.sibling.return=d.return,d=d.sibling}}return!0}function Ms(x,d){for(d&=~Tc,d&=~qu,x.suspendedLanes|=d,x.pingedLanes&=~d,x=x.expirationTimes;0x?16:x,Ll===null)var $=!1;else{if(x=Ll,Ll=null,Ho=0,(Pn&6)!==0)throw Error(o(331));var I=Pn;for(Pn|=4,Mn=x.current;Mn!==null;){var B=Mn,W=B.child;if(Mn.flags&16){var de=B.deletions;if(de!==null){for(var ke=0;keQi()-ho?pl(x,0):Tc|=_),Vs(x,d)}function ia(x,d){d===0&&(x.mode&1?(d=qo,qo<<=1,!(qo&130023424)&&(qo=4194304)):d=1);var _=Or();x=Ya(x,d),x!==null&&(_u(x,d,_),Vs(x,_))}function Ch(x){var d=x.memoizedState,_=0;d!==null&&(_=d.retryLane),ia(x,_)}function go(x,d){var _=0;switch(x.tag){case 13:var $=x.stateNode,I=x.memoizedState;I!==null&&(_=I.retryLane);break;case 19:$=x.stateNode;break;default:throw Error(o(314))}$!==null&&$.delete(d),ia(x,_)}var Iu;Iu=function(x,d,_){if(x!==null)if(x.memoizedProps!==d.pendingProps||yr.current)cl=!0;else{if(!(x.lanes&_)&&!(d.flags&128))return cl=!1,gi(x,d,_);cl=(x.flags&131072)!==0}else cl=!1,Sr&&d.flags&1048576&&ql(d,yh,d.index);switch(d.lanes=0,d.tag){case 2:var $=d.type;x!==null&&(x.alternate=null,d.alternate=null,d.flags|=2),x=d.pendingProps;var I=ws(d,Gr.current);Bi(d,_),I=$u(null,d,$,x,I,_);var B=qn();return d.flags|=1,typeof I=="object"&&I!==null&&typeof I.render=="function"&&I.$$typeof===void 0?(d.tag=1,d.memoizedState=null,d.updateQueue=null,fi($)?(B=!0,fc(d)):B=!1,d.memoizedState=I.state!==null&&I.state!==void 0?I.state:null,Xr(d),I.updater=Bc,d.stateNode=I,I._reactInternals=d,Md(d,$,x,_),d=Yc(null,d,$,!0,B,_)):(d.tag=0,Sr&&B&&Ql(d),Ri(null,d,I,_),d=d.child),d;case 16:$=d.elementType;e:{switch(x!==null&&(x.alternate=null,d.alternate=null,d.flags|=2),x=d.pendingProps,I=$._init,$=I($._payload),d.type=$,I=d.tag=rc($),x=Rs($,x),I){case 0:d=va(null,d,$,x,_);break e;case 1:d=os(null,d,$,x,_);break e;case 11:d=hi(null,d,$,x,_);break e;case 14:d=es(null,d,$,Rs($.type,x),_);break e}throw Error(o(306,$,""))}return d;case 0:return $=d.type,I=d.pendingProps,I=d.elementType===$?I:Rs($,I),va(x,d,$,I,_);case 1:return $=d.type,I=d.pendingProps,I=d.elementType===$?I:Rs($,I),os(x,d,$,I,_);case 3:e:{if(na(d),x===null)throw Error(o(387));$=d.pendingProps,B=d.memoizedState,I=B.element,dd(x,d),hr(d,$,null,_);var W=d.memoizedState;if($=W.element,$e&&B.isDehydrated)if(B={element:$,isDehydrated:!1,cache:W.cache,transitions:W.transitions},d.updateQueue.baseState=B,d.memoizedState=B,d.flags&256){I=Error(o(423)),d=Od(x,d,$,_,I);break e}else if($!==I){I=Error(o(424)),d=Od(x,d,$,_,I);break e}else for($e&&(Ai=Mt(d.stateNode.containerInfo),Wr=d,Sr=!0,fa=null,ji=!1),_=zc(d,null,$,_),d.child=_;_;)_.flags=_.flags&-3|4096,_=_.sibling;else{if(Fc(),$===I){d=mi(x,d,_);break e}Ri(x,d,$,_)}d=d.child}return d;case 5:return bh(d),x===null&&pd(d),$=d.type,I=d.pendingProps,B=x!==null?x.memoizedProps:null,W=I.children,Ie($,I)?W=null:B!==null&&Ie($,B)&&(d.flags|=32),_a(x,d),Ri(x,d,W,_),d.child;case 6:return x===null&&pd(d),null;case 13:return Gs(x,d,_);case 4:return tu(d,d.stateNode.containerInfo),$=d.pendingProps,x===null?d.child=Uh(d,null,$,_):Ri(x,d,$,_),d.child;case 11:return $=d.type,I=d.pendingProps,I=d.elementType===$?I:Rs($,I),hi(x,d,$,I,_);case 7:return Ri(x,d,d.pendingProps,_),d.child;case 8:return Ri(x,d,d.pendingProps.children,_),d.child;case 12:return Ri(x,d,d.pendingProps.children,_),d.child;case 10:e:{if($=d.type._context,I=d.pendingProps,B=d.memoizedProps,W=I.value,xo(d,$,W),B!==null)if(Gn(B.value,W)){if(B.children===I.children&&!yr.current){d=mi(x,d,_);break e}}else for(B=d.child,B!==null&&(B.return=d);B!==null;){var de=B.dependencies;if(de!==null){W=B.child;for(var ke=de.firstContext;ke!==null;){if(ke.context===$){if(B.tag===1){ke=wu(-1,_&-_),ke.tag=2;var et=B.updateQueue;if(et!==null){et=et.shared;var wt=et.pending;wt===null?ke.next=ke:(ke.next=wt.next,wt.next=ke),et.pending=ke}}B.lanes|=_,ke=B.alternate,ke!==null&&(ke.lanes|=_),sl(B.return,_,d),de.lanes|=_;break}ke=ke.next}}else if(B.tag===10)W=B.type===d.type?null:B.child;else if(B.tag===18){if(W=B.return,W===null)throw Error(o(341));W.lanes|=_,de=W.alternate,de!==null&&(de.lanes|=_),sl(W,_,d),W=B.sibling}else W=B.child;if(W!==null)W.return=B;else for(W=B;W!==null;){if(W===d){W=null;break}if(B=W.sibling,B!==null){B.return=W.return,W=B;break}W=W.return}B=W}Ri(x,d,I.children,_),d=d.child}return d;case 9:return I=d.type,$=d.pendingProps.children,Bi(d,_),I=Ci(I),$=$(I),d.flags|=1,Ri(x,d,$,_),d.child;case 14:return $=d.type,I=Rs($,d.pendingProps),I=Rs($.type,I),es(x,d,$,I,_);case 15:return ss(x,d,d.type,d.pendingProps,_);case 17:return $=d.type,I=d.pendingProps,I=d.elementType===$?I:Rs($,I),x!==null&&(x.alternate=null,d.alternate=null,d.flags|=2),d.tag=1,fi($)?(x=!0,fc(d)):x=!1,Bi(d,_),Bf(d,$,I),Md(d,$,I,_),Yc(null,d,$,!0,x,_);case 19:return $n(x,d,_);case 22:return jc(x,d,_)}throw Error(o(156,d.tag))};function eh(x,d){return Kl(x,d)}function wc(x,d,_,$){this.tag=x,this.key=_,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=d,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=$,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Go(x,d,_,$){return new wc(x,d,_,$)}function _o(x){return x=x.prototype,!(!x||!x.isReactComponent)}function rc(x){if(typeof x=="function")return _o(x)?1:0;if(x!=null){if(x=x.$$typeof,x===C)return 11;if(x===k)return 14}return 2}function Dl(x,d){var _=x.alternate;return _===null?(_=Go(x.tag,d,x.key,x.mode),_.elementType=x.elementType,_.type=x.type,_.stateNode=x.stateNode,_.alternate=x,x.alternate=_):(_.pendingProps=d,_.type=x.type,_.flags=0,_.subtreeFlags=0,_.deletions=null),_.flags=x.flags&14680064,_.childLanes=x.childLanes,_.lanes=x.lanes,_.child=x.child,_.memoizedProps=x.memoizedProps,_.memoizedState=x.memoizedState,_.updateQueue=x.updateQueue,d=x.dependencies,_.dependencies=d===null?null:{lanes:d.lanes,firstContext:d.firstContext},_.sibling=x.sibling,_.index=x.index,_.ref=x.ref,_}function vo(x,d,_,$,I,B){var W=2;if($=x,typeof x=="function")_o(x)&&(W=1);else if(typeof x=="string")W=5;else e:switch(x){case f:return Pl(_.children,I,B,d);case g:W=8,I|=8;break;case y:return x=Go(12,_,d,I|2),x.elementType=y,x.lanes=B,x;case M:return x=Go(13,_,d,I),x.elementType=M,x.lanes=B,x;case A:return x=Go(19,_,d,I),x.elementType=A,x.lanes=B,x;case P:return Xa(_,I,B,d);default:if(typeof x=="object"&&x!==null)switch(x.$$typeof){case b:W=10;break e;case w:W=9;break e;case C:W=11;break e;case k:W=14;break e;case L:W=16,$=null;break e}throw Error(o(130,x==null?x:typeof x,""))}return d=Go(W,_,d,I),d.elementType=x,d.type=$,d.lanes=B,d}function Pl(x,d,_,$){return x=Go(7,x,$,d),x.lanes=_,x}function Xa(x,d,_,$){return x=Go(22,x,$,d),x.elementType=P,x.lanes=_,x.stateNode={},x}function uu(x,d,_){return x=Go(6,x,null,d),x.lanes=_,x}function ni(x,d,_){return d=Go(4,x.children!==null?x.children:[],x.key,d),d.lanes=_,d.stateNode={containerInfo:x.containerInfo,pendingChildren:null,implementation:x.implementation},d}function cs(x,d,_,$,I){this.tag=d,this.containerInfo=x,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=rt,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=El(0),this.expirationTimes=El(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=El(0),this.identifierPrefix=$,this.onRecoverableError=I,$e&&(this.mutableSourceEagerHydrationData=null)}function qh(x,d,_,$,I,B,W,de,ke){return x=new cs(x,d,_,de,ke),d===1?(d=1,B===!0&&(d|=8)):d=0,B=Go(3,null,null,d),x.current=B,B.stateNode=x,B.memoizedState={element:$,isDehydrated:_,cache:null,transitions:null},Xr(B),x}function yd(x){if(!x)return Ir;x=x._reactInternals;e:{if(H(x)!==x||x.tag!==1)throw Error(o(170));var d=x;do{switch(d.tag){case 3:d=d.stateNode.context;break e;case 1:if(fi(d.type)){d=d.stateNode.__reactInternalMemoizedMergedChildContext;break e}}d=d.return}while(d!==null);throw Error(o(171))}if(x.tag===1){var _=x.type;if(fi(_))return Na(x,_,d)}return d}function Ta(x){var d=x._reactInternals;if(d===void 0)throw typeof x.render=="function"?Error(o(188)):(x=Object.keys(x).join(","),Error(o(268,x)));return x=Z(d),x===null?null:x.stateNode}function Sa(x,d){if(x=x.memoizedState,x!==null&&x.dehydrated!==null){var _=x.retryLane;x.retryLane=_!==0&&_=et&&B>=Zt&&I<=wt&&W<=cn){x.splice(d,1);break}else if($!==et||_.width!==ke.width||cnW){if(!(B!==Zt||_.height!==ke.height||wt<$||et>I)){et>$&&(ke.width+=et-$,ke.x=$),wtB&&(ke.height+=Zt-B,ke.y=B),cn_&&(_=W)),W ")+` No matching component was found for: - `)+x.join(" > ")}return null},e.getPublicRootInstance=function(x){if(x=x.current,!x.child)return null;switch(x.child.tag){case 5:return ue(x.child.stateNode);default:return x.child.stateNode}},e.injectIntoDevTools=function(x){if(x={bundleType:x.bundleType,version:x.version,rendererPackageName:x.rendererPackageName,rendererConfig:x.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:l.ReactCurrentDispatcher,findHostInstanceByFiber:Ec,findFiberByHostInstance:x.findFiberByHostInstance||Hf,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.0.0-fc46dba67-20220329"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")x=!1;else{var d=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(d.isDisabled||!d.supportsFiber)x=!0;else{try{zu=d.inject(x),ca=d}catch{}x=!!d.checkDCE}}return x},e.isAlreadyRendering=function(){return!1},e.observeVisibleRects=function(x,d,_,$){if(!Mt)throw Error(o(363));x=bc(x,d);var I=St(x,_,$).disconnect;return{disconnect:function(){I()}}},e.registerMutableSourceForHydration=function(x,d){var _=d._getVersion;_=_(d._source),x.mutableSourceEagerHydrationData==null?x.mutableSourceEagerHydrationData=[d,_]:x.mutableSourceEagerHydrationData.push(d,_)},e.runWithPriority=function(x,d){var _=br;try{return br=x,d()}finally{br=_}},e.shouldError=function(){return null},e.shouldSuspend=function(){return!1},e.updateContainer=function(x,d,_,$){var I=d.current,B=Or(),W=bs(I);return _=yd(_),d.context===null?d.context=_:d.pendingContext=_,d=wu(B,W),d.payload={element:x},$=$===void 0?null:$,$!==null&&(d.callback=$),Vi(I,d),x=Os(I,W,B),x!==null&&Pa(x,I,W),W},e}),H6}(function(n){n.exports=EMe()})(EZ);const xMe=wZ(EZ.exports);function $Me(n,e,t=(r,s)=>r===s){if(n===e)return!0;if(!n||!e)return!1;const r=n.length;if(e.length!==r)return!1;for(let s=0;ss.response=o).then(()=>{r.lifespan&&r.lifespan>0&&setTimeout(()=>{const o=AA.indexOf(s);o!==-1&&AA.splice(o,1)},r.lifespan)}).catch(o=>s.error=o)};if(AA.push(s),!t)throw s.promise}const MMe=(n,e,t)=>CMe(n,e,!1,t);var b2={exports:{}},mx={};/** + `)+x.join(" > ")}return null},e.getPublicRootInstance=function(x){if(x=x.current,!x.child)return null;switch(x.child.tag){case 5:return ue(x.child.stateNode);default:return x.child.stateNode}},e.injectIntoDevTools=function(x){if(x={bundleType:x.bundleType,version:x.version,rendererPackageName:x.rendererPackageName,rendererConfig:x.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:l.ReactCurrentDispatcher,findHostInstanceByFiber:Ec,findFiberByHostInstance:x.findFiberByHostInstance||Hf,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.0.0-fc46dba67-20220329"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")x=!1;else{var d=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(d.isDisabled||!d.supportsFiber)x=!0;else{try{zu=d.inject(x),ca=d}catch{}x=!!d.checkDCE}}return x},e.isAlreadyRendering=function(){return!1},e.observeVisibleRects=function(x,d,_,$){if(!Ct)throw Error(o(363));x=bc(x,d);var I=St(x,_,$).disconnect;return{disconnect:function(){I()}}},e.registerMutableSourceForHydration=function(x,d){var _=d._getVersion;_=_(d._source),x.mutableSourceEagerHydrationData==null?x.mutableSourceEagerHydrationData=[d,_]:x.mutableSourceEagerHydrationData.push(d,_)},e.runWithPriority=function(x,d){var _=br;try{return br=x,d()}finally{br=_}},e.shouldError=function(){return null},e.shouldSuspend=function(){return!1},e.updateContainer=function(x,d,_,$){var I=d.current,B=Or(),W=bs(I);return _=yd(_),d.context===null?d.context=_:d.pendingContext=_,d=wu(B,W),d.payload={element:x},$=$===void 0?null:$,$!==null&&(d.callback=$),Vi(I,d),x=Os(I,W,B),x!==null&&Pa(x,I,W),W},e}),G6}(function(n){n.exports=EMe()})(xZ);const xMe=EZ(xZ.exports);function $Me(n,e,t=(r,s)=>r===s){if(n===e)return!0;if(!n||!e)return!1;const r=n.length;if(e.length!==r)return!1;for(let s=0;ss.response=o).then(()=>{r.lifespan&&r.lifespan>0&&setTimeout(()=>{const o=AA.indexOf(s);o!==-1&&AA.splice(o,1)},r.lifespan)}).catch(o=>s.error=o)};if(AA.push(s),!t)throw s.promise}const MMe=(n,e,t)=>CMe(n,e,!1,t);var b2={exports:{}},mx={};/** * @license React * react-jsx-runtime.production.min.js * @@ -4921,7 +4921,7 @@ No matching component was found for: * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var W6;function AMe(){if(W6)return mx;W6=1;var n=yt,e=Symbol.for("react.element"),t=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,s=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function l(u,h,f){var g,y={},b=null,w=null;f!==void 0&&(b=""+f),h.key!==void 0&&(b=""+h.key),h.ref!==void 0&&(w=h.ref);for(g in h)r.call(h,g)&&!o.hasOwnProperty(g)&&(y[g]=h[g]);if(u&&u.defaultProps)for(g in h=u.defaultProps,h)y[g]===void 0&&(y[g]=h[g]);return{$$typeof:e,type:u,key:b,ref:w,props:y,_owner:s.current}}return mx.Fragment=t,mx.jsx=l,mx.jsxs=l,mx}(function(n){n.exports=AMe()})(b2);const PC=b2.exports.Fragment,un=b2.exports.jsx,Bh=b2.exports.jsxs,x4={},IMe=n=>void Object.assign(x4,n);function RMe(n,e){function t(f,{args:g=[],attach:y,...b},w){let C=`${f[0].toUpperCase()}${f.slice(1)}`,M;if(f==="primitive"){if(b.object===void 0)throw new Error("R3F: Primitives without 'object' are invalid!");const A=b.object;M=DS(A,{type:f,root:w,attach:y,primitive:!0})}else{const A=x4[C];if(!A)throw new Error(`R3F: ${C} is not part of the THREE namespace! Did you forget to extend? See: https://docs.pmnd.rs/react-three-fiber/api/objects#using-3rd-party-objects-declaratively`);if(!Array.isArray(g))throw new Error("R3F: The args prop must be an array!");M=DS(new A(...g),{type:f,root:w,attach:y,memoizedProps:{args:g}})}return M.__r3f.attach===void 0&&(M instanceof ui?M.__r3f.attach="geometry":M instanceof hd&&(M.__r3f.attach="material")),C!=="inject"&&JL(M,b),M}function r(f,g){let y=!1;if(g){var b,w;(b=g.__r3f)!=null&&b.attach?KL(f,g,g.__r3f.attach):g.isObject3D&&f.isObject3D&&(f.add(g),y=!0),y||(w=f.__r3f)==null||w.objects.push(g),g.__r3f||DS(g,{}),g.__r3f.parent=f,PP(g),PS(g)}}function s(f,g,y){let b=!1;if(g){var w,C;if((w=g.__r3f)!=null&&w.attach)KL(f,g,g.__r3f.attach);else if(g.isObject3D&&f.isObject3D){g.parent=f,g.dispatchEvent({type:"added"});const M=f.children.filter(k=>k!==g),A=M.indexOf(y);f.children=[...M.slice(0,A),g,...M.slice(A)],b=!0}b||(C=f.__r3f)==null||C.objects.push(g),g.__r3f||DS(g,{}),g.__r3f.parent=f,PP(g),PS(g)}}function o(f,g,y=!1){f&&[...f].forEach(b=>l(g,b,y))}function l(f,g,y){if(g){var b,w,C;if(g.__r3f&&(g.__r3f.parent=null),(b=f.__r3f)!=null&&b.objects&&(f.__r3f.objects=f.__r3f.objects.filter(P=>P!==g)),(w=g.__r3f)!=null&&w.attach)K6(f,g,g.__r3f.attach);else if(g.isObject3D&&f.isObject3D){var M;f.remove(g),(M=g.__r3f)!=null&&M.root&&BMe(g.__r3f.root,g)}const k=(C=g.__r3f)==null?void 0:C.primitive,L=y===void 0?g.dispose!==null&&!k:y;if(!k){var A;o((A=g.__r3f)==null?void 0:A.objects,g,L),o(g.children,g,L)}g.__r3f&&(delete g.__r3f.root,delete g.__r3f.objects,delete g.__r3f.handlers,delete g.__r3f.memoizedProps,k||delete g.__r3f),L&&g.dispose&&g.type!=="Scene"&&ER.exports.unstable_scheduleCallback(ER.exports.unstable_IdlePriority,()=>{try{g.dispose()}catch{}}),PS(f)}}function u(f,g,y,b){var w;const C=(w=f.__r3f)==null?void 0:w.parent;if(!C)return;const M=t(g,y,f.__r3f.root);if(f.children){for(const A of f.children)A.__r3f&&r(M,A);f.children=f.children.filter(A=>!A.__r3f)}f.__r3f.objects.forEach(A=>r(M,A)),f.__r3f.objects=[],f.__r3f.autoRemovedBeforeAppend||l(C,f),M.parent&&(M.__r3f.autoRemovedBeforeAppend=!0),r(C,M),M.raycast&&M.__r3f.eventCount&&M.__r3f.root.getState().internal.interaction.push(M),[b,b.alternate].forEach(A=>{A!==null&&(A.stateNode=M,A.ref&&(typeof A.ref=="function"?A.ref(M):A.ref.current=M))})}const h=()=>console.warn("Text is not allowed in the R3F tree! This could be stray whitespace or characters.");return{reconciler:xMe({createInstance:t,removeChild:l,appendChild:r,appendInitialChild:r,insertBefore:s,supportsMutation:!0,isPrimaryRenderer:!1,supportsPersistence:!1,supportsHydration:!1,noTimeout:-1,appendChildToContainer:(f,g)=>{if(!g)return;const y=f.getState().scene;!y.__r3f||(y.__r3f.root=f,r(y,g))},removeChildFromContainer:(f,g)=>{!g||l(f.getState().scene,g)},insertInContainerBefore:(f,g,y)=>{if(!g||!y)return;const b=f.getState().scene;!b.__r3f||s(b,g,y)},getRootHostContext:()=>null,getChildHostContext:f=>f,finalizeInitialChildren(f){var g;return!!((g=f==null?void 0:f.__r3f)!=null?g:{}).handlers},prepareUpdate(f,g,y,b){if(f.__r3f.primitive&&b.object&&b.object!==f)return[!0];{const{args:w=[],children:C,...M}=b,{args:A=[],children:k,...L}=y;if(!Array.isArray(w))throw new Error("R3F: the args prop must be an array!");if(w.some((D,z)=>D!==A[z]))return[!0];const P=RZ(f,M,L,!0);return P.changes.length?[!1,P]:null}},commitUpdate(f,[g,y],b,w,C,M){g?u(f,b,C,M):JL(f,y)},commitMount(f,g,y,b){var w;const C=(w=f.__r3f)!=null?w:{};f.raycast&&C.handlers&&C.eventCount&&f.__r3f.root.getState().internal.interaction.push(f)},getPublicInstance:f=>f,prepareForCommit:()=>null,preparePortalMount:f=>DS(f.getState().scene),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance(f){var g;const{attach:y,parent:b}=(g=f.__r3f)!=null?g:{};y&&b&&K6(b,f,y),f.isObject3D&&(f.visible=!1),PS(f)},unhideInstance(f,g){var y;const{attach:b,parent:w}=(y=f.__r3f)!=null?y:{};b&&w&&KL(w,f,b),(f.isObject3D&&g.visible==null||g.visible)&&(f.visible=!0),PS(f)},createTextInstance:h,hideTextInstance:h,unhideTextInstance:h,getCurrentEventPriority:()=>e?e():A1.exports.DefaultEventPriority,beforeActiveInstanceBlur:()=>{},afterActiveInstanceBlur:()=>{},detachDeletedInstance:()=>{},now:typeof performance<"u"&&Bu.fun(performance.now)?performance.now:Bu.fun(Date.now)?Date.now:()=>0,scheduleTimeout:Bu.fun(setTimeout)?setTimeout:void 0,cancelTimeout:Bu.fun(clearTimeout)?clearTimeout:void 0}),applyProps:JL}}var V6,j6;const xZ=()=>{var n;return(n=x4.ColorManagement)!=null?n:null},$Z=n=>n&&n.isOrthographicCamera,kMe=n=>n&&n.hasOwnProperty("current"),BC=typeof window<"u"&&((V6=window.document)!=null&&V6.createElement||((j6=window.navigator)==null?void 0:j6.product)==="ReactNative")?pe.useLayoutEffect:pe.useEffect;function CZ(n){const e=pe.useRef(n);return BC(()=>void(e.current=n),[n]),e}function OMe({set:n}){return BC(()=>(n(new Promise(()=>null)),()=>n(!1)),[n]),null}class MZ extends pe.Component{constructor(...e){super(...e),this.state={error:!1}}componentDidCatch(e){this.props.set(e)}render(){return this.state.error?null:this.props.children}}MZ.getDerivedStateFromError=()=>({error:!0});const AZ="__default",Y6=new Map,LMe=n=>n&&!!n.memoized&&!!n.changes;function IZ(n){const e=typeof window<"u"?window.devicePixelRatio:1;return Array.isArray(n)?Math.min(Math.max(n[0],e),n[1]):n}const gx=n=>{var e;return(e=n.__r3f)==null?void 0:e.root.getState()},Bu={obj:n=>n===Object(n)&&!Bu.arr(n)&&typeof n!="function",fun:n=>typeof n=="function",str:n=>typeof n=="string",num:n=>typeof n=="number",boo:n=>typeof n=="boolean",und:n=>n===void 0,arr:n=>Array.isArray(n),equ(n,e,{arrays:t="shallow",objects:r="reference",strict:s=!0}={}){if(typeof n!=typeof e||!!n!=!!e)return!1;if(Bu.str(n)||Bu.num(n))return n===e;const o=Bu.obj(n);if(o&&r==="reference")return n===e;const l=Bu.arr(n);if(l&&t==="reference")return n===e;if((l||o)&&n===e)return!0;let u;for(u in n)if(!(u in e))return!1;if(o&&t==="shallow"&&r==="shallow"){for(u in s?e:n)if(!Bu.equ(n[u],e[u],{strict:s,objects:"reference"}))return!1}else for(u in s?e:n)if(n[u]!==e[u])return!1;if(Bu.und(u)){if(l&&n.length===0&&e.length===0||o&&Object.keys(n).length===0&&Object.keys(e).length===0)return!0;if(n!==e)return!1}return!0}};function NMe(n){n.dispose&&n.type!=="Scene"&&n.dispose();for(const e in n)e.dispose==null||e.dispose(),delete n[e]}function DS(n,e){const t=n;return(e!=null&&e.primitive||!t.__r3f)&&(t.__r3f={type:"",root:null,previousAttach:null,memoizedProps:{},eventCount:0,handlers:{},objects:[],parent:null,...e}),n}function DP(n,e){let t=n;if(e.includes("-")){const r=e.split("-"),s=r.pop();return t=r.reduce((o,l)=>o[l],n),{target:t,key:s}}else return{target:t,key:e}}const X6=/-\d+$/;function KL(n,e,t){if(Bu.str(t)){if(X6.test(t)){const o=t.replace(X6,""),{target:l,key:u}=DP(n,o);Array.isArray(l[u])||(l[u]=[])}const{target:r,key:s}=DP(n,t);e.__r3f.previousAttach=r[s],r[s]=e}else e.__r3f.previousAttach=t(n,e)}function K6(n,e,t){var r,s;if(Bu.str(t)){const{target:o,key:l}=DP(n,t),u=e.__r3f.previousAttach;u===void 0?delete o[l]:o[l]=u}else(r=e.__r3f)==null||r.previousAttach==null||r.previousAttach(n,e);(s=e.__r3f)==null||delete s.previousAttach}function RZ(n,{children:e,key:t,ref:r,...s},{children:o,key:l,ref:u,...h}={},f=!1){var g;const y=(g=n==null?void 0:n.__r3f)!=null?g:{},b=Object.entries(s),w=[];if(f){const M=Object.keys(h);for(let A=0;A{var k;if((k=n.__r3f)!=null&&k.primitive&&M==="object"||Bu.equ(A,h[M]))return;if(/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/.test(M))return w.push([M,A,!0,[]]);let L=[];M.includes("-")&&(L=M.split("-")),w.push([M,A,!1,L]);for(const P in s){const D=s[P];P.startsWith(`${M}-`)&&w.push([P,D,!1,P.split("-")])}});const C={...s};return y.memoizedProps&&y.memoizedProps.args&&(C.args=y.memoizedProps.args),y.memoizedProps&&y.memoizedProps.attach&&(C.attach=y.memoizedProps.attach),{memoized:C,changes:w}}function JL(n,e){var t,r,s;const o=(t=n.__r3f)!=null?t:{},l=o.root,u=(r=l==null||l.getState==null?void 0:l.getState())!=null?r:{},{memoized:h,changes:f}=LMe(e)?e:RZ(n,e),g=o.eventCount;n.__r3f&&(n.__r3f.memoizedProps=h);for(let y=0;yL[P],n),!(k&&k.set))){const[L,...P]=M.reverse();A=P.reverse().reduce((D,z)=>D[z],n),b=L}if(w===AZ+"remove")if(A.constructor){let L=Y6.get(A.constructor);L||(L=new A.constructor,Y6.set(A.constructor,L)),w=L[b]}else w=0;if(C)w?o.handlers[b]=w:delete o.handlers[b],o.eventCount=Object.keys(o.handlers).length;else if(k&&k.set&&(k.copy||k instanceof B1)){if(Array.isArray(w))k.fromArray?k.fromArray(w):k.set(...w);else if(k.copy&&w&&w.constructor&&k.constructor===w.constructor)k.copy(w);else if(w!==void 0){const L=k instanceof Fn;!L&&k.setScalar?k.setScalar(w):k instanceof B1&&w instanceof B1?k.mask=w.mask:k.set(w),!xZ()&&!u.linear&&L&&k.convertSRGBToLinear()}}else A[b]=w,!u.linear&&A[b]instanceof dc&&A[b].format===jp&&A[b].type===af&&(A[b].encoding=ms);PS(n)}if(o.parent&&u.internal&&n.raycast&&g!==o.eventCount){const y=u.internal.interaction.indexOf(n);y>-1&&u.internal.interaction.splice(y,1),o.eventCount&&u.internal.interaction.push(n)}return!(f.length===1&&f[0][0]==="onUpdate")&&f.length&&(s=n.__r3f)!=null&&s.parent&&PP(n),n}function PS(n){var e,t;const r=(e=n.__r3f)==null||(t=e.root)==null||t.getState==null?void 0:t.getState();r&&r.internal.frames===0&&r.invalidate()}function PP(n){n.onUpdate==null||n.onUpdate(n)}function DMe(n,e){n.manual||($Z(n)?(n.left=e.width/-2,n.right=e.width/2,n.top=e.height/2,n.bottom=e.height/-2):n.aspect=e.width/e.height,n.updateProjectionMatrix(),n.updateMatrixWorld())}function IA(n){return(n.eventObject||n.object).uuid+"/"+n.index+n.instanceId}function PMe(){var n;const e=typeof self<"u"&&self||typeof window<"u"&&window;if(!e)return A1.exports.DefaultEventPriority;switch((n=e.event)==null?void 0:n.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return A1.exports.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return A1.exports.ContinuousEventPriority;default:return A1.exports.DefaultEventPriority}}function kZ(n,e,t,r){const s=t.get(e);s&&(t.delete(e),t.size===0&&(n.delete(r),s.target.releasePointerCapture(r)))}function BMe(n,e){const{internal:t}=n.getState();t.interaction=t.interaction.filter(r=>r!==e),t.initialHits=t.initialHits.filter(r=>r!==e),t.hovered.forEach((r,s)=>{(r.eventObject===e||r.object===e)&&t.hovered.delete(s)}),t.capturedMap.forEach((r,s)=>{kZ(t.capturedMap,e,r,s)})}function FMe(n){function e(h){const{internal:f}=n.getState(),g=h.offsetX-f.initialClick[0],y=h.offsetY-f.initialClick[1];return Math.round(Math.sqrt(g*g+y*y))}function t(h){return h.filter(f=>["Move","Over","Enter","Out","Leave"].some(g=>{var y;return(y=f.__r3f)==null?void 0:y.handlers["onPointer"+g]}))}function r(h,f){const g=n.getState(),y=new Set,b=[],w=f?f(g.internal.interaction):g.internal.interaction;for(let k=0;k{const P=gx(k.object),D=gx(L.object);return!P||!D?k.distance-L.distance:D.events.priority-P.events.priority||k.distance-L.distance}).filter(k=>{const L=IA(k);return y.has(L)?!1:(y.add(L),!0)});g.events.filter&&(M=g.events.filter(M,g));for(const k of M){let L=k.object;for(;L;){var A;(A=L.__r3f)!=null&&A.eventCount&&b.push({...k,eventObject:L}),L=L.parent}}if("pointerId"in h&&g.internal.capturedMap.has(h.pointerId))for(let k of g.internal.capturedMap.get(h.pointerId).values())y.has(IA(k.intersection))||b.push(k.intersection);return b}function s(h,f,g,y){const b=n.getState();if(h.length){const w={stopped:!1};for(const C of h){const M=gx(C.object)||b,{raycaster:A,pointer:k,camera:L,internal:P}=M,D=new Ae(k.x,k.y,0).unproject(L),z=le=>{var Z,q;return(Z=(q=P.capturedMap.get(le))==null?void 0:q.has(C.eventObject))!=null?Z:!1},U=le=>{const Z={intersection:C,target:f.target};P.capturedMap.has(le)?P.capturedMap.get(le).set(C.eventObject,Z):P.capturedMap.set(le,new Map([[C.eventObject,Z]])),f.target.setPointerCapture(le)},V=le=>{const Z=P.capturedMap.get(le);Z&&kZ(P.capturedMap,C.eventObject,Z,le)};let H={};for(let le in f){let Z=f[le];typeof Z!="function"&&(H[le]=Z)}let oe={...C,...H,pointer:k,intersections:h,stopped:w.stopped,delta:g,unprojectedPoint:D,ray:A.ray,camera:L,stopPropagation(){const le="pointerId"in f&&P.capturedMap.get(f.pointerId);if((!le||le.has(C.eventObject))&&(oe.stopped=w.stopped=!0,P.hovered.size&&Array.from(P.hovered.values()).find(Z=>Z.eventObject===C.eventObject))){const Z=h.slice(0,h.indexOf(C));o([...Z,C])}},target:{hasPointerCapture:z,setPointerCapture:U,releasePointerCapture:V},currentTarget:{hasPointerCapture:z,setPointerCapture:U,releasePointerCapture:V},nativeEvent:f};if(y(oe),w.stopped===!0)break}}return h}function o(h){const{internal:f}=n.getState();for(const g of f.hovered.values())if(!h.length||!h.find(y=>y.object===g.object&&y.index===g.index&&y.instanceId===g.instanceId)){const y=g.eventObject.__r3f,b=y==null?void 0:y.handlers;if(f.hovered.delete(IA(g)),y!=null&&y.eventCount){const w={...g,intersections:h};b.onPointerOut==null||b.onPointerOut(w),b.onPointerLeave==null||b.onPointerLeave(w)}}}function l(h,f){for(let g=0;go([]);case"onLostPointerCapture":return f=>{const{internal:g}=n.getState();"pointerId"in f&&g.capturedMap.has(f.pointerId)&&requestAnimationFrame(()=>{g.capturedMap.has(f.pointerId)&&(g.capturedMap.delete(f.pointerId),o([]))})}}return function(f){const{onPointerMissed:g,internal:y}=n.getState();y.lastEvent.current=f;const b=h==="onPointerMove",w=h==="onClick"||h==="onContextMenu"||h==="onDoubleClick",C=r(f,b?t:void 0),M=w?e(f):0;h==="onPointerDown"&&(y.initialClick=[f.offsetX,f.offsetY],y.initialHits=C.map(k=>k.eventObject)),w&&!C.length&&M<=2&&(l(f,y.interaction),g&&g(f)),b&&o(C);function A(k){const L=k.eventObject,P=L.__r3f,D=P==null?void 0:P.handlers;if(P!=null&&P.eventCount)if(b){if(D.onPointerOver||D.onPointerEnter||D.onPointerOut||D.onPointerLeave){const z=IA(k),U=y.hovered.get(z);U?U.stopped&&k.stopPropagation():(y.hovered.set(z,k),D.onPointerOver==null||D.onPointerOver(k),D.onPointerEnter==null||D.onPointerEnter(k))}D.onPointerMove==null||D.onPointerMove(k)}else{const z=D[h];z?(!w||y.initialHits.includes(L))&&(l(f,y.interaction.filter(U=>!y.initialHits.includes(U))),z(k)):w&&y.initialHits.includes(L)&&l(f,y.interaction.filter(U=>!y.initialHits.includes(U)))}}s(C,f,M,A)}}return{handlePointer:u}}const OZ=n=>!!(n!=null&&n.render),LZ=pe.createContext(null),zMe=(n,e)=>{const t=SMe((u,h)=>{const f=new Ae,g=new Ae,y=new Ae;function b(A=h().camera,k=g,L=h().size){const{width:P,height:D,top:z,left:U}=L,V=P/D;k instanceof Ae?y.copy(k):y.set(...k);const H=A.getWorldPosition(f).distanceTo(y);if($Z(A))return{width:P/A.zoom,height:D/A.zoom,top:z,left:U,factor:1,distance:H,aspect:V};{const oe=A.fov*Math.PI/180,le=2*Math.tan(oe/2)*H,Z=le*(P/D);return{width:Z,height:le,top:z,left:U,factor:P/Z,distance:H,aspect:V}}}let w;const C=A=>u(k=>({performance:{...k.performance,current:A}})),M=new jt;return{set:u,get:h,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},xr:null,invalidate:(A=1)=>n(h(),A),advance:(A,k)=>e(A,k,h()),legacy:!1,linear:!1,flat:!1,scene:DS(new V$),controls:null,clock:new b4,pointer:M,mouse:M,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const A=h();w&&clearTimeout(w),A.performance.current!==A.performance.min&&C(A.performance.min),w=setTimeout(()=>C(h().performance.max),A.performance.debounce)}},size:{width:0,height:0,top:0,left:0,updateStyle:!1},viewport:{initialDpr:0,dpr:0,width:0,height:0,top:0,left:0,aspect:0,distance:0,factor:0,getCurrentViewport:b},setEvents:A=>u(k=>({...k,events:{...k.events,...A}})),setSize:(A,k,L,P,D)=>{const z=h().camera,U={width:A,height:k,top:P||0,left:D||0,updateStyle:L};u(V=>({size:U,viewport:{...V.viewport,...b(z,g,U)}}))},setDpr:A=>u(k=>{const L=IZ(A);return{viewport:{...k.viewport,dpr:L,initialDpr:k.viewport.initialDpr||L}}}),setFrameloop:(A="always")=>{const k=h().clock;k.stop(),k.elapsedTime=0,A!=="never"&&(k.start(),k.elapsedTime=0),u(()=>({frameloop:A}))},previousRoot:void 0,internal:{active:!1,priority:0,frames:0,lastEvent:pe.createRef(),interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,subscribe:(A,k,L)=>{const P=h().internal;return P.priority=P.priority+(k>0?1:0),P.subscribers.push({ref:A,priority:k,store:L}),P.subscribers=P.subscribers.sort((D,z)=>D.priority-z.priority),()=>{const D=h().internal;D!=null&&D.subscribers&&(D.priority=D.priority-(k>0?1:0),D.subscribers=D.subscribers.filter(z=>z.ref!==A))}}}}}),r=t.getState();let s=r.size,o=r.viewport.dpr,l=r.camera;return t.subscribe(()=>{const{camera:u,size:h,viewport:f,gl:g,set:y}=t.getState();if(h!==s||f.dpr!==o){var b;s=h,o=f.dpr,DMe(u,h),g.setPixelRatio(f.dpr);const w=(b=h.updateStyle)!=null?b:typeof HTMLCanvasElement<"u"&&g.domElement instanceof HTMLCanvasElement;g.setSize(h.width,h.height,w)}u!==l&&(l=u,y(w=>({viewport:{...w.viewport,...w.viewport.getCurrentViewport(u)}})))}),t.subscribe(u=>n(u)),t};let RA,UMe=new Set,HMe=new Set,GMe=new Set;function qL(n,e){if(n.size)for(const{callback:t}of n.values())t(e)}function _x(n,e){switch(n){case"before":return qL(UMe,e);case"after":return qL(HMe,e);case"tail":return qL(GMe,e)}}let QL,ZL;function eN(n,e,t){let r=e.clock.getDelta();for(e.frameloop==="never"&&typeof n=="number"&&(r=n-e.clock.elapsedTime,e.clock.oldTime=e.clock.elapsedTime,e.clock.elapsedTime=n),QL=e.internal.subscribers,RA=0;RA0)&&!((f=s.gl.xr)!=null&&f.isPresenting)&&(t+=eN(h,s))}if(_x("after",h),t===0)return _x("tail",h),e=!1,cancelAnimationFrame(r)}function l(h,f=1){var g;if(!h)return n.forEach(y=>l(y.store.getState()),f);(g=h.gl.xr)!=null&&g.isPresenting||!h.internal.active||h.frameloop==="never"||(h.internal.frames=Math.min(60,h.internal.frames+f),e||(e=!0,requestAnimationFrame(o)))}function u(h,f=!0,g,y){if(f&&_x("before",h),g)eN(h,g,y);else for(const b of n.values())eN(h,b.store.getState());f&&_x("after",h)}return{loop:o,invalidate:l,advance:u}}function NZ(){const n=pe.useContext(LZ);if(!n)throw new Error("R3F: Hooks can only be used within the Canvas component!");return n}function nf(n=t=>t,e){return NZ()(n,e)}function Xm(n,e=0){const t=NZ(),r=t.getState().internal.subscribe,s=CZ(n);return BC(()=>r(s,e,t),[e,r,t]),null}const Xw=new Map,{invalidate:J6,advance:q6}=WMe(Xw),{reconciler:xR,applyProps:kA}=RMe(Xw,PMe),kS={objects:"shallow",strict:!1},VMe=(n,e)=>{const t=typeof n=="function"?n(e):n;return OZ(t)?t:new n4({powerPreference:"high-performance",canvas:e,antialias:!0,alpha:!0,...n})};function jMe(n,e){if(e)return e;if(typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement&&n.parentElement){const{width:t,height:r,top:s,left:o}=n.parentElement.getBoundingClientRect();return{width:t,height:r,top:s,left:o}}else if(typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas)return{width:n.width,height:n.height,top:0,left:0};return{width:0,height:0,top:0,left:0}}function YMe(n){const e=Xw.get(n),t=e==null?void 0:e.fiber,r=e==null?void 0:e.store;e&&console.warn("R3F.createRoot should only be called once!");const s=typeof reportError=="function"?reportError:console.error,o=r||zMe(J6,q6),l=t||xR.createContainer(o,A1.exports.ConcurrentRoot,null,!1,null,"",s,null);e||Xw.set(n,{fiber:l,store:o});let u,h=!1,f;return{configure(g={}){let{gl:y,size:b,events:w,onCreated:C,shadows:M=!1,linear:A=!1,flat:k=!1,legacy:L=!1,orthographic:P=!1,frameloop:D="always",dpr:z=[1,2],performance:U,raycaster:V,camera:H,onPointerMissed:oe}=g,le=o.getState(),Z=le.gl;le.gl||le.set({gl:Z=VMe(y,n)});let q=le.raycaster;q||le.set({raycaster:q=new w4});const{params:he,...ae}=V||{};if(Bu.equ(ae,q,kS)||kA(q,{...ae}),Bu.equ(he,q.params,kS)||kA(q,{params:{...q.params,...he}}),!le.camera||le.camera===f&&!Bu.equ(f,H,kS)){f=H;const ie=H instanceof fE,fe=ie?H:P?new u_(0,0,0,0,.1,1e3):new Za(75,0,.1,1e3);ie||(fe.position.z=5,H&&kA(fe,H),!le.camera&&!(H!=null&&H.rotation)&&fe.lookAt(0,0,0)),le.set({camera:fe})}if(!le.xr){const ie=(Fe,Ie)=>{const Je=o.getState();Je.frameloop!=="never"&&q6(Fe,!0,Je,Ie)},fe=()=>{const Fe=o.getState();Fe.gl.xr.enabled=Fe.gl.xr.isPresenting,Fe.gl.xr.setAnimationLoop(Fe.gl.xr.isPresenting?ie:null),Fe.gl.xr.isPresenting||J6(Fe)},Te={connect(){const Fe=o.getState().gl;Fe.xr.addEventListener("sessionstart",fe),Fe.xr.addEventListener("sessionend",fe)},disconnect(){const Fe=o.getState().gl;Fe.xr.removeEventListener("sessionstart",fe),Fe.xr.removeEventListener("sessionend",fe)}};Z.xr&&Te.connect(),le.set({xr:Te})}if(Z.shadowMap){const ie=Z.shadowMap.enabled,fe=Z.shadowMap.type;if(Z.shadowMap.enabled=!!M,Bu.boo(M))Z.shadowMap.type=Zx;else if(Bu.str(M)){var ue;const Te={basic:Aq,percentage:e2,soft:Zx,variance:E1};Z.shadowMap.type=(ue=Te[M])!=null?ue:Zx}else Bu.obj(M)&&Object.assign(Z.shadowMap,M);(ie!==Z.shadowMap.enabled||fe!==Z.shadowMap.type)&&(Z.shadowMap.needsUpdate=!0)}const ge=xZ();ge&&("enabled"in ge?ge.enabled=!L:"legacyMode"in ge&&(ge.legacyMode=L));const we=A?xg:ms,J=k?l0:jF;Z.outputEncoding!==we&&(Z.outputEncoding=we),Z.toneMapping!==J&&(Z.toneMapping=J),le.legacy!==L&&le.set(()=>({legacy:L})),le.linear!==A&&le.set(()=>({linear:A})),le.flat!==k&&le.set(()=>({flat:k})),y&&!Bu.fun(y)&&!OZ(y)&&!Bu.equ(y,Z,kS)&&kA(Z,y),w&&!le.events.handlers&&le.set({events:w(o)});const re=jMe(n,b);return Bu.equ(re,le.size,kS)||le.setSize(re.width,re.height,re.updateStyle,re.top,re.left),z&&le.viewport.dpr!==IZ(z)&&le.setDpr(z),le.frameloop!==D&&le.setFrameloop(D),le.onPointerMissed||le.set({onPointerMissed:oe}),U&&!Bu.equ(U,le.performance,kS)&&le.set(ie=>({performance:{...ie.performance,...U}})),u=C,h=!0,this},render(g){return h||this.configure(),xR.updateContainer(un(XMe,{store:o,children:g,onCreated:u,rootElement:n}),l,null,()=>{}),o},unmount(){DZ(n)}}}function XMe({store:n,children:e,onCreated:t,rootElement:r}){return BC(()=>{const s=n.getState();s.set(o=>({internal:{...o.internal,active:!0}})),t&&t(s),n.getState().events.connected||s.events.connect==null||s.events.connect(r)},[]),pe.createElement(LZ.Provider,{value:n},e)}function DZ(n,e){const t=Xw.get(n),r=t==null?void 0:t.fiber;if(r){const s=t==null?void 0:t.store.getState();s&&(s.internal.active=!1),xR.updateContainer(null,r,null,()=>{s&&setTimeout(()=>{try{var o,l,u,h;s.events.disconnect==null||s.events.disconnect(),(o=s.gl)==null||(l=o.renderLists)==null||l.dispose==null||l.dispose(),(u=s.gl)==null||u.forceContextLoss==null||u.forceContextLoss(),(h=s.gl)!=null&&h.xr&&s.xr.disconnect(),NMe(s),Xw.delete(n),e&&e(n)}catch{}},500)})}}xR.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:pe.version});function BP(){return BP=Object.assign?Object.assign.bind():function(n){for(var e=1;e=0?r=setTimeout(h,e-g):(r=null,t||(u=n.apply(o,s),o=s=null))}var f=function(){o=this,s=arguments,l=Date.now();var g=t&&!r;return r||(r=setTimeout(h,e)),g&&(u=n.apply(o,s),o=s=null),u};return f.clear=function(){r&&(clearTimeout(r),r=null)},f.flush=function(){r&&(u=n.apply(o,s),o=s=null,clearTimeout(r),r=null)},f}FP.debounce=FP;var Q6=FP;function KMe(n){let{debounce:e,scroll:t,polyfill:r,offsetSize:s}=n===void 0?{debounce:0,scroll:!1,offsetSize:!1}:n;const o=r||(typeof window>"u"?class{}:window.ResizeObserver);if(!o)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[l,u]=pe.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),h=pe.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:l}),f=e?typeof e=="number"?e:e.scroll:null,g=e?typeof e=="number"?e:e.resize:null,y=pe.useRef(!1);pe.useEffect(()=>(y.current=!0,()=>void(y.current=!1)));const[b,w,C]=pe.useMemo(()=>{const L=()=>{if(!h.current.element)return;const{left:P,top:D,width:z,height:U,bottom:V,right:H,x:oe,y:le}=h.current.element.getBoundingClientRect(),Z={left:P,top:D,width:z,height:U,bottom:V,right:H,x:oe,y:le};h.current.element instanceof HTMLElement&&s&&(Z.height=h.current.element.offsetHeight,Z.width=h.current.element.offsetWidth),Object.freeze(Z),y.current&&!ZMe(h.current.lastBounds,Z)&&u(h.current.lastBounds=Z)};return[L,g?Q6(L,g):L,f?Q6(L,f):L]},[u,s,f,g]);function M(){h.current.scrollContainers&&(h.current.scrollContainers.forEach(L=>L.removeEventListener("scroll",C,!0)),h.current.scrollContainers=null),h.current.resizeObserver&&(h.current.resizeObserver.disconnect(),h.current.resizeObserver=null)}function A(){!h.current.element||(h.current.resizeObserver=new o(C),h.current.resizeObserver.observe(h.current.element),t&&h.current.scrollContainers&&h.current.scrollContainers.forEach(L=>L.addEventListener("scroll",C,{capture:!0,passive:!0})))}const k=L=>{!L||L===h.current.element||(M(),h.current.element=L,h.current.scrollContainers=PZ(L),A())};return qMe(C,!!t),JMe(w),pe.useEffect(()=>{M(),A()},[t,C,w]),pe.useEffect(()=>M,[]),[k,l,b]}function JMe(n){pe.useEffect(()=>{const e=n;return window.addEventListener("resize",e),()=>void window.removeEventListener("resize",e)},[n])}function qMe(n,e){pe.useEffect(()=>{if(e){const t=n;return window.addEventListener("scroll",t,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",t,!0)}},[n,e])}function PZ(n){const e=[];if(!n||n===document.body)return e;const{overflow:t,overflowX:r,overflowY:s}=window.getComputedStyle(n);return[t,r,s].some(o=>o==="auto"||o==="scroll")&&e.push(n),[...e,...PZ(n.parentElement)]}const QMe=["x","y","top","bottom","left","right","width","height"],ZMe=(n,e)=>QMe.every(t=>n[t]===e[t]);var eAe=Object.defineProperty,tAe=Object.defineProperties,nAe=Object.getOwnPropertyDescriptors,Z6=Object.getOwnPropertySymbols,rAe=Object.prototype.hasOwnProperty,iAe=Object.prototype.propertyIsEnumerable,eW=(n,e,t)=>e in n?eAe(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,tW=(n,e)=>{for(var t in e||(e={}))rAe.call(e,t)&&eW(n,t,e[t]);if(Z6)for(var t of Z6(e))iAe.call(e,t)&&eW(n,t,e[t]);return n},sAe=(n,e)=>tAe(n,nAe(e)),nW;function BZ(n,e,t){if(!n)return;if(t(n)===!0)return n;let r=e?n.return:n.child;for(;r;){const s=BZ(r,e,t);if(s)return s;r=e?null:r.sibling}}function FZ(n){try{return Object.defineProperties(n,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return n}}const $4=FZ(pe.createContext(null));class zZ extends pe.Component{render(){return un($4.Provider,{value:this._reactInternals,children:this.props.children})}}const{ReactCurrentOwner:rW,ReactCurrentDispatcher:iW}=(nW=pe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED)!=null?nW:{};function oAe(){const n=pe.useContext($4),e=pe.useId();return pe.useMemo(()=>{var t;return(t=rW==null?void 0:rW.current)!=null?t:BZ(n,!1,r=>{let s=r.memoizedState;for(;s;){if(s.memoizedState===e)return!0;s=s.next}})},[n,e])}function aAe(){var n,e;const t=oAe(),[r]=pe.useState(()=>new Map);r.clear();let s=t;for(;s;){const o=(n=s.type)==null?void 0:n._context;o&&o!==$4&&!r.has(o)&&r.set(o,(e=iW==null?void 0:iW.current)==null?void 0:e.readContext(FZ(o))),s=s.return}return pe.useMemo(()=>Array.from(r.keys()).reduce((o,l)=>u=>pe.createElement(o,null,pe.createElement(l.Provider,sAe(tW({},u),{value:r.get(l)}))),o=>un(zZ,{...tW({},o)})),[r])}const tN={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 lAe(n){const{handlePointer:e}=FMe(n);return{priority:1,enabled:!0,compute(t,r,s){r.pointer.set(t.offsetX/r.size.width*2-1,-(t.offsetY/r.size.height)*2+1),r.raycaster.setFromCamera(r.pointer,r.camera)},connected:void 0,handlers:Object.keys(tN).reduce((t,r)=>({...t,[r]:e(r)}),{}),update:()=>{var t;const{events:r,internal:s}=n.getState();(t=s.lastEvent)!=null&&t.current&&r.handlers&&r.handlers.onPointerMove(s.lastEvent.current)},connect:t=>{var r;const{set:s,events:o}=n.getState();o.disconnect==null||o.disconnect(),s(l=>({events:{...l.events,connected:t}})),Object.entries((r=o.handlers)!=null?r:[]).forEach(([l,u])=>{const[h,f]=tN[l];t.addEventListener(h,u,{passive:f})})},disconnect:()=>{const{set:t,events:r}=n.getState();if(r.connected){var s;Object.entries((s=r.handlers)!=null?s:[]).forEach(([o,l])=>{if(r&&r.connected instanceof HTMLElement){const[u]=tN[o];r.connected.removeEventListener(u,l)}}),t(o=>({events:{...o.events,connected:void 0}}))}}}}const uAe=pe.forwardRef(function({children:n,fallback:e,resize:t,style:r,gl:s,events:o=lAe,eventSource:l,eventPrefix:u,shadows:h,linear:f,flat:g,legacy:y,orthographic:b,frameloop:w,dpr:C,performance:M,raycaster:A,camera:k,onPointerMissed:L,onCreated:P,...D},z){pe.useMemo(()=>IMe(vMe),[]);const U=aAe(),[V,H]=KMe({scroll:!0,debounce:{scroll:50,resize:0},...t}),oe=pe.useRef(null),le=pe.useRef(null);pe.useImperativeHandle(z,()=>oe.current);const Z=CZ(L),[q,he]=pe.useState(!1),[ae,ue]=pe.useState(!1);if(q)throw q;if(ae)throw ae;const ge=pe.useRef(null);return BC(()=>{const we=oe.current;H.width>0&&H.height>0&&we&&(ge.current||(ge.current=YMe(we)),ge.current.configure({gl:s,events:o,shadows:h,linear:f,flat:g,legacy:y,orthographic:b,frameloop:w,dpr:C,performance:M,raycaster:A,camera:k,size:H,onPointerMissed:(...J)=>Z.current==null?void 0:Z.current(...J),onCreated:J=>{J.events.connect==null||J.events.connect(l?kMe(l)?l.current:l:le.current),u&&J.setEvents({compute:(re,ie)=>{const fe=re[u+"X"],Te=re[u+"Y"];ie.pointer.set(fe/ie.size.width*2-1,-(Te/ie.size.height)*2+1),ie.raycaster.setFromCamera(ie.pointer,ie.camera)}}),P==null||P(J)}}),ge.current.render(un(U,{children:un(MZ,{set:ue,children:un(pe.Suspense,{fallback:un(OMe,{set:he}),children:n})})})))}),pe.useEffect(()=>{const we=oe.current;if(we)return()=>DZ(we)},[]),un("div",{ref:le,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:l?"none":"auto",...r},...D,children:un("div",{ref:V,style:{width:"100%",height:"100%"},children:un("canvas",{ref:oe,style:{display:"block"},children:e})})})}),cAe=pe.forwardRef(function(n,e){return un(zZ,{children:un(uAe,{...n,ref:e})})});var UZ={exports:{}},zp={},sW={exports:{}},oW={};/** + */var V6;function AMe(){if(V6)return mx;V6=1;var n=yt,e=Symbol.for("react.element"),t=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,s=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function l(u,h,f){var g,y={},b=null,w=null;f!==void 0&&(b=""+f),h.key!==void 0&&(b=""+h.key),h.ref!==void 0&&(w=h.ref);for(g in h)r.call(h,g)&&!o.hasOwnProperty(g)&&(y[g]=h[g]);if(u&&u.defaultProps)for(g in h=u.defaultProps,h)y[g]===void 0&&(y[g]=h[g]);return{$$typeof:e,type:u,key:b,ref:w,props:y,_owner:s.current}}return mx.Fragment=t,mx.jsx=l,mx.jsxs=l,mx}(function(n){n.exports=AMe()})(b2);const PC=b2.exports.Fragment,un=b2.exports.jsx,Bh=b2.exports.jsxs,x4={},IMe=n=>void Object.assign(x4,n);function RMe(n,e){function t(f,{args:g=[],attach:y,...b},w){let C=`${f[0].toUpperCase()}${f.slice(1)}`,M;if(f==="primitive"){if(b.object===void 0)throw new Error("R3F: Primitives without 'object' are invalid!");const A=b.object;M=DS(A,{type:f,root:w,attach:y,primitive:!0})}else{const A=x4[C];if(!A)throw new Error(`R3F: ${C} is not part of the THREE namespace! Did you forget to extend? See: https://docs.pmnd.rs/react-three-fiber/api/objects#using-3rd-party-objects-declaratively`);if(!Array.isArray(g))throw new Error("R3F: The args prop must be an array!");M=DS(new A(...g),{type:f,root:w,attach:y,memoizedProps:{args:g}})}return M.__r3f.attach===void 0&&(M instanceof ui?M.__r3f.attach="geometry":M instanceof hd&&(M.__r3f.attach="material")),C!=="inject"&&JL(M,b),M}function r(f,g){let y=!1;if(g){var b,w;(b=g.__r3f)!=null&&b.attach?KL(f,g,g.__r3f.attach):g.isObject3D&&f.isObject3D&&(f.add(g),y=!0),y||(w=f.__r3f)==null||w.objects.push(g),g.__r3f||DS(g,{}),g.__r3f.parent=f,PP(g),PS(g)}}function s(f,g,y){let b=!1;if(g){var w,C;if((w=g.__r3f)!=null&&w.attach)KL(f,g,g.__r3f.attach);else if(g.isObject3D&&f.isObject3D){g.parent=f,g.dispatchEvent({type:"added"});const M=f.children.filter(k=>k!==g),A=M.indexOf(y);f.children=[...M.slice(0,A),g,...M.slice(A)],b=!0}b||(C=f.__r3f)==null||C.objects.push(g),g.__r3f||DS(g,{}),g.__r3f.parent=f,PP(g),PS(g)}}function o(f,g,y=!1){f&&[...f].forEach(b=>l(g,b,y))}function l(f,g,y){if(g){var b,w,C;if(g.__r3f&&(g.__r3f.parent=null),(b=f.__r3f)!=null&&b.objects&&(f.__r3f.objects=f.__r3f.objects.filter(P=>P!==g)),(w=g.__r3f)!=null&&w.attach)J6(f,g,g.__r3f.attach);else if(g.isObject3D&&f.isObject3D){var M;f.remove(g),(M=g.__r3f)!=null&&M.root&&BMe(g.__r3f.root,g)}const k=(C=g.__r3f)==null?void 0:C.primitive,L=y===void 0?g.dispose!==null&&!k:y;if(!k){var A;o((A=g.__r3f)==null?void 0:A.objects,g,L),o(g.children,g,L)}g.__r3f&&(delete g.__r3f.root,delete g.__r3f.objects,delete g.__r3f.handlers,delete g.__r3f.memoizedProps,k||delete g.__r3f),L&&g.dispose&&g.type!=="Scene"&&ER.exports.unstable_scheduleCallback(ER.exports.unstable_IdlePriority,()=>{try{g.dispose()}catch{}}),PS(f)}}function u(f,g,y,b){var w;const C=(w=f.__r3f)==null?void 0:w.parent;if(!C)return;const M=t(g,y,f.__r3f.root);if(f.children){for(const A of f.children)A.__r3f&&r(M,A);f.children=f.children.filter(A=>!A.__r3f)}f.__r3f.objects.forEach(A=>r(M,A)),f.__r3f.objects=[],f.__r3f.autoRemovedBeforeAppend||l(C,f),M.parent&&(M.__r3f.autoRemovedBeforeAppend=!0),r(C,M),M.raycast&&M.__r3f.eventCount&&M.__r3f.root.getState().internal.interaction.push(M),[b,b.alternate].forEach(A=>{A!==null&&(A.stateNode=M,A.ref&&(typeof A.ref=="function"?A.ref(M):A.ref.current=M))})}const h=()=>console.warn("Text is not allowed in the R3F tree! This could be stray whitespace or characters.");return{reconciler:xMe({createInstance:t,removeChild:l,appendChild:r,appendInitialChild:r,insertBefore:s,supportsMutation:!0,isPrimaryRenderer:!1,supportsPersistence:!1,supportsHydration:!1,noTimeout:-1,appendChildToContainer:(f,g)=>{if(!g)return;const y=f.getState().scene;!y.__r3f||(y.__r3f.root=f,r(y,g))},removeChildFromContainer:(f,g)=>{!g||l(f.getState().scene,g)},insertInContainerBefore:(f,g,y)=>{if(!g||!y)return;const b=f.getState().scene;!b.__r3f||s(b,g,y)},getRootHostContext:()=>null,getChildHostContext:f=>f,finalizeInitialChildren(f){var g;return!!((g=f==null?void 0:f.__r3f)!=null?g:{}).handlers},prepareUpdate(f,g,y,b){if(f.__r3f.primitive&&b.object&&b.object!==f)return[!0];{const{args:w=[],children:C,...M}=b,{args:A=[],children:k,...L}=y;if(!Array.isArray(w))throw new Error("R3F: the args prop must be an array!");if(w.some((D,z)=>D!==A[z]))return[!0];const P=kZ(f,M,L,!0);return P.changes.length?[!1,P]:null}},commitUpdate(f,[g,y],b,w,C,M){g?u(f,b,C,M):JL(f,y)},commitMount(f,g,y,b){var w;const C=(w=f.__r3f)!=null?w:{};f.raycast&&C.handlers&&C.eventCount&&f.__r3f.root.getState().internal.interaction.push(f)},getPublicInstance:f=>f,prepareForCommit:()=>null,preparePortalMount:f=>DS(f.getState().scene),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance(f){var g;const{attach:y,parent:b}=(g=f.__r3f)!=null?g:{};y&&b&&J6(b,f,y),f.isObject3D&&(f.visible=!1),PS(f)},unhideInstance(f,g){var y;const{attach:b,parent:w}=(y=f.__r3f)!=null?y:{};b&&w&&KL(w,f,b),(f.isObject3D&&g.visible==null||g.visible)&&(f.visible=!0),PS(f)},createTextInstance:h,hideTextInstance:h,unhideTextInstance:h,getCurrentEventPriority:()=>e?e():I1.exports.DefaultEventPriority,beforeActiveInstanceBlur:()=>{},afterActiveInstanceBlur:()=>{},detachDeletedInstance:()=>{},now:typeof performance<"u"&&Bu.fun(performance.now)?performance.now:Bu.fun(Date.now)?Date.now:()=>0,scheduleTimeout:Bu.fun(setTimeout)?setTimeout:void 0,cancelTimeout:Bu.fun(clearTimeout)?clearTimeout:void 0}),applyProps:JL}}var j6,Y6;const $Z=()=>{var n;return(n=x4.ColorManagement)!=null?n:null},CZ=n=>n&&n.isOrthographicCamera,kMe=n=>n&&n.hasOwnProperty("current"),BC=typeof window<"u"&&((j6=window.document)!=null&&j6.createElement||((Y6=window.navigator)==null?void 0:Y6.product)==="ReactNative")?me.useLayoutEffect:me.useEffect;function MZ(n){const e=me.useRef(n);return BC(()=>void(e.current=n),[n]),e}function OMe({set:n}){return BC(()=>(n(new Promise(()=>null)),()=>n(!1)),[n]),null}class AZ extends me.Component{constructor(...e){super(...e),this.state={error:!1}}componentDidCatch(e){this.props.set(e)}render(){return this.state.error?null:this.props.children}}AZ.getDerivedStateFromError=()=>({error:!0});const IZ="__default",X6=new Map,LMe=n=>n&&!!n.memoized&&!!n.changes;function RZ(n){const e=typeof window<"u"?window.devicePixelRatio:1;return Array.isArray(n)?Math.min(Math.max(n[0],e),n[1]):n}const gx=n=>{var e;return(e=n.__r3f)==null?void 0:e.root.getState()},Bu={obj:n=>n===Object(n)&&!Bu.arr(n)&&typeof n!="function",fun:n=>typeof n=="function",str:n=>typeof n=="string",num:n=>typeof n=="number",boo:n=>typeof n=="boolean",und:n=>n===void 0,arr:n=>Array.isArray(n),equ(n,e,{arrays:t="shallow",objects:r="reference",strict:s=!0}={}){if(typeof n!=typeof e||!!n!=!!e)return!1;if(Bu.str(n)||Bu.num(n))return n===e;const o=Bu.obj(n);if(o&&r==="reference")return n===e;const l=Bu.arr(n);if(l&&t==="reference")return n===e;if((l||o)&&n===e)return!0;let u;for(u in n)if(!(u in e))return!1;if(o&&t==="shallow"&&r==="shallow"){for(u in s?e:n)if(!Bu.equ(n[u],e[u],{strict:s,objects:"reference"}))return!1}else for(u in s?e:n)if(n[u]!==e[u])return!1;if(Bu.und(u)){if(l&&n.length===0&&e.length===0||o&&Object.keys(n).length===0&&Object.keys(e).length===0)return!0;if(n!==e)return!1}return!0}};function NMe(n){n.dispose&&n.type!=="Scene"&&n.dispose();for(const e in n)e.dispose==null||e.dispose(),delete n[e]}function DS(n,e){const t=n;return(e!=null&&e.primitive||!t.__r3f)&&(t.__r3f={type:"",root:null,previousAttach:null,memoizedProps:{},eventCount:0,handlers:{},objects:[],parent:null,...e}),n}function DP(n,e){let t=n;if(e.includes("-")){const r=e.split("-"),s=r.pop();return t=r.reduce((o,l)=>o[l],n),{target:t,key:s}}else return{target:t,key:e}}const K6=/-\d+$/;function KL(n,e,t){if(Bu.str(t)){if(K6.test(t)){const o=t.replace(K6,""),{target:l,key:u}=DP(n,o);Array.isArray(l[u])||(l[u]=[])}const{target:r,key:s}=DP(n,t);e.__r3f.previousAttach=r[s],r[s]=e}else e.__r3f.previousAttach=t(n,e)}function J6(n,e,t){var r,s;if(Bu.str(t)){const{target:o,key:l}=DP(n,t),u=e.__r3f.previousAttach;u===void 0?delete o[l]:o[l]=u}else(r=e.__r3f)==null||r.previousAttach==null||r.previousAttach(n,e);(s=e.__r3f)==null||delete s.previousAttach}function kZ(n,{children:e,key:t,ref:r,...s},{children:o,key:l,ref:u,...h}={},f=!1){var g;const y=(g=n==null?void 0:n.__r3f)!=null?g:{},b=Object.entries(s),w=[];if(f){const M=Object.keys(h);for(let A=0;A{var k;if((k=n.__r3f)!=null&&k.primitive&&M==="object"||Bu.equ(A,h[M]))return;if(/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/.test(M))return w.push([M,A,!0,[]]);let L=[];M.includes("-")&&(L=M.split("-")),w.push([M,A,!1,L]);for(const P in s){const D=s[P];P.startsWith(`${M}-`)&&w.push([P,D,!1,P.split("-")])}});const C={...s};return y.memoizedProps&&y.memoizedProps.args&&(C.args=y.memoizedProps.args),y.memoizedProps&&y.memoizedProps.attach&&(C.attach=y.memoizedProps.attach),{memoized:C,changes:w}}function JL(n,e){var t,r,s;const o=(t=n.__r3f)!=null?t:{},l=o.root,u=(r=l==null||l.getState==null?void 0:l.getState())!=null?r:{},{memoized:h,changes:f}=LMe(e)?e:kZ(n,e),g=o.eventCount;n.__r3f&&(n.__r3f.memoizedProps=h);for(let y=0;yL[P],n),!(k&&k.set))){const[L,...P]=M.reverse();A=P.reverse().reduce((D,z)=>D[z],n),b=L}if(w===IZ+"remove")if(A.constructor){let L=X6.get(A.constructor);L||(L=new A.constructor,X6.set(A.constructor,L)),w=L[b]}else w=0;if(C)w?o.handlers[b]=w:delete o.handlers[b],o.eventCount=Object.keys(o.handlers).length;else if(k&&k.set&&(k.copy||k instanceof F1)){if(Array.isArray(w))k.fromArray?k.fromArray(w):k.set(...w);else if(k.copy&&w&&w.constructor&&k.constructor===w.constructor)k.copy(w);else if(w!==void 0){const L=k instanceof Fn;!L&&k.setScalar?k.setScalar(w):k instanceof F1&&w instanceof F1?k.mask=w.mask:k.set(w),!$Z()&&!u.linear&&L&&k.convertSRGBToLinear()}}else A[b]=w,!u.linear&&A[b]instanceof dc&&A[b].format===jp&&A[b].type===af&&(A[b].encoding=ms);PS(n)}if(o.parent&&u.internal&&n.raycast&&g!==o.eventCount){const y=u.internal.interaction.indexOf(n);y>-1&&u.internal.interaction.splice(y,1),o.eventCount&&u.internal.interaction.push(n)}return!(f.length===1&&f[0][0]==="onUpdate")&&f.length&&(s=n.__r3f)!=null&&s.parent&&PP(n),n}function PS(n){var e,t;const r=(e=n.__r3f)==null||(t=e.root)==null||t.getState==null?void 0:t.getState();r&&r.internal.frames===0&&r.invalidate()}function PP(n){n.onUpdate==null||n.onUpdate(n)}function DMe(n,e){n.manual||(CZ(n)?(n.left=e.width/-2,n.right=e.width/2,n.top=e.height/2,n.bottom=e.height/-2):n.aspect=e.width/e.height,n.updateProjectionMatrix(),n.updateMatrixWorld())}function IA(n){return(n.eventObject||n.object).uuid+"/"+n.index+n.instanceId}function PMe(){var n;const e=typeof self<"u"&&self||typeof window<"u"&&window;if(!e)return I1.exports.DefaultEventPriority;switch((n=e.event)==null?void 0:n.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return I1.exports.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return I1.exports.ContinuousEventPriority;default:return I1.exports.DefaultEventPriority}}function OZ(n,e,t,r){const s=t.get(e);s&&(t.delete(e),t.size===0&&(n.delete(r),s.target.releasePointerCapture(r)))}function BMe(n,e){const{internal:t}=n.getState();t.interaction=t.interaction.filter(r=>r!==e),t.initialHits=t.initialHits.filter(r=>r!==e),t.hovered.forEach((r,s)=>{(r.eventObject===e||r.object===e)&&t.hovered.delete(s)}),t.capturedMap.forEach((r,s)=>{OZ(t.capturedMap,e,r,s)})}function FMe(n){function e(h){const{internal:f}=n.getState(),g=h.offsetX-f.initialClick[0],y=h.offsetY-f.initialClick[1];return Math.round(Math.sqrt(g*g+y*y))}function t(h){return h.filter(f=>["Move","Over","Enter","Out","Leave"].some(g=>{var y;return(y=f.__r3f)==null?void 0:y.handlers["onPointer"+g]}))}function r(h,f){const g=n.getState(),y=new Set,b=[],w=f?f(g.internal.interaction):g.internal.interaction;for(let k=0;k{const P=gx(k.object),D=gx(L.object);return!P||!D?k.distance-L.distance:D.events.priority-P.events.priority||k.distance-L.distance}).filter(k=>{const L=IA(k);return y.has(L)?!1:(y.add(L),!0)});g.events.filter&&(M=g.events.filter(M,g));for(const k of M){let L=k.object;for(;L;){var A;(A=L.__r3f)!=null&&A.eventCount&&b.push({...k,eventObject:L}),L=L.parent}}if("pointerId"in h&&g.internal.capturedMap.has(h.pointerId))for(let k of g.internal.capturedMap.get(h.pointerId).values())y.has(IA(k.intersection))||b.push(k.intersection);return b}function s(h,f,g,y){const b=n.getState();if(h.length){const w={stopped:!1};for(const C of h){const M=gx(C.object)||b,{raycaster:A,pointer:k,camera:L,internal:P}=M,D=new Me(k.x,k.y,0).unproject(L),z=le=>{var Z,q;return(Z=(q=P.capturedMap.get(le))==null?void 0:q.has(C.eventObject))!=null?Z:!1},U=le=>{const Z={intersection:C,target:f.target};P.capturedMap.has(le)?P.capturedMap.get(le).set(C.eventObject,Z):P.capturedMap.set(le,new Map([[C.eventObject,Z]])),f.target.setPointerCapture(le)},V=le=>{const Z=P.capturedMap.get(le);Z&&OZ(P.capturedMap,C.eventObject,Z,le)};let H={};for(let le in f){let Z=f[le];typeof Z!="function"&&(H[le]=Z)}let oe={...C,...H,pointer:k,intersections:h,stopped:w.stopped,delta:g,unprojectedPoint:D,ray:A.ray,camera:L,stopPropagation(){const le="pointerId"in f&&P.capturedMap.get(f.pointerId);if((!le||le.has(C.eventObject))&&(oe.stopped=w.stopped=!0,P.hovered.size&&Array.from(P.hovered.values()).find(Z=>Z.eventObject===C.eventObject))){const Z=h.slice(0,h.indexOf(C));o([...Z,C])}},target:{hasPointerCapture:z,setPointerCapture:U,releasePointerCapture:V},currentTarget:{hasPointerCapture:z,setPointerCapture:U,releasePointerCapture:V},nativeEvent:f};if(y(oe),w.stopped===!0)break}}return h}function o(h){const{internal:f}=n.getState();for(const g of f.hovered.values())if(!h.length||!h.find(y=>y.object===g.object&&y.index===g.index&&y.instanceId===g.instanceId)){const y=g.eventObject.__r3f,b=y==null?void 0:y.handlers;if(f.hovered.delete(IA(g)),y!=null&&y.eventCount){const w={...g,intersections:h};b.onPointerOut==null||b.onPointerOut(w),b.onPointerLeave==null||b.onPointerLeave(w)}}}function l(h,f){for(let g=0;go([]);case"onLostPointerCapture":return f=>{const{internal:g}=n.getState();"pointerId"in f&&g.capturedMap.has(f.pointerId)&&requestAnimationFrame(()=>{g.capturedMap.has(f.pointerId)&&(g.capturedMap.delete(f.pointerId),o([]))})}}return function(f){const{onPointerMissed:g,internal:y}=n.getState();y.lastEvent.current=f;const b=h==="onPointerMove",w=h==="onClick"||h==="onContextMenu"||h==="onDoubleClick",C=r(f,b?t:void 0),M=w?e(f):0;h==="onPointerDown"&&(y.initialClick=[f.offsetX,f.offsetY],y.initialHits=C.map(k=>k.eventObject)),w&&!C.length&&M<=2&&(l(f,y.interaction),g&&g(f)),b&&o(C);function A(k){const L=k.eventObject,P=L.__r3f,D=P==null?void 0:P.handlers;if(P!=null&&P.eventCount)if(b){if(D.onPointerOver||D.onPointerEnter||D.onPointerOut||D.onPointerLeave){const z=IA(k),U=y.hovered.get(z);U?U.stopped&&k.stopPropagation():(y.hovered.set(z,k),D.onPointerOver==null||D.onPointerOver(k),D.onPointerEnter==null||D.onPointerEnter(k))}D.onPointerMove==null||D.onPointerMove(k)}else{const z=D[h];z?(!w||y.initialHits.includes(L))&&(l(f,y.interaction.filter(U=>!y.initialHits.includes(U))),z(k)):w&&y.initialHits.includes(L)&&l(f,y.interaction.filter(U=>!y.initialHits.includes(U)))}}s(C,f,M,A)}}return{handlePointer:u}}const LZ=n=>!!(n!=null&&n.render),NZ=me.createContext(null),zMe=(n,e)=>{const t=SMe((u,h)=>{const f=new Me,g=new Me,y=new Me;function b(A=h().camera,k=g,L=h().size){const{width:P,height:D,top:z,left:U}=L,V=P/D;k instanceof Me?y.copy(k):y.set(...k);const H=A.getWorldPosition(f).distanceTo(y);if(CZ(A))return{width:P/A.zoom,height:D/A.zoom,top:z,left:U,factor:1,distance:H,aspect:V};{const oe=A.fov*Math.PI/180,le=2*Math.tan(oe/2)*H,Z=le*(P/D);return{width:Z,height:le,top:z,left:U,factor:P/Z,distance:H,aspect:V}}}let w;const C=A=>u(k=>({performance:{...k.performance,current:A}})),M=new Vt;return{set:u,get:h,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},xr:null,invalidate:(A=1)=>n(h(),A),advance:(A,k)=>e(A,k,h()),legacy:!1,linear:!1,flat:!1,scene:DS(new V$),controls:null,clock:new b4,pointer:M,mouse:M,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const A=h();w&&clearTimeout(w),A.performance.current!==A.performance.min&&C(A.performance.min),w=setTimeout(()=>C(h().performance.max),A.performance.debounce)}},size:{width:0,height:0,top:0,left:0,updateStyle:!1},viewport:{initialDpr:0,dpr:0,width:0,height:0,top:0,left:0,aspect:0,distance:0,factor:0,getCurrentViewport:b},setEvents:A=>u(k=>({...k,events:{...k.events,...A}})),setSize:(A,k,L,P,D)=>{const z=h().camera,U={width:A,height:k,top:P||0,left:D||0,updateStyle:L};u(V=>({size:U,viewport:{...V.viewport,...b(z,g,U)}}))},setDpr:A=>u(k=>{const L=RZ(A);return{viewport:{...k.viewport,dpr:L,initialDpr:k.viewport.initialDpr||L}}}),setFrameloop:(A="always")=>{const k=h().clock;k.stop(),k.elapsedTime=0,A!=="never"&&(k.start(),k.elapsedTime=0),u(()=>({frameloop:A}))},previousRoot:void 0,internal:{active:!1,priority:0,frames:0,lastEvent:me.createRef(),interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,subscribe:(A,k,L)=>{const P=h().internal;return P.priority=P.priority+(k>0?1:0),P.subscribers.push({ref:A,priority:k,store:L}),P.subscribers=P.subscribers.sort((D,z)=>D.priority-z.priority),()=>{const D=h().internal;D!=null&&D.subscribers&&(D.priority=D.priority-(k>0?1:0),D.subscribers=D.subscribers.filter(z=>z.ref!==A))}}}}}),r=t.getState();let s=r.size,o=r.viewport.dpr,l=r.camera;return t.subscribe(()=>{const{camera:u,size:h,viewport:f,gl:g,set:y}=t.getState();if(h!==s||f.dpr!==o){var b;s=h,o=f.dpr,DMe(u,h),g.setPixelRatio(f.dpr);const w=(b=h.updateStyle)!=null?b:typeof HTMLCanvasElement<"u"&&g.domElement instanceof HTMLCanvasElement;g.setSize(h.width,h.height,w)}u!==l&&(l=u,y(w=>({viewport:{...w.viewport,...w.viewport.getCurrentViewport(u)}})))}),t.subscribe(u=>n(u)),t};let RA,UMe=new Set,HMe=new Set,GMe=new Set;function qL(n,e){if(n.size)for(const{callback:t}of n.values())t(e)}function _x(n,e){switch(n){case"before":return qL(UMe,e);case"after":return qL(HMe,e);case"tail":return qL(GMe,e)}}let QL,ZL;function eN(n,e,t){let r=e.clock.getDelta();for(e.frameloop==="never"&&typeof n=="number"&&(r=n-e.clock.elapsedTime,e.clock.oldTime=e.clock.elapsedTime,e.clock.elapsedTime=n),QL=e.internal.subscribers,RA=0;RA0)&&!((f=s.gl.xr)!=null&&f.isPresenting)&&(t+=eN(h,s))}if(_x("after",h),t===0)return _x("tail",h),e=!1,cancelAnimationFrame(r)}function l(h,f=1){var g;if(!h)return n.forEach(y=>l(y.store.getState()),f);(g=h.gl.xr)!=null&&g.isPresenting||!h.internal.active||h.frameloop==="never"||(h.internal.frames=Math.min(60,h.internal.frames+f),e||(e=!0,requestAnimationFrame(o)))}function u(h,f=!0,g,y){if(f&&_x("before",h),g)eN(h,g,y);else for(const b of n.values())eN(h,b.store.getState());f&&_x("after",h)}return{loop:o,invalidate:l,advance:u}}function DZ(){const n=me.useContext(NZ);if(!n)throw new Error("R3F: Hooks can only be used within the Canvas component!");return n}function nf(n=t=>t,e){return DZ()(n,e)}function Xm(n,e=0){const t=DZ(),r=t.getState().internal.subscribe,s=MZ(n);return BC(()=>r(s,e,t),[e,r,t]),null}const Xw=new Map,{invalidate:q6,advance:Q6}=WMe(Xw),{reconciler:xR,applyProps:kA}=RMe(Xw,PMe),kS={objects:"shallow",strict:!1},VMe=(n,e)=>{const t=typeof n=="function"?n(e):n;return LZ(t)?t:new n4({powerPreference:"high-performance",canvas:e,antialias:!0,alpha:!0,...n})};function jMe(n,e){if(e)return e;if(typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement&&n.parentElement){const{width:t,height:r,top:s,left:o}=n.parentElement.getBoundingClientRect();return{width:t,height:r,top:s,left:o}}else if(typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas)return{width:n.width,height:n.height,top:0,left:0};return{width:0,height:0,top:0,left:0}}function YMe(n){const e=Xw.get(n),t=e==null?void 0:e.fiber,r=e==null?void 0:e.store;e&&console.warn("R3F.createRoot should only be called once!");const s=typeof reportError=="function"?reportError:console.error,o=r||zMe(q6,Q6),l=t||xR.createContainer(o,I1.exports.ConcurrentRoot,null,!1,null,"",s,null);e||Xw.set(n,{fiber:l,store:o});let u,h=!1,f;return{configure(g={}){let{gl:y,size:b,events:w,onCreated:C,shadows:M=!1,linear:A=!1,flat:k=!1,legacy:L=!1,orthographic:P=!1,frameloop:D="always",dpr:z=[1,2],performance:U,raycaster:V,camera:H,onPointerMissed:oe}=g,le=o.getState(),Z=le.gl;le.gl||le.set({gl:Z=VMe(y,n)});let q=le.raycaster;q||le.set({raycaster:q=new w4});const{params:he,...ae}=V||{};if(Bu.equ(ae,q,kS)||kA(q,{...ae}),Bu.equ(he,q.params,kS)||kA(q,{params:{...q.params,...he}}),!le.camera||le.camera===f&&!Bu.equ(f,H,kS)){f=H;const se=H instanceof fE,fe=se?H:P?new u_(0,0,0,0,.1,1e3):new Za(75,0,.1,1e3);se||(fe.position.z=5,H&&kA(fe,H),!le.camera&&!(H!=null&&H.rotation)&&fe.lookAt(0,0,0)),le.set({camera:fe})}if(!le.xr){const se=(Fe,Ie)=>{const qe=o.getState();qe.frameloop!=="never"&&Q6(Fe,!0,qe,Ie)},fe=()=>{const Fe=o.getState();Fe.gl.xr.enabled=Fe.gl.xr.isPresenting,Fe.gl.xr.setAnimationLoop(Fe.gl.xr.isPresenting?se:null),Fe.gl.xr.isPresenting||q6(Fe)},Te={connect(){const Fe=o.getState().gl;Fe.xr.addEventListener("sessionstart",fe),Fe.xr.addEventListener("sessionend",fe)},disconnect(){const Fe=o.getState().gl;Fe.xr.removeEventListener("sessionstart",fe),Fe.xr.removeEventListener("sessionend",fe)}};Z.xr&&Te.connect(),le.set({xr:Te})}if(Z.shadowMap){const se=Z.shadowMap.enabled,fe=Z.shadowMap.type;if(Z.shadowMap.enabled=!!M,Bu.boo(M))Z.shadowMap.type=Zx;else if(Bu.str(M)){var ue;const Te={basic:Iq,percentage:e2,soft:Zx,variance:x1};Z.shadowMap.type=(ue=Te[M])!=null?ue:Zx}else Bu.obj(M)&&Object.assign(Z.shadowMap,M);(se!==Z.shadowMap.enabled||fe!==Z.shadowMap.type)&&(Z.shadowMap.needsUpdate=!0)}const ge=$Z();ge&&("enabled"in ge?ge.enabled=!L:"legacyMode"in ge&&(ge.legacyMode=L));const we=A?xg:ms,J=k?l0:jF;Z.outputEncoding!==we&&(Z.outputEncoding=we),Z.toneMapping!==J&&(Z.toneMapping=J),le.legacy!==L&&le.set(()=>({legacy:L})),le.linear!==A&&le.set(()=>({linear:A})),le.flat!==k&&le.set(()=>({flat:k})),y&&!Bu.fun(y)&&!LZ(y)&&!Bu.equ(y,Z,kS)&&kA(Z,y),w&&!le.events.handlers&&le.set({events:w(o)});const re=jMe(n,b);return Bu.equ(re,le.size,kS)||le.setSize(re.width,re.height,re.updateStyle,re.top,re.left),z&&le.viewport.dpr!==RZ(z)&&le.setDpr(z),le.frameloop!==D&&le.setFrameloop(D),le.onPointerMissed||le.set({onPointerMissed:oe}),U&&!Bu.equ(U,le.performance,kS)&&le.set(se=>({performance:{...se.performance,...U}})),u=C,h=!0,this},render(g){return h||this.configure(),xR.updateContainer(un(XMe,{store:o,children:g,onCreated:u,rootElement:n}),l,null,()=>{}),o},unmount(){PZ(n)}}}function XMe({store:n,children:e,onCreated:t,rootElement:r}){return BC(()=>{const s=n.getState();s.set(o=>({internal:{...o.internal,active:!0}})),t&&t(s),n.getState().events.connected||s.events.connect==null||s.events.connect(r)},[]),me.createElement(NZ.Provider,{value:n},e)}function PZ(n,e){const t=Xw.get(n),r=t==null?void 0:t.fiber;if(r){const s=t==null?void 0:t.store.getState();s&&(s.internal.active=!1),xR.updateContainer(null,r,null,()=>{s&&setTimeout(()=>{try{var o,l,u,h;s.events.disconnect==null||s.events.disconnect(),(o=s.gl)==null||(l=o.renderLists)==null||l.dispose==null||l.dispose(),(u=s.gl)==null||u.forceContextLoss==null||u.forceContextLoss(),(h=s.gl)!=null&&h.xr&&s.xr.disconnect(),NMe(s),Xw.delete(n),e&&e(n)}catch{}},500)})}}xR.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:me.version});function BP(){return BP=Object.assign?Object.assign.bind():function(n){for(var e=1;e=0?r=setTimeout(h,e-g):(r=null,t||(u=n.apply(o,s),o=s=null))}var f=function(){o=this,s=arguments,l=Date.now();var g=t&&!r;return r||(r=setTimeout(h,e)),g&&(u=n.apply(o,s),o=s=null),u};return f.clear=function(){r&&(clearTimeout(r),r=null)},f.flush=function(){r&&(u=n.apply(o,s),o=s=null,clearTimeout(r),r=null)},f}FP.debounce=FP;var Z6=FP;function KMe(n){let{debounce:e,scroll:t,polyfill:r,offsetSize:s}=n===void 0?{debounce:0,scroll:!1,offsetSize:!1}:n;const o=r||(typeof window>"u"?class{}:window.ResizeObserver);if(!o)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[l,u]=me.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),h=me.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:l}),f=e?typeof e=="number"?e:e.scroll:null,g=e?typeof e=="number"?e:e.resize:null,y=me.useRef(!1);me.useEffect(()=>(y.current=!0,()=>void(y.current=!1)));const[b,w,C]=me.useMemo(()=>{const L=()=>{if(!h.current.element)return;const{left:P,top:D,width:z,height:U,bottom:V,right:H,x:oe,y:le}=h.current.element.getBoundingClientRect(),Z={left:P,top:D,width:z,height:U,bottom:V,right:H,x:oe,y:le};h.current.element instanceof HTMLElement&&s&&(Z.height=h.current.element.offsetHeight,Z.width=h.current.element.offsetWidth),Object.freeze(Z),y.current&&!ZMe(h.current.lastBounds,Z)&&u(h.current.lastBounds=Z)};return[L,g?Z6(L,g):L,f?Z6(L,f):L]},[u,s,f,g]);function M(){h.current.scrollContainers&&(h.current.scrollContainers.forEach(L=>L.removeEventListener("scroll",C,!0)),h.current.scrollContainers=null),h.current.resizeObserver&&(h.current.resizeObserver.disconnect(),h.current.resizeObserver=null)}function A(){!h.current.element||(h.current.resizeObserver=new o(C),h.current.resizeObserver.observe(h.current.element),t&&h.current.scrollContainers&&h.current.scrollContainers.forEach(L=>L.addEventListener("scroll",C,{capture:!0,passive:!0})))}const k=L=>{!L||L===h.current.element||(M(),h.current.element=L,h.current.scrollContainers=BZ(L),A())};return qMe(C,!!t),JMe(w),me.useEffect(()=>{M(),A()},[t,C,w]),me.useEffect(()=>M,[]),[k,l,b]}function JMe(n){me.useEffect(()=>{const e=n;return window.addEventListener("resize",e),()=>void window.removeEventListener("resize",e)},[n])}function qMe(n,e){me.useEffect(()=>{if(e){const t=n;return window.addEventListener("scroll",t,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",t,!0)}},[n,e])}function BZ(n){const e=[];if(!n||n===document.body)return e;const{overflow:t,overflowX:r,overflowY:s}=window.getComputedStyle(n);return[t,r,s].some(o=>o==="auto"||o==="scroll")&&e.push(n),[...e,...BZ(n.parentElement)]}const QMe=["x","y","top","bottom","left","right","width","height"],ZMe=(n,e)=>QMe.every(t=>n[t]===e[t]);var eAe=Object.defineProperty,tAe=Object.defineProperties,nAe=Object.getOwnPropertyDescriptors,eW=Object.getOwnPropertySymbols,rAe=Object.prototype.hasOwnProperty,iAe=Object.prototype.propertyIsEnumerable,tW=(n,e,t)=>e in n?eAe(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,nW=(n,e)=>{for(var t in e||(e={}))rAe.call(e,t)&&tW(n,t,e[t]);if(eW)for(var t of eW(e))iAe.call(e,t)&&tW(n,t,e[t]);return n},sAe=(n,e)=>tAe(n,nAe(e)),rW;function FZ(n,e,t){if(!n)return;if(t(n)===!0)return n;let r=e?n.return:n.child;for(;r;){const s=FZ(r,e,t);if(s)return s;r=e?null:r.sibling}}function zZ(n){try{return Object.defineProperties(n,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return n}}const $4=zZ(me.createContext(null));class UZ extends me.Component{render(){return un($4.Provider,{value:this._reactInternals,children:this.props.children})}}const{ReactCurrentOwner:iW,ReactCurrentDispatcher:sW}=(rW=me.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED)!=null?rW:{};function oAe(){const n=me.useContext($4),e=me.useId();return me.useMemo(()=>{var t;return(t=iW==null?void 0:iW.current)!=null?t:FZ(n,!1,r=>{let s=r.memoizedState;for(;s;){if(s.memoizedState===e)return!0;s=s.next}})},[n,e])}function aAe(){var n,e;const t=oAe(),[r]=me.useState(()=>new Map);r.clear();let s=t;for(;s;){const o=(n=s.type)==null?void 0:n._context;o&&o!==$4&&!r.has(o)&&r.set(o,(e=sW==null?void 0:sW.current)==null?void 0:e.readContext(zZ(o))),s=s.return}return me.useMemo(()=>Array.from(r.keys()).reduce((o,l)=>u=>me.createElement(o,null,me.createElement(l.Provider,sAe(nW({},u),{value:r.get(l)}))),o=>un(UZ,{...nW({},o)})),[r])}const tN={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 lAe(n){const{handlePointer:e}=FMe(n);return{priority:1,enabled:!0,compute(t,r,s){r.pointer.set(t.offsetX/r.size.width*2-1,-(t.offsetY/r.size.height)*2+1),r.raycaster.setFromCamera(r.pointer,r.camera)},connected:void 0,handlers:Object.keys(tN).reduce((t,r)=>({...t,[r]:e(r)}),{}),update:()=>{var t;const{events:r,internal:s}=n.getState();(t=s.lastEvent)!=null&&t.current&&r.handlers&&r.handlers.onPointerMove(s.lastEvent.current)},connect:t=>{var r;const{set:s,events:o}=n.getState();o.disconnect==null||o.disconnect(),s(l=>({events:{...l.events,connected:t}})),Object.entries((r=o.handlers)!=null?r:[]).forEach(([l,u])=>{const[h,f]=tN[l];t.addEventListener(h,u,{passive:f})})},disconnect:()=>{const{set:t,events:r}=n.getState();if(r.connected){var s;Object.entries((s=r.handlers)!=null?s:[]).forEach(([o,l])=>{if(r&&r.connected instanceof HTMLElement){const[u]=tN[o];r.connected.removeEventListener(u,l)}}),t(o=>({events:{...o.events,connected:void 0}}))}}}}const uAe=me.forwardRef(function({children:n,fallback:e,resize:t,style:r,gl:s,events:o=lAe,eventSource:l,eventPrefix:u,shadows:h,linear:f,flat:g,legacy:y,orthographic:b,frameloop:w,dpr:C,performance:M,raycaster:A,camera:k,onPointerMissed:L,onCreated:P,...D},z){me.useMemo(()=>IMe(vMe),[]);const U=aAe(),[V,H]=KMe({scroll:!0,debounce:{scroll:50,resize:0},...t}),oe=me.useRef(null),le=me.useRef(null);me.useImperativeHandle(z,()=>oe.current);const Z=MZ(L),[q,he]=me.useState(!1),[ae,ue]=me.useState(!1);if(q)throw q;if(ae)throw ae;const ge=me.useRef(null);return BC(()=>{const we=oe.current;H.width>0&&H.height>0&&we&&(ge.current||(ge.current=YMe(we)),ge.current.configure({gl:s,events:o,shadows:h,linear:f,flat:g,legacy:y,orthographic:b,frameloop:w,dpr:C,performance:M,raycaster:A,camera:k,size:H,onPointerMissed:(...J)=>Z.current==null?void 0:Z.current(...J),onCreated:J=>{J.events.connect==null||J.events.connect(l?kMe(l)?l.current:l:le.current),u&&J.setEvents({compute:(re,se)=>{const fe=re[u+"X"],Te=re[u+"Y"];se.pointer.set(fe/se.size.width*2-1,-(Te/se.size.height)*2+1),se.raycaster.setFromCamera(se.pointer,se.camera)}}),P==null||P(J)}}),ge.current.render(un(U,{children:un(AZ,{set:ue,children:un(me.Suspense,{fallback:un(OMe,{set:he}),children:n})})})))}),me.useEffect(()=>{const we=oe.current;if(we)return()=>PZ(we)},[]),un("div",{ref:le,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:l?"none":"auto",...r},...D,children:un("div",{ref:V,style:{width:"100%",height:"100%"},children:un("canvas",{ref:oe,style:{display:"block"},children:e})})})}),cAe=me.forwardRef(function(n,e){return un(UZ,{children:un(uAe,{...n,ref:e})})});var HZ={exports:{}},zp={},oW={exports:{}},aW={};/** * @license React * scheduler.production.min.js * @@ -4929,7 +4929,7 @@ No matching component was found for: * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var aW;function hAe(){return aW||(aW=1,function(n){function e(J,re){var ie=J.length;J.push(re);e:for(;0>>1,Te=J[fe];if(0>>1;fes(Je,ie))Res(Qe,Je)?(J[fe]=Qe,J[Re]=ie,fe=Re):(J[fe]=Je,J[Ie]=ie,fe=Ie);else if(Res(Qe,ie))J[fe]=Qe,J[Re]=ie,fe=Re;else break e}}return re}function s(J,re){var ie=J.sortIndex-re.sortIndex;return ie!==0?ie:J.id-re.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;n.unstable_now=function(){return o.now()}}else{var l=Date,u=l.now();n.unstable_now=function(){return l.now()-u}}var h=[],f=[],g=1,y=null,b=3,w=!1,C=!1,M=!1,A=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,L=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function P(J){for(var re=t(f);re!==null;){if(re.callback===null)r(f);else if(re.startTime<=J)r(f),re.sortIndex=re.expirationTime,e(h,re);else break;re=t(f)}}function D(J){if(M=!1,P(J),!C)if(t(h)!==null)C=!0,ge(z);else{var re=t(f);re!==null&&we(D,re.startTime-J)}}function z(J,re){C=!1,M&&(M=!1,k(H),H=-1),w=!0;var ie=b;try{for(P(re),y=t(h);y!==null&&(!(y.expirationTime>re)||J&&!Z());){var fe=y.callback;if(typeof fe=="function"){y.callback=null,b=y.priorityLevel;var Te=fe(y.expirationTime<=re);re=n.unstable_now(),typeof Te=="function"?y.callback=Te:y===t(h)&&r(h),P(re)}else r(h);y=t(h)}if(y!==null)var Fe=!0;else{var Ie=t(f);Ie!==null&&we(D,Ie.startTime-re),Fe=!1}return Fe}finally{y=null,b=ie,w=!1}}var U=!1,V=null,H=-1,oe=5,le=-1;function Z(){return!(n.unstable_now()-leJ||125fe?(J.sortIndex=ie,e(f,J),t(h)===null&&J===t(f)&&(M?(k(H),H=-1):M=!0,we(D,ie-fe))):(J.sortIndex=Te,e(h,J),C||w||(C=!0,ge(z))),J},n.unstable_shouldYield=Z,n.unstable_wrapCallback=function(J){var re=b;return function(){var ie=b;b=re;try{return J.apply(this,arguments)}finally{b=ie}}}}(oW)),oW}var lW;function dAe(){return lW||(lW=1,function(n){n.exports=hAe()}(sW)),sW.exports}/** + */var lW;function hAe(){return lW||(lW=1,function(n){function e(J,re){var se=J.length;J.push(re);e:for(;0>>1,Te=J[fe];if(0>>1;fes(qe,se))Res(Ze,qe)?(J[fe]=Ze,J[Re]=se,fe=Re):(J[fe]=qe,J[Ie]=se,fe=Ie);else if(Res(Ze,se))J[fe]=Ze,J[Re]=se,fe=Re;else break e}}return re}function s(J,re){var se=J.sortIndex-re.sortIndex;return se!==0?se:J.id-re.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;n.unstable_now=function(){return o.now()}}else{var l=Date,u=l.now();n.unstable_now=function(){return l.now()-u}}var h=[],f=[],g=1,y=null,b=3,w=!1,C=!1,M=!1,A=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,L=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function P(J){for(var re=t(f);re!==null;){if(re.callback===null)r(f);else if(re.startTime<=J)r(f),re.sortIndex=re.expirationTime,e(h,re);else break;re=t(f)}}function D(J){if(M=!1,P(J),!C)if(t(h)!==null)C=!0,ge(z);else{var re=t(f);re!==null&&we(D,re.startTime-J)}}function z(J,re){C=!1,M&&(M=!1,k(H),H=-1),w=!0;var se=b;try{for(P(re),y=t(h);y!==null&&(!(y.expirationTime>re)||J&&!Z());){var fe=y.callback;if(typeof fe=="function"){y.callback=null,b=y.priorityLevel;var Te=fe(y.expirationTime<=re);re=n.unstable_now(),typeof Te=="function"?y.callback=Te:y===t(h)&&r(h),P(re)}else r(h);y=t(h)}if(y!==null)var Fe=!0;else{var Ie=t(f);Ie!==null&&we(D,Ie.startTime-re),Fe=!1}return Fe}finally{y=null,b=se,w=!1}}var U=!1,V=null,H=-1,oe=5,le=-1;function Z(){return!(n.unstable_now()-leJ||125fe?(J.sortIndex=se,e(f,J),t(h)===null&&J===t(f)&&(M?(k(H),H=-1):M=!0,we(D,se-fe))):(J.sortIndex=Te,e(h,J),C||w||(C=!0,ge(z))),J},n.unstable_shouldYield=Z,n.unstable_wrapCallback=function(J){var re=b;return function(){var se=b;b=re;try{return J.apply(this,arguments)}finally{b=se}}}}(aW)),aW}var uW;function dAe(){return uW||(uW=1,function(n){n.exports=hAe()}(oW)),oW.exports}/** * @license React * react-dom.production.min.js * @@ -4937,14 +4937,14 @@ No matching component was found for: * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var uW;function fAe(){if(uW)return zp;uW=1;var n=yt,e=dAe();function t(v){for(var T="https://reactjs.org/docs/error-decoder.html?invariant="+v,R=1;R"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),h=Object.prototype.hasOwnProperty,f=/^[: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]*$/,g={},y={};function b(v){return h.call(y,v)?!0:h.call(g,v)?!1:f.test(v)?y[v]=!0:(g[v]=!0,!1)}function w(v,T,R,F){if(R!==null&&R.type===0)return!1;switch(typeof T){case"function":case"symbol":return!0;case"boolean":return F?!1:R!==null?!R.acceptsBooleans:(v=v.toLowerCase().slice(0,5),v!=="data-"&&v!=="aria-");default:return!1}}function C(v,T,R,F){if(T===null||typeof T>"u"||w(v,T,R,F))return!0;if(F)return!1;if(R!==null)switch(R.type){case 3:return!T;case 4:return T===!1;case 5:return isNaN(T);case 6:return isNaN(T)||1>T}return!1}function M(v,T,R,F,Y,ee,be){this.acceptsBooleans=T===2||T===3||T===4,this.attributeName=F,this.attributeNamespace=Y,this.mustUseProperty=R,this.propertyName=v,this.type=T,this.sanitizeURL=ee,this.removeEmptyString=be}var A={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(v){A[v]=new M(v,0,!1,v,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(v){var T=v[0];A[T]=new M(T,1,!1,v[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(v){A[v]=new M(v,2,!1,v.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(v){A[v]=new M(v,2,!1,v,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(v){A[v]=new M(v,3,!1,v.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(v){A[v]=new M(v,3,!0,v,null,!1,!1)}),["capture","download"].forEach(function(v){A[v]=new M(v,4,!1,v,null,!1,!1)}),["cols","rows","size","span"].forEach(function(v){A[v]=new M(v,6,!1,v,null,!1,!1)}),["rowSpan","start"].forEach(function(v){A[v]=new M(v,5,!1,v.toLowerCase(),null,!1,!1)});var k=/[\-:]([a-z])/g;function L(v){return v[1].toUpperCase()}"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(v){var T=v.replace(k,L);A[T]=new M(T,1,!1,v,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(v){var T=v.replace(k,L);A[T]=new M(T,1,!1,v,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(v){var T=v.replace(k,L);A[T]=new M(T,1,!1,v,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(v){A[v]=new M(v,1,!1,v.toLowerCase(),null,!1,!1)}),A.xlinkHref=new M("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(v){A[v]=new M(v,1,!1,v.toLowerCase(),null,!0,!0)});function P(v,T,R,F){var Y=A.hasOwnProperty(T)?A[T]:null;(Y!==null?Y.type!==0:F||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),h=Object.prototype.hasOwnProperty,f=/^[: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]*$/,g={},y={};function b(v){return h.call(y,v)?!0:h.call(g,v)?!1:f.test(v)?y[v]=!0:(g[v]=!0,!1)}function w(v,T,R,F){if(R!==null&&R.type===0)return!1;switch(typeof T){case"function":case"symbol":return!0;case"boolean":return F?!1:R!==null?!R.acceptsBooleans:(v=v.toLowerCase().slice(0,5),v!=="data-"&&v!=="aria-");default:return!1}}function C(v,T,R,F){if(T===null||typeof T>"u"||w(v,T,R,F))return!0;if(F)return!1;if(R!==null)switch(R.type){case 3:return!T;case 4:return T===!1;case 5:return isNaN(T);case 6:return isNaN(T)||1>T}return!1}function M(v,T,R,F,Y,ee,be){this.acceptsBooleans=T===2||T===3||T===4,this.attributeName=F,this.attributeNamespace=Y,this.mustUseProperty=R,this.propertyName=v,this.type=T,this.sanitizeURL=ee,this.removeEmptyString=be}var A={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(v){A[v]=new M(v,0,!1,v,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(v){var T=v[0];A[T]=new M(T,1,!1,v[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(v){A[v]=new M(v,2,!1,v.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(v){A[v]=new M(v,2,!1,v,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(v){A[v]=new M(v,3,!1,v.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(v){A[v]=new M(v,3,!0,v,null,!1,!1)}),["capture","download"].forEach(function(v){A[v]=new M(v,4,!1,v,null,!1,!1)}),["cols","rows","size","span"].forEach(function(v){A[v]=new M(v,6,!1,v,null,!1,!1)}),["rowSpan","start"].forEach(function(v){A[v]=new M(v,5,!1,v.toLowerCase(),null,!1,!1)});var k=/[\-:]([a-z])/g;function L(v){return v[1].toUpperCase()}"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(v){var T=v.replace(k,L);A[T]=new M(T,1,!1,v,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(v){var T=v.replace(k,L);A[T]=new M(T,1,!1,v,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(v){var T=v.replace(k,L);A[T]=new M(T,1,!1,v,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(v){A[v]=new M(v,1,!1,v.toLowerCase(),null,!1,!1)}),A.xlinkHref=new M("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(v){A[v]=new M(v,1,!1,v.toLowerCase(),null,!0,!0)});function P(v,T,R,F){var Y=A.hasOwnProperty(T)?A[T]:null;(Y!==null?Y.type!==0:F||!(2Ye||Y[be]!==ee[Ye]){var at=` -`+Y[be].replace(" at new "," at ");return v.displayName&&at.includes("")&&(at=at.replace("",v.displayName)),at}while(1<=be&&0<=Ye);break}}}finally{Fe=!1,Error.prepareStackTrace=R}return(v=v?v.displayName||v.name:"")?Te(v):""}function Je(v){switch(v.tag){case 5:return Te(v.type);case 16:return Te("Lazy");case 13:return Te("Suspense");case 19:return Te("SuspenseList");case 0:case 2:case 15:return v=Ie(v.type,!1),v;case 11:return v=Ie(v.type.render,!1),v;case 1:return v=Ie(v.type,!0),v;default:return""}}function Re(v){if(v==null)return null;if(typeof v=="function")return v.displayName||v.name||null;if(typeof v=="string")return v;switch(v){case V:return"Fragment";case U:return"Portal";case oe:return"Profiler";case H:return"StrictMode";case he:return"Suspense";case ae:return"SuspenseList"}if(typeof v=="object")switch(v.$$typeof){case Z:return(v.displayName||"Context")+".Consumer";case le:return(v._context.displayName||"Context")+".Provider";case q:var T=v.render;return v=v.displayName,v||(v=T.displayName||T.name||"",v=v!==""?"ForwardRef("+v+")":"ForwardRef"),v;case ue:return T=v.displayName||null,T!==null?T:Re(v.type)||"Memo";case ge:T=v._payload,v=v._init;try{return Re(v(T))}catch{}}return null}function Qe(v){var T=v.type;switch(v.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 v=T.render,v=v.displayName||v.name||"",T.displayName||(v!==""?"ForwardRef("+v+")":"ForwardRef");case 7:return"Fragment";case 5:return T;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Re(T);case 8:return T===H?"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(typeof T=="function")return T.displayName||T.name||null;if(typeof T=="string")return T}return null}function nt(v){switch(typeof v){case"boolean":case"number":case"string":case"undefined":return v;case"object":return v;default:return""}}function ft(v){var T=v.type;return(v=v.nodeName)&&v.toLowerCase()==="input"&&(T==="checkbox"||T==="radio")}function lt(v){var T=ft(v)?"checked":"value",R=Object.getOwnPropertyDescriptor(v.constructor.prototype,T),F=""+v[T];if(!v.hasOwnProperty(T)&&typeof R<"u"&&typeof R.get=="function"&&typeof R.set=="function"){var Y=R.get,ee=R.set;return Object.defineProperty(v,T,{configurable:!0,get:function(){return Y.call(this)},set:function(be){F=""+be,ee.call(this,be)}}),Object.defineProperty(v,T,{enumerable:R.enumerable}),{getValue:function(){return F},setValue:function(be){F=""+be},stopTracking:function(){v._valueTracker=null,delete v[T]}}}}function ze(v){v._valueTracker||(v._valueTracker=lt(v))}function Ce(v){if(!v)return!1;var T=v._valueTracker;if(!T)return!0;var R=T.getValue(),F="";return v&&(F=ft(v)?v.checked?"true":"false":v.value),v=F,v!==R?(T.setValue(v),!0):!1}function He(v){if(v=v||(typeof document<"u"?document:void 0),typeof v>"u")return null;try{return v.activeElement||v.body}catch{return v.body}}function rt(v,T){var R=T.checked;return ie({},T,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:R??v._wrapperState.initialChecked})}function it(v,T){var R=T.defaultValue==null?"":T.defaultValue,F=T.checked!=null?T.checked:T.defaultChecked;R=nt(T.value!=null?T.value:R),v._wrapperState={initialChecked:F,initialValue:R,controlled:T.type==="checkbox"||T.type==="radio"?T.checked!=null:T.value!=null}}function Nt(v,T){T=T.checked,T!=null&&P(v,"checked",T,!1)}function kt(v,T){Nt(v,T);var R=nt(T.value),F=T.type;if(R!=null)F==="number"?(R===0&&v.value===""||v.value!=R)&&(v.value=""+R):v.value!==""+R&&(v.value=""+R);else if(F==="submit"||F==="reset"){v.removeAttribute("value");return}T.hasOwnProperty("value")?Mt(v,T.type,R):T.hasOwnProperty("defaultValue")&&Mt(v,T.type,nt(T.defaultValue)),T.checked==null&&T.defaultChecked!=null&&(v.defaultChecked=!!T.defaultChecked)}function vt(v,T,R){if(T.hasOwnProperty("value")||T.hasOwnProperty("defaultValue")){var F=T.type;if(!(F!=="submit"&&F!=="reset"||T.value!==void 0&&T.value!==null))return;T=""+v._wrapperState.initialValue,R||T===v.value||(v.value=T),v.defaultValue=T}R=v.name,R!==""&&(v.name=""),v.defaultChecked=!!v._wrapperState.initialChecked,R!==""&&(v.name=R)}function Mt(v,T,R){(T!=="number"||He(v.ownerDocument)!==v)&&(R==null?v.defaultValue=""+v._wrapperState.initialValue:v.defaultValue!==""+R&&(v.defaultValue=""+R))}var At=Array.isArray;function mt(v,T,R,F){if(v=v.options,T){T={};for(var Y=0;Y"+T.valueOf().toString()+"",T=pt.firstChild;v.firstChild;)v.removeChild(v.firstChild);for(;T.firstChild;)v.appendChild(T.firstChild)}});function Le(v,T){if(T){var R=v.firstChild;if(R&&R===v.lastChild&&R.nodeType===3){R.nodeValue=T;return}}v.textContent=T}var Q={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},te=["Webkit","ms","Moz","O"];Object.keys(Q).forEach(function(v){te.forEach(function(T){T=T+v.charAt(0).toUpperCase()+v.substring(1),Q[T]=Q[v]})});function me(v,T,R){return T==null||typeof T=="boolean"||T===""?"":R||typeof T!="number"||T===0||Q.hasOwnProperty(v)&&Q[v]?(""+T).trim():T+"px"}function ke(v,T){v=v.style;for(var R in T)if(T.hasOwnProperty(R)){var F=R.indexOf("--")===0,Y=me(R,T[R],F);R==="float"&&(R="cssFloat"),F?v.setProperty(R,Y):v[R]=Y}}var Xe=ie({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 Wt(v,T){if(T){if(Xe[v]&&(T.children!=null||T.dangerouslySetInnerHTML!=null))throw Error(t(137,v));if(T.dangerouslySetInnerHTML!=null){if(T.children!=null)throw Error(t(60));if(typeof T.dangerouslySetInnerHTML!="object"||!("__html"in T.dangerouslySetInnerHTML))throw Error(t(61))}if(T.style!=null&&typeof T.style!="object")throw Error(t(62))}}function Ge(v,T){if(v.indexOf("-")===-1)return typeof T.is=="string";switch(v){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 tn=null;function _t(v){return v=v.target||v.srcElement||window,v.correspondingUseElement&&(v=v.correspondingUseElement),v.nodeType===3?v.parentNode:v}var Jt=null,Kt=null,On=null;function ii(v){if(v=Cr(v)){if(typeof Jt!="function")throw Error(t(280));var T=v.stateNode;T&&(T=zf(T),Jt(v.stateNode,v.type,T))}}function Pr(v){Kt?On?On.push(v):On=[v]:Kt=v}function Ei(){if(Kt){var v=Kt,T=On;if(On=Kt=null,ii(v),T)for(v=0;v>>=0,v===0?32:31-(yr(v)/Pi|0)|0}var fi=64,gs=4194304;function tl(v){switch(v&-v){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 v&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return v&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return v}}function Na(v,T){var R=v.pendingLanes;if(R===0)return 0;var F=0,Y=v.suspendedLanes,ee=v.pingedLanes,be=R&268435455;if(be!==0){var Ye=be&~Y;Ye!==0?F=tl(Ye):(ee&=be,ee!==0&&(F=tl(ee)))}else be=R&~Y,be!==0?F=tl(be):ee!==0&&(F=tl(ee));if(F===0)return 0;if(T!==0&&T!==F&&!(T&Y)&&(Y=F&-F,ee=T&-T,Y>=ee||Y===16&&(ee&4194240)!==0))return T;if(F&4&&(F|=R&16),T=v.entangledLanes,T!==0)for(v=v.entanglements,T&=F;0R;R++)T.push(v);return T}function gu(v,T,R){v.pendingLanes|=T,T!==536870912&&(v.suspendedLanes=0,v.pingedLanes=0),v=v.eventTimes,T=31-Gr(T),v[T]=R}function mh(v,T){var R=v.pendingLanes&~T;v.pendingLanes=T,v.suspendedLanes=0,v.pingedLanes=0,v.expiredLanes&=T,v.mutableReadLanes&=T,v.entangledLanes&=T,T=v.entanglements;var F=v.eventTimes;for(v=v.expirationTimes;0=Sr),Eu=" ",cf=!1;function hf(v,T){switch(v){case"keyup":return Wr.indexOf(T.keyCode)!==-1;case"keydown":return T.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function pd(v){return v=v.detail,typeof v=="object"&&"data"in v?v.data:null}var Wu=!1;function ol(v,T){switch(v){case"compositionend":return pd(T);case"keypress":return T.which!==32?null:(cf=!0,Eu);case"textInput":return v=T.data,v===Eu&&cf?null:v;default:return null}}function Fc(v,T){if(Wu)return v==="compositionend"||!Ai&&hf(v,T)?(v=$i(),bi=Rs=wr=null,Wu=!1,v):null;switch(v){case"paste":return null;case"keypress":if(!(T.ctrlKey||T.altKey||T.metaKey)||T.ctrlKey&&T.altKey){if(T.char&&1=T)return{node:R,offset:T-v};v=F}e:{for(;R;){if(R.nextSibling){R=R.nextSibling;break e}R=R.parentNode}R=void 0}R=rn(R)}}function Jn(v,T){return v&&T?v===T?!0:v&&v.nodeType===3?!1:T&&T.nodeType===3?Jn(v,T.parentNode):"contains"in v?v.contains(T):v.compareDocumentPosition?!!(v.compareDocumentPosition(T)&16):!1:!1}function vn(){for(var v=window,T=He();T instanceof v.HTMLIFrameElement;){try{var R=typeof T.contentWindow.location.href=="string"}catch{R=!1}if(R)v=T.contentWindow;else break;T=He(v.document)}return T}function zr(v){var T=v&&v.nodeName&&v.nodeName.toLowerCase();return T&&(T==="input"&&(v.type==="text"||v.type==="search"||v.type==="tel"||v.type==="url"||v.type==="password")||T==="textarea"||v.contentEditable==="true")}function ao(v){var T=vn(),R=v.focusedElem,F=v.selectionRange;if(T!==R&&R&&R.ownerDocument&&Jn(R.ownerDocument.documentElement,R)){if(F!==null&&zr(R)){if(T=F.start,v=F.end,v===void 0&&(v=T),"selectionStart"in R)R.selectionStart=T,R.selectionEnd=Math.min(v,R.value.length);else if(v=(T=R.ownerDocument||document)&&T.defaultView||window,v.getSelection){v=v.getSelection();var Y=R.textContent.length,ee=Math.min(F.start,Y);F=F.end===void 0?ee:Math.min(F.end,Y),!v.extend&&ee>F&&(Y=F,F=ee,ee=Y),Y=In(R,ee);var be=In(R,F);Y&&be&&(v.rangeCount!==1||v.anchorNode!==Y.node||v.anchorOffset!==Y.offset||v.focusNode!==be.node||v.focusOffset!==be.offset)&&(T=T.createRange(),T.setStart(Y.node,Y.offset),v.removeAllRanges(),ee>F?(v.addRange(T),v.extend(be.node,be.offset)):(T.setEnd(be.node,be.offset),v.addRange(T)))}}for(T=[],v=R;v=v.parentNode;)v.nodeType===1&&T.push({element:v,left:v.scrollLeft,top:v.scrollTop});for(typeof R.focus=="function"&&R.focus(),R=0;R=document.documentMode,lo=null,al=null,Fi=null,vs=!1;function $u(v,T,R){var F=R.window===R?R.document:R.nodeType===9?R:R.ownerDocument;vs||lo==null||lo!==He(F)||(F=lo,"selectionStart"in F&&zr(F)?F={start:F.selectionStart,end:F.selectionEnd}:(F=(F.ownerDocument&&F.ownerDocument.defaultView||window).getSelection(),F={anchorNode:F.anchorNode,anchorOffset:F.anchorOffset,focusNode:F.focusNode,focusOffset:F.focusOffset}),Fi&&Ot(Fi,F)||(Fi=F,F=Rd(al,"onSelect"),0Ri||(v.current=cl[Ri],cl[Ri]=null,Ri--)}function ss(v,T){Ri++,cl[Ri]=v.current,v.current=T}var jc={},_a=hi(jc),va=hi(!1),os=jc;function Yc(v,T){var R=v.type.contextTypes;if(!R)return jc;var F=v.stateNode;if(F&&F.__reactInternalMemoizedUnmaskedChildContext===T)return F.__reactInternalMemoizedMaskedChildContext;var Y={},ee;for(ee in R)Y[ee]=T[ee];return F&&(v=v.stateNode,v.__reactInternalMemoizedUnmaskedChildContext=T,v.__reactInternalMemoizedMaskedChildContext=Y),Y}function na(v){return v=v.childContextTypes,v!=null}function Od(){es(va),es(_a)}function Ld(v,T,R){if(_a.current!==jc)throw Error(t(168));ss(_a,T),ss(va,R)}function Yh(v,T,R){var F=v.stateNode;if(T=T.childContextTypes,typeof F.getChildContext!="function")return R;F=F.getChildContext();for(var Y in F)if(!(Y in T))throw Error(t(108,Qe(v)||"Unknown",Y));return ie({},R,F)}function Gs(v){return v=(v=v.stateNode)&&v.__reactInternalMemoizedMergedChildContext||jc,os=_a.current,ss(_a,v),ss(va,va.current),!0}function Kn(v,T,R){var F=v.stateNode;if(!F)throw Error(t(169));R?(v=Yh(v,T,os),F.__reactInternalMemoizedMergedChildContext=v,es(va),es(_a),ss(_a,v)):es(va),ss(va,R)}var Ws=null,Js=!1,Ui=!1;function iu(v){Ws===null?Ws=[v]:Ws.push(v)}function Fo(v){Js=!0,iu(v)}function xn(){if(!Ui&&Ws!==null){Ui=!0;var v=0,T=vr;try{var R=Ws;for(vr=1;v>=be,Y-=be,yn=1<<32-Gr(T)+Y|R<Lr?(Ul=fr,fr=null):Ul=fr.sibling;var ds=an(xt,fr,Et[Lr],Sn);if(ds===null){fr===null&&(fr=Ul);break}v&&fr&&ds.alternate===null&&T(xt,fr),dt=ee(ds,dt,Lr),nr===null?lr=ds:nr.sibling=ds,nr=ds,fr=Ul}if(Lr===Et.length)return R(xt,fr),as&&vc(xt,Lr),lr;if(fr===null){for(;LrLr?(Ul=fr,fr=null):Ul=fr.sibling;var Qf=an(xt,fr,ds.value,Sn);if(Qf===null){fr===null&&(fr=Ul);break}v&&fr&&Qf.alternate===null&&T(xt,fr),dt=ee(Qf,dt,Lr),nr===null?lr=Qf:nr.sibling=Qf,nr=Qf,fr=Ul}if(ds.done)return R(xt,fr),as&&vc(xt,Lr),lr;if(fr===null){for(;!ds.done;Lr++,ds=Et.next())ds=hn(xt,ds.value,Sn),ds!==null&&(dt=ee(ds,dt,Lr),nr===null?lr=ds:nr.sibling=ds,nr=ds);return as&&vc(xt,Lr),lr}for(fr=F(xt,fr);!ds.done;Lr++,ds=Et.next())ds=Dn(fr,xt,Lr,ds.value,Sn),ds!==null&&(v&&ds.alternate!==null&&fr.delete(ds.key===null?Lr:ds.key),dt=ee(ds,dt,Lr),nr===null?lr=ds:nr.sibling=ds,nr=ds);return v&&fr.forEach(function($0){return T(xt,$0)}),as&&vc(xt,Lr),lr}function Io(xt,dt,Et,Sn){if(typeof Et=="object"&&Et!==null&&Et.type===V&&Et.key===null&&(Et=Et.props.children),typeof Et=="object"&&Et!==null){switch(Et.$$typeof){case z:e:{for(var lr=Et.key,nr=dt;nr!==null;){if(nr.key===lr){if(lr=Et.type,lr===V){if(nr.tag===7){R(xt,nr.sibling),dt=Y(nr,Et.props.children),dt.return=xt,xt=dt;break e}}else if(nr.elementType===lr||typeof lr=="object"&&lr!==null&&lr.$$typeof===ge&&ho(lr)===nr.type){R(xt,nr.sibling),dt=Y(nr,Et.props),dt.ref=Qu(xt,nr,Et),dt.return=xt,xt=dt;break e}R(xt,nr);break}else T(xt,nr);nr=nr.sibling}Et.type===V?(dt=Yf(Et.props.children,xt.mode,Sn,Et.key),dt.return=xt,xt=dt):(Sn=hm(Et.type,Et.key,Et.props,null,xt.mode,Sn),Sn.ref=Qu(xt,dt,Et),Sn.return=xt,xt=Sn)}return be(xt);case U:e:{for(nr=Et.key;dt!==null;){if(dt.key===nr)if(dt.tag===4&&dt.stateNode.containerInfo===Et.containerInfo&&dt.stateNode.implementation===Et.implementation){R(xt,dt.sibling),dt=Y(dt,Et.children||[]),dt.return=xt,xt=dt;break e}else{R(xt,dt);break}else T(xt,dt);dt=dt.sibling}dt=bd(Et,xt.mode,Sn),dt.return=xt,xt=dt}return be(xt);case ge:return nr=Et._init,Io(xt,dt,nr(Et._payload),Sn)}if(At(Et))return Zn(xt,dt,Et,Sn);if(re(Et))return ir(xt,dt,Et,Sn);qs(xt,Et)}return typeof Et=="string"&&Et!==""||typeof Et=="number"?(Et=""+Et,dt!==null&&dt.tag===6?(R(xt,dt.sibling),dt=Y(dt,Et),dt.return=xt,xt=dt):(R(xt,dt),dt=kp(Et,xt.mode,Sn),dt.return=xt,xt=dt),be(xt)):R(xt,dt)}return Io}var ba=vd(!0),Mu=vd(!1),Au={},fo=hi(Au),po=hi(Au),Ll=hi(Au);function Ho(v){if(v===Au)throw Error(t(174));return v}function Zu(v,T){switch(ss(Ll,T),ss(po,v),ss(fo,Au),v=T.nodeType,v){case 9:case 11:T=(T=T.documentElement)?T.namespaceURI:It(null,"");break;default:v=v===8?T.parentNode:T,T=v.namespaceURI||null,v=v.tagName,T=It(T,v)}es(fo),ss(fo,T)}function ec(){es(fo),es(po),es(Ll)}function xh(v){Ho(Ll.current);var T=Ho(fo.current),R=It(T,v.type);T!==R&&(ss(po,v),ss(fo,R))}function $h(v){po.current===v&&(es(fo),es(po))}var Or=hi(0);function bs(v){for(var T=v;T!==null;){if(T.tag===13){var R=T.memoizedState;if(R!==null&&(R=R.dehydrated,R===null||R.data==="$?"||R.data==="$!"))return T}else if(T.tag===19&&T.memoizedProps.revealOrder!==void 0){if(T.flags&128)return T}else if(T.child!==null){T.child.return=T,T=T.child;continue}if(T===v)break;for(;T.sibling===null;){if(T.return===null||T.return===v)return null;T=T.return}T.sibling.return=T.return,T=T.sibling}return null}var Os=[];function Ya(){for(var v=0;vR?R:4,v(!0);var F=fn.transition;fn.transition={};try{v(!1),T()}finally{vr=R,fn.transition=F}}function Ta(){return Xi().memoizedState}function Sa(v,T,R){var F=Wd(v);if(R={lane:F,action:R,hasEagerState:!1,eagerState:null,next:null},Ec(v))Hf(T,R);else if(R=_i(v,T,R,F),R!==null){var Y=Cc();sa(R,v,F,Y),x(R,T,F)}}function Qh(v,T,R){var F=Wd(v),Y={lane:F,action:R,hasEagerState:!1,eagerState:null,next:null};if(Ec(v))Hf(T,Y);else{var ee=v.alternate;if(v.lanes===0&&(ee===null||ee.lanes===0)&&(ee=T.lastRenderedReducer,ee!==null))try{var be=T.lastRenderedState,Ye=ee(be,R);if(Y.hasEagerState=!0,Y.eagerState=Ye,Be(Ye,be)){var at=T.interleaved;at===null?(Y.next=Y,Kc(T)):(Y.next=at.next,at.next=Y),T.interleaved=Y;return}}catch{}finally{}R=_i(v,T,Y,F),R!==null&&(Y=Cc(),sa(R,v,F,Y),x(R,T,F))}}function Ec(v){var T=v.alternate;return v===wn||T!==null&&T===wn}function Hf(v,T){Nl=lu=!0;var R=v.pending;R===null?T.next=T:(T.next=R.next,R.next=T),v.pending=T}function x(v,T,R){if(R&4194240){var F=T.lanes;F&=v.pendingLanes,R|=F,T.lanes=R,qo(v,R)}}var d={readContext:$s,useCallback:jr,useContext:jr,useEffect:jr,useImperativeHandle:jr,useInsertionEffect:jr,useLayoutEffect:jr,useMemo:jr,useReducer:jr,useRef:jr,useState:jr,useDebugValue:jr,useDeferredValue:jr,useTransition:jr,useMutableSource:jr,useSyncExternalStore:jr,useId:jr,unstable_isNewReconciler:!1},_={readContext:$s,useCallback:function(v,T){return oi().memoizedState=[v,T===void 0?null:T],v},useContext:$s,useEffect:_o,useImperativeHandle:function(v,T,R){return R=R!=null?R.concat([v]):null,wc(4194308,4,Pl.bind(null,T,v),R)},useLayoutEffect:function(v,T){return wc(4194308,4,v,T)},useInsertionEffect:function(v,T){return wc(4,2,v,T)},useMemo:function(v,T){var R=oi();return T=T===void 0?null:T,v=v(),R.memoizedState=[v,T],v},useReducer:function(v,T,R){var F=oi();return T=R!==void 0?R(T):T,F.memoizedState=F.baseState=T,v={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:v,lastRenderedState:T},F.queue=v,v=v.dispatch=Sa.bind(null,wn,v),[F.memoizedState,v]},useRef:function(v){var T=oi();return v={current:v},T.memoizedState=v},useState:go,useDebugValue:uu,useDeferredValue:function(v){return oi().memoizedState=v},useTransition:function(){var v=go(!1),T=v[0];return v=yd.bind(null,v[1]),oi().memoizedState=v,[T,v]},useMutableSource:function(){},useSyncExternalStore:function(v,T,R){var F=wn,Y=oi();if(as){if(R===void 0)throw Error(t(407));R=R()}else{if(R=T(),hu===null)throw Error(t(349));Jc&30||nc(F,T,R)}Y.memoizedState=R;var ee={value:R,getSnapshot:T};return Y.queue=ee,_o(Qs.bind(null,F,ee,v),[v]),F.flags|=2048,Iu(9,Ao.bind(null,F,ee,R,T),void 0,null),R},useId:function(){var v=oi(),T=hu.identifierPrefix;if(as){var R=hl,F=yn;R=(F&~(1<<32-Gr(F)-1)).toString(32)+R,T=":"+T+"R"+R,R=Ft++,0Xe||Y[be]!==ee[Xe]){var lt=` +`+Y[be].replace(" at new "," at ");return v.displayName&<.includes("")&&(lt=lt.replace("",v.displayName)),lt}while(1<=be&&0<=Xe);break}}}finally{Fe=!1,Error.prepareStackTrace=R}return(v=v?v.displayName||v.name:"")?Te(v):""}function qe(v){switch(v.tag){case 5:return Te(v.type);case 16:return Te("Lazy");case 13:return Te("Suspense");case 19:return Te("SuspenseList");case 0:case 2:case 15:return v=Ie(v.type,!1),v;case 11:return v=Ie(v.type.render,!1),v;case 1:return v=Ie(v.type,!0),v;default:return""}}function Re(v){if(v==null)return null;if(typeof v=="function")return v.displayName||v.name||null;if(typeof v=="string")return v;switch(v){case V:return"Fragment";case U:return"Portal";case oe:return"Profiler";case H:return"StrictMode";case he:return"Suspense";case ae:return"SuspenseList"}if(typeof v=="object")switch(v.$$typeof){case Z:return(v.displayName||"Context")+".Consumer";case le:return(v._context.displayName||"Context")+".Provider";case q:var T=v.render;return v=v.displayName,v||(v=T.displayName||T.name||"",v=v!==""?"ForwardRef("+v+")":"ForwardRef"),v;case ue:return T=v.displayName||null,T!==null?T:Re(v.type)||"Memo";case ge:T=v._payload,v=v._init;try{return Re(v(T))}catch{}}return null}function Ze(v){var T=v.type;switch(v.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 v=T.render,v=v.displayName||v.name||"",T.displayName||(v!==""?"ForwardRef("+v+")":"ForwardRef");case 7:return"Fragment";case 5:return T;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Re(T);case 8:return T===H?"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(typeof T=="function")return T.displayName||T.name||null;if(typeof T=="string")return T}return null}function rt(v){switch(typeof v){case"boolean":case"number":case"string":case"undefined":return v;case"object":return v;default:return""}}function ft(v){var T=v.type;return(v=v.nodeName)&&v.toLowerCase()==="input"&&(T==="checkbox"||T==="radio")}function ut(v){var T=ft(v)?"checked":"value",R=Object.getOwnPropertyDescriptor(v.constructor.prototype,T),F=""+v[T];if(!v.hasOwnProperty(T)&&typeof R<"u"&&typeof R.get=="function"&&typeof R.set=="function"){var Y=R.get,ee=R.set;return Object.defineProperty(v,T,{configurable:!0,get:function(){return Y.call(this)},set:function(be){F=""+be,ee.call(this,be)}}),Object.defineProperty(v,T,{enumerable:R.enumerable}),{getValue:function(){return F},setValue:function(be){F=""+be},stopTracking:function(){v._valueTracker=null,delete v[T]}}}}function ze(v){v._valueTracker||(v._valueTracker=ut(v))}function $e(v){if(!v)return!1;var T=v._valueTracker;if(!T)return!0;var R=T.getValue(),F="";return v&&(F=ft(v)?v.checked?"true":"false":v.value),v=F,v!==R?(T.setValue(v),!0):!1}function He(v){if(v=v||(typeof document<"u"?document:void 0),typeof v>"u")return null;try{return v.activeElement||v.body}catch{return v.body}}function it(v,T){var R=T.checked;return se({},T,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:R??v._wrapperState.initialChecked})}function st(v,T){var R=T.defaultValue==null?"":T.defaultValue,F=T.checked!=null?T.checked:T.defaultChecked;R=rt(T.value!=null?T.value:R),v._wrapperState={initialChecked:F,initialValue:R,controlled:T.type==="checkbox"||T.type==="radio"?T.checked!=null:T.value!=null}}function Nt(v,T){T=T.checked,T!=null&&P(v,"checked",T,!1)}function kt(v,T){Nt(v,T);var R=rt(T.value),F=T.type;if(R!=null)F==="number"?(R===0&&v.value===""||v.value!=R)&&(v.value=""+R):v.value!==""+R&&(v.value=""+R);else if(F==="submit"||F==="reset"){v.removeAttribute("value");return}T.hasOwnProperty("value")?Ct(v,T.type,R):T.hasOwnProperty("defaultValue")&&Ct(v,T.type,rt(T.defaultValue)),T.checked==null&&T.defaultChecked!=null&&(v.defaultChecked=!!T.defaultChecked)}function vt(v,T,R){if(T.hasOwnProperty("value")||T.hasOwnProperty("defaultValue")){var F=T.type;if(!(F!=="submit"&&F!=="reset"||T.value!==void 0&&T.value!==null))return;T=""+v._wrapperState.initialValue,R||T===v.value||(v.value=T),v.defaultValue=T}R=v.name,R!==""&&(v.name=""),v.defaultChecked=!!v._wrapperState.initialChecked,R!==""&&(v.name=R)}function Ct(v,T,R){(T!=="number"||He(v.ownerDocument)!==v)&&(R==null?v.defaultValue=""+v._wrapperState.initialValue:v.defaultValue!==""+R&&(v.defaultValue=""+R))}var At=Array.isArray;function gt(v,T,R,F){if(v=v.options,T){T={};for(var Y=0;Y"+T.valueOf().toString()+"",T=mt.firstChild;v.firstChild;)v.removeChild(v.firstChild);for(;T.firstChild;)v.appendChild(T.firstChild)}});function Oe(v,T){if(T){var R=v.firstChild;if(R&&R===v.lastChild&&R.nodeType===3){R.nodeValue=T;return}}v.textContent=T}var Q={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},te=["Webkit","ms","Moz","O"];Object.keys(Q).forEach(function(v){te.forEach(function(T){T=T+v.charAt(0).toUpperCase()+v.substring(1),Q[T]=Q[v]})});function pe(v,T,R){return T==null||typeof T=="boolean"||T===""?"":R||typeof T!="number"||T===0||Q.hasOwnProperty(v)&&Q[v]?(""+T).trim():T+"px"}function Ae(v,T){v=v.style;for(var R in T)if(T.hasOwnProperty(R)){var F=R.indexOf("--")===0,Y=pe(R,T[R],F);R==="float"&&(R="cssFloat"),F?v.setProperty(R,Y):v[R]=Y}}var Je=se({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 jt(v,T){if(T){if(Je[v]&&(T.children!=null||T.dangerouslySetInnerHTML!=null))throw Error(t(137,v));if(T.dangerouslySetInnerHTML!=null){if(T.children!=null)throw Error(t(60));if(typeof T.dangerouslySetInnerHTML!="object"||!("__html"in T.dangerouslySetInnerHTML))throw Error(t(61))}if(T.style!=null&&typeof T.style!="object")throw Error(t(62))}}function Ge(v,T){if(v.indexOf("-")===-1)return typeof T.is=="string";switch(v){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 qt=null;function pt(v){return v=v.target||v.srcElement||window,v.correspondingUseElement&&(v=v.correspondingUseElement),v.nodeType===3?v.parentNode:v}var Jt=null,Xt=null,xn=null;function ii(v){if(v=Cr(v)){if(typeof Jt!="function")throw Error(t(280));var T=v.stateNode;T&&(T=zf(T),Jt(v.stateNode,v.type,T))}}function Pr(v){Xt?xn?xn.push(v):xn=[v]:Xt=v}function Ei(){if(Xt){var v=Xt,T=xn;if(xn=Xt=null,ii(v),T)for(v=0;v>>=0,v===0?32:31-(yr(v)/Pi|0)|0}var fi=64,gs=4194304;function tl(v){switch(v&-v){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 v&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return v&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return v}}function Na(v,T){var R=v.pendingLanes;if(R===0)return 0;var F=0,Y=v.suspendedLanes,ee=v.pingedLanes,be=R&268435455;if(be!==0){var Xe=be&~Y;Xe!==0?F=tl(Xe):(ee&=be,ee!==0&&(F=tl(ee)))}else be=R&~Y,be!==0?F=tl(be):ee!==0&&(F=tl(ee));if(F===0)return 0;if(T!==0&&T!==F&&!(T&Y)&&(Y=F&-F,ee=T&-T,Y>=ee||Y===16&&(ee&4194240)!==0))return T;if(F&4&&(F|=R&16),T=v.entangledLanes,T!==0)for(v=v.entanglements,T&=F;0R;R++)T.push(v);return T}function gu(v,T,R){v.pendingLanes|=T,T!==536870912&&(v.suspendedLanes=0,v.pingedLanes=0),v=v.eventTimes,T=31-Gr(T),v[T]=R}function mh(v,T){var R=v.pendingLanes&~T;v.pendingLanes=T,v.suspendedLanes=0,v.pingedLanes=0,v.expiredLanes&=T,v.mutableReadLanes&=T,v.entangledLanes&=T,T=v.entanglements;var F=v.eventTimes;for(v=v.expirationTimes;0=Sr),Eu=" ",cf=!1;function hf(v,T){switch(v){case"keyup":return Wr.indexOf(T.keyCode)!==-1;case"keydown":return T.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function pd(v){return v=v.detail,typeof v=="object"&&"data"in v?v.data:null}var Wu=!1;function ol(v,T){switch(v){case"compositionend":return pd(T);case"keypress":return T.which!==32?null:(cf=!0,Eu);case"textInput":return v=T.data,v===Eu&&cf?null:v;default:return null}}function Fc(v,T){if(Wu)return v==="compositionend"||!Ai&&hf(v,T)?(v=$i(),bi=Rs=wr=null,Wu=!1,v):null;switch(v){case"paste":return null;case"keypress":if(!(T.ctrlKey||T.altKey||T.metaKey)||T.ctrlKey&&T.altKey){if(T.char&&1=T)return{node:R,offset:T-v};v=F}e:{for(;R;){if(R.nextSibling){R=R.nextSibling;break e}R=R.parentNode}R=void 0}R=rn(R)}}function Jn(v,T){return v&&T?v===T?!0:v&&v.nodeType===3?!1:T&&T.nodeType===3?Jn(v,T.parentNode):"contains"in v?v.contains(T):v.compareDocumentPosition?!!(v.compareDocumentPosition(T)&16):!1:!1}function vn(){for(var v=window,T=He();T instanceof v.HTMLIFrameElement;){try{var R=typeof T.contentWindow.location.href=="string"}catch{R=!1}if(R)v=T.contentWindow;else break;T=He(v.document)}return T}function zr(v){var T=v&&v.nodeName&&v.nodeName.toLowerCase();return T&&(T==="input"&&(v.type==="text"||v.type==="search"||v.type==="tel"||v.type==="url"||v.type==="password")||T==="textarea"||v.contentEditable==="true")}function ao(v){var T=vn(),R=v.focusedElem,F=v.selectionRange;if(T!==R&&R&&R.ownerDocument&&Jn(R.ownerDocument.documentElement,R)){if(F!==null&&zr(R)){if(T=F.start,v=F.end,v===void 0&&(v=T),"selectionStart"in R)R.selectionStart=T,R.selectionEnd=Math.min(v,R.value.length);else if(v=(T=R.ownerDocument||document)&&T.defaultView||window,v.getSelection){v=v.getSelection();var Y=R.textContent.length,ee=Math.min(F.start,Y);F=F.end===void 0?ee:Math.min(F.end,Y),!v.extend&&ee>F&&(Y=F,F=ee,ee=Y),Y=Rn(R,ee);var be=Rn(R,F);Y&&be&&(v.rangeCount!==1||v.anchorNode!==Y.node||v.anchorOffset!==Y.offset||v.focusNode!==be.node||v.focusOffset!==be.offset)&&(T=T.createRange(),T.setStart(Y.node,Y.offset),v.removeAllRanges(),ee>F?(v.addRange(T),v.extend(be.node,be.offset)):(T.setEnd(be.node,be.offset),v.addRange(T)))}}for(T=[],v=R;v=v.parentNode;)v.nodeType===1&&T.push({element:v,left:v.scrollLeft,top:v.scrollTop});for(typeof R.focus=="function"&&R.focus(),R=0;R=document.documentMode,lo=null,al=null,Fi=null,vs=!1;function $u(v,T,R){var F=R.window===R?R.document:R.nodeType===9?R:R.ownerDocument;vs||lo==null||lo!==He(F)||(F=lo,"selectionStart"in F&&zr(F)?F={start:F.selectionStart,end:F.selectionEnd}:(F=(F.ownerDocument&&F.ownerDocument.defaultView||window).getSelection(),F={anchorNode:F.anchorNode,anchorOffset:F.anchorOffset,focusNode:F.focusNode,focusOffset:F.focusOffset}),Fi&&Ot(Fi,F)||(Fi=F,F=Rd(al,"onSelect"),0Ri||(v.current=cl[Ri],cl[Ri]=null,Ri--)}function ss(v,T){Ri++,cl[Ri]=v.current,v.current=T}var jc={},_a=hi(jc),va=hi(!1),os=jc;function Yc(v,T){var R=v.type.contextTypes;if(!R)return jc;var F=v.stateNode;if(F&&F.__reactInternalMemoizedUnmaskedChildContext===T)return F.__reactInternalMemoizedMaskedChildContext;var Y={},ee;for(ee in R)Y[ee]=T[ee];return F&&(v=v.stateNode,v.__reactInternalMemoizedUnmaskedChildContext=T,v.__reactInternalMemoizedMaskedChildContext=Y),Y}function na(v){return v=v.childContextTypes,v!=null}function Od(){es(va),es(_a)}function Ld(v,T,R){if(_a.current!==jc)throw Error(t(168));ss(_a,T),ss(va,R)}function Yh(v,T,R){var F=v.stateNode;if(T=T.childContextTypes,typeof F.getChildContext!="function")return R;F=F.getChildContext();for(var Y in F)if(!(Y in T))throw Error(t(108,Ze(v)||"Unknown",Y));return se({},R,F)}function Gs(v){return v=(v=v.stateNode)&&v.__reactInternalMemoizedMergedChildContext||jc,os=_a.current,ss(_a,v),ss(va,va.current),!0}function Kn(v,T,R){var F=v.stateNode;if(!F)throw Error(t(169));R?(v=Yh(v,T,os),F.__reactInternalMemoizedMergedChildContext=v,es(va),es(_a),ss(_a,v)):es(va),ss(va,R)}var Ws=null,Js=!1,Ui=!1;function iu(v){Ws===null?Ws=[v]:Ws.push(v)}function Fo(v){Js=!0,iu(v)}function $n(){if(!Ui&&Ws!==null){Ui=!0;var v=0,T=vr;try{var R=Ws;for(vr=1;v>=be,Y-=be,yn=1<<32-Gr(T)+Y|R<Lr?(Ul=fr,fr=null):Ul=fr.sibling;var ds=an(xt,fr,Et[Lr],Sn);if(ds===null){fr===null&&(fr=Ul);break}v&&fr&&ds.alternate===null&&T(xt,fr),dt=ee(ds,dt,Lr),nr===null?lr=ds:nr.sibling=ds,nr=ds,fr=Ul}if(Lr===Et.length)return R(xt,fr),as&&vc(xt,Lr),lr;if(fr===null){for(;LrLr?(Ul=fr,fr=null):Ul=fr.sibling;var Qf=an(xt,fr,ds.value,Sn);if(Qf===null){fr===null&&(fr=Ul);break}v&&fr&&Qf.alternate===null&&T(xt,fr),dt=ee(Qf,dt,Lr),nr===null?lr=Qf:nr.sibling=Qf,nr=Qf,fr=Ul}if(ds.done)return R(xt,fr),as&&vc(xt,Lr),lr;if(fr===null){for(;!ds.done;Lr++,ds=Et.next())ds=hn(xt,ds.value,Sn),ds!==null&&(dt=ee(ds,dt,Lr),nr===null?lr=ds:nr.sibling=ds,nr=ds);return as&&vc(xt,Lr),lr}for(fr=F(xt,fr);!ds.done;Lr++,ds=Et.next())ds=Dn(fr,xt,Lr,ds.value,Sn),ds!==null&&(v&&ds.alternate!==null&&fr.delete(ds.key===null?Lr:ds.key),dt=ee(ds,dt,Lr),nr===null?lr=ds:nr.sibling=ds,nr=ds);return v&&fr.forEach(function($0){return T(xt,$0)}),as&&vc(xt,Lr),lr}function Io(xt,dt,Et,Sn){if(typeof Et=="object"&&Et!==null&&Et.type===V&&Et.key===null&&(Et=Et.props.children),typeof Et=="object"&&Et!==null){switch(Et.$$typeof){case z:e:{for(var lr=Et.key,nr=dt;nr!==null;){if(nr.key===lr){if(lr=Et.type,lr===V){if(nr.tag===7){R(xt,nr.sibling),dt=Y(nr,Et.props.children),dt.return=xt,xt=dt;break e}}else if(nr.elementType===lr||typeof lr=="object"&&lr!==null&&lr.$$typeof===ge&&ho(lr)===nr.type){R(xt,nr.sibling),dt=Y(nr,Et.props),dt.ref=Qu(xt,nr,Et),dt.return=xt,xt=dt;break e}R(xt,nr);break}else T(xt,nr);nr=nr.sibling}Et.type===V?(dt=Yf(Et.props.children,xt.mode,Sn,Et.key),dt.return=xt,xt=dt):(Sn=hm(Et.type,Et.key,Et.props,null,xt.mode,Sn),Sn.ref=Qu(xt,dt,Et),Sn.return=xt,xt=Sn)}return be(xt);case U:e:{for(nr=Et.key;dt!==null;){if(dt.key===nr)if(dt.tag===4&&dt.stateNode.containerInfo===Et.containerInfo&&dt.stateNode.implementation===Et.implementation){R(xt,dt.sibling),dt=Y(dt,Et.children||[]),dt.return=xt,xt=dt;break e}else{R(xt,dt);break}else T(xt,dt);dt=dt.sibling}dt=bd(Et,xt.mode,Sn),dt.return=xt,xt=dt}return be(xt);case ge:return nr=Et._init,Io(xt,dt,nr(Et._payload),Sn)}if(At(Et))return Zn(xt,dt,Et,Sn);if(re(Et))return ir(xt,dt,Et,Sn);qs(xt,Et)}return typeof Et=="string"&&Et!==""||typeof Et=="number"?(Et=""+Et,dt!==null&&dt.tag===6?(R(xt,dt.sibling),dt=Y(dt,Et),dt.return=xt,xt=dt):(R(xt,dt),dt=kp(Et,xt.mode,Sn),dt.return=xt,xt=dt),be(xt)):R(xt,dt)}return Io}var ba=vd(!0),Mu=vd(!1),Au={},fo=hi(Au),po=hi(Au),Ll=hi(Au);function Ho(v){if(v===Au)throw Error(t(174));return v}function Zu(v,T){switch(ss(Ll,T),ss(po,v),ss(fo,Au),v=T.nodeType,v){case 9:case 11:T=(T=T.documentElement)?T.namespaceURI:It(null,"");break;default:v=v===8?T.parentNode:T,T=v.namespaceURI||null,v=v.tagName,T=It(T,v)}es(fo),ss(fo,T)}function ec(){es(fo),es(po),es(Ll)}function xh(v){Ho(Ll.current);var T=Ho(fo.current),R=It(T,v.type);T!==R&&(ss(po,v),ss(fo,R))}function $h(v){po.current===v&&(es(fo),es(po))}var Or=hi(0);function bs(v){for(var T=v;T!==null;){if(T.tag===13){var R=T.memoizedState;if(R!==null&&(R=R.dehydrated,R===null||R.data==="$?"||R.data==="$!"))return T}else if(T.tag===19&&T.memoizedProps.revealOrder!==void 0){if(T.flags&128)return T}else if(T.child!==null){T.child.return=T,T=T.child;continue}if(T===v)break;for(;T.sibling===null;){if(T.return===null||T.return===v)return null;T=T.return}T.sibling.return=T.return,T=T.sibling}return null}var Os=[];function Ya(){for(var v=0;vR?R:4,v(!0);var F=fn.transition;fn.transition={};try{v(!1),T()}finally{vr=R,fn.transition=F}}function Ta(){return Xi().memoizedState}function Sa(v,T,R){var F=Wd(v);if(R={lane:F,action:R,hasEagerState:!1,eagerState:null,next:null},Ec(v))Hf(T,R);else if(R=_i(v,T,R,F),R!==null){var Y=Cc();sa(R,v,F,Y),x(R,T,F)}}function Qh(v,T,R){var F=Wd(v),Y={lane:F,action:R,hasEagerState:!1,eagerState:null,next:null};if(Ec(v))Hf(T,Y);else{var ee=v.alternate;if(v.lanes===0&&(ee===null||ee.lanes===0)&&(ee=T.lastRenderedReducer,ee!==null))try{var be=T.lastRenderedState,Xe=ee(be,R);if(Y.hasEagerState=!0,Y.eagerState=Xe,Be(Xe,be)){var lt=T.interleaved;lt===null?(Y.next=Y,Kc(T)):(Y.next=lt.next,lt.next=Y),T.interleaved=Y;return}}catch{}finally{}R=_i(v,T,Y,F),R!==null&&(Y=Cc(),sa(R,v,F,Y),x(R,T,F))}}function Ec(v){var T=v.alternate;return v===wn||T!==null&&T===wn}function Hf(v,T){Nl=lu=!0;var R=v.pending;R===null?T.next=T:(T.next=R.next,R.next=T),v.pending=T}function x(v,T,R){if(R&4194240){var F=T.lanes;F&=v.pendingLanes,R|=F,T.lanes=R,qo(v,R)}}var d={readContext:$s,useCallback:jr,useContext:jr,useEffect:jr,useImperativeHandle:jr,useInsertionEffect:jr,useLayoutEffect:jr,useMemo:jr,useReducer:jr,useRef:jr,useState:jr,useDebugValue:jr,useDeferredValue:jr,useTransition:jr,useMutableSource:jr,useSyncExternalStore:jr,useId:jr,unstable_isNewReconciler:!1},_={readContext:$s,useCallback:function(v,T){return oi().memoizedState=[v,T===void 0?null:T],v},useContext:$s,useEffect:_o,useImperativeHandle:function(v,T,R){return R=R!=null?R.concat([v]):null,wc(4194308,4,Pl.bind(null,T,v),R)},useLayoutEffect:function(v,T){return wc(4194308,4,v,T)},useInsertionEffect:function(v,T){return wc(4,2,v,T)},useMemo:function(v,T){var R=oi();return T=T===void 0?null:T,v=v(),R.memoizedState=[v,T],v},useReducer:function(v,T,R){var F=oi();return T=R!==void 0?R(T):T,F.memoizedState=F.baseState=T,v={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:v,lastRenderedState:T},F.queue=v,v=v.dispatch=Sa.bind(null,wn,v),[F.memoizedState,v]},useRef:function(v){var T=oi();return v={current:v},T.memoizedState=v},useState:go,useDebugValue:uu,useDeferredValue:function(v){return oi().memoizedState=v},useTransition:function(){var v=go(!1),T=v[0];return v=yd.bind(null,v[1]),oi().memoizedState=v,[T,v]},useMutableSource:function(){},useSyncExternalStore:function(v,T,R){var F=wn,Y=oi();if(as){if(R===void 0)throw Error(t(407));R=R()}else{if(R=T(),hu===null)throw Error(t(349));Jc&30||nc(F,T,R)}Y.memoizedState=R;var ee={value:R,getSnapshot:T};return Y.queue=ee,_o(Qs.bind(null,F,ee,v),[v]),F.flags|=2048,Iu(9,Ao.bind(null,F,ee,R,T),void 0,null),R},useId:function(){var v=oi(),T=hu.identifierPrefix;if(as){var R=hl,F=yn;R=(F&~(1<<32-Gr(F)-1)).toString(32)+R,T=":"+T+"R"+R,R=Ft++,0<\/script>",v=v.removeChild(v.firstChild)):typeof F.is=="string"?v=be.createElement(R,{is:F.is}):(v=be.createElement(R),R==="select"&&(be=v,F.multiple?be.multiple=!0:F.size&&(be.size=F.size))):v=be.createElementNS(v,R),v[Vr]=T,v[ul]=F,_n(v,T,!1,!1),T.stateNode=v;e:{switch(be=Ge(R,F),R){case"dialog":zi("cancel",v),zi("close",v),Y=F;break;case"iframe":case"object":case"embed":zi("load",v),Y=F;break;case"video":case"audio":for(Y=0;Yih&&(T.flags|=128,F=!0,xc(ee,!1),T.lanes=4194304)}else{if(!F)if(v=bs(be),v!==null){if(T.flags|=128,F=!0,R=v.updateQueue,R!==null&&(T.updateQueue=R,T.flags|=4),xc(ee,!0),ee.tail===null&&ee.tailMode==="hidden"&&!be.alternate&&!as)return Zs(T),null}else 2*nn()-ee.renderingStartTime>ih&&R!==1073741824&&(T.flags|=128,F=!0,xc(ee,!1),T.lanes=4194304);ee.isBackwards?(be.sibling=T.child,T.child=be):(R=ee.last,R!==null?R.sibling=be:T.child=be,ee.last=be)}return ee.tail!==null?(T=ee.tail,ee.rendering=T,ee.tail=T.sibling,ee.renderingStartTime=nn(),T.sibling=null,R=Or.current,ss(Or,F?R&1|2:R&1),T):(Zs(T),null);case 22:case 23:return T0(),F=T.memoizedState!==null,v!==null&&v.memoizedState!==null!==F&&(T.flags|=8192),F&&T.mode&1?du&1073741824&&(Zs(T),T.subtreeFlags&6&&(T.flags|=8192)):Zs(T),null;case 24:return null;case 25:return null}throw Error(t(156,T.tag))}function Dd(v,T){switch($o(T),T.tag){case 1:return na(T.type)&&Od(),v=T.flags,v&65536?(T.flags=v&-65537|128,T):null;case 3:return ec(),es(va),es(_a),Ya(),v=T.flags,v&65536&&!(v&128)?(T.flags=v&-65537|128,T):null;case 5:return $h(T),null;case 13:if(es(Or),v=T.memoizedState,v!==null&&v.dehydrated!==null){if(T.alternate===null)throw Error(t(340));Uo()}return v=T.flags,v&65536?(T.flags=v&-65537|128,T):null;case 19:return es(Or),null;case 4:return ec(),null;case 10:return Ju(T.type._context),null;case 22:case 23:return T0(),null;case 24:return null;default:return null}}var Ka=!1,Ur=!1,Ea=typeof WeakSet=="function"?WeakSet:Set,Ve=null;function Oi(v,T){var R=v.ref;if(R!==null)if(typeof R=="function")try{R(null)}catch(F){oa(v,T,F)}else R.current=null}function eo(v,T,R){try{R()}catch(F){oa(v,T,F)}}var S_=!1;function $c(v,T){if(Xu=so,v=vn(),zr(v)){if("selectionStart"in v)var R={start:v.selectionStart,end:v.selectionEnd};else e:{R=(R=v.ownerDocument)&&R.defaultView||window;var F=R.getSelection&&R.getSelection();if(F&&F.rangeCount!==0){R=F.anchorNode;var Y=F.anchorOffset,ee=F.focusNode;F=F.focusOffset;try{R.nodeType,ee.nodeType}catch{R=null;break e}var be=0,Ye=-1,at=-1,Lt=0,Zt=0,hn=v,an=null;t:for(;;){for(var Dn;hn!==R||Y!==0&&hn.nodeType!==3||(Ye=be+Y),hn!==ee||F!==0&&hn.nodeType!==3||(at=be+F),hn.nodeType===3&&(be+=hn.nodeValue.length),(Dn=hn.firstChild)!==null;)an=hn,hn=Dn;for(;;){if(hn===v)break t;if(an===R&&++Lt===Y&&(Ye=be),an===ee&&++Zt===F&&(at=be),(Dn=hn.nextSibling)!==null)break;hn=an,an=hn.parentNode}hn=Dn}R=Ye===-1||at===-1?null:{start:Ye,end:at}}else R=null}R=R||{start:0,end:0}}else R=null;for(Ku={focusedElem:v,selectionRange:R},so=!1,Ve=T;Ve!==null;)if(T=Ve,v=T.child,(T.subtreeFlags&1028)!==0&&v!==null)v.return=T,Ve=v;else for(;Ve!==null;){T=Ve;try{var Zn=T.alternate;if(T.flags&1024)switch(T.tag){case 0:case 11:case 15:break;case 1:if(Zn!==null){var ir=Zn.memoizedProps,Io=Zn.memoizedState,xt=T.stateNode,dt=xt.getSnapshotBeforeUpdate(T.elementType===T.type?ir:Cu(T.type,ir),Io);xt.__reactInternalSnapshotBeforeUpdate=dt}break;case 3:var Et=T.stateNode.containerInfo;Et.nodeType===1?Et.textContent="":Et.nodeType===9&&Et.documentElement&&Et.removeChild(Et.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(t(163))}}catch(Sn){oa(T,T.return,Sn)}if(v=T.sibling,v!==null){v.return=T.return,Ve=v;break}Ve=T.return}return Zn=S_,S_=!1,Zn}function Ep(v,T,R){var F=T.updateQueue;if(F=F!==null?F.lastEffect:null,F!==null){var Y=F=F.next;do{if((Y.tag&v)===v){var ee=Y.destroy;Y.destroy=void 0,ee!==void 0&&eo(T,R,ee)}Y=Y.next}while(Y!==F)}}function tm(v,T){if(T=T.updateQueue,T=T!==null?T.lastEffect:null,T!==null){var R=T=T.next;do{if((R.tag&v)===v){var F=R.create;R.destroy=F()}R=R.next}while(R!==T)}}function w_(v){var T=v.ref;if(T!==null){var R=v.stateNode;switch(v.tag){case 5:v=R;break;default:v=R}typeof T=="function"?T(v):T.current=v}}function xp(v){var T=v.alternate;T!==null&&(v.alternate=null,xp(T)),v.child=null,v.deletions=null,v.sibling=null,v.tag===5&&(T=v.stateNode,T!==null&&(delete T[Vr],delete T[ul],delete T[ma],delete T[X],delete T[xs])),v.stateNode=null,v.return=null,v.dependencies=null,v.memoizedProps=null,v.memoizedState=null,v.pendingProps=null,v.stateNode=null,v.updateQueue=null}function xa(v){return v.tag===5||v.tag===3||v.tag===4}function Ag(v){e:for(;;){for(;v.sibling===null;){if(v.return===null||xa(v.return))return null;v=v.return}for(v.sibling.return=v.return,v=v.sibling;v.tag!==5&&v.tag!==6&&v.tag!==18;){if(v.flags&2||v.child===null||v.tag===4)continue e;v.child.return=v,v=v.child}if(!(v.flags&2))return v.stateNode}}function nm(v,T,R){var F=v.tag;if(F===5||F===6)v=v.stateNode,T?R.nodeType===8?R.parentNode.insertBefore(v,T):R.insertBefore(v,T):(R.nodeType===8?(T=R.parentNode,T.insertBefore(v,R)):(T=R,T.appendChild(v)),R=R._reactRootContainer,R!=null||T.onclick!==null||(T.onclick=ru));else if(F!==4&&(v=v.child,v!==null))for(nm(v,T,R),v=v.sibling;v!==null;)nm(v,T,R),v=v.sibling}function $p(v,T,R){var F=v.tag;if(F===5||F===6)v=v.stateNode,T?R.insertBefore(v,T):R.appendChild(v);else if(F!==4&&(v=v.child,v!==null))for($p(v,T,R),v=v.sibling;v!==null;)$p(v,T,R),v=v.sibling}var _l=null,cu=!1;function Pd(v,T,R){for(R=R.child;R!==null;)gf(v,T,R),R=R.sibling}function gf(v,T,R){if(An&&typeof An.onCommitFiberUnmount=="function")try{An.onCommitFiberUnmount(kr,R)}catch{}switch(R.tag){case 5:Ur||Oi(R,T);case 6:var F=_l,Y=cu;_l=null,Pd(v,T,R),_l=F,cu=Y,_l!==null&&(cu?(v=_l,R=R.stateNode,v.nodeType===8?v.parentNode.removeChild(R):v.removeChild(R)):_l.removeChild(R.stateNode));break;case 18:_l!==null&&(cu?(v=_l,R=R.stateNode,v.nodeType===8?Vc(v.parentNode,R):v.nodeType===1&&Vc(v,R),Gn(v)):Vc(_l,R.stateNode));break;case 4:F=_l,Y=cu,_l=R.stateNode.containerInfo,cu=!0,Pd(v,T,R),_l=F,cu=Y;break;case 0:case 11:case 14:case 15:if(!Ur&&(F=R.updateQueue,F!==null&&(F=F.lastEffect,F!==null))){Y=F=F.next;do{var ee=Y,be=ee.destroy;ee=ee.tag,be!==void 0&&(ee&2||ee&4)&&eo(R,T,be),Y=Y.next}while(Y!==F)}Pd(v,T,R);break;case 1:if(!Ur&&(Oi(R,T),F=R.stateNode,typeof F.componentWillUnmount=="function"))try{F.props=R.memoizedProps,F.state=R.memoizedState,F.componentWillUnmount()}catch(Ye){oa(R,T,Ye)}Pd(v,T,R);break;case 21:Pd(v,T,R);break;case 22:R.mode&1?(Ur=(F=Ur)||R.memoizedState!==null,Pd(v,T,R),Ur=F):Pd(v,T,R);break;default:Pd(v,T,R)}}function Bd(v){var T=v.updateQueue;if(T!==null){v.updateQueue=null;var R=v.stateNode;R===null&&(R=v.stateNode=new Ea),T.forEach(function(F){var Y=sb.bind(null,v,F);R.has(F)||(R.add(F),F.then(Y,Y))})}}function nh(v,T){var R=T.deletions;if(R!==null)for(var F=0;FY&&(Y=be),F&=~ee}if(F=Y,F=nn()-F,F=(120>F?120:480>F?480:1080>F?1080:1920>F?1920:3e3>F?3e3:4320>F?4320:1960*im(F/1960))-F,10v?16:v,Ls===null)var F=!1;else{if(v=Ls,Ls=null,zl=0,(ns&6)!==0)throw Error(t(331));var Y=ns;for(ns|=4,Ve=v.current;Ve!==null;){var ee=Ve,be=ee.child;if(Ve.flags&16){var Ye=ee.deletions;if(Ye!==null){for(var at=0;atnn()-yl?lm(v,0):Rg|=R),$a(v,T)}function x0(v,T){T===0&&(v.mode&1?(T=gs,gs<<=1,!(gs&130023424)&&(gs=4194304)):T=1);var R=Cc();v=ja(v,T),v!==null&&(gu(v,T,R),$a(v,R))}function cm(v){var T=v.memoizedState,R=0;T!==null&&(R=T.retryLane),x0(v,R)}function sb(v,T){var R=0;switch(v.tag){case 13:var F=v.stateNode,Y=v.memoizedState;Y!==null&&(R=Y.retryLane);break;case 19:F=v.stateNode;break;default:throw Error(t(314))}F!==null&&F.delete(T),x0(v,R)}var Rv;Rv=function(v,T,R){if(v!==null)if(v.memoizedProps!==T.pendingProps||va.current)gn=!0;else{if(!(v.lanes&R)&&!(T.flags&128))return gn=!1,hs(v,T,R);gn=(v.flags&131072)!==0}else gn=!1,as&&T.flags&1048576&&wp(T,wh,T.index);switch(T.lanes=0,T.tag){case 2:var F=T.type;mf(v,T),v=T.pendingProps;var Y=Yc(T,_a.current);Va(T,R),Y=Jh(null,T,F,v,Y,R);var ee=qc();return T.flags|=1,typeof Y=="object"&&Y!==null&&typeof Y.render=="function"&&Y.$$typeof===void 0?(T.tag=1,T.memoizedState=null,T.updateQueue=null,na(F)?(ee=!0,Gs(T)):ee=!1,T.memoizedState=Y.state!==null&&Y.state!==void 0?Y.state:null,ff(T),Y.updater=us,T.stateNode=Y,Y._reactInternals=T,Tc(T,F,v,R),T=Rn(null,T,F,!0,ee,R)):(T.tag=0,as&&ee&&su(T),Dr(null,T,Y,R),T=T.child),T;case 16:F=T.elementType;e:{switch(mf(v,T),v=T.pendingProps,Y=F._init,F=Y(F._payload),T.type=F,Y=T.tag=jf(F),v=Cu(F,v),Y){case 0:T=on(null,T,F,v,R);break e;case 1:T=En(null,T,F,v,R);break e;case 11:T=Tt(null,T,F,v,R);break e;case 14:T=Me(null,T,F,Cu(F.type,v),R);break e}throw Error(t(306,F,""))}return T;case 0:return F=T.type,Y=T.pendingProps,Y=T.elementType===F?Y:Cu(F,Y),on(v,T,F,Y,R);case 1:return F=T.type,Y=T.pendingProps,Y=T.elementType===F?Y:Cu(F,Y),En(v,T,F,Y,R);case 3:e:{if(zn(T),v===null)throw Error(t(387));F=T.pendingProps,ee=T.memoizedState,Y=ee.element,Eh(v,T),Nr(T,F,null,R);var be=T.memoizedState;if(F=be.element,ee.isDehydrated)if(ee={element:F,isDehydrated:!1,cache:be.cache,pendingSuspenseBoundaries:be.pendingSuspenseBoundaries,transitions:be.transitions},T.updateQueue.baseState=ee,T.memoizedState=ee,T.flags&256){Y=B(Error(t(423)),T),T=cr(v,T,F,R,Y);break e}else if(F!==Y){Y=B(Error(t(424)),T),T=cr(v,T,F,R,Y);break e}else for(dl=_c(T.stateNode.containerInfo.firstChild),ys=T,as=!0,fl=null,R=Mu(T,null,F,R),T.child=R;R;)R.flags=R.flags&-3|4096,R=R.sibling;else{if(Uo(),F===Y){T=Zh(v,T,R);break e}Dr(v,T,F,R)}T=T.child}return T;case 5:return xh(T),v===null&&ki(T),F=T.type,Y=T.pendingProps,ee=v!==null?v.memoizedProps:null,be=Y.children,Sh(F,Y)?be=null:ee!==null&&Sh(F,ee)&&(T.flags|=32),Ht(v,T),Dr(v,T,be,R),T.child;case 6:return v===null&&ki(T),null;case 13:return pf(v,T,R);case 4:return Zu(T,T.stateNode.containerInfo),F=T.pendingProps,v===null?T.child=ba(T,null,F,R):Dr(v,T,F,R),T.child;case 11:return F=T.type,Y=T.pendingProps,Y=T.elementType===F?Y:Cu(F,Y),Tt(v,T,F,Y,R);case 7:return Dr(v,T,T.pendingProps,R),T.child;case 8:return Dr(v,T,T.pendingProps.children,R),T.child;case 12:return Dr(v,T,T.pendingProps.children,R),T.child;case 10:e:{if(F=T.type._context,Y=T.pendingProps,ee=T.memoizedProps,be=Y.value,ss(Ol,F._currentValue),F._currentValue=be,ee!==null)if(Be(ee.value,be)){if(ee.children===Y.children&&!va.current){T=Zh(v,T,R);break e}}else for(ee=T.child,ee!==null&&(ee.return=T);ee!==null;){var Ye=ee.dependencies;if(Ye!==null){be=ee.child;for(var at=Ye.firstContext;at!==null;){if(at.context===F){if(ee.tag===1){at=ra(-1,R&-R),at.tag=2;var Lt=ee.updateQueue;if(Lt!==null){Lt=Lt.shared;var Zt=Lt.pending;Zt===null?at.next=at:(at.next=Zt.next,Zt.next=at),Lt.pending=at}}ee.lanes|=R,at=ee.alternate,at!==null&&(at.lanes|=R),ls(ee.return,R,T),Ye.lanes|=R;break}at=at.next}}else if(ee.tag===10)be=ee.type===T.type?null:ee.child;else if(ee.tag===18){if(be=ee.return,be===null)throw Error(t(341));be.lanes|=R,Ye=be.alternate,Ye!==null&&(Ye.lanes|=R),ls(be,R,T),be=ee.sibling}else be=ee.child;if(be!==null)be.return=ee;else for(be=ee;be!==null;){if(be===T){be=null;break}if(ee=be.sibling,ee!==null){ee.return=be.return,be=ee;break}be=be.return}ee=be}Dr(v,T,Y.children,R),T=T.child}return T;case 9:return Y=T.type,F=T.pendingProps.children,Va(T,R),Y=$s(Y),F=F(Y),T.flags|=1,Dr(v,T,F,R),T.child;case 14:return F=T.type,Y=Cu(F,T.pendingProps),Y=Cu(F.type,Y),Me(v,T,F,Y,R);case 15:return Ne(v,T,T.type,T.pendingProps,R);case 17:return F=T.type,Y=T.pendingProps,Y=T.elementType===F?Y:Cu(F,Y),mf(v,T),T.tag=1,na(F)?(v=!0,Gs(T)):v=!1,Va(T,R),au(T,F,Y),Tc(T,F,Y,R),Rn(null,T,F,!0,v,R);case 19:return gl(v,T,R);case 22:return st(v,T,R)}throw Error(t(156,T.tag))};function oh(v,T){return Ss(v,T)}function To(v,T,R,F){this.tag=v,this.key=R,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=F,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ou(v,T,R,F){return new To(v,T,R,F)}function Og(v){return v=v.prototype,!(!v||!v.isReactComponent)}function jf(v){if(typeof v=="function")return Og(v)?1:0;if(v!=null){if(v=v.$$typeof,v===q)return 11;if(v===ue)return 14}return 2}function ed(v,T){var R=v.alternate;return R===null?(R=Ou(v.tag,T,v.key,v.mode),R.elementType=v.elementType,R.type=v.type,R.stateNode=v.stateNode,R.alternate=v,v.alternate=R):(R.pendingProps=T,R.type=v.type,R.flags=0,R.subtreeFlags=0,R.deletions=null),R.flags=v.flags&14680064,R.childLanes=v.childLanes,R.lanes=v.lanes,R.child=v.child,R.memoizedProps=v.memoizedProps,R.memoizedState=v.memoizedState,R.updateQueue=v.updateQueue,T=v.dependencies,R.dependencies=T===null?null:{lanes:T.lanes,firstContext:T.firstContext},R.sibling=v.sibling,R.index=v.index,R.ref=v.ref,R}function hm(v,T,R,F,Y,ee){var be=2;if(F=v,typeof v=="function")Og(v)&&(be=1);else if(typeof v=="string")be=5;else e:switch(v){case V:return Yf(R.children,Y,ee,T);case H:be=8,Y|=8;break;case oe:return v=Ou(12,R,T,Y|2),v.elementType=oe,v.lanes=ee,v;case he:return v=Ou(13,R,T,Y),v.elementType=he,v.lanes=ee,v;case ae:return v=Ou(19,R,T,Y),v.elementType=ae,v.lanes=ee,v;case we:return Xf(R,Y,ee,T);default:if(typeof v=="object"&&v!==null)switch(v.$$typeof){case le:be=10;break e;case Z:be=9;break e;case q:be=11;break e;case ue:be=14;break e;case ge:be=16,F=null;break e}throw Error(t(130,v==null?v:typeof v,""))}return T=Ou(be,R,T,Y),T.elementType=v,T.type=F,T.lanes=ee,T}function Yf(v,T,R,F){return v=Ou(7,v,F,T),v.lanes=R,v}function Xf(v,T,R,F){return v=Ou(22,v,F,T),v.elementType=we,v.lanes=R,v.stateNode={isHidden:!1},v}function kp(v,T,R){return v=Ou(6,v,null,T),v.lanes=R,v}function bd(v,T,R){return T=Ou(4,v.children!==null?v.children:[],v.key,T),T.lanes=R,T.stateNode={containerInfo:v.containerInfo,pendingChildren:null,implementation:v.implementation},T}function yf(v,T,R,F,Y){this.tag=T,this.containerInfo=v,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Xl(0),this.expirationTimes=Xl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Xl(0),this.identifierPrefix=F,this.onRecoverableError=Y,this.mutableSourceEagerHydrationData=null}function eg(v,T,R,F,Y,ee,be,Ye,at){return v=new yf(v,T,R,Ye,at),T===1?(T=1,ee===!0&&(T|=8)):T=0,ee=Ou(3,null,null,T),v.current=ee,ee.stateNode=v,ee.memoizedState={element:F,isDehydrated:R,cache:null,transitions:null,pendingSuspenseBoundaries:null},ff(ee),v}function kv(v,T,R){var F=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}e(),n.exports=fAe()})(UZ);var HZ,cW=UZ.exports;HZ=cW.createRoot,cW.hydrateRoot;const FC=new Ae,C4=new Ae,pAe=new Ae;function mAe(n,e,t){const r=FC.setFromMatrixPosition(n.matrixWorld);r.project(e);const s=t.width/2,o=t.height/2;return[r.x*s+s,-(r.y*o)+o]}function gAe(n,e){const t=FC.setFromMatrixPosition(n.matrixWorld),r=C4.setFromMatrixPosition(e.matrixWorld),s=t.sub(r),o=e.getWorldDirection(pAe);return s.angleTo(o)>Math.PI/2}function _Ae(n,e,t,r){const s=FC.setFromMatrixPosition(n.matrixWorld),o=s.clone();o.project(e),t.setFromCamera(o,e);const l=t.intersectObjects(r,!0);if(l.length){const u=l[0].distance;return s.distanceTo(t.ray.origin)Math.abs(n)<1e-10?0:n;function GZ(n,e,t=""){let r="matrix3d(";for(let s=0;s!==16;s++)r+=zP(e[s]*n.elements[s])+(s!==15?",":")");return t+r}const bAe=(n=>e=>GZ(e,n))([1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1]),TAe=(n=>(e,t)=>GZ(e,n(t),"translate(-50%,-50%)"))(n=>[1/n,1/n,1/n,1,-1/n,-1/n,-1/n,-1,1/n,1/n,1/n,1,1,1,1,1]);function SAe(n){return n&&typeof n=="object"&&"current"in n}const WZ=pe.forwardRef(({children:n,eps:e=.001,style:t,className:r,prepend:s,center:o,fullscreen:l,portal:u,distanceFactor:h,sprite:f=!1,transform:g=!1,occlude:y,onOcclude:b,castShadow:w,receiveShadow:C,material:M,geometry:A,zIndexRange:k=[16777271,0],calculatePosition:L=mAe,as:P="div",wrapperClass:D,pointerEvents:z="auto",...U},V)=>{const{gl:H,camera:oe,scene:le,size:Z,raycaster:q,events:he,viewport:ae}=nf(),[ue]=pe.useState(()=>document.createElement(P)),ge=pe.useRef(),we=pe.useRef(null),J=pe.useRef(0),re=pe.useRef([0,0]),ie=pe.useRef(null),fe=pe.useRef(null),Te=(u==null?void 0:u.current)||he.connected||H.domElement.parentNode,Fe=pe.useRef(null),Ie=pe.useRef(!1),Je=pe.useMemo(()=>y&&y!=="blending"||Array.isArray(y)&&y.length&&SAe(y[0]),[y]);pe.useLayoutEffect(()=>{const lt=H.domElement;y&&y==="blending"?(lt.style.zIndex=`${Math.floor(k[0]/2)}`,lt.style.position="absolute",lt.style.pointerEvents="none"):(lt.style.zIndex=null,lt.style.position=null,lt.style.pointerEvents=null)},[y]),pe.useLayoutEffect(()=>{if(we.current){const lt=ge.current=HZ(ue);if(le.updateMatrixWorld(),g)ue.style.cssText="position:absolute;top:0;left:0;pointer-events:none;overflow:hidden;";else{const ze=L(we.current,oe,Z);ue.style.cssText=`position:absolute;top:0;left:0;transform:translate3d(${ze[0]}px,${ze[1]}px,0);transform-origin:0 0;`}return Te&&(s?Te.prepend(ue):Te.appendChild(ue)),()=>{Te&&Te.removeChild(ue),lt.unmount()}}},[Te,g]),pe.useLayoutEffect(()=>{D&&(ue.className=D)},[D]);const Re=pe.useMemo(()=>g?{position:"absolute",top:0,left:0,width:Z.width,height:Z.height,transformStyle:"preserve-3d",pointerEvents:"none"}:{position:"absolute",transform:o?"translate3d(-50%,-50%,0)":"none",...l&&{top:-Z.height/2,left:-Z.width/2,width:Z.width,height:Z.height},...t},[t,o,l,Z,g]),Qe=pe.useMemo(()=>({position:"absolute",pointerEvents:z}),[z]);pe.useLayoutEffect(()=>{if(Ie.current=!1,g){var lt;(lt=ge.current)==null||lt.render(un("div",{ref:ie,style:Re,children:un("div",{ref:fe,style:Qe,children:un("div",{ref:V,className:r,style:t,children:n})})}))}else{var ze;(ze=ge.current)==null||ze.render(un("div",{ref:V,style:Re,className:r,children:n}))}});const nt=pe.useRef(!0);Xm(lt=>{if(we.current){oe.updateMatrixWorld(),we.current.updateWorldMatrix(!0,!1);const ze=g?re.current:L(we.current,oe,Z);if(g||Math.abs(J.current-oe.zoom)>e||Math.abs(re.current[0]-ze[0])>e||Math.abs(re.current[1]-ze[1])>e){const Ce=gAe(we.current,oe);let He=!1;Je&&(y!=="blending"?He=[le]:Array.isArray(y)&&(He=y.map(kt=>kt.current)));const rt=nt.current;if(He){const kt=_Ae(we.current,oe,q,He);nt.current=kt&&!Ce}else nt.current=!Ce;rt!==nt.current&&(b?b(!nt.current):ue.style.display=nt.current?"block":"none");const it=Math.floor(k[0]/2),Nt=y?Je?[k[0],it]:[it-1,0]:k;if(ue.style.zIndex=`${yAe(we.current,oe,Nt)}`,g){const[kt,vt]=[Z.width/2,Z.height/2],Mt=oe.projectionMatrix.elements[5]*vt,{isOrthographicCamera:At,top:mt,left:xe,bottom:se,right:$e}=oe,ht=bAe(oe.matrixWorldInverse),St=At?`scale(${Mt})translate(${zP(-($e+xe)/2)}px,${zP((mt+se)/2)}px)`:`translateZ(${Mt}px)`;let It=we.current.matrixWorld;f&&(It=oe.matrixWorldInverse.clone().transpose().copyPosition(It).scale(we.current.scale),It.elements[3]=It.elements[7]=It.elements[11]=0,It.elements[15]=1),ue.style.width=Z.width+"px",ue.style.height=Z.height+"px",ue.style.perspective=At?"":`${Mt}px`,ie.current&&fe.current&&(ie.current.style.transform=`${St}${ht}translate(${kt}px,${vt}px)`,fe.current.style.transform=TAe(It,1/((h||10)/400)))}else{const kt=h===void 0?1:vAe(we.current,oe)*h;ue.style.transform=`translate3d(${ze[0]}px,${ze[1]}px,0) scale(${kt})`}re.current=ze,J.current=oe.zoom}}if(!Je&&Fe.current&&!Ie.current)if(g){if(ie.current){const ze=ie.current.children[0];if(ze!=null&&ze.clientWidth&&ze!=null&&ze.clientHeight){const{isOrthographicCamera:Ce}=oe;if(Ce||A)U.scale&&(Array.isArray(U.scale)?U.scale instanceof Ae?Fe.current.scale.copy(U.scale.clone().divideScalar(1)):Fe.current.scale.set(1/U.scale[0],1/U.scale[1],1/U.scale[2]):Fe.current.scale.setScalar(1/U.scale));else{const He=(h||10)/400,rt=ze.clientWidth*He,it=ze.clientHeight*He;Fe.current.scale.set(rt,it,1)}Ie.current=!0}}}else{const ze=ue.children[0];if(ze!=null&&ze.clientWidth&&ze!=null&&ze.clientHeight){const Ce=1/ae.factor,He=ze.clientWidth*Ce,rt=ze.clientHeight*Ce;Fe.current.scale.set(He,rt,1),Ie.current=!0}Fe.current.lookAt(lt.camera.position)}});const ft=pe.useMemo(()=>({vertexShader:g?void 0:` +`+ee.stack}return{value:v,source:T,stack:Y,digest:null}}function W(v,T,R){return{value:v,source:null,stack:R??null,digest:T??null}}function de(v,T){try{console.error(T.value)}catch(R){setTimeout(function(){throw R})}}var ke=typeof WeakMap=="function"?WeakMap:Map;function et(v,T,R){R=ra(-1,R),R.tag=3,R.payload={element:null};var F=T.value;return R.callback=function(){qm||(qm=!0,Qm=F),de(v,T)},R}function wt(v,T,R){R=ra(-1,R),R.tag=3;var F=v.type.getDerivedStateFromError;if(typeof F=="function"){var Y=T.value;R.payload=function(){return F(Y)},R.callback=function(){de(v,T)}}var ee=v.stateNode;return ee!==null&&typeof ee.componentDidCatch=="function"&&(R.callback=function(){de(v,T),typeof F!="function"&&(bo===null?bo=new Set([this]):bo.add(this));var be=T.stack;this.componentDidCatch(T.value,{componentStack:be!==null?be:""})}),R}function Zt(v,T,R){var F=v.pingCache;if(F===null){F=v.pingCache=new ke;var Y=new Set;F.set(T,Y)}else Y=F.get(T),Y===void 0&&(Y=new Set,F.set(T,Y));Y.has(R)||(Y.add(R),v=C_.bind(null,v,T,R),T.then(v,v))}function cn(v){do{var T;if((T=v.tag===13)&&(T=v.memoizedState,T=T!==null?T.dehydrated!==null:!0),T)return v;v=v.return}while(v!==null);return null}function bn(v,T,R,F,Y){return v.mode&1?(v.flags|=65536,v.lanes=Y,v):(v===T?v.flags|=65536:(v.flags|=128,R.flags|=131072,R.flags&=-52805,R.tag===1&&(R.alternate===null?R.tag=17:(T=ra(-1,1),T.tag=2,Yi(R,T,1))),R.lanes|=1),v)}var Tn=D.ReactCurrentOwner,gn=!1;function Dr(v,T,R,F){T.child=v===null?Mu(T,null,R,F):ba(T,v.child,R,F)}function Tt(v,T,R,F,Y){R=R.render;var ee=T.ref;return Va(T,Y),F=Jh(v,T,R,F,ee,Y),R=qc(),v!==null&&!gn?(T.updateQueue=v.updateQueue,T.flags&=-2053,v.lanes&=~Y,Zh(v,T,Y)):(as&&R&&su(T),T.flags|=1,Dr(v,T,F,Y),T.child)}function Ce(v,T,R,F,Y){if(v===null){var ee=R.type;return typeof ee=="function"&&!Og(ee)&&ee.defaultProps===void 0&&R.compare===null&&R.defaultProps===void 0?(T.tag=15,T.type=ee,Le(v,T,ee,F,Y)):(v=hm(R.type,null,F,T,T.mode,Y),v.ref=T.ref,v.return=T,T.child=v)}if(ee=v.child,(v.lanes&Y)===0){var be=ee.memoizedProps;if(R=R.compare,R=R!==null?R:Ot,R(be,F)&&v.ref===T.ref)return Zh(v,T,Y)}return T.flags|=1,v=ed(ee,F),v.ref=T.ref,v.return=T,T.child=v}function Le(v,T,R,F,Y){if(v!==null){var ee=v.memoizedProps;if(Ot(ee,F)&&v.ref===T.ref)if(gn=!1,T.pendingProps=F=ee,(v.lanes&Y)!==0)v.flags&131072&&(gn=!0);else return T.lanes=v.lanes,Zh(v,T,Y)}return on(v,T,R,F,Y)}function ot(v,T,R){var F=T.pendingProps,Y=F.children,ee=v!==null?v.memoizedState:null;if(F.mode==="hidden")if(!(T.mode&1))T.memoizedState={baseLanes:0,cachePool:null,transitions:null},ss(Cp,du),du|=R;else{if(!(R&1073741824))return v=ee!==null?ee.baseLanes|R:R,T.lanes=T.childLanes=1073741824,T.memoizedState={baseLanes:v,cachePool:null,transitions:null},T.updateQueue=null,ss(Cp,du),du|=v,null;T.memoizedState={baseLanes:0,cachePool:null,transitions:null},F=ee!==null?ee.baseLanes:R,ss(Cp,du),du|=F}else ee!==null?(F=ee.baseLanes|R,T.memoizedState=null):F=R,ss(Cp,du),du|=F;return Dr(v,T,Y,R),T.child}function Ht(v,T){var R=T.ref;(v===null&&R!==null||v!==null&&v.ref!==R)&&(T.flags|=512,T.flags|=2097152)}function on(v,T,R,F,Y){var ee=na(R)?os:_a.current;return ee=Yc(T,ee),Va(T,Y),R=Jh(v,T,R,F,ee,Y),F=qc(),v!==null&&!gn?(T.updateQueue=v.updateQueue,T.flags&=-2053,v.lanes&=~Y,Zh(v,T,Y)):(as&&F&&su(T),T.flags|=1,Dr(v,T,R,Y),T.child)}function En(v,T,R,F,Y){if(na(R)){var ee=!0;Gs(T)}else ee=!1;if(Va(T,Y),T.stateNode===null)mf(v,T),au(T,R,F),Tc(T,R,F,Y),F=!0;else if(v===null){var be=T.stateNode,Xe=T.memoizedProps;be.props=Xe;var lt=be.context,Lt=R.contextType;typeof Lt=="object"&&Lt!==null?Lt=$s(Lt):(Lt=na(R)?os:_a.current,Lt=Yc(T,Lt));var en=R.getDerivedStateFromProps,hn=typeof en=="function"||typeof be.getSnapshotBeforeUpdate=="function";hn||typeof be.UNSAFE_componentWillReceiveProps!="function"&&typeof be.componentWillReceiveProps!="function"||(Xe!==F||lt!==Lt)&&qu(T,be,F,Lt),bc=!1;var an=T.memoizedState;be.state=an,Nr(T,F,be,Y),lt=T.memoizedState,Xe!==F||an!==lt||va.current||bc?(typeof en=="function"&&(Mo(T,R,en,F),lt=T.memoizedState),(Xe=bc||ts(T,R,Xe,F,an,lt,Lt))?(hn||typeof be.UNSAFE_componentWillMount!="function"&&typeof be.componentWillMount!="function"||(typeof be.componentWillMount=="function"&&be.componentWillMount(),typeof be.UNSAFE_componentWillMount=="function"&&be.UNSAFE_componentWillMount()),typeof be.componentDidMount=="function"&&(T.flags|=4194308)):(typeof be.componentDidMount=="function"&&(T.flags|=4194308),T.memoizedProps=F,T.memoizedState=lt),be.props=F,be.state=lt,be.context=Lt,F=Xe):(typeof be.componentDidMount=="function"&&(T.flags|=4194308),F=!1)}else{be=T.stateNode,Eh(v,T),Xe=T.memoizedProps,Lt=T.type===T.elementType?Xe:Cu(T.type,Xe),be.props=Lt,hn=T.pendingProps,an=be.context,lt=R.contextType,typeof lt=="object"&<!==null?lt=$s(lt):(lt=na(R)?os:_a.current,lt=Yc(T,lt));var Dn=R.getDerivedStateFromProps;(en=typeof Dn=="function"||typeof be.getSnapshotBeforeUpdate=="function")||typeof be.UNSAFE_componentWillReceiveProps!="function"&&typeof be.componentWillReceiveProps!="function"||(Xe!==hn||an!==lt)&&qu(T,be,F,lt),bc=!1,an=T.memoizedState,be.state=an,Nr(T,F,be,Y);var Zn=T.memoizedState;Xe!==hn||an!==Zn||va.current||bc?(typeof Dn=="function"&&(Mo(T,R,Dn,F),Zn=T.memoizedState),(Lt=bc||ts(T,R,Lt,F,an,Zn,lt)||!1)?(en||typeof be.UNSAFE_componentWillUpdate!="function"&&typeof be.componentWillUpdate!="function"||(typeof be.componentWillUpdate=="function"&&be.componentWillUpdate(F,Zn,lt),typeof be.UNSAFE_componentWillUpdate=="function"&&be.UNSAFE_componentWillUpdate(F,Zn,lt)),typeof be.componentDidUpdate=="function"&&(T.flags|=4),typeof be.getSnapshotBeforeUpdate=="function"&&(T.flags|=1024)):(typeof be.componentDidUpdate!="function"||Xe===v.memoizedProps&&an===v.memoizedState||(T.flags|=4),typeof be.getSnapshotBeforeUpdate!="function"||Xe===v.memoizedProps&&an===v.memoizedState||(T.flags|=1024),T.memoizedProps=F,T.memoizedState=Zn),be.props=F,be.state=Zn,be.context=lt,F=Lt):(typeof be.componentDidUpdate!="function"||Xe===v.memoizedProps&&an===v.memoizedState||(T.flags|=4),typeof be.getSnapshotBeforeUpdate!="function"||Xe===v.memoizedProps&&an===v.memoizedState||(T.flags|=1024),F=!1)}return kn(v,T,R,F,ee,Y)}function kn(v,T,R,F,Y,ee){Ht(v,T);var be=(T.flags&128)!==0;if(!F&&!be)return Y&&Kn(T,R,!1),Zh(v,T,ee);F=T.stateNode,Tn.current=T;var Xe=be&&typeof R.getDerivedStateFromError!="function"?null:F.render();return T.flags|=1,v!==null&&be?(T.child=ba(T,v.child,null,ee),T.child=ba(T,null,Xe,ee)):Dr(v,T,Xe,ee),T.memoizedState=F.state,Y&&Kn(T,R,!0),T.child}function zn(v){var T=v.stateNode;T.pendingContext?Ld(v,T.pendingContext,T.pendingContext!==T.context):T.context&&Ld(v,T.context,!1),Zu(v,T.containerInfo)}function cr(v,T,R,F,Y){return Uo(),Co(Y),T.flags|=256,Dr(v,T,R,F),T.child}var Mr={dehydrated:null,treeContext:null,retryLane:0};function Bl(v){return{baseLanes:v,cachePool:null,transitions:null}}function pf(v,T,R){var F=T.pendingProps,Y=Or.current,ee=!1,be=(T.flags&128)!==0,Xe;if((Xe=be)||(Xe=v!==null&&v.memoizedState===null?!1:(Y&2)!==0),Xe?(ee=!0,T.flags&=-129):(v===null||v.memoizedState!==null)&&(Y|=1),ss(Or,Y&1),v===null)return ki(T),v=T.memoizedState,v!==null&&(v=v.dehydrated,v!==null)?(T.mode&1?v.data==="$!"?T.lanes=8:T.lanes=1073741824:T.lanes=1,null):(be=F.children,v=F.fallback,ee?(F=T.mode,ee=T.child,be={mode:"hidden",children:be},!(F&1)&&ee!==null?(ee.childLanes=0,ee.pendingProps=be):ee=Xf(be,F,0,null),v=Yf(v,F,R,null),ee.return=T,v.return=T,ee.sibling=v,T.child=ee,T.child.memoizedState=Bl(R),T.memoizedState=Mr,v):Mh(T,be));if(Y=v.memoizedState,Y!==null&&(Xe=Y.dehydrated,Xe!==null))return th(v,T,be,F,Xe,Y,R);if(ee){ee=F.fallback,be=T.mode,Y=v.child,Xe=Y.sibling;var lt={mode:"hidden",children:F.children};return!(be&1)&&T.child!==Y?(F=T.child,F.childLanes=0,F.pendingProps=lt,T.deletions=null):(F=ed(Y,lt),F.subtreeFlags=Y.subtreeFlags&14680064),Xe!==null?ee=ed(Xe,ee):(ee=Yf(ee,be,R,null),ee.flags|=2),ee.return=T,F.return=T,F.sibling=ee,T.child=F,F=ee,ee=T.child,be=v.child.memoizedState,be=be===null?Bl(R):{baseLanes:be.baseLanes|R,cachePool:null,transitions:be.transitions},ee.memoizedState=be,ee.childLanes=v.childLanes&~R,T.memoizedState=Mr,F}return ee=v.child,v=ee.sibling,F=ed(ee,{mode:"visible",children:F.children}),!(T.mode&1)&&(F.lanes=R),F.return=T,F.sibling=null,v!==null&&(R=T.deletions,R===null?(T.deletions=[v],T.flags|=16):R.push(v)),T.child=F,T.memoizedState=null,F}function Mh(v,T){return T=Xf({mode:"visible",children:T},v.mode,0,null),T.return=v,v.child=T}function ln(v,T,R,F){return F!==null&&Co(F),ba(T,v.child,null,R),v=Mh(T,T.pendingProps.children),v.flags|=2,T.memoizedState=null,v}function th(v,T,R,F,Y,ee,be){if(R)return T.flags&256?(T.flags&=-257,F=W(Error(t(422))),ln(v,T,be,F)):T.memoizedState!==null?(T.child=v.child,T.flags|=128,null):(ee=F.fallback,Y=T.mode,F=Xf({mode:"visible",children:F.children},Y,0,null),ee=Yf(ee,Y,be,null),ee.flags|=2,F.return=T,ee.return=T,F.sibling=ee,T.child=F,T.mode&1&&ba(T,v.child,null,be),T.child.memoizedState=Bl(be),T.memoizedState=Mr,ee);if(!(T.mode&1))return ln(v,T,be,null);if(Y.data==="$!"){if(F=Y.nextSibling&&Y.nextSibling.dataset,F)var Xe=F.dgst;return F=Xe,ee=Error(t(419)),F=W(ee,F,void 0),ln(v,T,be,F)}if(Xe=(be&v.childLanes)!==0,gn||Xe){if(F=hu,F!==null){switch(be&-be){case 4:Y=2;break;case 16:Y=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:Y=32;break;case 536870912:Y=268435456;break;default:Y=0}Y=Y&(F.suspendedLanes|be)?0:Y,Y!==0&&Y!==ee.retryLane&&(ee.retryLane=Y,ja(v,Y),sa(F,v,Y,-1))}return um(),F=W(Error(t(421))),ln(v,T,be,F)}return Y.data==="$?"?(T.flags|=128,T.child=v.child,T=cm.bind(null,v),Y._reactRetry=T,null):(v=ee.treeContext,dl=_c(Y.nextSibling),ys=T,as=!0,fl=null,v!==null&&(co[ya++]=yn,co[ya++]=hl,co[ya++]=Mn,yn=v.id,hl=v.overflow,Mn=T),T=Mh(T,F.children),T.flags|=4096,T)}function em(v,T,R){v.lanes|=T;var F=v.alternate;F!==null&&(F.lanes|=T),ls(v.return,T,R)}function wa(v,T,R,F,Y){var ee=v.memoizedState;ee===null?v.memoizedState={isBackwards:T,rendering:null,renderingStartTime:0,last:F,tail:R,tailMode:Y}:(ee.isBackwards=T,ee.rendering=null,ee.renderingStartTime=0,ee.last=F,ee.tail=R,ee.tailMode=Y)}function gl(v,T,R){var F=T.pendingProps,Y=F.revealOrder,ee=F.tail;if(Dr(v,T,F.children,R),F=Or.current,(F&2)!==0)F=F&1|2,T.flags|=128;else{if(v!==null&&v.flags&128)e:for(v=T.child;v!==null;){if(v.tag===13)v.memoizedState!==null&&em(v,R,T);else if(v.tag===19)em(v,R,T);else if(v.child!==null){v.child.return=v,v=v.child;continue}if(v===T)break e;for(;v.sibling===null;){if(v.return===null||v.return===T)break e;v=v.return}v.sibling.return=v.return,v=v.sibling}F&=1}if(ss(Or,F),(T.mode&1)===0)T.memoizedState=null;else switch(Y){case"forwards":for(R=T.child,Y=null;R!==null;)v=R.alternate,v!==null&&bs(v)===null&&(Y=R),R=R.sibling;R=Y,R===null?(Y=T.child,T.child=null):(Y=R.sibling,R.sibling=null),wa(T,!1,Y,R,ee);break;case"backwards":for(R=null,Y=T.child,T.child=null;Y!==null;){if(v=Y.alternate,v!==null&&bs(v)===null){T.child=Y;break}v=Y.sibling,Y.sibling=R,R=Y,Y=v}wa(T,!0,R,null,ee);break;case"together":wa(T,!1,null,null,void 0);break;default:T.memoizedState=null}return T.child}function mf(v,T){!(T.mode&1)&&v!==null&&(v.alternate=null,T.alternate=null,T.flags|=2)}function Zh(v,T,R){if(v!==null&&(T.dependencies=v.dependencies),Ud|=T.lanes,(R&T.childLanes)===0)return null;if(v!==null&&T.child!==v.child)throw Error(t(153));if(T.child!==null){for(v=T.child,R=ed(v,v.pendingProps),T.child=R,R.return=T;v.sibling!==null;)v=v.sibling,R=R.sibling=ed(v,v.pendingProps),R.return=T;R.sibling=null}return T.child}function hs(v,T,R){switch(T.tag){case 3:zn(T),Uo();break;case 5:xh(T);break;case 1:na(T.type)&&Gs(T);break;case 4:Zu(T,T.stateNode.containerInfo);break;case 10:var F=T.type._context,Y=T.memoizedProps.value;ss(Ol,F._currentValue),F._currentValue=Y;break;case 13:if(F=T.memoizedState,F!==null)return F.dehydrated!==null?(ss(Or,Or.current&1),T.flags|=128,null):R&T.child.childLanes?pf(v,T,R):(ss(Or,Or.current&1),v=Zh(v,T,R),v!==null?v.sibling:null);ss(Or,Or.current&1);break;case 19:if(F=(R&T.childLanes)!==0,(v.flags&128)!==0){if(F)return gl(v,T,R);T.flags|=128}if(Y=T.memoizedState,Y!==null&&(Y.rendering=null,Y.tail=null,Y.lastEffect=null),ss(Or,Or.current),F)break;return null;case 22:case 23:return T.lanes=0,ot(v,T,R)}return Zh(v,T,R)}var _n,g0,Mg,Jm;_n=function(v,T){for(var R=T.child;R!==null;){if(R.tag===5||R.tag===6)v.appendChild(R.stateNode);else if(R.tag!==4&&R.child!==null){R.child.return=R,R=R.child;continue}if(R===T)break;for(;R.sibling===null;){if(R.return===null||R.return===T)return;R=R.return}R.sibling.return=R.return,R=R.sibling}},g0=function(){},Mg=function(v,T,R,F){var Y=v.memoizedProps;if(Y!==F){v=T.stateNode,Ho(fo.current);var ee=null;switch(R){case"input":Y=it(v,Y),F=it(v,F),ee=[];break;case"select":Y=se({},Y,{value:void 0}),F=se({},F,{value:void 0}),ee=[];break;case"textarea":Y=xe(v,Y),F=xe(v,F),ee=[];break;default:typeof Y.onClick!="function"&&typeof F.onClick=="function"&&(v.onclick=ru)}jt(R,F);var be;R=null;for(Lt in Y)if(!F.hasOwnProperty(Lt)&&Y.hasOwnProperty(Lt)&&Y[Lt]!=null)if(Lt==="style"){var Xe=Y[Lt];for(be in Xe)Xe.hasOwnProperty(be)&&(R||(R={}),R[be]="")}else Lt!=="dangerouslySetInnerHTML"&&Lt!=="children"&&Lt!=="suppressContentEditableWarning"&&Lt!=="suppressHydrationWarning"&&Lt!=="autoFocus"&&(s.hasOwnProperty(Lt)?ee||(ee=[]):(ee=ee||[]).push(Lt,null));for(Lt in F){var lt=F[Lt];if(Xe=Y!=null?Y[Lt]:void 0,F.hasOwnProperty(Lt)&<!==Xe&&(lt!=null||Xe!=null))if(Lt==="style")if(Xe){for(be in Xe)!Xe.hasOwnProperty(be)||lt&<.hasOwnProperty(be)||(R||(R={}),R[be]="");for(be in lt)lt.hasOwnProperty(be)&&Xe[be]!==lt[be]&&(R||(R={}),R[be]=lt[be])}else R||(ee||(ee=[]),ee.push(Lt,R)),R=lt;else Lt==="dangerouslySetInnerHTML"?(lt=lt?lt.__html:void 0,Xe=Xe?Xe.__html:void 0,lt!=null&&Xe!==lt&&(ee=ee||[]).push(Lt,lt)):Lt==="children"?typeof lt!="string"&&typeof lt!="number"||(ee=ee||[]).push(Lt,""+lt):Lt!=="suppressContentEditableWarning"&&Lt!=="suppressHydrationWarning"&&(s.hasOwnProperty(Lt)?(lt!=null&&Lt==="onScroll"&&zi("scroll",v),ee||Xe===lt||(ee=[])):(ee=ee||[]).push(Lt,lt))}R&&(ee=ee||[]).push("style",R);var Lt=ee;(T.updateQueue=Lt)&&(T.flags|=4)}},Jm=function(v,T,R,F){R!==F&&(T.flags|=4)};function xc(v,T){if(!as)switch(v.tailMode){case"hidden":T=v.tail;for(var R=null;T!==null;)T.alternate!==null&&(R=T),T=T.sibling;R===null?v.tail=null:R.sibling=null;break;case"collapsed":R=v.tail;for(var F=null;R!==null;)R.alternate!==null&&(F=R),R=R.sibling;F===null?T||v.tail===null?v.tail=null:v.tail.sibling=null:F.sibling=null}}function Zs(v){var T=v.alternate!==null&&v.alternate.child===v.child,R=0,F=0;if(T)for(var Y=v.child;Y!==null;)R|=Y.lanes|Y.childLanes,F|=Y.subtreeFlags&14680064,F|=Y.flags&14680064,Y.return=v,Y=Y.sibling;else for(Y=v.child;Y!==null;)R|=Y.lanes|Y.childLanes,F|=Y.subtreeFlags,F|=Y.flags,Y.return=v,Y=Y.sibling;return v.subtreeFlags|=F,v.childLanes=R,T}function Gf(v,T,R){var F=T.pendingProps;switch($o(T),T.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Zs(T),null;case 1:return na(T.type)&&Od(),Zs(T),null;case 3:return F=T.stateNode,ec(),es(va),es(_a),Ya(),F.pendingContext&&(F.context=F.pendingContext,F.pendingContext=null),(v===null||v.child===null)&&(Xc(T)?T.flags|=4:v===null||v.memoizedState.isDehydrated&&!(T.flags&256)||(T.flags|=1024,fl!==null&&(y0(fl),fl=null))),g0(v,T),Zs(T),null;case 5:$h(T);var Y=Ho(Ll.current);if(R=T.type,v!==null&&T.stateNode!=null)Mg(v,T,R,F,Y),v.ref!==T.ref&&(T.flags|=512,T.flags|=2097152);else{if(!F){if(T.stateNode===null)throw Error(t(166));return Zs(T),null}if(v=Ho(fo.current),Xc(T)){F=T.stateNode,R=T.type;var ee=T.memoizedProps;switch(F[Vr]=T,F[ul]=ee,v=(T.mode&1)!==0,R){case"dialog":zi("cancel",F),zi("close",F);break;case"iframe":case"object":case"embed":zi("load",F);break;case"video":case"audio":for(Y=0;Y<\/script>",v=v.removeChild(v.firstChild)):typeof F.is=="string"?v=be.createElement(R,{is:F.is}):(v=be.createElement(R),R==="select"&&(be=v,F.multiple?be.multiple=!0:F.size&&(be.size=F.size))):v=be.createElementNS(v,R),v[Vr]=T,v[ul]=F,_n(v,T,!1,!1),T.stateNode=v;e:{switch(be=Ge(R,F),R){case"dialog":zi("cancel",v),zi("close",v),Y=F;break;case"iframe":case"object":case"embed":zi("load",v),Y=F;break;case"video":case"audio":for(Y=0;Yih&&(T.flags|=128,F=!0,xc(ee,!1),T.lanes=4194304)}else{if(!F)if(v=bs(be),v!==null){if(T.flags|=128,F=!0,R=v.updateQueue,R!==null&&(T.updateQueue=R,T.flags|=4),xc(ee,!0),ee.tail===null&&ee.tailMode==="hidden"&&!be.alternate&&!as)return Zs(T),null}else 2*nn()-ee.renderingStartTime>ih&&R!==1073741824&&(T.flags|=128,F=!0,xc(ee,!1),T.lanes=4194304);ee.isBackwards?(be.sibling=T.child,T.child=be):(R=ee.last,R!==null?R.sibling=be:T.child=be,ee.last=be)}return ee.tail!==null?(T=ee.tail,ee.rendering=T,ee.tail=T.sibling,ee.renderingStartTime=nn(),T.sibling=null,R=Or.current,ss(Or,F?R&1|2:R&1),T):(Zs(T),null);case 22:case 23:return T0(),F=T.memoizedState!==null,v!==null&&v.memoizedState!==null!==F&&(T.flags|=8192),F&&T.mode&1?du&1073741824&&(Zs(T),T.subtreeFlags&6&&(T.flags|=8192)):Zs(T),null;case 24:return null;case 25:return null}throw Error(t(156,T.tag))}function Dd(v,T){switch($o(T),T.tag){case 1:return na(T.type)&&Od(),v=T.flags,v&65536?(T.flags=v&-65537|128,T):null;case 3:return ec(),es(va),es(_a),Ya(),v=T.flags,v&65536&&!(v&128)?(T.flags=v&-65537|128,T):null;case 5:return $h(T),null;case 13:if(es(Or),v=T.memoizedState,v!==null&&v.dehydrated!==null){if(T.alternate===null)throw Error(t(340));Uo()}return v=T.flags,v&65536?(T.flags=v&-65537|128,T):null;case 19:return es(Or),null;case 4:return ec(),null;case 10:return Ju(T.type._context),null;case 22:case 23:return T0(),null;case 24:return null;default:return null}}var Ka=!1,Ur=!1,Ea=typeof WeakSet=="function"?WeakSet:Set,Ve=null;function Oi(v,T){var R=v.ref;if(R!==null)if(typeof R=="function")try{R(null)}catch(F){oa(v,T,F)}else R.current=null}function eo(v,T,R){try{R()}catch(F){oa(v,T,F)}}var S_=!1;function $c(v,T){if(Xu=so,v=vn(),zr(v)){if("selectionStart"in v)var R={start:v.selectionStart,end:v.selectionEnd};else e:{R=(R=v.ownerDocument)&&R.defaultView||window;var F=R.getSelection&&R.getSelection();if(F&&F.rangeCount!==0){R=F.anchorNode;var Y=F.anchorOffset,ee=F.focusNode;F=F.focusOffset;try{R.nodeType,ee.nodeType}catch{R=null;break e}var be=0,Xe=-1,lt=-1,Lt=0,en=0,hn=v,an=null;t:for(;;){for(var Dn;hn!==R||Y!==0&&hn.nodeType!==3||(Xe=be+Y),hn!==ee||F!==0&&hn.nodeType!==3||(lt=be+F),hn.nodeType===3&&(be+=hn.nodeValue.length),(Dn=hn.firstChild)!==null;)an=hn,hn=Dn;for(;;){if(hn===v)break t;if(an===R&&++Lt===Y&&(Xe=be),an===ee&&++en===F&&(lt=be),(Dn=hn.nextSibling)!==null)break;hn=an,an=hn.parentNode}hn=Dn}R=Xe===-1||lt===-1?null:{start:Xe,end:lt}}else R=null}R=R||{start:0,end:0}}else R=null;for(Ku={focusedElem:v,selectionRange:R},so=!1,Ve=T;Ve!==null;)if(T=Ve,v=T.child,(T.subtreeFlags&1028)!==0&&v!==null)v.return=T,Ve=v;else for(;Ve!==null;){T=Ve;try{var Zn=T.alternate;if(T.flags&1024)switch(T.tag){case 0:case 11:case 15:break;case 1:if(Zn!==null){var ir=Zn.memoizedProps,Io=Zn.memoizedState,xt=T.stateNode,dt=xt.getSnapshotBeforeUpdate(T.elementType===T.type?ir:Cu(T.type,ir),Io);xt.__reactInternalSnapshotBeforeUpdate=dt}break;case 3:var Et=T.stateNode.containerInfo;Et.nodeType===1?Et.textContent="":Et.nodeType===9&&Et.documentElement&&Et.removeChild(Et.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(t(163))}}catch(Sn){oa(T,T.return,Sn)}if(v=T.sibling,v!==null){v.return=T.return,Ve=v;break}Ve=T.return}return Zn=S_,S_=!1,Zn}function Ep(v,T,R){var F=T.updateQueue;if(F=F!==null?F.lastEffect:null,F!==null){var Y=F=F.next;do{if((Y.tag&v)===v){var ee=Y.destroy;Y.destroy=void 0,ee!==void 0&&eo(T,R,ee)}Y=Y.next}while(Y!==F)}}function tm(v,T){if(T=T.updateQueue,T=T!==null?T.lastEffect:null,T!==null){var R=T=T.next;do{if((R.tag&v)===v){var F=R.create;R.destroy=F()}R=R.next}while(R!==T)}}function w_(v){var T=v.ref;if(T!==null){var R=v.stateNode;switch(v.tag){case 5:v=R;break;default:v=R}typeof T=="function"?T(v):T.current=v}}function xp(v){var T=v.alternate;T!==null&&(v.alternate=null,xp(T)),v.child=null,v.deletions=null,v.sibling=null,v.tag===5&&(T=v.stateNode,T!==null&&(delete T[Vr],delete T[ul],delete T[ma],delete T[X],delete T[xs])),v.stateNode=null,v.return=null,v.dependencies=null,v.memoizedProps=null,v.memoizedState=null,v.pendingProps=null,v.stateNode=null,v.updateQueue=null}function xa(v){return v.tag===5||v.tag===3||v.tag===4}function Ag(v){e:for(;;){for(;v.sibling===null;){if(v.return===null||xa(v.return))return null;v=v.return}for(v.sibling.return=v.return,v=v.sibling;v.tag!==5&&v.tag!==6&&v.tag!==18;){if(v.flags&2||v.child===null||v.tag===4)continue e;v.child.return=v,v=v.child}if(!(v.flags&2))return v.stateNode}}function nm(v,T,R){var F=v.tag;if(F===5||F===6)v=v.stateNode,T?R.nodeType===8?R.parentNode.insertBefore(v,T):R.insertBefore(v,T):(R.nodeType===8?(T=R.parentNode,T.insertBefore(v,R)):(T=R,T.appendChild(v)),R=R._reactRootContainer,R!=null||T.onclick!==null||(T.onclick=ru));else if(F!==4&&(v=v.child,v!==null))for(nm(v,T,R),v=v.sibling;v!==null;)nm(v,T,R),v=v.sibling}function $p(v,T,R){var F=v.tag;if(F===5||F===6)v=v.stateNode,T?R.insertBefore(v,T):R.appendChild(v);else if(F!==4&&(v=v.child,v!==null))for($p(v,T,R),v=v.sibling;v!==null;)$p(v,T,R),v=v.sibling}var _l=null,cu=!1;function Pd(v,T,R){for(R=R.child;R!==null;)gf(v,T,R),R=R.sibling}function gf(v,T,R){if(In&&typeof In.onCommitFiberUnmount=="function")try{In.onCommitFiberUnmount(kr,R)}catch{}switch(R.tag){case 5:Ur||Oi(R,T);case 6:var F=_l,Y=cu;_l=null,Pd(v,T,R),_l=F,cu=Y,_l!==null&&(cu?(v=_l,R=R.stateNode,v.nodeType===8?v.parentNode.removeChild(R):v.removeChild(R)):_l.removeChild(R.stateNode));break;case 18:_l!==null&&(cu?(v=_l,R=R.stateNode,v.nodeType===8?Vc(v.parentNode,R):v.nodeType===1&&Vc(v,R),Gn(v)):Vc(_l,R.stateNode));break;case 4:F=_l,Y=cu,_l=R.stateNode.containerInfo,cu=!0,Pd(v,T,R),_l=F,cu=Y;break;case 0:case 11:case 14:case 15:if(!Ur&&(F=R.updateQueue,F!==null&&(F=F.lastEffect,F!==null))){Y=F=F.next;do{var ee=Y,be=ee.destroy;ee=ee.tag,be!==void 0&&(ee&2||ee&4)&&eo(R,T,be),Y=Y.next}while(Y!==F)}Pd(v,T,R);break;case 1:if(!Ur&&(Oi(R,T),F=R.stateNode,typeof F.componentWillUnmount=="function"))try{F.props=R.memoizedProps,F.state=R.memoizedState,F.componentWillUnmount()}catch(Xe){oa(R,T,Xe)}Pd(v,T,R);break;case 21:Pd(v,T,R);break;case 22:R.mode&1?(Ur=(F=Ur)||R.memoizedState!==null,Pd(v,T,R),Ur=F):Pd(v,T,R);break;default:Pd(v,T,R)}}function Bd(v){var T=v.updateQueue;if(T!==null){v.updateQueue=null;var R=v.stateNode;R===null&&(R=v.stateNode=new Ea),T.forEach(function(F){var Y=sb.bind(null,v,F);R.has(F)||(R.add(F),F.then(Y,Y))})}}function nh(v,T){var R=T.deletions;if(R!==null)for(var F=0;FY&&(Y=be),F&=~ee}if(F=Y,F=nn()-F,F=(120>F?120:480>F?480:1080>F?1080:1920>F?1920:3e3>F?3e3:4320>F?4320:1960*im(F/1960))-F,10v?16:v,Ls===null)var F=!1;else{if(v=Ls,Ls=null,zl=0,(ns&6)!==0)throw Error(t(331));var Y=ns;for(ns|=4,Ve=v.current;Ve!==null;){var ee=Ve,be=ee.child;if(Ve.flags&16){var Xe=ee.deletions;if(Xe!==null){for(var lt=0;ltnn()-yl?lm(v,0):Rg|=R),$a(v,T)}function x0(v,T){T===0&&(v.mode&1?(T=gs,gs<<=1,!(gs&130023424)&&(gs=4194304)):T=1);var R=Cc();v=ja(v,T),v!==null&&(gu(v,T,R),$a(v,R))}function cm(v){var T=v.memoizedState,R=0;T!==null&&(R=T.retryLane),x0(v,R)}function sb(v,T){var R=0;switch(v.tag){case 13:var F=v.stateNode,Y=v.memoizedState;Y!==null&&(R=Y.retryLane);break;case 19:F=v.stateNode;break;default:throw Error(t(314))}F!==null&&F.delete(T),x0(v,R)}var Rv;Rv=function(v,T,R){if(v!==null)if(v.memoizedProps!==T.pendingProps||va.current)gn=!0;else{if(!(v.lanes&R)&&!(T.flags&128))return gn=!1,hs(v,T,R);gn=(v.flags&131072)!==0}else gn=!1,as&&T.flags&1048576&&wp(T,wh,T.index);switch(T.lanes=0,T.tag){case 2:var F=T.type;mf(v,T),v=T.pendingProps;var Y=Yc(T,_a.current);Va(T,R),Y=Jh(null,T,F,v,Y,R);var ee=qc();return T.flags|=1,typeof Y=="object"&&Y!==null&&typeof Y.render=="function"&&Y.$$typeof===void 0?(T.tag=1,T.memoizedState=null,T.updateQueue=null,na(F)?(ee=!0,Gs(T)):ee=!1,T.memoizedState=Y.state!==null&&Y.state!==void 0?Y.state:null,ff(T),Y.updater=us,T.stateNode=Y,Y._reactInternals=T,Tc(T,F,v,R),T=kn(null,T,F,!0,ee,R)):(T.tag=0,as&&ee&&su(T),Dr(null,T,Y,R),T=T.child),T;case 16:F=T.elementType;e:{switch(mf(v,T),v=T.pendingProps,Y=F._init,F=Y(F._payload),T.type=F,Y=T.tag=jf(F),v=Cu(F,v),Y){case 0:T=on(null,T,F,v,R);break e;case 1:T=En(null,T,F,v,R);break e;case 11:T=Tt(null,T,F,v,R);break e;case 14:T=Ce(null,T,F,Cu(F.type,v),R);break e}throw Error(t(306,F,""))}return T;case 0:return F=T.type,Y=T.pendingProps,Y=T.elementType===F?Y:Cu(F,Y),on(v,T,F,Y,R);case 1:return F=T.type,Y=T.pendingProps,Y=T.elementType===F?Y:Cu(F,Y),En(v,T,F,Y,R);case 3:e:{if(zn(T),v===null)throw Error(t(387));F=T.pendingProps,ee=T.memoizedState,Y=ee.element,Eh(v,T),Nr(T,F,null,R);var be=T.memoizedState;if(F=be.element,ee.isDehydrated)if(ee={element:F,isDehydrated:!1,cache:be.cache,pendingSuspenseBoundaries:be.pendingSuspenseBoundaries,transitions:be.transitions},T.updateQueue.baseState=ee,T.memoizedState=ee,T.flags&256){Y=B(Error(t(423)),T),T=cr(v,T,F,R,Y);break e}else if(F!==Y){Y=B(Error(t(424)),T),T=cr(v,T,F,R,Y);break e}else for(dl=_c(T.stateNode.containerInfo.firstChild),ys=T,as=!0,fl=null,R=Mu(T,null,F,R),T.child=R;R;)R.flags=R.flags&-3|4096,R=R.sibling;else{if(Uo(),F===Y){T=Zh(v,T,R);break e}Dr(v,T,F,R)}T=T.child}return T;case 5:return xh(T),v===null&&ki(T),F=T.type,Y=T.pendingProps,ee=v!==null?v.memoizedProps:null,be=Y.children,Sh(F,Y)?be=null:ee!==null&&Sh(F,ee)&&(T.flags|=32),Ht(v,T),Dr(v,T,be,R),T.child;case 6:return v===null&&ki(T),null;case 13:return pf(v,T,R);case 4:return Zu(T,T.stateNode.containerInfo),F=T.pendingProps,v===null?T.child=ba(T,null,F,R):Dr(v,T,F,R),T.child;case 11:return F=T.type,Y=T.pendingProps,Y=T.elementType===F?Y:Cu(F,Y),Tt(v,T,F,Y,R);case 7:return Dr(v,T,T.pendingProps,R),T.child;case 8:return Dr(v,T,T.pendingProps.children,R),T.child;case 12:return Dr(v,T,T.pendingProps.children,R),T.child;case 10:e:{if(F=T.type._context,Y=T.pendingProps,ee=T.memoizedProps,be=Y.value,ss(Ol,F._currentValue),F._currentValue=be,ee!==null)if(Be(ee.value,be)){if(ee.children===Y.children&&!va.current){T=Zh(v,T,R);break e}}else for(ee=T.child,ee!==null&&(ee.return=T);ee!==null;){var Xe=ee.dependencies;if(Xe!==null){be=ee.child;for(var lt=Xe.firstContext;lt!==null;){if(lt.context===F){if(ee.tag===1){lt=ra(-1,R&-R),lt.tag=2;var Lt=ee.updateQueue;if(Lt!==null){Lt=Lt.shared;var en=Lt.pending;en===null?lt.next=lt:(lt.next=en.next,en.next=lt),Lt.pending=lt}}ee.lanes|=R,lt=ee.alternate,lt!==null&&(lt.lanes|=R),ls(ee.return,R,T),Xe.lanes|=R;break}lt=lt.next}}else if(ee.tag===10)be=ee.type===T.type?null:ee.child;else if(ee.tag===18){if(be=ee.return,be===null)throw Error(t(341));be.lanes|=R,Xe=be.alternate,Xe!==null&&(Xe.lanes|=R),ls(be,R,T),be=ee.sibling}else be=ee.child;if(be!==null)be.return=ee;else for(be=ee;be!==null;){if(be===T){be=null;break}if(ee=be.sibling,ee!==null){ee.return=be.return,be=ee;break}be=be.return}ee=be}Dr(v,T,Y.children,R),T=T.child}return T;case 9:return Y=T.type,F=T.pendingProps.children,Va(T,R),Y=$s(Y),F=F(Y),T.flags|=1,Dr(v,T,F,R),T.child;case 14:return F=T.type,Y=Cu(F,T.pendingProps),Y=Cu(F.type,Y),Ce(v,T,F,Y,R);case 15:return Le(v,T,T.type,T.pendingProps,R);case 17:return F=T.type,Y=T.pendingProps,Y=T.elementType===F?Y:Cu(F,Y),mf(v,T),T.tag=1,na(F)?(v=!0,Gs(T)):v=!1,Va(T,R),au(T,F,Y),Tc(T,F,Y,R),kn(null,T,F,!0,v,R);case 19:return gl(v,T,R);case 22:return ot(v,T,R)}throw Error(t(156,T.tag))};function oh(v,T){return Ss(v,T)}function To(v,T,R,F){this.tag=v,this.key=R,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=F,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ou(v,T,R,F){return new To(v,T,R,F)}function Og(v){return v=v.prototype,!(!v||!v.isReactComponent)}function jf(v){if(typeof v=="function")return Og(v)?1:0;if(v!=null){if(v=v.$$typeof,v===q)return 11;if(v===ue)return 14}return 2}function ed(v,T){var R=v.alternate;return R===null?(R=Ou(v.tag,T,v.key,v.mode),R.elementType=v.elementType,R.type=v.type,R.stateNode=v.stateNode,R.alternate=v,v.alternate=R):(R.pendingProps=T,R.type=v.type,R.flags=0,R.subtreeFlags=0,R.deletions=null),R.flags=v.flags&14680064,R.childLanes=v.childLanes,R.lanes=v.lanes,R.child=v.child,R.memoizedProps=v.memoizedProps,R.memoizedState=v.memoizedState,R.updateQueue=v.updateQueue,T=v.dependencies,R.dependencies=T===null?null:{lanes:T.lanes,firstContext:T.firstContext},R.sibling=v.sibling,R.index=v.index,R.ref=v.ref,R}function hm(v,T,R,F,Y,ee){var be=2;if(F=v,typeof v=="function")Og(v)&&(be=1);else if(typeof v=="string")be=5;else e:switch(v){case V:return Yf(R.children,Y,ee,T);case H:be=8,Y|=8;break;case oe:return v=Ou(12,R,T,Y|2),v.elementType=oe,v.lanes=ee,v;case he:return v=Ou(13,R,T,Y),v.elementType=he,v.lanes=ee,v;case ae:return v=Ou(19,R,T,Y),v.elementType=ae,v.lanes=ee,v;case we:return Xf(R,Y,ee,T);default:if(typeof v=="object"&&v!==null)switch(v.$$typeof){case le:be=10;break e;case Z:be=9;break e;case q:be=11;break e;case ue:be=14;break e;case ge:be=16,F=null;break e}throw Error(t(130,v==null?v:typeof v,""))}return T=Ou(be,R,T,Y),T.elementType=v,T.type=F,T.lanes=ee,T}function Yf(v,T,R,F){return v=Ou(7,v,F,T),v.lanes=R,v}function Xf(v,T,R,F){return v=Ou(22,v,F,T),v.elementType=we,v.lanes=R,v.stateNode={isHidden:!1},v}function kp(v,T,R){return v=Ou(6,v,null,T),v.lanes=R,v}function bd(v,T,R){return T=Ou(4,v.children!==null?v.children:[],v.key,T),T.lanes=R,T.stateNode={containerInfo:v.containerInfo,pendingChildren:null,implementation:v.implementation},T}function yf(v,T,R,F,Y){this.tag=T,this.containerInfo=v,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Xl(0),this.expirationTimes=Xl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Xl(0),this.identifierPrefix=F,this.onRecoverableError=Y,this.mutableSourceEagerHydrationData=null}function eg(v,T,R,F,Y,ee,be,Xe,lt){return v=new yf(v,T,R,Xe,lt),T===1?(T=1,ee===!0&&(T|=8)):T=0,ee=Ou(3,null,null,T),v.current=ee,ee.stateNode=v,ee.memoizedState={element:F,isDehydrated:R,cache:null,transitions:null,pendingSuspenseBoundaries:null},ff(ee),v}function kv(v,T,R){var F=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}e(),n.exports=fAe()})(HZ);var GZ,hW=HZ.exports;GZ=hW.createRoot,hW.hydrateRoot;const FC=new Me,C4=new Me,pAe=new Me;function mAe(n,e,t){const r=FC.setFromMatrixPosition(n.matrixWorld);r.project(e);const s=t.width/2,o=t.height/2;return[r.x*s+s,-(r.y*o)+o]}function gAe(n,e){const t=FC.setFromMatrixPosition(n.matrixWorld),r=C4.setFromMatrixPosition(e.matrixWorld),s=t.sub(r),o=e.getWorldDirection(pAe);return s.angleTo(o)>Math.PI/2}function _Ae(n,e,t,r){const s=FC.setFromMatrixPosition(n.matrixWorld),o=s.clone();o.project(e),t.setFromCamera(o,e);const l=t.intersectObjects(r,!0);if(l.length){const u=l[0].distance;return s.distanceTo(t.ray.origin)Math.abs(n)<1e-10?0:n;function WZ(n,e,t=""){let r="matrix3d(";for(let s=0;s!==16;s++)r+=zP(e[s]*n.elements[s])+(s!==15?",":")");return t+r}const bAe=(n=>e=>WZ(e,n))([1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1]),TAe=(n=>(e,t)=>WZ(e,n(t),"translate(-50%,-50%)"))(n=>[1/n,1/n,1/n,1,-1/n,-1/n,-1/n,-1,1/n,1/n,1/n,1,1,1,1,1]);function SAe(n){return n&&typeof n=="object"&&"current"in n}const VZ=me.forwardRef(({children:n,eps:e=.001,style:t,className:r,prepend:s,center:o,fullscreen:l,portal:u,distanceFactor:h,sprite:f=!1,transform:g=!1,occlude:y,onOcclude:b,castShadow:w,receiveShadow:C,material:M,geometry:A,zIndexRange:k=[16777271,0],calculatePosition:L=mAe,as:P="div",wrapperClass:D,pointerEvents:z="auto",...U},V)=>{const{gl:H,camera:oe,scene:le,size:Z,raycaster:q,events:he,viewport:ae}=nf(),[ue]=me.useState(()=>document.createElement(P)),ge=me.useRef(),we=me.useRef(null),J=me.useRef(0),re=me.useRef([0,0]),se=me.useRef(null),fe=me.useRef(null),Te=(u==null?void 0:u.current)||he.connected||H.domElement.parentNode,Fe=me.useRef(null),Ie=me.useRef(!1),qe=me.useMemo(()=>y&&y!=="blending"||Array.isArray(y)&&y.length&&SAe(y[0]),[y]);me.useLayoutEffect(()=>{const ut=H.domElement;y&&y==="blending"?(ut.style.zIndex=`${Math.floor(k[0]/2)}`,ut.style.position="absolute",ut.style.pointerEvents="none"):(ut.style.zIndex=null,ut.style.position=null,ut.style.pointerEvents=null)},[y]),me.useLayoutEffect(()=>{if(we.current){const ut=ge.current=GZ(ue);if(le.updateMatrixWorld(),g)ue.style.cssText="position:absolute;top:0;left:0;pointer-events:none;overflow:hidden;";else{const ze=L(we.current,oe,Z);ue.style.cssText=`position:absolute;top:0;left:0;transform:translate3d(${ze[0]}px,${ze[1]}px,0);transform-origin:0 0;`}return Te&&(s?Te.prepend(ue):Te.appendChild(ue)),()=>{Te&&Te.removeChild(ue),ut.unmount()}}},[Te,g]),me.useLayoutEffect(()=>{D&&(ue.className=D)},[D]);const Re=me.useMemo(()=>g?{position:"absolute",top:0,left:0,width:Z.width,height:Z.height,transformStyle:"preserve-3d",pointerEvents:"none"}:{position:"absolute",transform:o?"translate3d(-50%,-50%,0)":"none",...l&&{top:-Z.height/2,left:-Z.width/2,width:Z.width,height:Z.height},...t},[t,o,l,Z,g]),Ze=me.useMemo(()=>({position:"absolute",pointerEvents:z}),[z]);me.useLayoutEffect(()=>{if(Ie.current=!1,g){var ut;(ut=ge.current)==null||ut.render(un("div",{ref:se,style:Re,children:un("div",{ref:fe,style:Ze,children:un("div",{ref:V,className:r,style:t,children:n})})}))}else{var ze;(ze=ge.current)==null||ze.render(un("div",{ref:V,style:Re,className:r,children:n}))}});const rt=me.useRef(!0);Xm(ut=>{if(we.current){oe.updateMatrixWorld(),we.current.updateWorldMatrix(!0,!1);const ze=g?re.current:L(we.current,oe,Z);if(g||Math.abs(J.current-oe.zoom)>e||Math.abs(re.current[0]-ze[0])>e||Math.abs(re.current[1]-ze[1])>e){const $e=gAe(we.current,oe);let He=!1;qe&&(y!=="blending"?He=[le]:Array.isArray(y)&&(He=y.map(kt=>kt.current)));const it=rt.current;if(He){const kt=_Ae(we.current,oe,q,He);rt.current=kt&&!$e}else rt.current=!$e;it!==rt.current&&(b?b(!rt.current):ue.style.display=rt.current?"block":"none");const st=Math.floor(k[0]/2),Nt=y?qe?[k[0],st]:[st-1,0]:k;if(ue.style.zIndex=`${yAe(we.current,oe,Nt)}`,g){const[kt,vt]=[Z.width/2,Z.height/2],Ct=oe.projectionMatrix.elements[5]*vt,{isOrthographicCamera:At,top:gt,left:xe,bottom:ie,right:Pe}=oe,Ye=bAe(oe.matrixWorldInverse),St=At?`scale(${Ct})translate(${zP(-(Pe+xe)/2)}px,${zP((gt+ie)/2)}px)`:`translateZ(${Ct}px)`;let It=we.current.matrixWorld;f&&(It=oe.matrixWorldInverse.clone().transpose().copyPosition(It).scale(we.current.scale),It.elements[3]=It.elements[7]=It.elements[11]=0,It.elements[15]=1),ue.style.width=Z.width+"px",ue.style.height=Z.height+"px",ue.style.perspective=At?"":`${Ct}px`,se.current&&fe.current&&(se.current.style.transform=`${St}${Ye}translate(${kt}px,${vt}px)`,fe.current.style.transform=TAe(It,1/((h||10)/400)))}else{const kt=h===void 0?1:vAe(we.current,oe)*h;ue.style.transform=`translate3d(${ze[0]}px,${ze[1]}px,0) scale(${kt})`}re.current=ze,J.current=oe.zoom}}if(!qe&&Fe.current&&!Ie.current)if(g){if(se.current){const ze=se.current.children[0];if(ze!=null&&ze.clientWidth&&ze!=null&&ze.clientHeight){const{isOrthographicCamera:$e}=oe;if($e||A)U.scale&&(Array.isArray(U.scale)?U.scale instanceof Me?Fe.current.scale.copy(U.scale.clone().divideScalar(1)):Fe.current.scale.set(1/U.scale[0],1/U.scale[1],1/U.scale[2]):Fe.current.scale.setScalar(1/U.scale));else{const He=(h||10)/400,it=ze.clientWidth*He,st=ze.clientHeight*He;Fe.current.scale.set(it,st,1)}Ie.current=!0}}}else{const ze=ue.children[0];if(ze!=null&&ze.clientWidth&&ze!=null&&ze.clientHeight){const $e=1/ae.factor,He=ze.clientWidth*$e,it=ze.clientHeight*$e;Fe.current.scale.set(He,it,1),Ie.current=!0}Fe.current.lookAt(ut.camera.position)}});const ft=me.useMemo(()=>({vertexShader:g?void 0:` /* This shader is from the THREE's SpriteMaterial. We need to turn the backing plane into a Sprite @@ -4981,7 +4981,7 @@ Error generating stack: `+ee.message+` void main() { gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); } - `}),[g]);return un("group",{...U,ref:we,children:y&&!Je&&Bh("mesh",{castShadow:w,receiveShadow:C,ref:Fe,children:[A||un("planeGeometry",{}),M||un("shaderMaterial",{side:lp,vertexShader:ft.vertexShader,fragmentShader:ft.fragmentShader})]})})});function M4(n){return function(e){n.forEach(function(t){typeof t=="function"?t(e):t!=null&&(t.current=e)})}}const EI=0,wAe=1,EAe=new Ae,hW=new E4,nN=new ov,dW=new Ae,OA=new Im;class fW{constructor(){this.tolerance=-1,this.faces=[],this.newFaces=[],this.assigned=new pW,this.unassigned=new pW,this.vertices=[]}setFromPoints(e){if(e.length>=4){this.makeEmpty();for(let t=0,r=e.length;tthis.tolerance)return!1;return!0}intersectRay(e,t){const r=this.faces;let s=-1/0,o=1/0;for(let l=0,u=r.length;l0&&g>=0)return null;const y=g!==0?-f/g:0;if(!(y<=0)&&(g>0?o=Math.min(y,o):s=Math.max(y,s),s>o))return null}return s!==-1/0?e.at(s,t):e.at(o,t),t}intersectsRay(e){return this.intersectRay(e,EAe)!==null}makeEmpty(){return this.faces=[],this.vertices=[],this}addVertexToFace(e,t){return e.face=t,t.outside===null?this.assigned.append(e):this.assigned.insertBefore(t.outside,e),t.outside=e,this}removeVertexFromFace(e,t){return e===t.outside&&(e.next!==null&&e.next.face===t?t.outside=e.next:t.outside=null),this.assigned.remove(e),this}removeAllVerticesFromFace(e){if(e.outside!==null){const t=e.outside;let r=e.outside;for(;r.next!==null&&r.next.face===e;)r=r.next;return this.assigned.removeSubList(t,r),t.prev=r.next=null,e.outside=null,t}}deleteFaceVertices(e,t){const r=this.removeAllVerticesFromFace(e);if(r!==void 0)if(t===void 0)this.unassigned.appendChain(r);else{let s=r;do{const o=s.next;t.distanceToPoint(s.point)>this.tolerance?this.addVertexToFace(s,t):this.unassigned.append(s),s=o}while(s!==null)}return this}resolveUnassignedPoints(e){if(this.unassigned.isEmpty()===!1){let t=this.unassigned.first();do{const r=t.next;let s=this.tolerance,o=null;for(let l=0;ls&&(s=h,o=u),s>1e3*this.tolerance)break}}o!==null&&this.addVertexToFace(t,o),t=r}while(t!==null)}return this}computeExtremes(){const e=new Ae,t=new Ae,r=[],s=[];for(let o=0;o<3;o++)r[o]=s[o]=this.vertices[0];e.copy(this.vertices[0].point),t.copy(this.vertices[0].point);for(let o=0,l=this.vertices.length;ot.getComponent(f)&&(t.setComponent(f,h.getComponent(f)),s[f]=u)}return this.tolerance=3*Number.EPSILON*(Math.max(Math.abs(e.x),Math.abs(t.x))+Math.max(Math.abs(e.y),Math.abs(t.y))+Math.max(Math.abs(e.z),Math.abs(t.z))),{min:r,max:s}}computeInitialHull(){const e=this.vertices,t=this.computeExtremes(),r=t.min,s=t.max;let o=0,l=0;for(let b=0;b<3;b++){const w=s[b].point.getComponent(b)-r[b].point.getComponent(b);w>o&&(o=w,l=b)}const u=r[l],h=s[l];let f,g;o=0,hW.set(u.point,h.point);for(let b=0,w=this.vertices.length;bo&&(o=M,f=C)}}o=-1,nN.setFromCoplanarPoints(u.point,h.point,f.point);for(let b=0,w=this.vertices.length;bo&&(o=M,g=C)}}const y=[];if(nN.distanceToPoint(g.point)<0){y.push(Kg.create(u,h,f),Kg.create(g,h,u),Kg.create(g,f,h),Kg.create(g,u,f));for(let b=0;b<3;b++){const w=(b+1)%3;y[b+1].getEdge(2).setTwin(y[0].getEdge(w)),y[b+1].getEdge(1).setTwin(y[w+1].getEdge(0))}}else{y.push(Kg.create(u,f,h),Kg.create(g,u,h),Kg.create(g,h,f),Kg.create(g,f,u));for(let b=0;b<3;b++){const w=(b+1)%3;y[b+1].getEdge(2).setTwin(y[0].getEdge((3-b)%3)),y[b+1].getEdge(0).setTwin(y[w+1].getEdge(1))}}for(let b=0;b<4;b++)this.faces.push(y[b]);for(let b=0,w=e.length;bo&&(o=k,M=this.faces[A])}M!==null&&this.addVertexToFace(C,M)}}return this}reindexFaces(){const e=[];for(let t=0;tt&&(t=o,e=s),s=s.next}while(s!==null&&s.face===r);return e}}computeHorizon(e,t,r,s){this.deleteFaceVertices(r),r.mark=wAe;let o;t===null?o=t=r.getEdge(0):o=t.next;do{const l=o.twin,u=l.face;u.mark===EI&&(u.distanceToPoint(e)>this.tolerance?this.computeHorizon(e,l,u,s):s.push(o)),o=o.next}while(o!==t);return this}addAdjoiningFace(e,t){const r=Kg.create(e,t.tail(),t.head());return this.faces.push(r),r.getEdge(-1).setTwin(t.twin),r.getEdge(0)}addNewFaces(e,t){this.newFaces=[];let r=null,s=null;for(let o=0;o0;)t=t.next,e--;for(;e<0;)t=t.prev,e++;return t}compute(){const e=this.edge.tail(),t=this.edge.head(),r=this.edge.next.head();return OA.set(e.point,t.point,r.point),OA.getNormal(this.normal),OA.getMidpoint(this.midpoint),this.area=OA.getArea(),this.constant=this.normal.dot(this.midpoint),this}distanceToPoint(e){return this.normal.dot(e)-this.constant}}class rN{constructor(e,t){this.vertex=e,this.prev=null,this.next=null,this.twin=null,this.face=t}head(){return this.vertex}tail(){return this.prev?this.prev.vertex:null}length(){const e=this.head(),t=this.tail();return t!==null?t.point.distanceTo(e.point):-1}lengthSquared(){const e=this.head(),t=this.tail();return t!==null?t.point.distanceToSquared(e.point):-1}setTwin(e){return this.twin=e,e.twin=this,this}}class xAe{constructor(e){this.point=e,this.prev=null,this.next=null,this.face=null}}class pW{constructor(){this.head=null,this.tail=null}first(){return this.head}last(){return this.tail}clear(){return this.head=this.tail=null,this}insertBefore(e,t){return t.prev=e.prev,t.next=e,t.prev===null?this.head=t:t.prev.next=t,e.prev=t,this}insertAfter(e,t){return t.prev=e,t.next=e.next,t.next===null?this.tail=t:t.next.prev=t,e.next=t,this}append(e){return this.head===null?this.head=e:this.tail.next=e,e.prev=this.tail,e.next=null,this.tail=e,this}appendChain(e){for(this.head===null?this.head=e:this.tail.next=e,e.prev=this.tail;e.next!==null;)e=e.next;return this.tail=e,this}remove(e){return e.prev===null?this.head=e.next:e.prev.next=e.next,e.next===null?this.tail=e.prev:e.next.prev=e.prev,this}removeSubList(e,t){return e.prev===null?this.head=t.next:e.prev.next=t.next,t.next===null?this.tail=e.prev:t.next.prev=e.prev,this}isEmpty(){return this.head===null}}class mW extends ui{constructor(e=[]){super();const t=[],r=[];fW===void 0&&console.error("THREE.ConvexGeometry: ConvexGeometry relies on ConvexHull");const s=new fW().setFromPoints(e).faces;for(let o=0;o{const t=n[0].index!==null,r=new Set(Object.keys(n[0].attributes)),s=new Set(Object.keys(n[0].morphAttributes)),o={},l={},u=n[0].morphTargetsRelative,h=new ui;let f=0;if(n.forEach((g,y)=>{let b=0;if(t!==(g.index!==null))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+y+". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."),null;for(let w in g.attributes){if(!r.has(w))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+y+'. All geometries must have compatible attributes; make sure "'+w+'" attribute exists among all geometries, or in none of them.'),null;o[w]===void 0&&(o[w]=[]),o[w].push(g.attributes[w]),b++}if(b!==r.size)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+y+". Make sure all geometries have the same number of attributes."),null;if(u!==g.morphTargetsRelative)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+y+". .morphTargetsRelative must be consistent throughout all geometries."),null;for(let w in g.morphAttributes){if(!s.has(w))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+y+". .morphAttributes must be consistent throughout all geometries."),null;l[w]===void 0&&(l[w]=[]),l[w].push(g.morphAttributes[w])}if(h.userData.mergedUserData=h.userData.mergedUserData||[],h.userData.mergedUserData.push(g.userData),e){let w;if(g.index)w=g.index.count;else if(g.attributes.position!==void 0)w=g.attributes.position.count;else return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+y+". The geometry must have either an index or a position attribute"),null;h.addGroup(f,w,y),f+=w}}),t){let g=0;const y=[];n.forEach(b=>{const w=b.index;for(let C=0;C{let e,t,r,s=0;if(n.forEach(o=>{if(e===void 0&&(e=o.array.constructor),e!==o.array.constructor)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."),null;if(t===void 0&&(t=o.itemSize),t!==o.itemSize)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."),null;if(r===void 0&&(r=o.normalized),r!==o.normalized)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."),null;s+=o.array.length}),e&&t){const o=new e(s);let l=0;return n.forEach(u=>{o.set(u.array,l),l+=u.array.length}),new Do(o,t,r)}},_W=(n,e)=>(n%e+e)%e;class $Ae extends jm{constructor(e,t){super(),Ni(this,"object",void 0),Ni(this,"domElement",void 0),Ni(this,"enabled",!0),Ni(this,"target",new Ae),Ni(this,"minDistance",0),Ni(this,"maxDistance",1/0),Ni(this,"minZoom",0),Ni(this,"maxZoom",1/0),Ni(this,"minPolarAngle",0),Ni(this,"maxPolarAngle",Math.PI),Ni(this,"minAzimuthAngle",-1/0),Ni(this,"maxAzimuthAngle",1/0),Ni(this,"enableDamping",!1),Ni(this,"dampingFactor",.05),Ni(this,"enableZoom",!0),Ni(this,"zoomSpeed",1),Ni(this,"enableRotate",!0),Ni(this,"rotateSpeed",1),Ni(this,"enablePan",!0),Ni(this,"panSpeed",1),Ni(this,"screenSpacePanning",!0),Ni(this,"keyPanSpeed",7),Ni(this,"autoRotate",!1),Ni(this,"autoRotateSpeed",2),Ni(this,"reverseOrbit",!1),Ni(this,"keys",{LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"}),Ni(this,"mouseButtons",{LEFT:l1.ROTATE,MIDDLE:l1.DOLLY,RIGHT:l1.PAN}),Ni(this,"touches",{ONE:u1.ROTATE,TWO:u1.DOLLY_PAN}),Ni(this,"target0",void 0),Ni(this,"position0",void 0),Ni(this,"zoom0",void 0),Ni(this,"_domElementKeyEvents",null),Ni(this,"getPolarAngle",void 0),Ni(this,"getAzimuthalAngle",void 0),Ni(this,"setPolarAngle",void 0),Ni(this,"setAzimuthalAngle",void 0),Ni(this,"getDistance",void 0),Ni(this,"listenToKeyEvents",void 0),Ni(this,"saveState",void 0),Ni(this,"reset",void 0),Ni(this,"update",void 0),Ni(this,"connect",void 0),Ni(this,"dispose",void 0),this.object=e,this.domElement=t,this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object instanceof Za?this.object.zoom:1,this.getPolarAngle=()=>g.phi,this.getAzimuthalAngle=()=>g.theta,this.setPolarAngle=te=>{let me=_W(te,2*Math.PI),ke=g.phi;ke<0&&(ke+=2*Math.PI),me<0&&(me+=2*Math.PI);let Xe=Math.abs(me-ke);2*Math.PI-Xe{let me=_W(te,2*Math.PI),ke=g.theta;ke<0&&(ke+=2*Math.PI),me<0&&(me+=2*Math.PI);let Xe=Math.abs(me-ke);2*Math.PI-Xer.object.position.distanceTo(r.target),this.listenToKeyEvents=te=>{te.addEventListener("keydown",$e),this._domElementKeyEvents=te},this.saveState=()=>{r.target0.copy(r.target),r.position0.copy(r.object.position),r.zoom0=r.object instanceof Za?r.object.zoom:1},this.reset=()=>{r.target.copy(r.target0),r.object.position.copy(r.position0),r.object instanceof Za&&(r.object.zoom=r.zoom0,r.object.updateProjectionMatrix()),r.dispatchEvent(s),r.update(),h=u.NONE},this.update=(()=>{const te=new Ae,me=new Sl().setFromUnitVectors(e.up,new Ae(0,1,0)),ke=me.clone().invert(),Xe=new Ae,Wt=new Sl,Ge=2*Math.PI;return function(){const tn=r.object.position;te.copy(tn).sub(r.target),te.applyQuaternion(me),g.setFromVector3(te),r.autoRotate&&h===u.NONE&&q(le()),r.enableDamping?(g.theta+=y.theta*r.dampingFactor,g.phi+=y.phi*r.dampingFactor):(g.theta+=y.theta,g.phi+=y.phi);let _t=r.minAzimuthAngle,Jt=r.maxAzimuthAngle;return isFinite(_t)&&isFinite(Jt)&&(_t<-Math.PI?_t+=Ge:_t>Math.PI&&(_t-=Ge),Jt<-Math.PI?Jt+=Ge:Jt>Math.PI&&(Jt-=Ge),_t<=Jt?g.theta=Math.max(_t,Math.min(Jt,g.theta)):g.theta=g.theta>(_t+Jt)/2?Math.max(_t,g.theta):Math.min(Jt,g.theta)),g.phi=Math.max(r.minPolarAngle,Math.min(r.maxPolarAngle,g.phi)),g.makeSafe(),g.radius*=b,g.radius=Math.max(r.minDistance,Math.min(r.maxDistance,g.radius)),r.enableDamping===!0?r.target.addScaledVector(w,r.dampingFactor):r.target.add(w),te.setFromSpherical(g),te.applyQuaternion(ke),tn.copy(r.target).add(te),r.object.lookAt(r.target),r.enableDamping===!0?(y.theta*=1-r.dampingFactor,y.phi*=1-r.dampingFactor,w.multiplyScalar(1-r.dampingFactor)):(y.set(0,0,0),w.set(0,0,0)),b=1,C||Xe.distanceToSquared(r.object.position)>f||8*(1-Wt.dot(r.object.quaternion))>f?(r.dispatchEvent(s),Xe.copy(r.object.position),Wt.copy(r.object.quaternion),C=!1,!0):!1}})(),this.connect=te=>{te===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),r.domElement=te,r.domElement.style.touchAction="none",r.domElement.addEventListener("contextmenu",It),r.domElement.addEventListener("pointerdown",kt),r.domElement.addEventListener("pointercancel",At),r.domElement.addEventListener("wheel",se)},this.dispose=()=>{var te,me,ke,Xe,Wt,Ge;(te=r.domElement)===null||te===void 0||te.removeEventListener("contextmenu",It),(me=r.domElement)===null||me===void 0||me.removeEventListener("pointerdown",kt),(ke=r.domElement)===null||ke===void 0||ke.removeEventListener("pointercancel",At),(Xe=r.domElement)===null||Xe===void 0||Xe.removeEventListener("wheel",se),(Wt=r.domElement)===null||Wt===void 0||Wt.ownerDocument.removeEventListener("pointermove",vt),(Ge=r.domElement)===null||Ge===void 0||Ge.ownerDocument.removeEventListener("pointerup",Mt),r._domElementKeyEvents!==null&&r._domElementKeyEvents.removeEventListener("keydown",$e)};const r=this,s={type:"change"},o={type:"start"},l={type:"end"},u={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let h=u.NONE;const f=1e-6,g=new NP,y=new NP;let b=1;const w=new Ae;let C=!1;const M=new jt,A=new jt,k=new jt,L=new jt,P=new jt,D=new jt,z=new jt,U=new jt,V=new jt,H=[],oe={};function le(){return 2*Math.PI/60/60*r.autoRotateSpeed}function Z(){return Math.pow(.95,r.zoomSpeed)}function q(te){r.reverseOrbit?y.theta+=te:y.theta-=te}function he(te){r.reverseOrbit?y.phi+=te:y.phi-=te}const ae=(()=>{const te=new Ae;return function(me,ke){te.setFromMatrixColumn(ke,0),te.multiplyScalar(-me),w.add(te)}})(),ue=(()=>{const te=new Ae;return function(me,ke){r.screenSpacePanning===!0?te.setFromMatrixColumn(ke,1):(te.setFromMatrixColumn(ke,0),te.crossVectors(r.object.up,te)),te.multiplyScalar(me),w.add(te)}})(),ge=(()=>{const te=new Ae;return function(me,ke){const Xe=r.domElement;if(Xe&&r.object instanceof Za&&r.object.isPerspectiveCamera){const Wt=r.object.position;te.copy(Wt).sub(r.target);let Ge=te.length();Ge*=Math.tan(r.object.fov/2*Math.PI/180),ae(2*me*Ge/Xe.clientHeight,r.object.matrix),ue(2*ke*Ge/Xe.clientHeight,r.object.matrix)}else Xe&&r.object instanceof u_&&r.object.isOrthographicCamera?(ae(me*(r.object.right-r.object.left)/r.object.zoom/Xe.clientWidth,r.object.matrix),ue(ke*(r.object.top-r.object.bottom)/r.object.zoom/Xe.clientHeight,r.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),r.enablePan=!1)}})();function we(te){r.object instanceof Za&&r.object.isPerspectiveCamera?b/=te:r.object instanceof u_&&r.object.isOrthographicCamera?(r.object.zoom=Math.max(r.minZoom,Math.min(r.maxZoom,r.object.zoom*te)),r.object.updateProjectionMatrix(),C=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),r.enableZoom=!1)}function J(te){r.object instanceof Za&&r.object.isPerspectiveCamera?b*=te:r.object instanceof u_&&r.object.isOrthographicCamera?(r.object.zoom=Math.max(r.minZoom,Math.min(r.maxZoom,r.object.zoom/te)),r.object.updateProjectionMatrix(),C=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),r.enableZoom=!1)}function re(te){M.set(te.clientX,te.clientY)}function ie(te){z.set(te.clientX,te.clientY)}function fe(te){L.set(te.clientX,te.clientY)}function Te(te){A.set(te.clientX,te.clientY),k.subVectors(A,M).multiplyScalar(r.rotateSpeed);const me=r.domElement;me&&(q(2*Math.PI*k.x/me.clientHeight),he(2*Math.PI*k.y/me.clientHeight)),M.copy(A),r.update()}function Fe(te){U.set(te.clientX,te.clientY),V.subVectors(U,z),V.y>0?we(Z()):V.y<0&&J(Z()),z.copy(U),r.update()}function Ie(te){P.set(te.clientX,te.clientY),D.subVectors(P,L).multiplyScalar(r.panSpeed),ge(D.x,D.y),L.copy(P),r.update()}function Je(te){te.deltaY<0?J(Z()):te.deltaY>0&&we(Z()),r.update()}function Re(te){let me=!1;switch(te.code){case r.keys.UP:ge(0,r.keyPanSpeed),me=!0;break;case r.keys.BOTTOM:ge(0,-r.keyPanSpeed),me=!0;break;case r.keys.LEFT:ge(r.keyPanSpeed,0),me=!0;break;case r.keys.RIGHT:ge(-r.keyPanSpeed,0),me=!0;break}me&&(te.preventDefault(),r.update())}function Qe(){if(H.length==1)M.set(H[0].pageX,H[0].pageY);else{const te=.5*(H[0].pageX+H[1].pageX),me=.5*(H[0].pageY+H[1].pageY);M.set(te,me)}}function nt(){if(H.length==1)L.set(H[0].pageX,H[0].pageY);else{const te=.5*(H[0].pageX+H[1].pageX),me=.5*(H[0].pageY+H[1].pageY);L.set(te,me)}}function ft(){const te=H[0].pageX-H[1].pageX,me=H[0].pageY-H[1].pageY,ke=Math.sqrt(te*te+me*me);z.set(0,ke)}function lt(){r.enableZoom&&ft(),r.enablePan&&nt()}function ze(){r.enableZoom&&ft(),r.enableRotate&&Qe()}function Ce(te){if(H.length==1)A.set(te.pageX,te.pageY);else{const ke=Q(te),Xe=.5*(te.pageX+ke.x),Wt=.5*(te.pageY+ke.y);A.set(Xe,Wt)}k.subVectors(A,M).multiplyScalar(r.rotateSpeed);const me=r.domElement;me&&(q(2*Math.PI*k.x/me.clientHeight),he(2*Math.PI*k.y/me.clientHeight)),M.copy(A)}function He(te){if(H.length==1)P.set(te.pageX,te.pageY);else{const me=Q(te),ke=.5*(te.pageX+me.x),Xe=.5*(te.pageY+me.y);P.set(ke,Xe)}D.subVectors(P,L).multiplyScalar(r.panSpeed),ge(D.x,D.y),L.copy(P)}function rt(te){const me=Q(te),ke=te.pageX-me.x,Xe=te.pageY-me.y,Wt=Math.sqrt(ke*ke+Xe*Xe);U.set(0,Wt),V.set(0,Math.pow(U.y/z.y,r.zoomSpeed)),we(V.y),z.copy(U)}function it(te){r.enableZoom&&rt(te),r.enablePan&&He(te)}function Nt(te){r.enableZoom&&rt(te),r.enableRotate&&Ce(te)}function kt(te){if(r.enabled!==!1){if(H.length===0){var me,ke;(me=r.domElement)===null||me===void 0||me.ownerDocument.addEventListener("pointermove",vt),(ke=r.domElement)===null||ke===void 0||ke.ownerDocument.addEventListener("pointerup",Mt)}pt(te),te.pointerType==="touch"?ht(te):mt(te)}}function vt(te){r.enabled!==!1&&(te.pointerType==="touch"?St(te):xe(te))}function Mt(te){if(Ke(te),H.length===0){var me,ke,Xe;(me=r.domElement)===null||me===void 0||me.releasePointerCapture(te.pointerId),(ke=r.domElement)===null||ke===void 0||ke.ownerDocument.removeEventListener("pointermove",vt),(Xe=r.domElement)===null||Xe===void 0||Xe.ownerDocument.removeEventListener("pointerup",Mt)}r.dispatchEvent(l),h=u.NONE}function At(te){Ke(te)}function mt(te){let me;switch(te.button){case 0:me=r.mouseButtons.LEFT;break;case 1:me=r.mouseButtons.MIDDLE;break;case 2:me=r.mouseButtons.RIGHT;break;default:me=-1}switch(me){case l1.DOLLY:if(r.enableZoom===!1)return;ie(te),h=u.DOLLY;break;case l1.ROTATE:if(te.ctrlKey||te.metaKey||te.shiftKey){if(r.enablePan===!1)return;fe(te),h=u.PAN}else{if(r.enableRotate===!1)return;re(te),h=u.ROTATE}break;case l1.PAN:if(te.ctrlKey||te.metaKey||te.shiftKey){if(r.enableRotate===!1)return;re(te),h=u.ROTATE}else{if(r.enablePan===!1)return;fe(te),h=u.PAN}break;default:h=u.NONE}h!==u.NONE&&r.dispatchEvent(o)}function xe(te){if(r.enabled!==!1)switch(h){case u.ROTATE:if(r.enableRotate===!1)return;Te(te);break;case u.DOLLY:if(r.enableZoom===!1)return;Fe(te);break;case u.PAN:if(r.enablePan===!1)return;Ie(te);break}}function se(te){r.enabled===!1||r.enableZoom===!1||h!==u.NONE&&h!==u.ROTATE||(te.preventDefault(),r.dispatchEvent(o),Je(te),r.dispatchEvent(l))}function $e(te){r.enabled===!1||r.enablePan===!1||Re(te)}function ht(te){switch(Le(te),H.length){case 1:switch(r.touches.ONE){case u1.ROTATE:if(r.enableRotate===!1)return;Qe(),h=u.TOUCH_ROTATE;break;case u1.PAN:if(r.enablePan===!1)return;nt(),h=u.TOUCH_PAN;break;default:h=u.NONE}break;case 2:switch(r.touches.TWO){case u1.DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;lt(),h=u.TOUCH_DOLLY_PAN;break;case u1.DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;ze(),h=u.TOUCH_DOLLY_ROTATE;break;default:h=u.NONE}break;default:h=u.NONE}h!==u.NONE&&r.dispatchEvent(o)}function St(te){switch(Le(te),h){case u.TOUCH_ROTATE:if(r.enableRotate===!1)return;Ce(te),r.update();break;case u.TOUCH_PAN:if(r.enablePan===!1)return;He(te),r.update();break;case u.TOUCH_DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;it(te),r.update();break;case u.TOUCH_DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;Nt(te),r.update();break;default:h=u.NONE}}function It(te){r.enabled!==!1&&te.preventDefault()}function pt(te){H.push(te)}function Ke(te){delete oe[te.pointerId];for(let me=0;me=4){this.makeEmpty();for(let t=0,r=e.length;tthis.tolerance)return!1;return!0}intersectRay(e,t){const r=this.faces;let s=-1/0,o=1/0;for(let l=0,u=r.length;l0&&g>=0)return null;const y=g!==0?-f/g:0;if(!(y<=0)&&(g>0?o=Math.min(y,o):s=Math.max(y,s),s>o))return null}return s!==-1/0?e.at(s,t):e.at(o,t),t}intersectsRay(e){return this.intersectRay(e,EAe)!==null}makeEmpty(){return this.faces=[],this.vertices=[],this}addVertexToFace(e,t){return e.face=t,t.outside===null?this.assigned.append(e):this.assigned.insertBefore(t.outside,e),t.outside=e,this}removeVertexFromFace(e,t){return e===t.outside&&(e.next!==null&&e.next.face===t?t.outside=e.next:t.outside=null),this.assigned.remove(e),this}removeAllVerticesFromFace(e){if(e.outside!==null){const t=e.outside;let r=e.outside;for(;r.next!==null&&r.next.face===e;)r=r.next;return this.assigned.removeSubList(t,r),t.prev=r.next=null,e.outside=null,t}}deleteFaceVertices(e,t){const r=this.removeAllVerticesFromFace(e);if(r!==void 0)if(t===void 0)this.unassigned.appendChain(r);else{let s=r;do{const o=s.next;t.distanceToPoint(s.point)>this.tolerance?this.addVertexToFace(s,t):this.unassigned.append(s),s=o}while(s!==null)}return this}resolveUnassignedPoints(e){if(this.unassigned.isEmpty()===!1){let t=this.unassigned.first();do{const r=t.next;let s=this.tolerance,o=null;for(let l=0;ls&&(s=h,o=u),s>1e3*this.tolerance)break}}o!==null&&this.addVertexToFace(t,o),t=r}while(t!==null)}return this}computeExtremes(){const e=new Me,t=new Me,r=[],s=[];for(let o=0;o<3;o++)r[o]=s[o]=this.vertices[0];e.copy(this.vertices[0].point),t.copy(this.vertices[0].point);for(let o=0,l=this.vertices.length;ot.getComponent(f)&&(t.setComponent(f,h.getComponent(f)),s[f]=u)}return this.tolerance=3*Number.EPSILON*(Math.max(Math.abs(e.x),Math.abs(t.x))+Math.max(Math.abs(e.y),Math.abs(t.y))+Math.max(Math.abs(e.z),Math.abs(t.z))),{min:r,max:s}}computeInitialHull(){const e=this.vertices,t=this.computeExtremes(),r=t.min,s=t.max;let o=0,l=0;for(let b=0;b<3;b++){const w=s[b].point.getComponent(b)-r[b].point.getComponent(b);w>o&&(o=w,l=b)}const u=r[l],h=s[l];let f,g;o=0,dW.set(u.point,h.point);for(let b=0,w=this.vertices.length;bo&&(o=M,f=C)}}o=-1,nN.setFromCoplanarPoints(u.point,h.point,f.point);for(let b=0,w=this.vertices.length;bo&&(o=M,g=C)}}const y=[];if(nN.distanceToPoint(g.point)<0){y.push(Kg.create(u,h,f),Kg.create(g,h,u),Kg.create(g,f,h),Kg.create(g,u,f));for(let b=0;b<3;b++){const w=(b+1)%3;y[b+1].getEdge(2).setTwin(y[0].getEdge(w)),y[b+1].getEdge(1).setTwin(y[w+1].getEdge(0))}}else{y.push(Kg.create(u,f,h),Kg.create(g,u,h),Kg.create(g,h,f),Kg.create(g,f,u));for(let b=0;b<3;b++){const w=(b+1)%3;y[b+1].getEdge(2).setTwin(y[0].getEdge((3-b)%3)),y[b+1].getEdge(0).setTwin(y[w+1].getEdge(1))}}for(let b=0;b<4;b++)this.faces.push(y[b]);for(let b=0,w=e.length;bo&&(o=k,M=this.faces[A])}M!==null&&this.addVertexToFace(C,M)}}return this}reindexFaces(){const e=[];for(let t=0;tt&&(t=o,e=s),s=s.next}while(s!==null&&s.face===r);return e}}computeHorizon(e,t,r,s){this.deleteFaceVertices(r),r.mark=wAe;let o;t===null?o=t=r.getEdge(0):o=t.next;do{const l=o.twin,u=l.face;u.mark===EI&&(u.distanceToPoint(e)>this.tolerance?this.computeHorizon(e,l,u,s):s.push(o)),o=o.next}while(o!==t);return this}addAdjoiningFace(e,t){const r=Kg.create(e,t.tail(),t.head());return this.faces.push(r),r.getEdge(-1).setTwin(t.twin),r.getEdge(0)}addNewFaces(e,t){this.newFaces=[];let r=null,s=null;for(let o=0;o0;)t=t.next,e--;for(;e<0;)t=t.prev,e++;return t}compute(){const e=this.edge.tail(),t=this.edge.head(),r=this.edge.next.head();return OA.set(e.point,t.point,r.point),OA.getNormal(this.normal),OA.getMidpoint(this.midpoint),this.area=OA.getArea(),this.constant=this.normal.dot(this.midpoint),this}distanceToPoint(e){return this.normal.dot(e)-this.constant}}class rN{constructor(e,t){this.vertex=e,this.prev=null,this.next=null,this.twin=null,this.face=t}head(){return this.vertex}tail(){return this.prev?this.prev.vertex:null}length(){const e=this.head(),t=this.tail();return t!==null?t.point.distanceTo(e.point):-1}lengthSquared(){const e=this.head(),t=this.tail();return t!==null?t.point.distanceToSquared(e.point):-1}setTwin(e){return this.twin=e,e.twin=this,this}}class xAe{constructor(e){this.point=e,this.prev=null,this.next=null,this.face=null}}class mW{constructor(){this.head=null,this.tail=null}first(){return this.head}last(){return this.tail}clear(){return this.head=this.tail=null,this}insertBefore(e,t){return t.prev=e.prev,t.next=e,t.prev===null?this.head=t:t.prev.next=t,e.prev=t,this}insertAfter(e,t){return t.prev=e,t.next=e.next,t.next===null?this.tail=t:t.next.prev=t,e.next=t,this}append(e){return this.head===null?this.head=e:this.tail.next=e,e.prev=this.tail,e.next=null,this.tail=e,this}appendChain(e){for(this.head===null?this.head=e:this.tail.next=e,e.prev=this.tail;e.next!==null;)e=e.next;return this.tail=e,this}remove(e){return e.prev===null?this.head=e.next:e.prev.next=e.next,e.next===null?this.tail=e.prev:e.next.prev=e.prev,this}removeSubList(e,t){return e.prev===null?this.head=t.next:e.prev.next=t.next,t.next===null?this.tail=e.prev:t.next.prev=e.prev,this}isEmpty(){return this.head===null}}class gW extends ui{constructor(e=[]){super();const t=[],r=[];pW===void 0&&console.error("THREE.ConvexGeometry: ConvexGeometry relies on ConvexHull");const s=new pW().setFromPoints(e).faces;for(let o=0;o{const t=n[0].index!==null,r=new Set(Object.keys(n[0].attributes)),s=new Set(Object.keys(n[0].morphAttributes)),o={},l={},u=n[0].morphTargetsRelative,h=new ui;let f=0;if(n.forEach((g,y)=>{let b=0;if(t!==(g.index!==null))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+y+". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."),null;for(let w in g.attributes){if(!r.has(w))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+y+'. All geometries must have compatible attributes; make sure "'+w+'" attribute exists among all geometries, or in none of them.'),null;o[w]===void 0&&(o[w]=[]),o[w].push(g.attributes[w]),b++}if(b!==r.size)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+y+". Make sure all geometries have the same number of attributes."),null;if(u!==g.morphTargetsRelative)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+y+". .morphTargetsRelative must be consistent throughout all geometries."),null;for(let w in g.morphAttributes){if(!s.has(w))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+y+". .morphAttributes must be consistent throughout all geometries."),null;l[w]===void 0&&(l[w]=[]),l[w].push(g.morphAttributes[w])}if(h.userData.mergedUserData=h.userData.mergedUserData||[],h.userData.mergedUserData.push(g.userData),e){let w;if(g.index)w=g.index.count;else if(g.attributes.position!==void 0)w=g.attributes.position.count;else return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+y+". The geometry must have either an index or a position attribute"),null;h.addGroup(f,w,y),f+=w}}),t){let g=0;const y=[];n.forEach(b=>{const w=b.index;for(let C=0;C{let e,t,r,s=0;if(n.forEach(o=>{if(e===void 0&&(e=o.array.constructor),e!==o.array.constructor)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."),null;if(t===void 0&&(t=o.itemSize),t!==o.itemSize)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."),null;if(r===void 0&&(r=o.normalized),r!==o.normalized)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."),null;s+=o.array.length}),e&&t){const o=new e(s);let l=0;return n.forEach(u=>{o.set(u.array,l),l+=u.array.length}),new Do(o,t,r)}},vW=(n,e)=>(n%e+e)%e;class $Ae extends jm{constructor(e,t){super(),Ni(this,"object",void 0),Ni(this,"domElement",void 0),Ni(this,"enabled",!0),Ni(this,"target",new Me),Ni(this,"minDistance",0),Ni(this,"maxDistance",1/0),Ni(this,"minZoom",0),Ni(this,"maxZoom",1/0),Ni(this,"minPolarAngle",0),Ni(this,"maxPolarAngle",Math.PI),Ni(this,"minAzimuthAngle",-1/0),Ni(this,"maxAzimuthAngle",1/0),Ni(this,"enableDamping",!1),Ni(this,"dampingFactor",.05),Ni(this,"enableZoom",!0),Ni(this,"zoomSpeed",1),Ni(this,"enableRotate",!0),Ni(this,"rotateSpeed",1),Ni(this,"enablePan",!0),Ni(this,"panSpeed",1),Ni(this,"screenSpacePanning",!0),Ni(this,"keyPanSpeed",7),Ni(this,"autoRotate",!1),Ni(this,"autoRotateSpeed",2),Ni(this,"reverseOrbit",!1),Ni(this,"keys",{LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"}),Ni(this,"mouseButtons",{LEFT:u1.ROTATE,MIDDLE:u1.DOLLY,RIGHT:u1.PAN}),Ni(this,"touches",{ONE:c1.ROTATE,TWO:c1.DOLLY_PAN}),Ni(this,"target0",void 0),Ni(this,"position0",void 0),Ni(this,"zoom0",void 0),Ni(this,"_domElementKeyEvents",null),Ni(this,"getPolarAngle",void 0),Ni(this,"getAzimuthalAngle",void 0),Ni(this,"setPolarAngle",void 0),Ni(this,"setAzimuthalAngle",void 0),Ni(this,"getDistance",void 0),Ni(this,"listenToKeyEvents",void 0),Ni(this,"saveState",void 0),Ni(this,"reset",void 0),Ni(this,"update",void 0),Ni(this,"connect",void 0),Ni(this,"dispose",void 0),this.object=e,this.domElement=t,this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object instanceof Za?this.object.zoom:1,this.getPolarAngle=()=>g.phi,this.getAzimuthalAngle=()=>g.theta,this.setPolarAngle=te=>{let pe=vW(te,2*Math.PI),Ae=g.phi;Ae<0&&(Ae+=2*Math.PI),pe<0&&(pe+=2*Math.PI);let Je=Math.abs(pe-Ae);2*Math.PI-Je{let pe=vW(te,2*Math.PI),Ae=g.theta;Ae<0&&(Ae+=2*Math.PI),pe<0&&(pe+=2*Math.PI);let Je=Math.abs(pe-Ae);2*Math.PI-Jer.object.position.distanceTo(r.target),this.listenToKeyEvents=te=>{te.addEventListener("keydown",Pe),this._domElementKeyEvents=te},this.saveState=()=>{r.target0.copy(r.target),r.position0.copy(r.object.position),r.zoom0=r.object instanceof Za?r.object.zoom:1},this.reset=()=>{r.target.copy(r.target0),r.object.position.copy(r.position0),r.object instanceof Za&&(r.object.zoom=r.zoom0,r.object.updateProjectionMatrix()),r.dispatchEvent(s),r.update(),h=u.NONE},this.update=(()=>{const te=new Me,pe=new Sl().setFromUnitVectors(e.up,new Me(0,1,0)),Ae=pe.clone().invert(),Je=new Me,jt=new Sl,Ge=2*Math.PI;return function(){const qt=r.object.position;te.copy(qt).sub(r.target),te.applyQuaternion(pe),g.setFromVector3(te),r.autoRotate&&h===u.NONE&&q(le()),r.enableDamping?(g.theta+=y.theta*r.dampingFactor,g.phi+=y.phi*r.dampingFactor):(g.theta+=y.theta,g.phi+=y.phi);let pt=r.minAzimuthAngle,Jt=r.maxAzimuthAngle;return isFinite(pt)&&isFinite(Jt)&&(pt<-Math.PI?pt+=Ge:pt>Math.PI&&(pt-=Ge),Jt<-Math.PI?Jt+=Ge:Jt>Math.PI&&(Jt-=Ge),pt<=Jt?g.theta=Math.max(pt,Math.min(Jt,g.theta)):g.theta=g.theta>(pt+Jt)/2?Math.max(pt,g.theta):Math.min(Jt,g.theta)),g.phi=Math.max(r.minPolarAngle,Math.min(r.maxPolarAngle,g.phi)),g.makeSafe(),g.radius*=b,g.radius=Math.max(r.minDistance,Math.min(r.maxDistance,g.radius)),r.enableDamping===!0?r.target.addScaledVector(w,r.dampingFactor):r.target.add(w),te.setFromSpherical(g),te.applyQuaternion(Ae),qt.copy(r.target).add(te),r.object.lookAt(r.target),r.enableDamping===!0?(y.theta*=1-r.dampingFactor,y.phi*=1-r.dampingFactor,w.multiplyScalar(1-r.dampingFactor)):(y.set(0,0,0),w.set(0,0,0)),b=1,C||Je.distanceToSquared(r.object.position)>f||8*(1-jt.dot(r.object.quaternion))>f?(r.dispatchEvent(s),Je.copy(r.object.position),jt.copy(r.object.quaternion),C=!1,!0):!1}})(),this.connect=te=>{te===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),r.domElement=te,r.domElement.style.touchAction="none",r.domElement.addEventListener("contextmenu",It),r.domElement.addEventListener("pointerdown",kt),r.domElement.addEventListener("pointercancel",At),r.domElement.addEventListener("wheel",ie)},this.dispose=()=>{var te,pe,Ae,Je,jt,Ge;(te=r.domElement)===null||te===void 0||te.removeEventListener("contextmenu",It),(pe=r.domElement)===null||pe===void 0||pe.removeEventListener("pointerdown",kt),(Ae=r.domElement)===null||Ae===void 0||Ae.removeEventListener("pointercancel",At),(Je=r.domElement)===null||Je===void 0||Je.removeEventListener("wheel",ie),(jt=r.domElement)===null||jt===void 0||jt.ownerDocument.removeEventListener("pointermove",vt),(Ge=r.domElement)===null||Ge===void 0||Ge.ownerDocument.removeEventListener("pointerup",Ct),r._domElementKeyEvents!==null&&r._domElementKeyEvents.removeEventListener("keydown",Pe)};const r=this,s={type:"change"},o={type:"start"},l={type:"end"},u={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let h=u.NONE;const f=1e-6,g=new NP,y=new NP;let b=1;const w=new Me;let C=!1;const M=new Vt,A=new Vt,k=new Vt,L=new Vt,P=new Vt,D=new Vt,z=new Vt,U=new Vt,V=new Vt,H=[],oe={};function le(){return 2*Math.PI/60/60*r.autoRotateSpeed}function Z(){return Math.pow(.95,r.zoomSpeed)}function q(te){r.reverseOrbit?y.theta+=te:y.theta-=te}function he(te){r.reverseOrbit?y.phi+=te:y.phi-=te}const ae=(()=>{const te=new Me;return function(pe,Ae){te.setFromMatrixColumn(Ae,0),te.multiplyScalar(-pe),w.add(te)}})(),ue=(()=>{const te=new Me;return function(pe,Ae){r.screenSpacePanning===!0?te.setFromMatrixColumn(Ae,1):(te.setFromMatrixColumn(Ae,0),te.crossVectors(r.object.up,te)),te.multiplyScalar(pe),w.add(te)}})(),ge=(()=>{const te=new Me;return function(pe,Ae){const Je=r.domElement;if(Je&&r.object instanceof Za&&r.object.isPerspectiveCamera){const jt=r.object.position;te.copy(jt).sub(r.target);let Ge=te.length();Ge*=Math.tan(r.object.fov/2*Math.PI/180),ae(2*pe*Ge/Je.clientHeight,r.object.matrix),ue(2*Ae*Ge/Je.clientHeight,r.object.matrix)}else Je&&r.object instanceof u_&&r.object.isOrthographicCamera?(ae(pe*(r.object.right-r.object.left)/r.object.zoom/Je.clientWidth,r.object.matrix),ue(Ae*(r.object.top-r.object.bottom)/r.object.zoom/Je.clientHeight,r.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),r.enablePan=!1)}})();function we(te){r.object instanceof Za&&r.object.isPerspectiveCamera?b/=te:r.object instanceof u_&&r.object.isOrthographicCamera?(r.object.zoom=Math.max(r.minZoom,Math.min(r.maxZoom,r.object.zoom*te)),r.object.updateProjectionMatrix(),C=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),r.enableZoom=!1)}function J(te){r.object instanceof Za&&r.object.isPerspectiveCamera?b*=te:r.object instanceof u_&&r.object.isOrthographicCamera?(r.object.zoom=Math.max(r.minZoom,Math.min(r.maxZoom,r.object.zoom/te)),r.object.updateProjectionMatrix(),C=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),r.enableZoom=!1)}function re(te){M.set(te.clientX,te.clientY)}function se(te){z.set(te.clientX,te.clientY)}function fe(te){L.set(te.clientX,te.clientY)}function Te(te){A.set(te.clientX,te.clientY),k.subVectors(A,M).multiplyScalar(r.rotateSpeed);const pe=r.domElement;pe&&(q(2*Math.PI*k.x/pe.clientHeight),he(2*Math.PI*k.y/pe.clientHeight)),M.copy(A),r.update()}function Fe(te){U.set(te.clientX,te.clientY),V.subVectors(U,z),V.y>0?we(Z()):V.y<0&&J(Z()),z.copy(U),r.update()}function Ie(te){P.set(te.clientX,te.clientY),D.subVectors(P,L).multiplyScalar(r.panSpeed),ge(D.x,D.y),L.copy(P),r.update()}function qe(te){te.deltaY<0?J(Z()):te.deltaY>0&&we(Z()),r.update()}function Re(te){let pe=!1;switch(te.code){case r.keys.UP:ge(0,r.keyPanSpeed),pe=!0;break;case r.keys.BOTTOM:ge(0,-r.keyPanSpeed),pe=!0;break;case r.keys.LEFT:ge(r.keyPanSpeed,0),pe=!0;break;case r.keys.RIGHT:ge(-r.keyPanSpeed,0),pe=!0;break}pe&&(te.preventDefault(),r.update())}function Ze(){if(H.length==1)M.set(H[0].pageX,H[0].pageY);else{const te=.5*(H[0].pageX+H[1].pageX),pe=.5*(H[0].pageY+H[1].pageY);M.set(te,pe)}}function rt(){if(H.length==1)L.set(H[0].pageX,H[0].pageY);else{const te=.5*(H[0].pageX+H[1].pageX),pe=.5*(H[0].pageY+H[1].pageY);L.set(te,pe)}}function ft(){const te=H[0].pageX-H[1].pageX,pe=H[0].pageY-H[1].pageY,Ae=Math.sqrt(te*te+pe*pe);z.set(0,Ae)}function ut(){r.enableZoom&&ft(),r.enablePan&&rt()}function ze(){r.enableZoom&&ft(),r.enableRotate&&Ze()}function $e(te){if(H.length==1)A.set(te.pageX,te.pageY);else{const Ae=Q(te),Je=.5*(te.pageX+Ae.x),jt=.5*(te.pageY+Ae.y);A.set(Je,jt)}k.subVectors(A,M).multiplyScalar(r.rotateSpeed);const pe=r.domElement;pe&&(q(2*Math.PI*k.x/pe.clientHeight),he(2*Math.PI*k.y/pe.clientHeight)),M.copy(A)}function He(te){if(H.length==1)P.set(te.pageX,te.pageY);else{const pe=Q(te),Ae=.5*(te.pageX+pe.x),Je=.5*(te.pageY+pe.y);P.set(Ae,Je)}D.subVectors(P,L).multiplyScalar(r.panSpeed),ge(D.x,D.y),L.copy(P)}function it(te){const pe=Q(te),Ae=te.pageX-pe.x,Je=te.pageY-pe.y,jt=Math.sqrt(Ae*Ae+Je*Je);U.set(0,jt),V.set(0,Math.pow(U.y/z.y,r.zoomSpeed)),we(V.y),z.copy(U)}function st(te){r.enableZoom&&it(te),r.enablePan&&He(te)}function Nt(te){r.enableZoom&&it(te),r.enableRotate&&$e(te)}function kt(te){if(r.enabled!==!1){if(H.length===0){var pe,Ae;(pe=r.domElement)===null||pe===void 0||pe.ownerDocument.addEventListener("pointermove",vt),(Ae=r.domElement)===null||Ae===void 0||Ae.ownerDocument.addEventListener("pointerup",Ct)}mt(te),te.pointerType==="touch"?Ye(te):gt(te)}}function vt(te){r.enabled!==!1&&(te.pointerType==="touch"?St(te):xe(te))}function Ct(te){if(Ke(te),H.length===0){var pe,Ae,Je;(pe=r.domElement)===null||pe===void 0||pe.releasePointerCapture(te.pointerId),(Ae=r.domElement)===null||Ae===void 0||Ae.ownerDocument.removeEventListener("pointermove",vt),(Je=r.domElement)===null||Je===void 0||Je.ownerDocument.removeEventListener("pointerup",Ct)}r.dispatchEvent(l),h=u.NONE}function At(te){Ke(te)}function gt(te){let pe;switch(te.button){case 0:pe=r.mouseButtons.LEFT;break;case 1:pe=r.mouseButtons.MIDDLE;break;case 2:pe=r.mouseButtons.RIGHT;break;default:pe=-1}switch(pe){case u1.DOLLY:if(r.enableZoom===!1)return;se(te),h=u.DOLLY;break;case u1.ROTATE:if(te.ctrlKey||te.metaKey||te.shiftKey){if(r.enablePan===!1)return;fe(te),h=u.PAN}else{if(r.enableRotate===!1)return;re(te),h=u.ROTATE}break;case u1.PAN:if(te.ctrlKey||te.metaKey||te.shiftKey){if(r.enableRotate===!1)return;re(te),h=u.ROTATE}else{if(r.enablePan===!1)return;fe(te),h=u.PAN}break;default:h=u.NONE}h!==u.NONE&&r.dispatchEvent(o)}function xe(te){if(r.enabled!==!1)switch(h){case u.ROTATE:if(r.enableRotate===!1)return;Te(te);break;case u.DOLLY:if(r.enableZoom===!1)return;Fe(te);break;case u.PAN:if(r.enablePan===!1)return;Ie(te);break}}function ie(te){r.enabled===!1||r.enableZoom===!1||h!==u.NONE&&h!==u.ROTATE||(te.preventDefault(),r.dispatchEvent(o),qe(te),r.dispatchEvent(l))}function Pe(te){r.enabled===!1||r.enablePan===!1||Re(te)}function Ye(te){switch(Oe(te),H.length){case 1:switch(r.touches.ONE){case c1.ROTATE:if(r.enableRotate===!1)return;Ze(),h=u.TOUCH_ROTATE;break;case c1.PAN:if(r.enablePan===!1)return;rt(),h=u.TOUCH_PAN;break;default:h=u.NONE}break;case 2:switch(r.touches.TWO){case c1.DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;ut(),h=u.TOUCH_DOLLY_PAN;break;case c1.DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;ze(),h=u.TOUCH_DOLLY_ROTATE;break;default:h=u.NONE}break;default:h=u.NONE}h!==u.NONE&&r.dispatchEvent(o)}function St(te){switch(Oe(te),h){case u.TOUCH_ROTATE:if(r.enableRotate===!1)return;$e(te),r.update();break;case u.TOUCH_PAN:if(r.enablePan===!1)return;He(te),r.update();break;case u.TOUCH_DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;st(te),r.update();break;case u.TOUCH_DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;Nt(te),r.update();break;default:h=u.NONE}}function It(te){r.enabled!==!1&&te.preventDefault()}function mt(te){H.push(te)}function Ke(te){delete oe[te.pointerId];for(let pe=0;pe #include #include @@ -5368,15 +5368,15 @@ Error generating stack: `+ee.message+` #include } - `};class I4 extends xd{constructor(e){super({type:"LineMaterial",uniforms:OC.clone(op.line.uniforms),vertexShader:op.line.vertexShader,fragmentShader:op.line.fragmentShader,clipping:!0}),this.isLineMaterial=!0,Object.defineProperties(this,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(t){this.uniforms.diffuse.value=t}},worldUnits:{enumerable:!0,get:function(){return"WORLD_UNITS"in this.defines},set:function(t){t===!0?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(t){this.uniforms.linewidth.value=t}},dashed:{enumerable:!0,get:function(){return"USE_DASH"in this.defines},set(t){!!t!="USE_DASH"in this.defines&&(this.needsUpdate=!0),t===!0?this.defines.USE_DASH="":delete this.defines.USE_DASH}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(t){this.uniforms.dashScale.value=t}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(t){this.uniforms.dashSize.value=t}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(t){this.uniforms.dashOffset.value=t}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(t){this.uniforms.gapSize.value=t}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(t){this.uniforms.opacity.value=t}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(t){this.uniforms.resolution.value.copy(t)}},alphaToCoverage:{enumerable:!0,get:function(){return"USE_ALPHA_TO_COVERAGE"in this.defines},set:function(t){!!t!="USE_ALPHA_TO_COVERAGE"in this.defines&&(this.needsUpdate=!0),t===!0?(this.defines.USE_ALPHA_TO_COVERAGE="",this.extensions.derivatives=!0):(delete this.defines.USE_ALPHA_TO_COVERAGE,this.extensions.derivatives=!1)}}}),this.setValues(e)}}const yW=new Ae,bW=new Ae,Qd=new Ts,Zd=new Ts,j0=new Ts,iN=new Ae,sN=new Qr,If=new E4,TW=new Ae,NA=new d0,DA=new b_,Y0=new Ts;let n_,UP,YZ,z1;function SW(n,e,t){return Y0.set(0,0,-e,1).applyMatrix4(n.projectionMatrix),Y0.multiplyScalar(1/Y0.w),Y0.x=z1/t.width,Y0.y=z1/t.height,Y0.applyMatrix4(n.projectionMatrixInverse),Y0.multiplyScalar(1/Y0.w),Math.abs(Math.max(Y0.x,Y0.y))}function MAe(n,e){for(let t=0,r=UP.count;tf&&Zd.z>f)continue;if(Qd.z>f){const A=Qd.z-Zd.z,k=(Qd.z-f)/A;Qd.lerp(Zd,k)}else if(Zd.z>f){const A=Zd.z-Qd.z,k=(Zd.z-f)/A;Zd.lerp(Qd,k)}Qd.applyMatrix4(r),Zd.applyMatrix4(r),Qd.multiplyScalar(1/Qd.w),Zd.multiplyScalar(1/Zd.w),Qd.x*=s.x/2,Qd.y*=s.y/2,Zd.x*=s.x/2,Zd.y*=s.y/2,If.start.copy(Qd),If.start.z=0,If.end.copy(Zd),If.end.z=0;const b=If.closestPointToPointParameter(iN,!0);If.at(b,TW);const w=SQ.lerp(Qd.z,Zd.z,b),C=w>=-1&&w<=1,M=iN.distanceTo(TW){if(!n||!l.current)return;const h=l.current.rotation.clone();u.getWorldQuaternion(l.current.quaternion),e&&(l.current.rotation.x=h.x),t&&(l.current.rotation.y=h.y),r&&(l.current.rotation.z=h.z)}),un("group",{ref:M4([l,o]),...s})}),kAe=pe.forwardRef(function({points:n,color:e="black",vertexColors:t,linewidth:r,lineWidth:s,segments:o,dashed:l,...u},h){const f=nf(w=>w.size),g=pe.useMemo(()=>o?new XZ:new IAe,[o]),[y]=pe.useState(()=>new I4),b=pe.useMemo(()=>{const w=o?new A4:new jZ,C=n.map(M=>{const A=Array.isArray(M);return M instanceof Ae?[M.x,M.y,M.z]:M instanceof jt?[M.x,M.y,0]:A&&M.length===3?[M[0],M[1],M[2]]:A&&M.length===2?[M[0],M[1],0]:M});if(w.setPositions(C.flat()),t){const M=t.map(A=>A instanceof Fn?A.toArray():A);w.setColors(M.flat())}return w},[n,o,t]);return pe.useLayoutEffect(()=>{g.computeLineDistances()},[n,g]),pe.useLayoutEffect(()=>{l?y.defines.USE_DASH="":delete y.defines.USE_DASH,y.needsUpdate=!0},[l,y]),pe.useEffect(()=>()=>b.dispose(),[b]),Bh("primitive",{object:g,ref:h,...u,children:[un("primitive",{object:b,attach:"geometry"}),un("primitive",{object:y,attach:"material",color:e,vertexColors:!!t,resolution:[f.width,f.height],linewidth:r??s,dashed:l,...u})]})});function OAe(){var n=Object.create(null);function e(s,o){var l=s.id,u=s.name,h=s.dependencies;h===void 0&&(h=[]);var f=s.init;f===void 0&&(f=function(){});var g=s.getTransferables;if(g===void 0&&(g=null),!n[l])try{h=h.map(function(b){return b&&b.isWorkerModule&&(e(b,function(w){if(w instanceof Error)throw w}),b=n[b.id].value),b}),f=r("<"+u+">.init",f),g&&(g=r("<"+u+">.getTransferables",g));var y=null;typeof f=="function"?y=f.apply(void 0,h):console.error("worker module init function failed to rehydrate"),n[l]={id:l,value:y,getTransferables:g},o(y)}catch(b){b&&b.noLog||console.error(b),o(b)}}function t(s,o){var l,u=s.id,h=s.args;(!n[u]||typeof n[u].value!="function")&&o(new Error("Worker module "+u+": not found or its 'init' did not return a function"));try{var f=(l=n[u]).value.apply(l,h);f&&typeof f.then=="function"?f.then(g,function(y){return o(y instanceof Error?y:new Error(""+y))}):g(f)}catch(y){o(y)}function g(y){try{var b=n[u].getTransferables&&n[u].getTransferables(y);(!b||!Array.isArray(b)||!b.length)&&(b=void 0),o(y,b)}catch(w){console.error(w),o(w)}}}function r(s,o){var l=void 0;self.troikaDefine=function(h){return l=h};var u=URL.createObjectURL(new Blob(["/** "+s.replace(/\*/g,"")+` **/ + `};class I4 extends xd{constructor(e){super({type:"LineMaterial",uniforms:OC.clone(op.line.uniforms),vertexShader:op.line.vertexShader,fragmentShader:op.line.fragmentShader,clipping:!0}),this.isLineMaterial=!0,Object.defineProperties(this,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(t){this.uniforms.diffuse.value=t}},worldUnits:{enumerable:!0,get:function(){return"WORLD_UNITS"in this.defines},set:function(t){t===!0?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(t){this.uniforms.linewidth.value=t}},dashed:{enumerable:!0,get:function(){return"USE_DASH"in this.defines},set(t){!!t!="USE_DASH"in this.defines&&(this.needsUpdate=!0),t===!0?this.defines.USE_DASH="":delete this.defines.USE_DASH}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(t){this.uniforms.dashScale.value=t}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(t){this.uniforms.dashSize.value=t}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(t){this.uniforms.dashOffset.value=t}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(t){this.uniforms.gapSize.value=t}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(t){this.uniforms.opacity.value=t}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(t){this.uniforms.resolution.value.copy(t)}},alphaToCoverage:{enumerable:!0,get:function(){return"USE_ALPHA_TO_COVERAGE"in this.defines},set:function(t){!!t!="USE_ALPHA_TO_COVERAGE"in this.defines&&(this.needsUpdate=!0),t===!0?(this.defines.USE_ALPHA_TO_COVERAGE="",this.extensions.derivatives=!0):(delete this.defines.USE_ALPHA_TO_COVERAGE,this.extensions.derivatives=!1)}}}),this.setValues(e)}}const bW=new Me,TW=new Me,Qd=new Ts,Zd=new Ts,j0=new Ts,iN=new Me,sN=new Qr,If=new E4,SW=new Me,NA=new d0,DA=new b_,Y0=new Ts;let n_,UP,XZ,U1;function wW(n,e,t){return Y0.set(0,0,-e,1).applyMatrix4(n.projectionMatrix),Y0.multiplyScalar(1/Y0.w),Y0.x=U1/t.width,Y0.y=U1/t.height,Y0.applyMatrix4(n.projectionMatrixInverse),Y0.multiplyScalar(1/Y0.w),Math.abs(Math.max(Y0.x,Y0.y))}function MAe(n,e){for(let t=0,r=UP.count;tf&&Zd.z>f)continue;if(Qd.z>f){const A=Qd.z-Zd.z,k=(Qd.z-f)/A;Qd.lerp(Zd,k)}else if(Zd.z>f){const A=Zd.z-Qd.z,k=(Zd.z-f)/A;Zd.lerp(Qd,k)}Qd.applyMatrix4(r),Zd.applyMatrix4(r),Qd.multiplyScalar(1/Qd.w),Zd.multiplyScalar(1/Zd.w),Qd.x*=s.x/2,Qd.y*=s.y/2,Zd.x*=s.x/2,Zd.y*=s.y/2,If.start.copy(Qd),If.start.z=0,If.end.copy(Zd),If.end.z=0;const b=If.closestPointToPointParameter(iN,!0);If.at(b,SW);const w=wQ.lerp(Qd.z,Zd.z,b),C=w>=-1&&w<=1,M=iN.distanceTo(SW){if(!n||!l.current)return;const h=l.current.rotation.clone();u.getWorldQuaternion(l.current.quaternion),e&&(l.current.rotation.x=h.x),t&&(l.current.rotation.y=h.y),r&&(l.current.rotation.z=h.z)}),un("group",{ref:M4([l,o]),...s})}),kAe=me.forwardRef(function({points:n,color:e="black",vertexColors:t,linewidth:r,lineWidth:s,segments:o,dashed:l,...u},h){const f=nf(w=>w.size),g=me.useMemo(()=>o?new KZ:new IAe,[o]),[y]=me.useState(()=>new I4),b=me.useMemo(()=>{const w=o?new A4:new YZ,C=n.map(M=>{const A=Array.isArray(M);return M instanceof Me?[M.x,M.y,M.z]:M instanceof Vt?[M.x,M.y,0]:A&&M.length===3?[M[0],M[1],M[2]]:A&&M.length===2?[M[0],M[1],0]:M});if(w.setPositions(C.flat()),t){const M=t.map(A=>A instanceof Fn?A.toArray():A);w.setColors(M.flat())}return w},[n,o,t]);return me.useLayoutEffect(()=>{g.computeLineDistances()},[n,g]),me.useLayoutEffect(()=>{l?y.defines.USE_DASH="":delete y.defines.USE_DASH,y.needsUpdate=!0},[l,y]),me.useEffect(()=>()=>b.dispose(),[b]),Bh("primitive",{object:g,ref:h,...u,children:[un("primitive",{object:b,attach:"geometry"}),un("primitive",{object:y,attach:"material",color:e,vertexColors:!!t,resolution:[f.width,f.height],linewidth:r??s,dashed:l,...u})]})});function OAe(){var n=Object.create(null);function e(s,o){var l=s.id,u=s.name,h=s.dependencies;h===void 0&&(h=[]);var f=s.init;f===void 0&&(f=function(){});var g=s.getTransferables;if(g===void 0&&(g=null),!n[l])try{h=h.map(function(b){return b&&b.isWorkerModule&&(e(b,function(w){if(w instanceof Error)throw w}),b=n[b.id].value),b}),f=r("<"+u+">.init",f),g&&(g=r("<"+u+">.getTransferables",g));var y=null;typeof f=="function"?y=f.apply(void 0,h):console.error("worker module init function failed to rehydrate"),n[l]={id:l,value:y,getTransferables:g},o(y)}catch(b){b&&b.noLog||console.error(b),o(b)}}function t(s,o){var l,u=s.id,h=s.args;(!n[u]||typeof n[u].value!="function")&&o(new Error("Worker module "+u+": not found or its 'init' did not return a function"));try{var f=(l=n[u]).value.apply(l,h);f&&typeof f.then=="function"?f.then(g,function(y){return o(y instanceof Error?y:new Error(""+y))}):g(f)}catch(y){o(y)}function g(y){try{var b=n[u].getTransferables&&n[u].getTransferables(y);(!b||!Array.isArray(b)||!b.length)&&(b=void 0),o(y,b)}catch(w){console.error(w),o(w)}}}function r(s,o){var l=void 0;self.troikaDefine=function(h){return l=h};var u=URL.createObjectURL(new Blob(["/** "+s.replace(/\*/g,"")+` **/ troikaDefine( `+o+` -)`],{type:"application/javascript"}));try{importScripts(u)}catch(h){console.error(h)}return URL.revokeObjectURL(u),delete self.troikaDefine,l}self.addEventListener("message",function(s){var o=s.data,l=o.messageId,u=o.action,h=o.data;try{u==="registerModule"&&e(h,function(f){f instanceof Error?postMessage({messageId:l,success:!1,error:f.message}):postMessage({messageId:l,success:!0,result:{isCallable:typeof f=="function"}})}),u==="callModule"&&t(h,function(f,g){f instanceof Error?postMessage({messageId:l,success:!1,error:f.message}):postMessage({messageId:l,success:!0,result:f},g||void 0)})}catch(f){postMessage({messageId:l,success:!1,error:f.stack})}})}function LAe(n){var e=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return e._getInitResult().then(function(s){if(typeof s=="function")return s.apply(void 0,t);throw new Error("Worker module function was called but `init` did not return a callable function")})};return e._getInitResult=function(){var t=n.dependencies,r=n.init;t=Array.isArray(t)?t.map(function(o){return o&&o._getInitResult?o._getInitResult():o}):[];var s=Promise.all(t).then(function(o){return r.apply(null,o)});return e._getInitResult=function(){return s},s},e}var KZ=function(){var n=!1;if(typeof window<"u"&&typeof window.document<"u")try{var e=new Worker(URL.createObjectURL(new Blob([""],{type:"application/javascript"})));e.terminate(),n=!0}catch(t){typeof process<"u"&&!1||console.log("Troika createWorkerModule: web workers not allowed; falling back to main thread execution. Cause: ["+t.message+"]")}return KZ=function(){return n},n},NAe=0,DAe=0,oN=!1,r$=Object.create(null),i$=Object.create(null),HP=Object.create(null);function zC(n){if((!n||typeof n.init!="function")&&!oN)throw new Error("requires `options.init` function");var e=n.dependencies,t=n.init,r=n.getTransferables,s=n.workerId;if(!KZ())return LAe(n);s==null&&(s="#default");var o="workerModule"+ ++NAe,l=n.name||o,u=null;e=e&&e.map(function(f){return typeof f=="function"&&!f.workerModuleData&&(oN=!0,f=zC({workerId:s,name:"<"+l+"> function dependency: "+f.name,init:`function(){return ( +)`],{type:"application/javascript"}));try{importScripts(u)}catch(h){console.error(h)}return URL.revokeObjectURL(u),delete self.troikaDefine,l}self.addEventListener("message",function(s){var o=s.data,l=o.messageId,u=o.action,h=o.data;try{u==="registerModule"&&e(h,function(f){f instanceof Error?postMessage({messageId:l,success:!1,error:f.message}):postMessage({messageId:l,success:!0,result:{isCallable:typeof f=="function"}})}),u==="callModule"&&t(h,function(f,g){f instanceof Error?postMessage({messageId:l,success:!1,error:f.message}):postMessage({messageId:l,success:!0,result:f},g||void 0)})}catch(f){postMessage({messageId:l,success:!1,error:f.stack})}})}function LAe(n){var e=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return e._getInitResult().then(function(s){if(typeof s=="function")return s.apply(void 0,t);throw new Error("Worker module function was called but `init` did not return a callable function")})};return e._getInitResult=function(){var t=n.dependencies,r=n.init;t=Array.isArray(t)?t.map(function(o){return o&&o._getInitResult?o._getInitResult():o}):[];var s=Promise.all(t).then(function(o){return r.apply(null,o)});return e._getInitResult=function(){return s},s},e}var JZ=function(){var n=!1;if(typeof window<"u"&&typeof window.document<"u")try{var e=new Worker(URL.createObjectURL(new Blob([""],{type:"application/javascript"})));e.terminate(),n=!0}catch(t){typeof process<"u"&&!1||console.log("Troika createWorkerModule: web workers not allowed; falling back to main thread execution. Cause: ["+t.message+"]")}return JZ=function(){return n},n},NAe=0,DAe=0,oN=!1,r$=Object.create(null),i$=Object.create(null),HP=Object.create(null);function zC(n){if((!n||typeof n.init!="function")&&!oN)throw new Error("requires `options.init` function");var e=n.dependencies,t=n.init,r=n.getTransferables,s=n.workerId;if(!JZ())return LAe(n);s==null&&(s="#default");var o="workerModule"+ ++NAe,l=n.name||o,u=null;e=e&&e.map(function(f){return typeof f=="function"&&!f.workerModuleData&&(oN=!0,f=zC({workerId:s,name:"<"+l+"> function dependency: "+f.name,init:`function(){return ( `+xI(f)+` -)}`}),oN=!1),f&&f.workerModuleData&&(f=f.workerModuleData),f});function h(){for(var f=[],g=arguments.length;g--;)f[g]=arguments[g];if(!u){u=wW(s,"registerModule",h.workerModuleData);var y=function(){u=null,i$[s].delete(y)};(i$[s]||(i$[s]=new Set)).add(y)}return u.then(function(b){var w=b.isCallable;if(w)return wW(s,"callModule",{id:o,args:f});throw new Error("Worker module function was called but `init` did not return a callable function")})}return h.workerModuleData={isWorkerModule:!0,id:o,name:l,dependencies:e,init:xI(t),getTransferables:r&&xI(r)},h}function PAe(n){i$[n]&&i$[n].forEach(function(e){e()}),r$[n]&&(r$[n].terminate(),delete r$[n])}function xI(n){var e=n.toString();return!/^function/.test(e)&&/^\w+\s*\(/.test(e)&&(e="function "+e),e}function BAe(n){var e=r$[n];if(!e){var t=xI(OAe);e=r$[n]=new Worker(URL.createObjectURL(new Blob(["/** Worker Module Bootstrap: "+n.replace(/\*/g,"")+` **/ +)}`}),oN=!1),f&&f.workerModuleData&&(f=f.workerModuleData),f});function h(){for(var f=[],g=arguments.length;g--;)f[g]=arguments[g];if(!u){u=EW(s,"registerModule",h.workerModuleData);var y=function(){u=null,i$[s].delete(y)};(i$[s]||(i$[s]=new Set)).add(y)}return u.then(function(b){var w=b.isCallable;if(w)return EW(s,"callModule",{id:o,args:f});throw new Error("Worker module function was called but `init` did not return a callable function")})}return h.workerModuleData={isWorkerModule:!0,id:o,name:l,dependencies:e,init:xI(t),getTransferables:r&&xI(r)},h}function PAe(n){i$[n]&&i$[n].forEach(function(e){e()}),r$[n]&&(r$[n].terminate(),delete r$[n])}function xI(n){var e=n.toString();return!/^function/.test(e)&&/^\w+\s*\(/.test(e)&&(e="function "+e),e}function BAe(n){var e=r$[n];if(!e){var t=xI(OAe);e=r$[n]=new Worker(URL.createObjectURL(new Blob(["/** Worker Module Bootstrap: "+n.replace(/\*/g,"")+` **/ -;(`+t+")()"],{type:"application/javascript"}))),e.onmessage=function(r){var s=r.data,o=s.messageId,l=HP[o];if(!l)throw new Error("WorkerModule response with empty or unknown messageId");delete HP[o],l(s)}}return e}function wW(n,e,t){return new Promise(function(r,s){var o=++DAe;HP[o]=function(l){l.success?r(l.result):s(new Error("Error in worker "+e+" call: "+l.error))},BAe(n).postMessage({messageId:o,action:e,data:t})})}function JZ(){var n=function(e){function t(re,ie,fe,Te,Fe,Ie,Je,Re){var Qe=1-Je;Re.x=Qe*Qe*re+2*Qe*Je*fe+Je*Je*Fe,Re.y=Qe*Qe*ie+2*Qe*Je*Te+Je*Je*Ie}function r(re,ie,fe,Te,Fe,Ie,Je,Re,Qe,nt){var ft=1-Qe;nt.x=ft*ft*ft*re+3*ft*ft*Qe*fe+3*ft*Qe*Qe*Fe+Qe*Qe*Qe*Je,nt.y=ft*ft*ft*ie+3*ft*ft*Qe*Te+3*ft*Qe*Qe*Ie+Qe*Qe*Qe*Re}function s(re,ie){for(var fe=/([MLQCZ])([^MLQCZ]*)/g,Te,Fe,Ie,Je,Re;Te=fe.exec(re);){var Qe=Te[2].replace(/^\s*|\s*$/g,"").split(/[,\s]+/).map(function(nt){return parseFloat(nt)});switch(Te[1]){case"M":Je=Fe=Qe[0],Re=Ie=Qe[1];break;case"L":(Qe[0]!==Je||Qe[1]!==Re)&&ie("L",Je,Re,Je=Qe[0],Re=Qe[1]);break;case"Q":{ie("Q",Je,Re,Je=Qe[2],Re=Qe[3],Qe[0],Qe[1]);break}case"C":{ie("C",Je,Re,Je=Qe[4],Re=Qe[5],Qe[0],Qe[1],Qe[2],Qe[3]);break}case"Z":(Je!==Fe||Re!==Ie)&&ie("L",Je,Re,Fe,Ie);break}}}function o(re,ie,fe){fe===void 0&&(fe=16);var Te={x:0,y:0};s(re,function(Fe,Ie,Je,Re,Qe,nt,ft,lt,ze){switch(Fe){case"L":ie(Ie,Je,Re,Qe);break;case"Q":{for(var Ce=Ie,He=Je,rt=1;rt0;)ht[St]=arguments[St+2];var It=At[$e]||(At[$e]=fe.getUniformLocation(mt,$e));fe["uniform"+se].apply(fe,[It].concat(ht))},setAttribute:function(se,$e,ht,St,It){var pt=Mt[se];pt||(pt=Mt[se]={buf:fe.createBuffer(),loc:fe.getAttribLocation(mt,se),data:null}),fe.bindBuffer(fe.ARRAY_BUFFER,pt.buf),fe.vertexAttribPointer(pt.loc,$e,fe.FLOAT,!1,0,0),fe.enableVertexAttribArray(pt.loc),Fe?fe.vertexAttribDivisor(pt.loc,St):ft("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(pt.loc,St),It!==pt.data&&(fe.bufferData(fe.ARRAY_BUFFER,It,ht),pt.data=It)}})}}}Je[it].transaction(vt)},Ce=function(it,Nt){Qe++;try{fe.activeTexture(fe.TEXTURE0+Qe);var kt=Re[it];kt||(kt=Re[it]=fe.createTexture(),fe.bindTexture(fe.TEXTURE_2D,kt),fe.texParameteri(fe.TEXTURE_2D,fe.TEXTURE_MIN_FILTER,fe.NEAREST),fe.texParameteri(fe.TEXTURE_2D,fe.TEXTURE_MAG_FILTER,fe.NEAREST)),fe.bindTexture(fe.TEXTURE_2D,kt),Nt(kt,Qe)}finally{Qe--}},He=function(it,Nt,kt){var vt=fe.createFramebuffer();nt.push(vt),fe.bindFramebuffer(fe.FRAMEBUFFER,vt),fe.activeTexture(fe.TEXTURE0+Nt),fe.bindTexture(fe.TEXTURE_2D,it),fe.framebufferTexture2D(fe.FRAMEBUFFER,fe.COLOR_ATTACHMENT0,fe.TEXTURE_2D,it,0);try{kt(vt)}finally{fe.deleteFramebuffer(vt),fe.bindFramebuffer(fe.FRAMEBUFFER,nt[--nt.length-1]||null)}},rt=function(){Ie={},Je={},Re={},Qe=-1,nt.length=0};var Fe=typeof WebGL2RenderingContext<"u"&&fe instanceof WebGL2RenderingContext,Ie={},Je={},Re={},Qe=-1,nt=[];fe.canvas.addEventListener("webglcontextlost",function(it){rt(),it.preventDefault()},!1),h.set(fe,Te={gl:fe,isWebGL2:Fe,getExtension:ft,withProgram:ze,withTexture:Ce,withTextureFramebuffer:He,handleContextLoss:rt})}ie(Te)}function y(re,ie,fe,Te,Fe,Ie,Je,Re){Je===void 0&&(Je=15),Re===void 0&&(Re=null),g(re,function(Qe){var nt=Qe.gl,ft=Qe.withProgram,lt=Qe.withTexture;lt("copy",function(ze,Ce){nt.texImage2D(nt.TEXTURE_2D,0,nt.RGBA,Fe,Ie,0,nt.RGBA,nt.UNSIGNED_BYTE,ie),ft("copy",l,u,function(He){var rt=He.setUniform,it=He.setAttribute;it("aUV",2,nt.STATIC_DRAW,0,new Float32Array([0,0,2,0,0,2])),rt("1i","image",Ce),nt.bindFramebuffer(nt.FRAMEBUFFER,Re||null),nt.disable(nt.BLEND),nt.colorMask(Je&8,Je&4,Je&2,Je&1),nt.viewport(fe,Te,Fe,Ie),nt.scissor(fe,Te,Fe,Ie),nt.drawArrays(nt.TRIANGLES,0,3)})})})}function b(re,ie,fe){var Te=re.width,Fe=re.height;g(re,function(Ie){var Je=Ie.gl,Re=new Uint8Array(Te*Fe*4);Je.readPixels(0,0,Te,Fe,Je.RGBA,Je.UNSIGNED_BYTE,Re),re.width=ie,re.height=fe,y(Je,Re,0,0,Te,Fe)})}var w=Object.freeze({__proto__:null,withWebGLContext:g,renderImageData:y,resizeWebGLCanvasWithoutClearing:b});function C(re,ie,fe,Te,Fe,Ie){Ie===void 0&&(Ie=1);var Je=new Uint8Array(re*ie),Re=Te[2]-Te[0],Qe=Te[3]-Te[1],nt=[];o(fe,function(it,Nt,kt,vt){nt.push({x1:it,y1:Nt,x2:kt,y2:vt,minX:Math.min(it,kt),minY:Math.min(Nt,vt),maxX:Math.max(it,kt),maxY:Math.max(Nt,vt)})}),nt.sort(function(it,Nt){return it.maxX-Nt.maxX});for(var ft=0;ftAt.minX&&Nt-vtAt.minY){var mt=k(it,Nt,At.x1,At.y1,At.x2,At.y2);mtNt!=Mt.y2>Nt&&it<(Mt.x2-Mt.x1)*(Nt-Mt.y1)/(Mt.y2-Mt.y1)+Mt.x1;At&&(kt+=Mt.y1p.y!=seg.w>p.y)&&(p.x<(seg.z-seg.x)*(p.y-seg.y)/(seg.w-seg.y)+seg.x);bool crossingUp=crossing&&vLineSegment.y1,1e>2,u>2,2wt>1,1>1,1ge>1,1wp>1,1j>1,f>1,hm>1,1>1,u>1,u6>1,1>1,+5,28>1,w>1,1>1,+3,b8>1,1>1,+3,1>3,-1>-1,3>1,1>1,+2,1s>1,1>1,x>1,th>1,1>1,+2,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,4q>1,1e>2,u>2,2>1,+1",canonical:"6f1>-6dx,6dy>-6dx,6ec>-6ed,6ee>-6ed,6ww>2jj,-2ji>2jj,14r4>-1e7l,1e7m>-1e7l,1e7m>-1e5c,1e5d>-1e5b,1e5c>-14qx,14qy>-14qx,14vn>-1ecg,1ech>-1ecg,1edu>-1ecg,1eci>-1ecg,1eda>-1ecg,1eci>-1ecg,1eci>-168q,168r>-168q,168s>-14ye,14yf>-14ye"};function M(vt,Mt){var At=36,mt=0,xe=new Map,se=Mt&&new Map,$e;return vt.split(",").forEach(function ht(St){if(St.indexOf("+")!==-1)for(var It=+St;It--;)ht($e);else{$e=St;var pt=St.split(">"),Ke=pt[0],Le=pt[1];Ke=String.fromCodePoint(mt+=parseInt(Ke,At)),Le=String.fromCodePoint(mt+=parseInt(Le,At)),xe.set(Ke,Le),Mt&&se.set(Le,Ke)}}),{map:xe,reverseMap:se}}var A,k,L;function P(){if(!A){var vt=M(C.pairs,!0),Mt=vt.map,At=vt.reverseMap;A=Mt,k=At,L=M(C.canonical,!1).map}}function D(vt){return P(),A.get(vt)||null}function z(vt){return P(),k.get(vt)||null}function U(vt){return P(),L.get(vt)||null}var V=r.L,H=r.R,oe=r.EN,le=r.ES,Z=r.ET,q=r.AN,he=r.CS,ae=r.B,ue=r.S,ge=r.ON,we=r.BN,J=r.NSM,re=r.AL,ie=r.LRO,fe=r.RLO,Te=r.LRE,Fe=r.RLE,Ie=r.PDF,Je=r.LRI,Re=r.RLI,Qe=r.FSI,nt=r.PDI;function ft(vt,Mt){for(var At=125,mt=new Uint32Array(vt.length),xe=0;xe0)Wt--;else if(tn>0){for(Ge=0;!ke[ke.length-1]._isolate;)ke.pop();var Pr=ke[ke.length-1]._isolInitIndex;Pr!=null&&(St.set(Pr,_t),St.set(_t,Pr)),ke.pop(),tn--}Xe=ke[ke.length-1],ht[_t]=Xe._level,Xe._override&&$e(_t,Xe._override)}else Jt&Ie?(Wt===0&&(Ge>0?Ge--:!Xe._isolate&&ke.length>1&&(ke.pop(),Xe=ke[ke.length-1])),ht[_t]=Xe._level):Jt&ae&&(ht[_t]=pt.level);else ht[_t]=Xe._level,Xe._override&&Jt!==we&&$e(_t,Xe._override)}for(var Ei=[],xr=null,mr=pt.start;mr<=pt.end;mr++){var ne=mt[mr];if(!(ne&h)){var Se=ht[mr],We=ne&o,ot=ne===nt;xr&&Se===xr._level?(xr._end=mr,xr._endsWithIsolInit=We):Ei.push(xr={_start:mr,_end:mr,_level:Se,_startsWithPDI:ot,_endsWithIsolInit:We})}}for(var zt=[],sn=0;sn=0;si--)if(!(mt[si]&h)){$r=ht[si];break}var Br=bt[bt.length-1],Yr=ht[Br],Ss=pt.level;if(!(mt[Br]&o)){for(var Oa=Br+1;Oa<=pt.end;Oa++)if(!(mt[Oa]&h)){Ss=ht[Oa];break}}zt.push({_seqIndices:bt,_sosType:Math.max($r,_r)%2?H:V,_eosType:Math.max(Ss,Yr)%2?H:V})}}for(var Eo=0;Eo=0;Di--)if(!(mt[nn[Di]]&h)){zs=mt[nn[Di]];break}$e(Fs,zs&(o|nt)?ge:zs)}}if(se.get(oe))for(var kr=0;kr=-1;Ir--){var Gr=Ir===-1?Rr:mt[nn[Ir]];if(Gr&l){Gr===re&&$e(An,q);break}}}if(se.get(re))for(var yr=0;yr=0&&(gs=mt[nn[Na]],!!(gs&h));Na--);for(var fc=ws+1;fc=0&&mt[nn[Jo]]&(Z|h);Jo--)$e(nn[Jo],oe);for(var Xl=pc+1;Xl=0&&mt[nn[qo]]&h;qo--)$e(nn[qo],ge);for(var vr=gu+1;vr=0;nl--){var rl=$l[nl].char;if(rl===Kl||rl===z(U(Tr))||D(U(rl))===Tr){xl.push([$l[nl].seqIndex,br]),$l.length=nl;break}}}xl.sort(function(Bi,Ci){return Bi[0]-Ci[0]})}for(var vu=0;vu=0;or--){var Gn=nn[or];if(mt[Gn]&_u){var Es=mt[Gn]&El?H:V;Es!==sl(Gn)?io=Es:io=sl(Gn);break}}}if(io){if(mt[nn[_s]]=mt[nn[il]]=io,io!==sl(nn[_s])){for(var so=_s+1;so=0;Hu--)if(mt[nn[Hu]]&h)_h=Hu;else{ha=mt[nn[Hu]]&El?H:V;break}for(var wr=el,Rs=bu+1;Rs=0&&b(vt[Tu])&f;Tu--)ht[Tu]=pt.level}}return{levels:ht,paragraphs:It};function xo(Bi,Ci){for(var Vn=Bi;Vn=ht&&b(vt[pt])&f;pt--)It[pt]=$e.level;for(var Ke=$e.level,Le=1/0,Q=0;QKe&&(Ke=te),te=Le;me--)for(var ke=0;ke=me){for(var Xe=ke;ke+1=me;)ke++;ke>Xe&&se.push([Xe+At,ke+At])}}}),se}function Nt(vt,Mt,At,mt){var xe=kt(vt,Mt,At,mt),se=[].concat(vt);return xe.forEach(function($e,ht){se[ht]=(Mt.levels[$e]&1?He(vt[$e]):null)||vt[$e]}),se.join("")}function kt(vt,Mt,At,mt){for(var xe=it(vt,Mt,At,mt),se=[],$e=0;$e/gm;function t(r,s){let o=ps[s];return o?GP(o):r}return n.replace(e,t)}const ef=[];for(let n=0;n<256;n++)ef[n]=(n<16?"0":"")+n.toString(16);function zAe(){const n=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,r=Math.random()*4294967295|0;return(ef[n&255]+ef[n>>8&255]+ef[n>>16&255]+ef[n>>24&255]+"-"+ef[e&255]+ef[e>>8&255]+"-"+ef[e>>16&15|64]+ef[e>>24&255]+"-"+ef[t&63|128]+ef[t>>8&255]+"-"+ef[t>>16&255]+ef[t>>24&255]+ef[r&255]+ef[r>>8&255]+ef[r>>16&255]+ef[r>>24&255]).toUpperCase()}const Zb=Object.assign||function(){let n=arguments[0];for(let e=1,t=arguments.length;e/gm,` +;(`+t+")()"],{type:"application/javascript"}))),e.onmessage=function(r){var s=r.data,o=s.messageId,l=HP[o];if(!l)throw new Error("WorkerModule response with empty or unknown messageId");delete HP[o],l(s)}}return e}function EW(n,e,t){return new Promise(function(r,s){var o=++DAe;HP[o]=function(l){l.success?r(l.result):s(new Error("Error in worker "+e+" call: "+l.error))},BAe(n).postMessage({messageId:o,action:e,data:t})})}function qZ(){var n=function(e){function t(re,se,fe,Te,Fe,Ie,qe,Re){var Ze=1-qe;Re.x=Ze*Ze*re+2*Ze*qe*fe+qe*qe*Fe,Re.y=Ze*Ze*se+2*Ze*qe*Te+qe*qe*Ie}function r(re,se,fe,Te,Fe,Ie,qe,Re,Ze,rt){var ft=1-Ze;rt.x=ft*ft*ft*re+3*ft*ft*Ze*fe+3*ft*Ze*Ze*Fe+Ze*Ze*Ze*qe,rt.y=ft*ft*ft*se+3*ft*ft*Ze*Te+3*ft*Ze*Ze*Ie+Ze*Ze*Ze*Re}function s(re,se){for(var fe=/([MLQCZ])([^MLQCZ]*)/g,Te,Fe,Ie,qe,Re;Te=fe.exec(re);){var Ze=Te[2].replace(/^\s*|\s*$/g,"").split(/[,\s]+/).map(function(rt){return parseFloat(rt)});switch(Te[1]){case"M":qe=Fe=Ze[0],Re=Ie=Ze[1];break;case"L":(Ze[0]!==qe||Ze[1]!==Re)&&se("L",qe,Re,qe=Ze[0],Re=Ze[1]);break;case"Q":{se("Q",qe,Re,qe=Ze[2],Re=Ze[3],Ze[0],Ze[1]);break}case"C":{se("C",qe,Re,qe=Ze[4],Re=Ze[5],Ze[0],Ze[1],Ze[2],Ze[3]);break}case"Z":(qe!==Fe||Re!==Ie)&&se("L",qe,Re,Fe,Ie);break}}}function o(re,se,fe){fe===void 0&&(fe=16);var Te={x:0,y:0};s(re,function(Fe,Ie,qe,Re,Ze,rt,ft,ut,ze){switch(Fe){case"L":se(Ie,qe,Re,Ze);break;case"Q":{for(var $e=Ie,He=qe,it=1;it0;)Ye[St]=arguments[St+2];var It=At[Pe]||(At[Pe]=fe.getUniformLocation(gt,Pe));fe["uniform"+ie].apply(fe,[It].concat(Ye))},setAttribute:function(ie,Pe,Ye,St,It){var mt=Ct[ie];mt||(mt=Ct[ie]={buf:fe.createBuffer(),loc:fe.getAttribLocation(gt,ie),data:null}),fe.bindBuffer(fe.ARRAY_BUFFER,mt.buf),fe.vertexAttribPointer(mt.loc,Pe,fe.FLOAT,!1,0,0),fe.enableVertexAttribArray(mt.loc),Fe?fe.vertexAttribDivisor(mt.loc,St):ft("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(mt.loc,St),It!==mt.data&&(fe.bufferData(fe.ARRAY_BUFFER,It,Ye),mt.data=It)}})}}}qe[st].transaction(vt)},$e=function(st,Nt){Ze++;try{fe.activeTexture(fe.TEXTURE0+Ze);var kt=Re[st];kt||(kt=Re[st]=fe.createTexture(),fe.bindTexture(fe.TEXTURE_2D,kt),fe.texParameteri(fe.TEXTURE_2D,fe.TEXTURE_MIN_FILTER,fe.NEAREST),fe.texParameteri(fe.TEXTURE_2D,fe.TEXTURE_MAG_FILTER,fe.NEAREST)),fe.bindTexture(fe.TEXTURE_2D,kt),Nt(kt,Ze)}finally{Ze--}},He=function(st,Nt,kt){var vt=fe.createFramebuffer();rt.push(vt),fe.bindFramebuffer(fe.FRAMEBUFFER,vt),fe.activeTexture(fe.TEXTURE0+Nt),fe.bindTexture(fe.TEXTURE_2D,st),fe.framebufferTexture2D(fe.FRAMEBUFFER,fe.COLOR_ATTACHMENT0,fe.TEXTURE_2D,st,0);try{kt(vt)}finally{fe.deleteFramebuffer(vt),fe.bindFramebuffer(fe.FRAMEBUFFER,rt[--rt.length-1]||null)}},it=function(){Ie={},qe={},Re={},Ze=-1,rt.length=0};var Fe=typeof WebGL2RenderingContext<"u"&&fe instanceof WebGL2RenderingContext,Ie={},qe={},Re={},Ze=-1,rt=[];fe.canvas.addEventListener("webglcontextlost",function(st){it(),st.preventDefault()},!1),h.set(fe,Te={gl:fe,isWebGL2:Fe,getExtension:ft,withProgram:ze,withTexture:$e,withTextureFramebuffer:He,handleContextLoss:it})}se(Te)}function y(re,se,fe,Te,Fe,Ie,qe,Re){qe===void 0&&(qe=15),Re===void 0&&(Re=null),g(re,function(Ze){var rt=Ze.gl,ft=Ze.withProgram,ut=Ze.withTexture;ut("copy",function(ze,$e){rt.texImage2D(rt.TEXTURE_2D,0,rt.RGBA,Fe,Ie,0,rt.RGBA,rt.UNSIGNED_BYTE,se),ft("copy",l,u,function(He){var it=He.setUniform,st=He.setAttribute;st("aUV",2,rt.STATIC_DRAW,0,new Float32Array([0,0,2,0,0,2])),it("1i","image",$e),rt.bindFramebuffer(rt.FRAMEBUFFER,Re||null),rt.disable(rt.BLEND),rt.colorMask(qe&8,qe&4,qe&2,qe&1),rt.viewport(fe,Te,Fe,Ie),rt.scissor(fe,Te,Fe,Ie),rt.drawArrays(rt.TRIANGLES,0,3)})})})}function b(re,se,fe){var Te=re.width,Fe=re.height;g(re,function(Ie){var qe=Ie.gl,Re=new Uint8Array(Te*Fe*4);qe.readPixels(0,0,Te,Fe,qe.RGBA,qe.UNSIGNED_BYTE,Re),re.width=se,re.height=fe,y(qe,Re,0,0,Te,Fe)})}var w=Object.freeze({__proto__:null,withWebGLContext:g,renderImageData:y,resizeWebGLCanvasWithoutClearing:b});function C(re,se,fe,Te,Fe,Ie){Ie===void 0&&(Ie=1);var qe=new Uint8Array(re*se),Re=Te[2]-Te[0],Ze=Te[3]-Te[1],rt=[];o(fe,function(st,Nt,kt,vt){rt.push({x1:st,y1:Nt,x2:kt,y2:vt,minX:Math.min(st,kt),minY:Math.min(Nt,vt),maxX:Math.max(st,kt),maxY:Math.max(Nt,vt)})}),rt.sort(function(st,Nt){return st.maxX-Nt.maxX});for(var ft=0;ftAt.minX&&Nt-vtAt.minY){var gt=k(st,Nt,At.x1,At.y1,At.x2,At.y2);gtNt!=Ct.y2>Nt&&st<(Ct.x2-Ct.x1)*(Nt-Ct.y1)/(Ct.y2-Ct.y1)+Ct.x1;At&&(kt+=Ct.y1p.y!=seg.w>p.y)&&(p.x<(seg.z-seg.x)*(p.y-seg.y)/(seg.w-seg.y)+seg.x);bool crossingUp=crossing&&vLineSegment.y1,1e>2,u>2,2wt>1,1>1,1ge>1,1wp>1,1j>1,f>1,hm>1,1>1,u>1,u6>1,1>1,+5,28>1,w>1,1>1,+3,b8>1,1>1,+3,1>3,-1>-1,3>1,1>1,+2,1s>1,1>1,x>1,th>1,1>1,+2,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,4q>1,1e>2,u>2,2>1,+1",canonical:"6f1>-6dx,6dy>-6dx,6ec>-6ed,6ee>-6ed,6ww>2jj,-2ji>2jj,14r4>-1e7l,1e7m>-1e7l,1e7m>-1e5c,1e5d>-1e5b,1e5c>-14qx,14qy>-14qx,14vn>-1ecg,1ech>-1ecg,1edu>-1ecg,1eci>-1ecg,1eda>-1ecg,1eci>-1ecg,1eci>-168q,168r>-168q,168s>-14ye,14yf>-14ye"};function M(vt,Ct){var At=36,gt=0,xe=new Map,ie=Ct&&new Map,Pe;return vt.split(",").forEach(function Ye(St){if(St.indexOf("+")!==-1)for(var It=+St;It--;)Ye(Pe);else{Pe=St;var mt=St.split(">"),Ke=mt[0],Oe=mt[1];Ke=String.fromCodePoint(gt+=parseInt(Ke,At)),Oe=String.fromCodePoint(gt+=parseInt(Oe,At)),xe.set(Ke,Oe),Ct&&ie.set(Oe,Ke)}}),{map:xe,reverseMap:ie}}var A,k,L;function P(){if(!A){var vt=M(C.pairs,!0),Ct=vt.map,At=vt.reverseMap;A=Ct,k=At,L=M(C.canonical,!1).map}}function D(vt){return P(),A.get(vt)||null}function z(vt){return P(),k.get(vt)||null}function U(vt){return P(),L.get(vt)||null}var V=r.L,H=r.R,oe=r.EN,le=r.ES,Z=r.ET,q=r.AN,he=r.CS,ae=r.B,ue=r.S,ge=r.ON,we=r.BN,J=r.NSM,re=r.AL,se=r.LRO,fe=r.RLO,Te=r.LRE,Fe=r.RLE,Ie=r.PDF,qe=r.LRI,Re=r.RLI,Ze=r.FSI,rt=r.PDI;function ft(vt,Ct){for(var At=125,gt=new Uint32Array(vt.length),xe=0;xe0)jt--;else if(qt>0){for(Ge=0;!Ae[Ae.length-1]._isolate;)Ae.pop();var Pr=Ae[Ae.length-1]._isolInitIndex;Pr!=null&&(St.set(Pr,pt),St.set(pt,Pr)),Ae.pop(),qt--}Je=Ae[Ae.length-1],Ye[pt]=Je._level,Je._override&&Pe(pt,Je._override)}else Jt&Ie?(jt===0&&(Ge>0?Ge--:!Je._isolate&&Ae.length>1&&(Ae.pop(),Je=Ae[Ae.length-1])),Ye[pt]=Je._level):Jt&ae&&(Ye[pt]=mt.level);else Ye[pt]=Je._level,Je._override&&Jt!==we&&Pe(pt,Je._override)}for(var Ei=[],xr=null,mr=mt.start;mr<=mt.end;mr++){var ne=gt[mr];if(!(ne&h)){var Se=Ye[mr],We=ne&o,at=ne===rt;xr&&Se===xr._level?(xr._end=mr,xr._endsWithIsolInit=We):Ei.push(xr={_start:mr,_end:mr,_level:Se,_startsWithPDI:at,_endsWithIsolInit:We})}}for(var zt=[],sn=0;sn=0;si--)if(!(gt[si]&h)){$r=Ye[si];break}var Br=bt[bt.length-1],Yr=Ye[Br],Ss=mt.level;if(!(gt[Br]&o)){for(var Oa=Br+1;Oa<=mt.end;Oa++)if(!(gt[Oa]&h)){Ss=Ye[Oa];break}}zt.push({_seqIndices:bt,_sosType:Math.max($r,_r)%2?H:V,_eosType:Math.max(Ss,Yr)%2?H:V})}}for(var Eo=0;Eo=0;Di--)if(!(gt[nn[Di]]&h)){zs=gt[nn[Di]];break}Pe(Fs,zs&(o|rt)?ge:zs)}}if(ie.get(oe))for(var kr=0;kr=-1;Ir--){var Gr=Ir===-1?Rr:gt[nn[Ir]];if(Gr&l){Gr===re&&Pe(In,q);break}}}if(ie.get(re))for(var yr=0;yr=0&&(gs=gt[nn[Na]],!!(gs&h));Na--);for(var fc=ws+1;fc=0&>[nn[Jo]]&(Z|h);Jo--)Pe(nn[Jo],oe);for(var Xl=pc+1;Xl=0&>[nn[qo]]&h;qo--)Pe(nn[qo],ge);for(var vr=gu+1;vr=0;nl--){var rl=$l[nl].char;if(rl===Kl||rl===z(U(Tr))||D(U(rl))===Tr){xl.push([$l[nl].seqIndex,br]),$l.length=nl;break}}}xl.sort(function(Bi,Ci){return Bi[0]-Ci[0]})}for(var vu=0;vu=0;or--){var Gn=nn[or];if(gt[Gn]&_u){var Es=gt[Gn]&El?H:V;Es!==sl(Gn)?io=Es:io=sl(Gn);break}}}if(io){if(gt[nn[_s]]=gt[nn[il]]=io,io!==sl(nn[_s])){for(var so=_s+1;so=0;Hu--)if(gt[nn[Hu]]&h)_h=Hu;else{ha=gt[nn[Hu]]&El?H:V;break}for(var wr=el,Rs=bu+1;Rs=0&&b(vt[Tu])&f;Tu--)Ye[Tu]=mt.level}}return{levels:Ye,paragraphs:It};function xo(Bi,Ci){for(var Vn=Bi;Vn=Ye&&b(vt[mt])&f;mt--)It[mt]=Pe.level;for(var Ke=Pe.level,Oe=1/0,Q=0;QKe&&(Ke=te),te=Oe;pe--)for(var Ae=0;Ae=pe){for(var Je=Ae;Ae+1=pe;)Ae++;Ae>Je&&ie.push([Je+At,Ae+At])}}}),ie}function Nt(vt,Ct,At,gt){var xe=kt(vt,Ct,At,gt),ie=[].concat(vt);return xe.forEach(function(Pe,Ye){ie[Ye]=(Ct.levels[Pe]&1?He(vt[Pe]):null)||vt[Pe]}),ie.join("")}function kt(vt,Ct,At,gt){for(var xe=st(vt,Ct,At,gt),ie=[],Pe=0;Pe/gm;function t(r,s){let o=ps[s];return o?GP(o):r}return n.replace(e,t)}const ef=[];for(let n=0;n<256;n++)ef[n]=(n<16?"0":"")+n.toString(16);function zAe(){const n=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,r=Math.random()*4294967295|0;return(ef[n&255]+ef[n>>8&255]+ef[n>>16&255]+ef[n>>24&255]+"-"+ef[e&255]+ef[e>>8&255]+"-"+ef[e>>16&15|64]+ef[e>>24&255]+"-"+ef[t&63|128]+ef[t>>8&255]+"-"+ef[t>>16&255]+ef[t>>24&255]+ef[r&255]+ef[r>>8&255]+ef[r>>16&255]+ef[r>>24&255]).toUpperCase()}const e1=Object.assign||function(){let n=arguments[0];for(let e=1,t=arguments.length;e/gm,` //!BEGIN_POST_CHUNK $1 $& //!END_POST_CHUNK @@ -5399,27 +5399,27 @@ troika_normal_${r} = vec3(normal); troika_uv_${r} = vec2(uv); troikaVertexTransform${r}(troika_position_${r}, troika_normal_${r}, troika_uv_${r}); ${o} -`,n=n.replace(/\b(position|normal|uv)\b/g,(C,M,A,k)=>/\battribute\s+vec[23]\s+$/.test(k.substr(0,A))?M:`troika_${M}_${r}`)),n=$W(n,r,s,o,l),e=$W(e,r,h,f,g),{vertexShader:n,fragmentShader:e}}function $W(n,e,t,r,s){return(r||s||t)&&(n=n.replace(qZ,` +`,n=n.replace(/\b(position|normal|uv)\b/g,(C,M,A,k)=>/\battribute\s+vec[23]\s+$/.test(k.substr(0,A))?M:`troika_${M}_${r}`)),n=CW(n,r,s,o,l),e=CW(e,r,h,f,g),{vertexShader:n,fragmentShader:e}}function CW(n,e,t,r,s){return(r||s||t)&&(n=n.replace(QZ,` ${t} void troikaOrigMain${e}() {`),n+=` void main() { ${r} troikaOrigMain${e}(); ${s} -}`),n}function WAe(n,e){return n==="uniforms"?void 0:typeof e=="function"?e.toString():e}let VAe=0;const CW=new Map;function jAe(n){const e=JSON.stringify(n,WAe);let t=CW.get(e);return t==null&&CW.set(e,t=++VAe),t}function YAe(n,e,t){const{defaultFontURL:r}=t,s=Object.create(null),o=1/0,l=/[\u00AD\u034F\u061C\u115F-\u1160\u17B4-\u17B5\u180B-\u180E\u200B-\u200F\u202A-\u202E\u2060-\u206F\u3164\uFE00-\uFE0F\uFEFF\uFFA0\uFFF0-\uFFF8]/,u="[^\\S\\u00A0]",h=new RegExp(`${u}|[\\-\\u007C\\u00AD\\u2010\\u2012-\\u2014\\u2027\\u2056\\u2E17\\u2E40]`);function f(L,P){function D(){const z=U=>{console.error(`Failure loading font ${L}${L===r?"":"; trying fallback"}`,U),L!==r&&(L=r,D())};try{const U=new XMLHttpRequest;U.open("get",L,!0),U.responseType="arraybuffer",U.onload=function(){if(U.status>=400)z(new Error(U.statusText));else if(U.status>0)try{const V=n(U.response);P(V)}catch(V){z(V)}},U.onerror=z,U.send()}catch(U){z(U)}}D()}function g(L,P){L||(L=r);let D=s[L];D?D.pending?D.pending.push(P):P(D):(s[L]={pending:[P]},f(L,z=>{let U=s[L].pending;s[L]=z,U.forEach(V=>V(z))}))}function y({text:L="",font:P=r,sdfGlyphSize:D=64,fontSize:z=1,letterSpacing:U=0,lineHeight:V="normal",maxWidth:H=o,direction:oe,textAlign:le="left",textIndent:Z=0,whiteSpace:q="normal",overflowWrap:he="normal",anchorX:ae=0,anchorY:ue=0,includeCaretPositions:ge=!1,chunkedBoundsSize:we=8192,colorRanges:J=null},re,ie=!1){const fe=M(),Te={fontLoad:0,typesetting:0};L.indexOf("\r")>-1&&(console.info("Typesetter: got text with \\r chars; normalizing to \\n"),L=L.replace(/\r\n/g,` +}`),n}function WAe(n,e){return n==="uniforms"?void 0:typeof e=="function"?e.toString():e}let VAe=0;const MW=new Map;function jAe(n){const e=JSON.stringify(n,WAe);let t=MW.get(e);return t==null&&MW.set(e,t=++VAe),t}function YAe(n,e,t){const{defaultFontURL:r}=t,s=Object.create(null),o=1/0,l=/[\u00AD\u034F\u061C\u115F-\u1160\u17B4-\u17B5\u180B-\u180E\u200B-\u200F\u202A-\u202E\u2060-\u206F\u3164\uFE00-\uFE0F\uFEFF\uFFA0\uFFF0-\uFFF8]/,u="[^\\S\\u00A0]",h=new RegExp(`${u}|[\\-\\u007C\\u00AD\\u2010\\u2012-\\u2014\\u2027\\u2056\\u2E17\\u2E40]`);function f(L,P){function D(){const z=U=>{console.error(`Failure loading font ${L}${L===r?"":"; trying fallback"}`,U),L!==r&&(L=r,D())};try{const U=new XMLHttpRequest;U.open("get",L,!0),U.responseType="arraybuffer",U.onload=function(){if(U.status>=400)z(new Error(U.statusText));else if(U.status>0)try{const V=n(U.response);P(V)}catch(V){z(V)}},U.onerror=z,U.send()}catch(U){z(U)}}D()}function g(L,P){L||(L=r);let D=s[L];D?D.pending?D.pending.push(P):P(D):(s[L]={pending:[P]},f(L,z=>{let U=s[L].pending;s[L]=z,U.forEach(V=>V(z))}))}function y({text:L="",font:P=r,sdfGlyphSize:D=64,fontSize:z=1,letterSpacing:U=0,lineHeight:V="normal",maxWidth:H=o,direction:oe,textAlign:le="left",textIndent:Z=0,whiteSpace:q="normal",overflowWrap:he="normal",anchorX:ae=0,anchorY:ue=0,includeCaretPositions:ge=!1,chunkedBoundsSize:we=8192,colorRanges:J=null},re,se=!1){const fe=M(),Te={fontLoad:0,typesetting:0};L.indexOf("\r")>-1&&(console.info("Typesetter: got text with \\r chars; normalizing to \\n"),L=L.replace(/\r\n/g,` `).replace(/\r/g,` -`)),z=+z,U=+U,H=+H,V=V||"normal",Z=+Z,g(P,Fe=>{const Ie=isFinite(H);let Je=null,Re=null,Qe=null,nt=null,ft=null,lt=null,ze=null,Ce=0,He=0,rt=q!=="nowrap";const{ascender:it,descender:Nt,unitsPerEm:kt,lineGap:vt,capHeight:Mt,xHeight:At}=Fe;Te.fontLoad=M()-fe;const mt=M(),xe=z/kt;V==="normal"&&(V=(it-Nt+vt)/kt),V=V*z;const se=(V-(it-Nt)*xe)/2,$e=-(it*xe+se),ht=Math.min(V,(it-Nt)*xe),St=(it+Nt)/2*xe-ht/2;let It=Z,pt=new A;const Ke=[pt];Fe.forEachGlyph(L,z,U,(te,me,ke)=>{const Xe=L.charAt(ke),Wt=te.advanceWidth*xe,Ge=pt.count;let tn;if("isEmpty"in te||(te.isWhitespace=!!Xe&&new RegExp(u).test(Xe),te.canBreakAfter=!!Xe&&h.test(Xe),te.isEmpty=te.xMin===te.xMax||te.yMin===te.yMax||l.test(Xe)),!te.isWhitespace&&!te.isEmpty&&He++,rt&&Ie&&!te.isWhitespace&&me+Wt+It>H&&Ge){if(pt.glyphAt(Ge-1).glyphObj.canBreakAfter)tn=new A,It=-me;else for(let Jt=Ge;Jt--;)if(Jt===0&&he==="break-word"){tn=new A,It=-me;break}else if(pt.glyphAt(Jt).glyphObj.canBreakAfter){tn=pt.splitAt(Jt+1);const Kt=tn.glyphAt(0).x;It-=Kt;for(let On=tn.count;On--;)tn.glyphAt(On).x-=Kt;break}tn&&(pt.isSoftWrapped=!0,pt=tn,Ke.push(pt),Ce=H)}let _t=pt.glyphAt(pt.count);_t.glyphObj=te,_t.x=me+It,_t.width=Wt,_t.charIndex=ke,Xe===` -`&&(pt=new A,Ke.push(pt),It=-(me+Wt+U*z)+Z)}),Ke.forEach(te=>{for(let me=te.count;me--;){let{glyphObj:ke,x:Xe,width:Wt}=te.glyphAt(me);if(!ke.isWhitespace){te.width=Xe+Wt,te.width>Ce&&(Ce=te.width);return}}});let Le=0,Q=0;if(ae&&(typeof ae=="number"?Le=-ae:typeof ae=="string"&&(Le=-Ce*(ae==="left"?0:ae==="center"?.5:ae==="right"?1:w(ae)))),ue){if(typeof ue=="number")Q=-ue;else if(typeof ue=="string"){let te=Ke.length*V;Q=ue==="top"?0:ue==="top-baseline"?-$e:ue==="top-cap"?-$e-Mt*xe:ue==="top-ex"?-$e-At*xe:ue==="middle"?te/2:ue==="bottom"?te:ue==="bottom-baseline"?te-se+Nt*xe:w(ue)*te}}if(!ie){const te=e.getEmbeddingLevels(L,oe);Je=new Uint16Array(He),Re=new Float32Array(He*2),Qe={},lt=[o,o,-o,-o],ze=[];let me=$e;ge&&(ft=new Float32Array(L.length*3)),J&&(nt=new Uint8Array(He*3));let ke=0,Xe=-1,Wt=-1,Ge,tn;if(Ke.forEach((_t,Jt)=>{let{count:Kt,width:On}=_t;if(Kt>0){let ii=0;for(let Se=Kt;Se--&&_t.glyphAt(Se).glyphObj.isWhitespace;)ii++;let Pr=0,Ei=0;if(le==="center")Pr=(Ce-On)/2;else if(le==="right")Pr=Ce-On;else if(le==="justify"&&_t.isSoftWrapped){let Se=0;for(let We=Kt-ii;We--;)_t.glyphAt(We).glyphObj.isWhitespace&&Se++;Ei=(Ce-On)/Se}if(Ei||Pr){let Se=0;for(let We=0;We=We){let Pe=Nn,gt=Nn;for(;gtot)break;gtmr=Se;for(let Se=0;Se1&&C(ft,Xe,gt),Xe=sn}if(J){const{charIndex:sn}=We;for(;sn>Wt;)Wt++,J.hasOwnProperty(Wt)&&(tn=J[Wt])}if(!mr.isWhitespace&&!mr.isEmpty){const sn=ke++;Qe[ot]||(Qe[ot]={path:mr.path,pathBounds:[mr.xMin,mr.yMin,mr.xMax,mr.yMax]});const Nn=We.x+Le,Pe=me+Q;Re[sn*2]=Nn,Re[sn*2+1]=Pe;const gt=Nn+mr.xMin*xe,Ct=Pe+mr.yMin*xe,bt=Nn+mr.xMax*xe,Vt=Pe+mr.yMax*xe;gtlt[2]&&(lt[2]=bt),Vt>lt[3]&&(lt[3]=Vt),sn%we===0&&(Ge={start:sn,end:sn,rect:[o,o,-o,-o]},ze.push(Ge)),Ge.end++;const Wn=Ge.rect;if(gtWn[2]&&(Wn[2]=bt),Vt>Wn[3]&&(Wn[3]=Vt),Je[sn]=ot,J){const rr=sn*3;nt[rr]=tn>>16&255,nt[rr+1]=tn>>8&255,nt[rr+2]=tn&255}}}}me-=V}),ft){const _t=L.length-Xe;_t>1&&C(ft,Xe,_t)}}Te.typesetting=M()-mt,re({glyphIds:Je,glyphPositions:Re,glyphData:Qe,caretPositions:ft,caretHeight:ht,glyphColors:nt,chunkedBounds:ze,fontSize:z,unitsPerEm:kt,ascender:it*xe,descender:Nt*xe,capHeight:Mt*xe,xHeight:At*xe,lineHeight:V,topBaseline:$e,blockBounds:[Le,Q-Ke.length*V,Le+Ce,Q],visibleBounds:lt,timings:Te})})}function b(L,P){y(L,D=>{const[z,U,V,H]=D.blockBounds;P({width:V-z,height:H-U})},{metricsOnly:!0})}function w(L){let P=L.match(/^([\d.]+)%$/),D=P?parseFloat(P[1]):NaN;return isNaN(D)?0:D/100}function C(L,P,D){const z=L[P*3],U=L[P*3+1],V=L[P*3+2],H=(U-z)/D;for(let oe=0;oe(Object.defineProperty(L,P,{get(){return this.data[this.index*k.length+D]},set(U){this.data[this.index*k.length+D]=U}}),L),{data:null,index:0}),{typeset:y,measure:b,loadFont:g}}const U1=()=>(self.performance||Date).now(),T2=JZ();let MW;function XAe(n,e,t,r,s,o,l,u,h,f,g=!0){return g?JAe(n,e,t,r,s,o,l,u,h,f).then(null,y=>(MW||(console.warn("WebGL SDF generation failed, falling back to JS",y),MW=!0),IW(n,e,t,r,s,o,l,u,h,f))):IW(n,e,t,r,s,o,l,u,h,f)}const $I=[],KAe=5;let VP=0;function QZ(){const n=U1();for(;$I.length&&U1()-nnew Promise((e,t)=>{$I.push(()=>{const r=U1();try{T2.webgl.generateIntoCanvas(...n),e({timing:U1()-r})}catch(s){t(s)}}),VP||(VP=setTimeout(QZ,0))}),qAe=4,QAe=2e3,AW={};let ZAe=0;function IW(n,e,t,r,s,o,l,u,h,f){const g="TroikaTextSDFGenerator_JS_"+ZAe++%qAe;let y=AW[g];return y||(y=AW[g]={workerModule:zC({name:g,workerId:g,dependencies:[JZ,U1],init(b,w){const C=b().javascript.generate;return function(...M){const A=w();return{textureData:C(...M),timing:w()-A}}},getTransferables(b){return[b.textureData.buffer]}}),requests:0,idleTimer:null}),y.requests++,clearTimeout(y.idleTimer),y.workerModule(n,e,t,r,s,o).then(({textureData:b,timing:w})=>{const C=U1(),M=new Uint8Array(b.length*4);for(let A=0;A{PAe(g)},QAe)),{timing:w}})}function eIe(n){n._warm||(T2.webgl.isSupported(n),n._warm=!0)}const tIe=T2.webglUtils.resizeWebGLCanvasWithoutClearing;/*! +`)),z=+z,U=+U,H=+H,V=V||"normal",Z=+Z,g(P,Fe=>{const Ie=isFinite(H);let qe=null,Re=null,Ze=null,rt=null,ft=null,ut=null,ze=null,$e=0,He=0,it=q!=="nowrap";const{ascender:st,descender:Nt,unitsPerEm:kt,lineGap:vt,capHeight:Ct,xHeight:At}=Fe;Te.fontLoad=M()-fe;const gt=M(),xe=z/kt;V==="normal"&&(V=(st-Nt+vt)/kt),V=V*z;const ie=(V-(st-Nt)*xe)/2,Pe=-(st*xe+ie),Ye=Math.min(V,(st-Nt)*xe),St=(st+Nt)/2*xe-Ye/2;let It=Z,mt=new A;const Ke=[mt];Fe.forEachGlyph(L,z,U,(te,pe,Ae)=>{const Je=L.charAt(Ae),jt=te.advanceWidth*xe,Ge=mt.count;let qt;if("isEmpty"in te||(te.isWhitespace=!!Je&&new RegExp(u).test(Je),te.canBreakAfter=!!Je&&h.test(Je),te.isEmpty=te.xMin===te.xMax||te.yMin===te.yMax||l.test(Je)),!te.isWhitespace&&!te.isEmpty&&He++,it&&Ie&&!te.isWhitespace&&pe+jt+It>H&&Ge){if(mt.glyphAt(Ge-1).glyphObj.canBreakAfter)qt=new A,It=-pe;else for(let Jt=Ge;Jt--;)if(Jt===0&&he==="break-word"){qt=new A,It=-pe;break}else if(mt.glyphAt(Jt).glyphObj.canBreakAfter){qt=mt.splitAt(Jt+1);const Xt=qt.glyphAt(0).x;It-=Xt;for(let xn=qt.count;xn--;)qt.glyphAt(xn).x-=Xt;break}qt&&(mt.isSoftWrapped=!0,mt=qt,Ke.push(mt),$e=H)}let pt=mt.glyphAt(mt.count);pt.glyphObj=te,pt.x=pe+It,pt.width=jt,pt.charIndex=Ae,Je===` +`&&(mt=new A,Ke.push(mt),It=-(pe+jt+U*z)+Z)}),Ke.forEach(te=>{for(let pe=te.count;pe--;){let{glyphObj:Ae,x:Je,width:jt}=te.glyphAt(pe);if(!Ae.isWhitespace){te.width=Je+jt,te.width>$e&&($e=te.width);return}}});let Oe=0,Q=0;if(ae&&(typeof ae=="number"?Oe=-ae:typeof ae=="string"&&(Oe=-$e*(ae==="left"?0:ae==="center"?.5:ae==="right"?1:w(ae)))),ue){if(typeof ue=="number")Q=-ue;else if(typeof ue=="string"){let te=Ke.length*V;Q=ue==="top"?0:ue==="top-baseline"?-Pe:ue==="top-cap"?-Pe-Ct*xe:ue==="top-ex"?-Pe-At*xe:ue==="middle"?te/2:ue==="bottom"?te:ue==="bottom-baseline"?te-ie+Nt*xe:w(ue)*te}}if(!se){const te=e.getEmbeddingLevels(L,oe);qe=new Uint16Array(He),Re=new Float32Array(He*2),Ze={},ut=[o,o,-o,-o],ze=[];let pe=Pe;ge&&(ft=new Float32Array(L.length*3)),J&&(rt=new Uint8Array(He*3));let Ae=0,Je=-1,jt=-1,Ge,qt;if(Ke.forEach((pt,Jt)=>{let{count:Xt,width:xn}=pt;if(Xt>0){let ii=0;for(let Se=Xt;Se--&&pt.glyphAt(Se).glyphObj.isWhitespace;)ii++;let Pr=0,Ei=0;if(le==="center")Pr=($e-xn)/2;else if(le==="right")Pr=$e-xn;else if(le==="justify"&&pt.isSoftWrapped){let Se=0;for(let We=Xt-ii;We--;)pt.glyphAt(We).glyphObj.isWhitespace&&Se++;Ei=($e-xn)/Se}if(Ei||Pr){let Se=0;for(let We=0;We=We){let De=Nn,_t=Nn;for(;_tat)break;_tmr=Se;for(let Se=0;Se1&&C(ft,Je,_t),Je=sn}if(J){const{charIndex:sn}=We;for(;sn>jt;)jt++,J.hasOwnProperty(jt)&&(qt=J[jt])}if(!mr.isWhitespace&&!mr.isEmpty){const sn=Ae++;Ze[at]||(Ze[at]={path:mr.path,pathBounds:[mr.xMin,mr.yMin,mr.xMax,mr.yMax]});const Nn=We.x+Oe,De=pe+Q;Re[sn*2]=Nn,Re[sn*2+1]=De;const _t=Nn+mr.xMin*xe,Mt=De+mr.yMin*xe,bt=Nn+mr.xMax*xe,Wt=De+mr.yMax*xe;_tut[2]&&(ut[2]=bt),Wt>ut[3]&&(ut[3]=Wt),sn%we===0&&(Ge={start:sn,end:sn,rect:[o,o,-o,-o]},ze.push(Ge)),Ge.end++;const Wn=Ge.rect;if(_tWn[2]&&(Wn[2]=bt),Wt>Wn[3]&&(Wn[3]=Wt),qe[sn]=at,J){const rr=sn*3;rt[rr]=qt>>16&255,rt[rr+1]=qt>>8&255,rt[rr+2]=qt&255}}}}pe-=V}),ft){const pt=L.length-Je;pt>1&&C(ft,Je,pt)}}Te.typesetting=M()-gt,re({glyphIds:qe,glyphPositions:Re,glyphData:Ze,caretPositions:ft,caretHeight:Ye,glyphColors:rt,chunkedBounds:ze,fontSize:z,unitsPerEm:kt,ascender:st*xe,descender:Nt*xe,capHeight:Ct*xe,xHeight:At*xe,lineHeight:V,topBaseline:Pe,blockBounds:[Oe,Q-Ke.length*V,Oe+$e,Q],visibleBounds:ut,timings:Te})})}function b(L,P){y(L,D=>{const[z,U,V,H]=D.blockBounds;P({width:V-z,height:H-U})},{metricsOnly:!0})}function w(L){let P=L.match(/^([\d.]+)%$/),D=P?parseFloat(P[1]):NaN;return isNaN(D)?0:D/100}function C(L,P,D){const z=L[P*3],U=L[P*3+1],V=L[P*3+2],H=(U-z)/D;for(let oe=0;oe(Object.defineProperty(L,P,{get(){return this.data[this.index*k.length+D]},set(U){this.data[this.index*k.length+D]=U}}),L),{data:null,index:0}),{typeset:y,measure:b,loadFont:g}}const H1=()=>(self.performance||Date).now(),T2=qZ();let AW;function XAe(n,e,t,r,s,o,l,u,h,f,g=!0){return g?JAe(n,e,t,r,s,o,l,u,h,f).then(null,y=>(AW||(console.warn("WebGL SDF generation failed, falling back to JS",y),AW=!0),RW(n,e,t,r,s,o,l,u,h,f))):RW(n,e,t,r,s,o,l,u,h,f)}const $I=[],KAe=5;let VP=0;function ZZ(){const n=H1();for(;$I.length&&H1()-nnew Promise((e,t)=>{$I.push(()=>{const r=H1();try{T2.webgl.generateIntoCanvas(...n),e({timing:H1()-r})}catch(s){t(s)}}),VP||(VP=setTimeout(ZZ,0))}),qAe=4,QAe=2e3,IW={};let ZAe=0;function RW(n,e,t,r,s,o,l,u,h,f){const g="TroikaTextSDFGenerator_JS_"+ZAe++%qAe;let y=IW[g];return y||(y=IW[g]={workerModule:zC({name:g,workerId:g,dependencies:[qZ,H1],init(b,w){const C=b().javascript.generate;return function(...M){const A=w();return{textureData:C(...M),timing:w()-A}}},getTransferables(b){return[b.textureData.buffer]}}),requests:0,idleTimer:null}),y.requests++,clearTimeout(y.idleTimer),y.workerModule(n,e,t,r,s,o).then(({textureData:b,timing:w})=>{const C=H1(),M=new Uint8Array(b.length*4);for(let A=0;A{PAe(g)},QAe)),{timing:w}})}function eIe(n){n._warm||(T2.webgl.isSupported(n),n._warm=!0)}const tIe=T2.webglUtils.resizeWebGLCanvasWithoutClearing;/*! Custom build of Typr.ts (https://github.com/fredli74/Typr.ts) for use in Troika text rendering. Original MIT license applies: https://github.com/fredli74/Typr.ts/blob/master/LICENSE -*/function nIe(){return typeof window>"u"&&(self.window=self),function(n){var e={parse:function(s){var o=e._bin,l=new Uint8Array(s);if(o.readASCII(l,0,4)=="ttcf"){var u=4;o.readUshort(l,u),u+=2,o.readUshort(l,u),u+=2;var h=o.readUint(l,u);u+=4;for(var f=[],g=0;g>>l&1&&o++;return o},e._lctf.readClassDef=function(s,o){var l=e._bin,u=[],h=l.readUshort(s,o);if(o+=2,h==1){var f=l.readUshort(s,o);o+=2;var g=l.readUshort(s,o);o+=2;for(var y=0;y0&&(h.featureParams=u+f);var g=l.readUshort(s,o);o+=2,h.tab=[];for(var y=0;y255?-1:e.CFF.glyphByUnicode(s,e.CFF.tableSE[o])},e.CFF.readEncoding=function(s,o,l){e._bin;var u=[".notdef"],h=s[o];if(o++,h!=0)throw"error: unknown encoding format: "+h;var f=s[o];o++;for(var g=0;g>4,L=15&A;if(k!=15&&M.push(k),L!=15&&M.push(L),L==15)break}for(var P="",D=[0,1,2,3,4,5,6,7,8,9,".","e","e-","reserved","-","endOfNumber"],z=0;z=f.xMax||f.yMin>=f.yMax)return null;if(f.noc>0){f.endPts=[];for(var g=0;g=1&&g.fmt<=2){b=h.readUshort(s,l),l+=2;var C=h.readUshort(s,l);l+=2,w=e._lctf.numOfOnes(b);var M=e._lctf.numOfOnes(C);if(g.fmt==1){g.pairsets=[];var A=h.readUshort(s,l);l+=2;for(var k=0;k=1&&g.fmt<=2){if(g.fmt==1)g.delta=h.readShort(s,l),l+=2;else if(g.fmt==2){var b=h.readUshort(s,l);l+=2,g.newg=h.readUshorts(s,l,b),l+=2*g.newg.length}}else if(o==4){g.vals=[],b=h.readUshort(s,l),l+=2;for(var w=0;w>>8;if((C&=15)!=0)throw"unknown kern table format: "+C;o=e.kern.readFormat0(s,o,y)}return y},e.kern.parseV1=function(s,o,l,u){var h=e._bin;h.readFixed(s,o),o+=4;var f=h.readUint(s,o);o+=4;for(var g={glyph1:[],rval:[]},y=0;y>>8;if((w&=15)!=0)throw"unknown kern table format: "+w;o=e.kern.readFormat0(s,o,g)}return g},e.kern.readFormat0=function(s,o,l){var u=e._bin,h=-1,f=u.readUshort(s,o);o+=2,u.readUshort(s,o),o+=2,u.readUshort(s,o),o+=2,u.readUshort(s,o),o+=2;for(var g=0;g=h.map.length?0:h.map[o];if(h.format==4){for(var f=-1,g=0;go?0:65535&(h.idRangeOffset[f]!=0?h.glyphIdArray[o-h.startCount[f]+(h.idRangeOffset[f]>>1)-(h.idRangeOffset.length-f)]:o+h.idDelta[f])}if(h.format==12){if(o>h.groups[h.groups.length-1][1])return 0;for(g=0;g-1?e.U._simpleGlyph(u,l):e.U._compoGlyph(u,o,l))},e.U._simpleGlyph=function(s,o){for(var l=0;lh)){for(var A=!0,k=0,L=0;Lh)){for(A=!0,L=0;L>1,f.length=0,y=!0;else if(q=="o3"||q=="o23")f.length%2!=0&&!y&&(b=f.shift()+u.nominalWidthX),g+=f.length>>1,f.length=0,y=!0;else if(q=="o4")f.length>1&&!y&&(b=f.shift()+u.nominalWidthX,y=!0),w&&e.U.P.closePath(h),A+=f.pop(),e.U.P.moveTo(h,M,A),w=!0;else if(q=="o5")for(;f.length>0;)M+=f.shift(),A+=f.shift(),e.U.P.lineTo(h,M,A);else if(q=="o6"||q=="o7")for(var he=f.length,ae=q=="o6",ue=0;ueMath.abs(H-A)?M=V+f.shift():A=H+f.shift(),e.U.P.curveTo(h,k,L,P,D,oe,le),e.U.P.curveTo(h,z,U,V,H,M,A));else if(q=="o14"){if(f.length>0&&!y&&(b=f.shift()+l.nominalWidthX,y=!0),f.length==4){var J=f.shift(),re=f.shift(),ie=f.shift(),fe=f.shift(),Te=e.CFF.glyphBySE(l,ie),Fe=e.CFF.glyphBySE(l,fe);e.U._drawCFF(l.CharStrings[Te],o,l,u,h),o.x=J,o.y=re,e.U._drawCFF(l.CharStrings[Fe],o,l,u,h)}w&&(e.U.P.closePath(h),w=!1)}else if(q=="o19"||q=="o20")f.length%2!=0&&!y&&(b=f.shift()+u.nominalWidthX),g+=f.length>>1,f.length=0,y=!0,C+=g+7>>3;else if(q=="o21")f.length>2&&!y&&(b=f.shift()+u.nominalWidthX,y=!0),A+=f.pop(),M+=f.pop(),w&&e.U.P.closePath(h),e.U.P.moveTo(h,M,A),w=!0;else if(q=="o22")f.length>1&&!y&&(b=f.shift()+u.nominalWidthX,y=!0),M+=f.pop(),w&&e.U.P.closePath(h),e.U.P.moveTo(h,M,A),w=!0;else if(q=="o25"){for(;f.length>6;)M+=f.shift(),A+=f.shift(),e.U.P.lineTo(h,M,A);k=M+f.shift(),L=A+f.shift(),P=k+f.shift(),D=L+f.shift(),M=P+f.shift(),A=D+f.shift(),e.U.P.curveTo(h,k,L,P,D,M,A)}else if(q=="o26")for(f.length%2&&(M+=f.shift());f.length>0;)k=M,L=A+f.shift(),M=P=k+f.shift(),A=(D=L+f.shift())+f.shift(),e.U.P.curveTo(h,k,L,P,D,M,A);else if(q=="o27")for(f.length%2&&(A+=f.shift());f.length>0;)L=A,P=(k=M+f.shift())+f.shift(),D=L+f.shift(),M=P+f.shift(),A=D,e.U.P.curveTo(h,k,L,P,D,M,A);else if(q=="o10"||q=="o29"){var Ie=q=="o10"?u:l;if(f.length==0)console.debug("error: empty stack");else{var Je=f.pop(),Re=Ie.Subrs[Je+Ie.Bias];o.x=M,o.y=A,o.nStems=g,o.haveWidth=y,o.width=b,o.open=w,e.U._drawCFF(Re,o,l,u,h),M=o.x,A=o.y,g=o.nStems,y=o.haveWidth,b=o.width,w=o.open}}else if(q=="o30"||q=="o31"){var Qe=f.length,nt=(we=0,q=="o31");for(we+=Qe-(he=-3&Qe);we"u"&&(self.window=self),function(n){var e={parse:function(s){var o=e._bin,l=new Uint8Array(s);if(o.readASCII(l,0,4)=="ttcf"){var u=4;o.readUshort(l,u),u+=2,o.readUshort(l,u),u+=2;var h=o.readUint(l,u);u+=4;for(var f=[],g=0;g>>l&1&&o++;return o},e._lctf.readClassDef=function(s,o){var l=e._bin,u=[],h=l.readUshort(s,o);if(o+=2,h==1){var f=l.readUshort(s,o);o+=2;var g=l.readUshort(s,o);o+=2;for(var y=0;y0&&(h.featureParams=u+f);var g=l.readUshort(s,o);o+=2,h.tab=[];for(var y=0;y255?-1:e.CFF.glyphByUnicode(s,e.CFF.tableSE[o])},e.CFF.readEncoding=function(s,o,l){e._bin;var u=[".notdef"],h=s[o];if(o++,h!=0)throw"error: unknown encoding format: "+h;var f=s[o];o++;for(var g=0;g>4,L=15&A;if(k!=15&&M.push(k),L!=15&&M.push(L),L==15)break}for(var P="",D=[0,1,2,3,4,5,6,7,8,9,".","e","e-","reserved","-","endOfNumber"],z=0;z=f.xMax||f.yMin>=f.yMax)return null;if(f.noc>0){f.endPts=[];for(var g=0;g=1&&g.fmt<=2){b=h.readUshort(s,l),l+=2;var C=h.readUshort(s,l);l+=2,w=e._lctf.numOfOnes(b);var M=e._lctf.numOfOnes(C);if(g.fmt==1){g.pairsets=[];var A=h.readUshort(s,l);l+=2;for(var k=0;k=1&&g.fmt<=2){if(g.fmt==1)g.delta=h.readShort(s,l),l+=2;else if(g.fmt==2){var b=h.readUshort(s,l);l+=2,g.newg=h.readUshorts(s,l,b),l+=2*g.newg.length}}else if(o==4){g.vals=[],b=h.readUshort(s,l),l+=2;for(var w=0;w>>8;if((C&=15)!=0)throw"unknown kern table format: "+C;o=e.kern.readFormat0(s,o,y)}return y},e.kern.parseV1=function(s,o,l,u){var h=e._bin;h.readFixed(s,o),o+=4;var f=h.readUint(s,o);o+=4;for(var g={glyph1:[],rval:[]},y=0;y>>8;if((w&=15)!=0)throw"unknown kern table format: "+w;o=e.kern.readFormat0(s,o,g)}return g},e.kern.readFormat0=function(s,o,l){var u=e._bin,h=-1,f=u.readUshort(s,o);o+=2,u.readUshort(s,o),o+=2,u.readUshort(s,o),o+=2,u.readUshort(s,o),o+=2;for(var g=0;g=h.map.length?0:h.map[o];if(h.format==4){for(var f=-1,g=0;go?0:65535&(h.idRangeOffset[f]!=0?h.glyphIdArray[o-h.startCount[f]+(h.idRangeOffset[f]>>1)-(h.idRangeOffset.length-f)]:o+h.idDelta[f])}if(h.format==12){if(o>h.groups[h.groups.length-1][1])return 0;for(g=0;g-1?e.U._simpleGlyph(u,l):e.U._compoGlyph(u,o,l))},e.U._simpleGlyph=function(s,o){for(var l=0;lh)){for(var A=!0,k=0,L=0;Lh)){for(A=!0,L=0;L>1,f.length=0,y=!0;else if(q=="o3"||q=="o23")f.length%2!=0&&!y&&(b=f.shift()+u.nominalWidthX),g+=f.length>>1,f.length=0,y=!0;else if(q=="o4")f.length>1&&!y&&(b=f.shift()+u.nominalWidthX,y=!0),w&&e.U.P.closePath(h),A+=f.pop(),e.U.P.moveTo(h,M,A),w=!0;else if(q=="o5")for(;f.length>0;)M+=f.shift(),A+=f.shift(),e.U.P.lineTo(h,M,A);else if(q=="o6"||q=="o7")for(var he=f.length,ae=q=="o6",ue=0;ueMath.abs(H-A)?M=V+f.shift():A=H+f.shift(),e.U.P.curveTo(h,k,L,P,D,oe,le),e.U.P.curveTo(h,z,U,V,H,M,A));else if(q=="o14"){if(f.length>0&&!y&&(b=f.shift()+l.nominalWidthX,y=!0),f.length==4){var J=f.shift(),re=f.shift(),se=f.shift(),fe=f.shift(),Te=e.CFF.glyphBySE(l,se),Fe=e.CFF.glyphBySE(l,fe);e.U._drawCFF(l.CharStrings[Te],o,l,u,h),o.x=J,o.y=re,e.U._drawCFF(l.CharStrings[Fe],o,l,u,h)}w&&(e.U.P.closePath(h),w=!1)}else if(q=="o19"||q=="o20")f.length%2!=0&&!y&&(b=f.shift()+u.nominalWidthX),g+=f.length>>1,f.length=0,y=!0,C+=g+7>>3;else if(q=="o21")f.length>2&&!y&&(b=f.shift()+u.nominalWidthX,y=!0),A+=f.pop(),M+=f.pop(),w&&e.U.P.closePath(h),e.U.P.moveTo(h,M,A),w=!0;else if(q=="o22")f.length>1&&!y&&(b=f.shift()+u.nominalWidthX,y=!0),M+=f.pop(),w&&e.U.P.closePath(h),e.U.P.moveTo(h,M,A),w=!0;else if(q=="o25"){for(;f.length>6;)M+=f.shift(),A+=f.shift(),e.U.P.lineTo(h,M,A);k=M+f.shift(),L=A+f.shift(),P=k+f.shift(),D=L+f.shift(),M=P+f.shift(),A=D+f.shift(),e.U.P.curveTo(h,k,L,P,D,M,A)}else if(q=="o26")for(f.length%2&&(M+=f.shift());f.length>0;)k=M,L=A+f.shift(),M=P=k+f.shift(),A=(D=L+f.shift())+f.shift(),e.U.P.curveTo(h,k,L,P,D,M,A);else if(q=="o27")for(f.length%2&&(A+=f.shift());f.length>0;)L=A,P=(k=M+f.shift())+f.shift(),D=L+f.shift(),M=P+f.shift(),A=D,e.U.P.curveTo(h,k,L,P,D,M,A);else if(q=="o10"||q=="o29"){var Ie=q=="o10"?u:l;if(f.length==0)console.debug("error: empty stack");else{var qe=f.pop(),Re=Ie.Subrs[qe+Ie.Bias];o.x=M,o.y=A,o.nStems=g,o.haveWidth=y,o.width=b,o.open=w,e.U._drawCFF(Re,o,l,u,h),M=o.x,A=o.y,g=o.nStems,y=o.haveWidth,b=o.width,w=o.open}}else if(q=="o30"||q=="o31"){var Ze=f.length,rt=(we=0,q=="o31");for(we+=Ze-(he=-3&Ze);we>>1|(21845&w)<<1;C=(61680&(C=(52428&C)>>>2|(13107&C)<<2))>>>4|(3855&C)<<4,b[w]=((65280&C)>>>8|(255&C)<<8)>>>1}var M=function(q,he,ae){for(var ue=q.length,ge=0,we=new t(he);ge>>ie]=fe}else for(J=new t(ue),ge=0;ge>>15-q[ge]);return J},A=new e(288);for(w=0;w<144;++w)A[w]=8;for(w=144;w<256;++w)A[w]=9;for(w=256;w<280;++w)A[w]=7;for(w=280;w<288;++w)A[w]=8;var k=new e(32);for(w=0;w<32;++w)k[w]=5;var L=M(A,9,1),P=M(k,5,1),D=function(q){for(var he=q[0],ae=1;aehe&&(he=q[ae]);return he},z=function(q,he,ae){var ue=he/8|0;return(q[ue]|q[ue+1]<<8)>>(7&he)&ae},U=function(q,he){var ae=he/8|0;return(q[ae]|q[ae+1]<<8|q[ae+2]<<16)>>(7&he)},V=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],H=function(q,he,ae){var ue=new Error(he||V[q]);if(ue.code=q,Error.captureStackTrace&&Error.captureStackTrace(ue,H),!ae)throw ue;return ue},oe=function(q,he,ae){var ue=q.length;if(!ue||ae&&!ae.l&&ue<5)return he||new e(0);var ge=!he||ae,we=!ae||ae.i;ae||(ae={}),he||(he=new e(3*ue));var J,re=function(Xe){var Wt=he.length;if(Xe>Wt){var Ge=new e(Math.max(2*Wt,Xe));Ge.set(he),he=Ge}},ie=ae.f||0,fe=ae.p||0,Te=ae.b||0,Fe=ae.l,Ie=ae.d,Je=ae.m,Re=ae.n,Qe=8*ue;do{if(!Fe){ae.f=ie=z(q,fe,1);var nt=z(q,fe+1,3);if(fe+=3,!nt){var ft=q[(At=((J=fe)/8|0)+(7&J&&1)+4)-4]|q[At-3]<<8,lt=At+ft;if(lt>ue){we&&H(0);break}ge&&re(Te+ft),he.set(q.subarray(At,lt),Te),ae.b=Te+=ft,ae.p=fe=8*lt;continue}if(nt==1)Fe=L,Ie=P,Je=9,Re=5;else if(nt==2){var ze=z(q,fe,31)+257,Ce=z(q,fe+10,15)+4,He=ze+z(q,fe+5,31)+1;fe+=14;for(var rt=new e(He),it=new e(19),Nt=0;Nt>>4)<16)rt[Nt++]=At;else{var xe=0,se=0;for(At==16?(se=3+z(q,fe,3),fe+=2,xe=rt[Nt-1]):At==17?(se=3+z(q,fe,7),fe+=3):At==18&&(se=11+z(q,fe,127),fe+=7);se--;)rt[Nt++]=xe}}var $e=rt.subarray(0,ze),ht=rt.subarray(ze);Je=D($e),Re=D(ht),Fe=M($e,Je,1),Ie=M(ht,Re,1)}else H(1);if(fe>Qe){we&&H(0);break}}ge&&re(Te+131072);for(var St=(1<>>4;if((fe+=15&xe)>Qe){we&&H(0);break}if(xe||H(2),Ke<256)he[Te++]=Ke;else{if(Ke==256){pt=fe,Fe=null;break}var Le=Ke-254;if(Ke>264){var Q=s[Nt=Ke-257];Le=z(q,fe,(1<>>4;if(te||H(3),fe+=15&te,ht=y[me],me>3&&(Q=o[me],ht+=U(q,fe)&(1<Qe){we&&H(0);break}ge&&re(Te+131072);for(var ke=Te+Le;TeXe.length)&&(Ge=Xe.length);var tn=new(Xe instanceof t?t:Xe instanceof r?r:e)(Ge-Wt);return tn.set(Xe.subarray(Wt,Ge)),tn}(he,0,Te)},le=new e(0),Z=typeof TextDecoder<"u"&&new TextDecoder;try{Z.decode(le,{stream:!0})}catch{}return n.convert_streams=function(q){var he=new DataView(q),ae=0;function ue(){var ze=he.getUint16(ae);return ae+=2,ze}function ge(){var ze=he.getUint32(ae);return ae+=4,ze}function we(ze){ft.setUint16(lt,ze),lt+=2}function J(ze){ft.setUint32(lt,ze),lt+=4}for(var re={signature:ge(),flavor:ge(),length:ge(),numTables:ue(),reserved:ue(),totalSfntSize:ge(),majorVersion:ue(),minorVersion:ue(),metaOffset:ge(),metaLength:ge(),metaOrigLength:ge(),privOffset:ge(),privLength:ge()},ie=0;Math.pow(2,ie)<=re.numTables;)ie++;ie--;for(var fe=16*Math.pow(2,ie),Te=16*re.numTables-fe,Fe=12,Ie=[],Je=0;Je{let[le,Z]=oe.split("+");le=parseInt(le,36),Z=Z?parseInt(Z,36):0,g.set(H+=le,U[V]);for(let q=Z;q--;)g.set(++H,U[V])})}}return g.get(z)||f}const b=1,w=2,C=3,M=4,A=[null,"isol","init","fina","medi"];function k(z){const U=new Uint8Array(z.length);let V=f,H=b,oe=-1;for(let le=0;le65535&&le++)}return U}function L(z,U){const V=[];for(let oe=0;oe65535&&oe++,V.push(n.U.codeToGlyph(z,le))}const H=z.GSUB;if(H){const{lookupList:oe,featureList:le}=H;let Z;const q=/^(rlig|liga|mset|isol|init|fina|medi|half|pres|blws)$/,he=[];le.forEach(ae=>{if(q.test(ae.tag))for(let ue=0;ue{if(fe!==-1){let Fe=U[fe];if(!Fe){const{cmds:Ie,crds:Je}=n.U.glyphToPath(z,fe);let Re="",Qe=0;for(let Ce=0,He=Ie.length;Ce1?",":"")+Je[Qe++]}let nt,ft,lt,ze;if(Je.length){nt=ft=1/0,lt=ze=-1/0;for(let Ce=0,He=Je.length;Celt&&(lt=rt),it>ze&&(ze=it)}}else nt=lt=ft=ze=0;Fe=U[fe]={index:fe,advanceWidth:z.hmtx.aWidth[fe],xMin:nt,yMin:ft,xMax:lt,yMax:ze,path:Re,pathCommandCount:Ie.length}}ie!==-1&&(ge+=n.U.getPairAdjustment(z,ie,fe)*we),ue.call(null,Fe,ge,re),Fe.advanceWidth&&(ge+=Fe.advanceWidth*we),ae&&(ge+=ae*he),ie=fe}re+=q.codePointAt(re)>65535?2:1}),ge}};return Z}return function(z){const U=new Uint8Array(z,0,4),V=n._bin.readASCII(U,0,4);if(V==="wOFF")z=e(z);else if(V==="wOF2")throw new Error("woff2 fonts not supported");return D(n.parse(z)[0])}}const sIe=zC({name:"Typr Font Parser",dependencies:[nIe,rIe,iIe],init(n,e,t){const r=n(),s=e();return t(r,s)}}),nw={defaultFontURL:"https://fonts.gstatic.com/s/roboto/v18/KFOmCnqEu92Fr1Mu4mxM.woff",sdfGlyphSize:64,sdfMargin:1/16,sdfExponent:9,textureWidth:2048},oIe=new Fn;function OS(){return(self.performance||Date).now()}const RW=Object.create(null);function ZZ(n,e){n=uIe({},n);const t=OS();if(n.font=cIe(n.font||nw.defaultFontURL),n.text=""+n.text,n.sdfGlyphSize=n.sdfGlyphSize||nw.sdfGlyphSize,n.colorRanges!=null){let y={};for(let b in n.colorRanges)if(n.colorRanges.hasOwnProperty(b)){let w=n.colorRanges[b];typeof w!="number"&&(w=oIe.set(w).getHex()),y[b]=w}n.colorRanges=y}Object.freeze(n);const{textureWidth:r,sdfExponent:s}=nw,{sdfGlyphSize:o}=n,l=r/o*4;let u=RW[o];if(!u){const y=document.createElement("canvas");y.width=r,y.height=o*256/l,u=RW[o]={glyphCount:0,sdfGlyphSize:o,sdfCanvas:y,sdfTexture:new dc(y,void 0,void 0,void 0,wl,wl),contextLost:!1,glyphsByFont:new Map},u.sdfTexture.generateMipmaps=!1,aIe(u)}const{sdfTexture:h,sdfCanvas:f}=u;let g=u.glyphsByFont.get(n.font);g||u.glyphsByFont.set(n.font,g=new Map),dIe(n).then(y=>{const{glyphIds:b,glyphPositions:w,fontSize:C,unitsPerEm:M,timings:A}=y,k=[],L=new Float32Array(b.length*4),P=C/M;let D=0,z=0;const U=OS();b.forEach((Z,q)=>{let he=g.get(Z);if(!he){const{path:we,pathBounds:J}=y.glyphData[Z],re=Math.max(J[2]-J[0],J[3]-J[1])/o*(nw.sdfMargin*o+.5),ie=u.glyphCount++,fe=[J[0]-re,J[1]-re,J[2]+re,J[3]+re];g.set(Z,he={path:we,atlasIndex:ie,sdfViewBox:fe}),k.push(he)}const{sdfViewBox:ae}=he,ue=w[z++],ge=w[z++];L[D++]=ue+ae[0]*P,L[D++]=ge+ae[1]*P,L[D++]=ue+ae[2]*P,L[D++]=ge+ae[3]*P,b[q]=he.atlasIndex}),A.quads=(A.quads||0)+(OS()-U);const V=OS();A.sdf={};const H=f.height,oe=Math.ceil(u.glyphCount/l),le=Math.pow(2,Math.ceil(Math.log2(oe*o)));le>H&&(console.info(`Increasing SDF texture size ${H}->${le}`),tIe(f,r,le),h.dispose()),Promise.all(k.map(Z=>eee(Z,u,n.gpuAccelerateSDF).then(({timing:q})=>{A.sdf[Z.atlasIndex]=q}))).then(()=>{k.length&&!u.contextLost&&(tee(u),h.needsUpdate=!0),A.sdfTotal=OS()-V,A.total=OS()-t,e(Object.freeze({parameters:n,sdfTexture:h,sdfGlyphSize:o,sdfExponent:s,glyphBounds:L,glyphAtlasIndices:b,glyphColors:y.glyphColors,caretPositions:y.caretPositions,caretHeight:y.caretHeight,chunkedBounds:y.chunkedBounds,ascender:y.ascender,descender:y.descender,lineHeight:y.lineHeight,capHeight:y.capHeight,xHeight:y.xHeight,topBaseline:y.topBaseline,blockBounds:y.blockBounds,visibleBounds:y.visibleBounds,timings:y.timings}))})}),Promise.resolve().then(()=>{u.contextLost||eIe(f)})}function eee({path:n,atlasIndex:e,sdfViewBox:t},{sdfGlyphSize:r,sdfCanvas:s,contextLost:o},l){if(o)return Promise.resolve({timing:-1});const{textureWidth:u,sdfExponent:h}=nw,f=Math.max(t[2]-t[0],t[3]-t[1]),g=Math.floor(e/4),y=g%(u/r)*r,b=Math.floor(g/(u/r))*r,w=e%4;return XAe(r,r,n,t,f,h,s,y,b,w,l)}function aIe(n){const e=n.sdfCanvas;e.addEventListener("webglcontextlost",t=>{console.log("Context Lost",t),t.preventDefault(),n.contextLost=!0}),e.addEventListener("webglcontextrestored",t=>{console.log("Context Restored",t),n.contextLost=!1;const r=[];n.glyphsByFont.forEach(s=>{s.forEach(o=>{r.push(eee(o,n,!0))})}),Promise.all(r).then(()=>{tee(n),n.sdfTexture.needsUpdate=!0})})}function lIe({font:n,characters:e,sdfGlyphSize:t},r){let s=Array.isArray(e)?e.join(` -`):""+e;ZZ({font:n,sdfGlyphSize:t,text:s},r)}function uIe(n,e){for(let t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);return n}let PA;function cIe(n){return PA||(PA=typeof document>"u"?{}:document.createElement("a")),PA.href=n,PA.href}function tee(n){if(typeof createImageBitmap!="function"){console.info("Safari<15: applying SDF canvas workaround");const{sdfCanvas:e,sdfTexture:t}=n,{width:r,height:s}=e,o=n.sdfCanvas.getContext("webgl");let l=t.image.data;(!l||l.length!==r*s*4)&&(l=new Uint8Array(r*s*4),t.image={width:r,height:s,data:l},t.flipY=!1,t.isDataTexture=!0),o.readPixels(0,0,r,s,o.RGBA,o.UNSIGNED_BYTE,l)}}const hIe=zC({name:"Typesetter",dependencies:[nw,sIe,YAe,FAe],init(n,e,t,r){const{defaultFontURL:s}=n;return t(e,r(),{defaultFontURL:s})}}),dIe=zC({name:"Typesetter",dependencies:[hIe],init(n){return function(e){return new Promise(t=>{n.typeset(e,t)})}},getTransferables(n){const e=[n.glyphPositions.buffer,n.glyphIds.buffer];return n.caretPositions&&e.push(n.caretPositions.buffer),n.glyphColors&&e.push(n.glyphColors.buffer),e}}),kW={};function fIe(n){let e=kW[n];if(!e){const t=new c0(1,1,n,n),r=t.clone(),s=t.attributes,o=r.attributes,l=new ui,u=s.uv.count;for(let h=0;h{l.setAttribute(h,new ar([...s[h].array,...o[h].array],s[h].itemSize))}),l.setIndex([...t.index.array,...r.index.array.map(h=>h+u)]),l.translate(.5,.5,0),e=kW[n]=l}return e}const pIe="aTroikaGlyphBounds",OW="aTroikaGlyphIndex",mIe="aTroikaGlyphColor";class gIe extends y2{constructor(){super(),this.detail=1,this.curveRadius=0,this.groups=[{start:0,count:1/0,materialIndex:0},{start:0,count:1/0,materialIndex:1}],this.boundingSphere=new b_,this.boundingBox=new d0}computeBoundingSphere(){}computeBoundingBox(){}setSide(e){const t=this.getIndex().count;this.setDrawRange(e===cd?t/2:0,e===lp?t:t/2)}set detail(e){if(e!==this._detail){this._detail=e,(typeof e!="number"||e<1)&&(e=1);let t=fIe(e);["position","normal","uv"].forEach(r=>{this.attributes[r]=t.attributes[r].clone()}),this.setIndex(t.getIndex().clone())}}get detail(){return this._detail}set curveRadius(e){e!==this._curveRadius&&(this._curveRadius=e,this._updateBounds())}get curveRadius(){return this._curveRadius}updateGlyphs(e,t,r,s,o){aN(this,pIe,e,4),aN(this,OW,t,1),aN(this,mIe,o,3),this._blockBounds=r,this._chunkedBounds=s,this.instanceCount=t.length,this._updateBounds()}_updateBounds(){const e=this._blockBounds;if(e){const{curveRadius:t,boundingBox:r}=this;if(t){const{PI:s,floor:o,min:l,max:u,sin:h,cos:f}=Math,g=s/2,y=s*2,b=Math.abs(t),w=e[0]/b,C=e[2]/b,M=o((w+g)/y)!==o((C+g)/y)?-b:l(h(w)*b,h(C)*b),A=o((w-g)/y)!==o((C-g)/y)?b:u(h(w)*b,h(C)*b),k=o((w+s)/y)!==o((C+s)/y)?b*2:u(b-f(w)*b,b-f(C)*b);r.min.set(M,e[1],t<0?-k:0),r.max.set(A,e[3],t<0?0:k)}else r.min.set(e[0],e[1],0),r.max.set(e[2],e[3],0);r.getBoundingSphere(this.boundingSphere)}}applyClipRect(e){let t=this.getAttribute(OW).count,r=this._chunkedBounds;if(r)for(let s=r.length;s--;){t=r[s].end;let o=r[s].rect;if(o[1]e.y&&o[0]e.x)break}this.instanceCount=t}}function aN(n,e,t,r){const s=n.getAttribute(e);t?s&&s.array.length===t.length?(s.array.set(t),s.needsUpdate=!0):(n.setAttribute(e,new Z1(t,r)),delete n._maxInstanceCount,n.dispose()):s&&n.deleteAttribute(e)}const _Ie=` +*/function rIe(){return function(n){var e=Uint8Array,t=Uint16Array,r=Uint32Array,s=new e([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),o=new e([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),l=new e([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),u=function(q,he){for(var ae=new t(31),ue=0;ue<31;++ue)ae[ue]=he+=1<>>1|(21845&w)<<1;C=(61680&(C=(52428&C)>>>2|(13107&C)<<2))>>>4|(3855&C)<<4,b[w]=((65280&C)>>>8|(255&C)<<8)>>>1}var M=function(q,he,ae){for(var ue=q.length,ge=0,we=new t(he);ge>>se]=fe}else for(J=new t(ue),ge=0;ge>>15-q[ge]);return J},A=new e(288);for(w=0;w<144;++w)A[w]=8;for(w=144;w<256;++w)A[w]=9;for(w=256;w<280;++w)A[w]=7;for(w=280;w<288;++w)A[w]=8;var k=new e(32);for(w=0;w<32;++w)k[w]=5;var L=M(A,9,1),P=M(k,5,1),D=function(q){for(var he=q[0],ae=1;aehe&&(he=q[ae]);return he},z=function(q,he,ae){var ue=he/8|0;return(q[ue]|q[ue+1]<<8)>>(7&he)&ae},U=function(q,he){var ae=he/8|0;return(q[ae]|q[ae+1]<<8|q[ae+2]<<16)>>(7&he)},V=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],H=function(q,he,ae){var ue=new Error(he||V[q]);if(ue.code=q,Error.captureStackTrace&&Error.captureStackTrace(ue,H),!ae)throw ue;return ue},oe=function(q,he,ae){var ue=q.length;if(!ue||ae&&!ae.l&&ue<5)return he||new e(0);var ge=!he||ae,we=!ae||ae.i;ae||(ae={}),he||(he=new e(3*ue));var J,re=function(Je){var jt=he.length;if(Je>jt){var Ge=new e(Math.max(2*jt,Je));Ge.set(he),he=Ge}},se=ae.f||0,fe=ae.p||0,Te=ae.b||0,Fe=ae.l,Ie=ae.d,qe=ae.m,Re=ae.n,Ze=8*ue;do{if(!Fe){ae.f=se=z(q,fe,1);var rt=z(q,fe+1,3);if(fe+=3,!rt){var ft=q[(At=((J=fe)/8|0)+(7&J&&1)+4)-4]|q[At-3]<<8,ut=At+ft;if(ut>ue){we&&H(0);break}ge&&re(Te+ft),he.set(q.subarray(At,ut),Te),ae.b=Te+=ft,ae.p=fe=8*ut;continue}if(rt==1)Fe=L,Ie=P,qe=9,Re=5;else if(rt==2){var ze=z(q,fe,31)+257,$e=z(q,fe+10,15)+4,He=ze+z(q,fe+5,31)+1;fe+=14;for(var it=new e(He),st=new e(19),Nt=0;Nt<$e;++Nt)st[l[Nt]]=z(q,fe+3*Nt,7);fe+=3*$e;var kt=D(st),vt=(1<>>4)<16)it[Nt++]=At;else{var xe=0,ie=0;for(At==16?(ie=3+z(q,fe,3),fe+=2,xe=it[Nt-1]):At==17?(ie=3+z(q,fe,7),fe+=3):At==18&&(ie=11+z(q,fe,127),fe+=7);ie--;)it[Nt++]=xe}}var Pe=it.subarray(0,ze),Ye=it.subarray(ze);qe=D(Pe),Re=D(Ye),Fe=M(Pe,qe,1),Ie=M(Ye,Re,1)}else H(1);if(fe>Ze){we&&H(0);break}}ge&&re(Te+131072);for(var St=(1<>>4;if((fe+=15&xe)>Ze){we&&H(0);break}if(xe||H(2),Ke<256)he[Te++]=Ke;else{if(Ke==256){mt=fe,Fe=null;break}var Oe=Ke-254;if(Ke>264){var Q=s[Nt=Ke-257];Oe=z(q,fe,(1<>>4;if(te||H(3),fe+=15&te,Ye=y[pe],pe>3&&(Q=o[pe],Ye+=U(q,fe)&(1<Ze){we&&H(0);break}ge&&re(Te+131072);for(var Ae=Te+Oe;TeJe.length)&&(Ge=Je.length);var qt=new(Je instanceof t?t:Je instanceof r?r:e)(Ge-jt);return qt.set(Je.subarray(jt,Ge)),qt}(he,0,Te)},le=new e(0),Z=typeof TextDecoder<"u"&&new TextDecoder;try{Z.decode(le,{stream:!0})}catch{}return n.convert_streams=function(q){var he=new DataView(q),ae=0;function ue(){var ze=he.getUint16(ae);return ae+=2,ze}function ge(){var ze=he.getUint32(ae);return ae+=4,ze}function we(ze){ft.setUint16(ut,ze),ut+=2}function J(ze){ft.setUint32(ut,ze),ut+=4}for(var re={signature:ge(),flavor:ge(),length:ge(),numTables:ue(),reserved:ue(),totalSfntSize:ge(),majorVersion:ue(),minorVersion:ue(),metaOffset:ge(),metaLength:ge(),metaOrigLength:ge(),privOffset:ge(),privLength:ge()},se=0;Math.pow(2,se)<=re.numTables;)se++;se--;for(var fe=16*Math.pow(2,se),Te=16*re.numTables-fe,Fe=12,Ie=[],qe=0;qe{let[le,Z]=oe.split("+");le=parseInt(le,36),Z=Z?parseInt(Z,36):0,g.set(H+=le,U[V]);for(let q=Z;q--;)g.set(++H,U[V])})}}return g.get(z)||f}const b=1,w=2,C=3,M=4,A=[null,"isol","init","fina","medi"];function k(z){const U=new Uint8Array(z.length);let V=f,H=b,oe=-1;for(let le=0;le65535&&le++)}return U}function L(z,U){const V=[];for(let oe=0;oe65535&&oe++,V.push(n.U.codeToGlyph(z,le))}const H=z.GSUB;if(H){const{lookupList:oe,featureList:le}=H;let Z;const q=/^(rlig|liga|mset|isol|init|fina|medi|half|pres|blws)$/,he=[];le.forEach(ae=>{if(q.test(ae.tag))for(let ue=0;ue{if(fe!==-1){let Fe=U[fe];if(!Fe){const{cmds:Ie,crds:qe}=n.U.glyphToPath(z,fe);let Re="",Ze=0;for(let $e=0,He=Ie.length;$e1?",":"")+qe[Ze++]}let rt,ft,ut,ze;if(qe.length){rt=ft=1/0,ut=ze=-1/0;for(let $e=0,He=qe.length;$eut&&(ut=it),st>ze&&(ze=st)}}else rt=ut=ft=ze=0;Fe=U[fe]={index:fe,advanceWidth:z.hmtx.aWidth[fe],xMin:rt,yMin:ft,xMax:ut,yMax:ze,path:Re,pathCommandCount:Ie.length}}se!==-1&&(ge+=n.U.getPairAdjustment(z,se,fe)*we),ue.call(null,Fe,ge,re),Fe.advanceWidth&&(ge+=Fe.advanceWidth*we),ae&&(ge+=ae*he),se=fe}re+=q.codePointAt(re)>65535?2:1}),ge}};return Z}return function(z){const U=new Uint8Array(z,0,4),V=n._bin.readASCII(U,0,4);if(V==="wOFF")z=e(z);else if(V==="wOF2")throw new Error("woff2 fonts not supported");return D(n.parse(z)[0])}}const sIe=zC({name:"Typr Font Parser",dependencies:[nIe,rIe,iIe],init(n,e,t){const r=n(),s=e();return t(r,s)}}),nw={defaultFontURL:"https://fonts.gstatic.com/s/roboto/v18/KFOmCnqEu92Fr1Mu4mxM.woff",sdfGlyphSize:64,sdfMargin:1/16,sdfExponent:9,textureWidth:2048},oIe=new Fn;function OS(){return(self.performance||Date).now()}const kW=Object.create(null);function eee(n,e){n=uIe({},n);const t=OS();if(n.font=cIe(n.font||nw.defaultFontURL),n.text=""+n.text,n.sdfGlyphSize=n.sdfGlyphSize||nw.sdfGlyphSize,n.colorRanges!=null){let y={};for(let b in n.colorRanges)if(n.colorRanges.hasOwnProperty(b)){let w=n.colorRanges[b];typeof w!="number"&&(w=oIe.set(w).getHex()),y[b]=w}n.colorRanges=y}Object.freeze(n);const{textureWidth:r,sdfExponent:s}=nw,{sdfGlyphSize:o}=n,l=r/o*4;let u=kW[o];if(!u){const y=document.createElement("canvas");y.width=r,y.height=o*256/l,u=kW[o]={glyphCount:0,sdfGlyphSize:o,sdfCanvas:y,sdfTexture:new dc(y,void 0,void 0,void 0,wl,wl),contextLost:!1,glyphsByFont:new Map},u.sdfTexture.generateMipmaps=!1,aIe(u)}const{sdfTexture:h,sdfCanvas:f}=u;let g=u.glyphsByFont.get(n.font);g||u.glyphsByFont.set(n.font,g=new Map),dIe(n).then(y=>{const{glyphIds:b,glyphPositions:w,fontSize:C,unitsPerEm:M,timings:A}=y,k=[],L=new Float32Array(b.length*4),P=C/M;let D=0,z=0;const U=OS();b.forEach((Z,q)=>{let he=g.get(Z);if(!he){const{path:we,pathBounds:J}=y.glyphData[Z],re=Math.max(J[2]-J[0],J[3]-J[1])/o*(nw.sdfMargin*o+.5),se=u.glyphCount++,fe=[J[0]-re,J[1]-re,J[2]+re,J[3]+re];g.set(Z,he={path:we,atlasIndex:se,sdfViewBox:fe}),k.push(he)}const{sdfViewBox:ae}=he,ue=w[z++],ge=w[z++];L[D++]=ue+ae[0]*P,L[D++]=ge+ae[1]*P,L[D++]=ue+ae[2]*P,L[D++]=ge+ae[3]*P,b[q]=he.atlasIndex}),A.quads=(A.quads||0)+(OS()-U);const V=OS();A.sdf={};const H=f.height,oe=Math.ceil(u.glyphCount/l),le=Math.pow(2,Math.ceil(Math.log2(oe*o)));le>H&&(console.info(`Increasing SDF texture size ${H}->${le}`),tIe(f,r,le),h.dispose()),Promise.all(k.map(Z=>tee(Z,u,n.gpuAccelerateSDF).then(({timing:q})=>{A.sdf[Z.atlasIndex]=q}))).then(()=>{k.length&&!u.contextLost&&(nee(u),h.needsUpdate=!0),A.sdfTotal=OS()-V,A.total=OS()-t,e(Object.freeze({parameters:n,sdfTexture:h,sdfGlyphSize:o,sdfExponent:s,glyphBounds:L,glyphAtlasIndices:b,glyphColors:y.glyphColors,caretPositions:y.caretPositions,caretHeight:y.caretHeight,chunkedBounds:y.chunkedBounds,ascender:y.ascender,descender:y.descender,lineHeight:y.lineHeight,capHeight:y.capHeight,xHeight:y.xHeight,topBaseline:y.topBaseline,blockBounds:y.blockBounds,visibleBounds:y.visibleBounds,timings:y.timings}))})}),Promise.resolve().then(()=>{u.contextLost||eIe(f)})}function tee({path:n,atlasIndex:e,sdfViewBox:t},{sdfGlyphSize:r,sdfCanvas:s,contextLost:o},l){if(o)return Promise.resolve({timing:-1});const{textureWidth:u,sdfExponent:h}=nw,f=Math.max(t[2]-t[0],t[3]-t[1]),g=Math.floor(e/4),y=g%(u/r)*r,b=Math.floor(g/(u/r))*r,w=e%4;return XAe(r,r,n,t,f,h,s,y,b,w,l)}function aIe(n){const e=n.sdfCanvas;e.addEventListener("webglcontextlost",t=>{console.log("Context Lost",t),t.preventDefault(),n.contextLost=!0}),e.addEventListener("webglcontextrestored",t=>{console.log("Context Restored",t),n.contextLost=!1;const r=[];n.glyphsByFont.forEach(s=>{s.forEach(o=>{r.push(tee(o,n,!0))})}),Promise.all(r).then(()=>{nee(n),n.sdfTexture.needsUpdate=!0})})}function lIe({font:n,characters:e,sdfGlyphSize:t},r){let s=Array.isArray(e)?e.join(` +`):""+e;eee({font:n,sdfGlyphSize:t,text:s},r)}function uIe(n,e){for(let t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);return n}let PA;function cIe(n){return PA||(PA=typeof document>"u"?{}:document.createElement("a")),PA.href=n,PA.href}function nee(n){if(typeof createImageBitmap!="function"){console.info("Safari<15: applying SDF canvas workaround");const{sdfCanvas:e,sdfTexture:t}=n,{width:r,height:s}=e,o=n.sdfCanvas.getContext("webgl");let l=t.image.data;(!l||l.length!==r*s*4)&&(l=new Uint8Array(r*s*4),t.image={width:r,height:s,data:l},t.flipY=!1,t.isDataTexture=!0),o.readPixels(0,0,r,s,o.RGBA,o.UNSIGNED_BYTE,l)}}const hIe=zC({name:"Typesetter",dependencies:[nw,sIe,YAe,FAe],init(n,e,t,r){const{defaultFontURL:s}=n;return t(e,r(),{defaultFontURL:s})}}),dIe=zC({name:"Typesetter",dependencies:[hIe],init(n){return function(e){return new Promise(t=>{n.typeset(e,t)})}},getTransferables(n){const e=[n.glyphPositions.buffer,n.glyphIds.buffer];return n.caretPositions&&e.push(n.caretPositions.buffer),n.glyphColors&&e.push(n.glyphColors.buffer),e}}),OW={};function fIe(n){let e=OW[n];if(!e){const t=new c0(1,1,n,n),r=t.clone(),s=t.attributes,o=r.attributes,l=new ui,u=s.uv.count;for(let h=0;h{l.setAttribute(h,new ar([...s[h].array,...o[h].array],s[h].itemSize))}),l.setIndex([...t.index.array,...r.index.array.map(h=>h+u)]),l.translate(.5,.5,0),e=OW[n]=l}return e}const pIe="aTroikaGlyphBounds",LW="aTroikaGlyphIndex",mIe="aTroikaGlyphColor";class gIe extends y2{constructor(){super(),this.detail=1,this.curveRadius=0,this.groups=[{start:0,count:1/0,materialIndex:0},{start:0,count:1/0,materialIndex:1}],this.boundingSphere=new b_,this.boundingBox=new d0}computeBoundingSphere(){}computeBoundingBox(){}setSide(e){const t=this.getIndex().count;this.setDrawRange(e===cd?t/2:0,e===lp?t:t/2)}set detail(e){if(e!==this._detail){this._detail=e,(typeof e!="number"||e<1)&&(e=1);let t=fIe(e);["position","normal","uv"].forEach(r=>{this.attributes[r]=t.attributes[r].clone()}),this.setIndex(t.getIndex().clone())}}get detail(){return this._detail}set curveRadius(e){e!==this._curveRadius&&(this._curveRadius=e,this._updateBounds())}get curveRadius(){return this._curveRadius}updateGlyphs(e,t,r,s,o){aN(this,pIe,e,4),aN(this,LW,t,1),aN(this,mIe,o,3),this._blockBounds=r,this._chunkedBounds=s,this.instanceCount=t.length,this._updateBounds()}_updateBounds(){const e=this._blockBounds;if(e){const{curveRadius:t,boundingBox:r}=this;if(t){const{PI:s,floor:o,min:l,max:u,sin:h,cos:f}=Math,g=s/2,y=s*2,b=Math.abs(t),w=e[0]/b,C=e[2]/b,M=o((w+g)/y)!==o((C+g)/y)?-b:l(h(w)*b,h(C)*b),A=o((w-g)/y)!==o((C-g)/y)?b:u(h(w)*b,h(C)*b),k=o((w+s)/y)!==o((C+s)/y)?b*2:u(b-f(w)*b,b-f(C)*b);r.min.set(M,e[1],t<0?-k:0),r.max.set(A,e[3],t<0?0:k)}else r.min.set(e[0],e[1],0),r.max.set(e[2],e[3],0);r.getBoundingSphere(this.boundingSphere)}}applyClipRect(e){let t=this.getAttribute(LW).count,r=this._chunkedBounds;if(r)for(let s=r.length;s--;){t=r[s].end;let o=r[s].rect;if(o[1]e.y&&o[0]e.x)break}this.instanceCount=t}}function aN(n,e,t,r){const s=n.getAttribute(e);t?s&&s.array.length===t.length?(s.array.set(t),s.needsUpdate=!0):(n.setAttribute(e,new eT(t,r)),delete n._maxInstanceCount,n.dispose()):s&&n.deleteAttribute(e)}const _Ie=` uniform vec2 uTroikaSDFTextureSize; uniform float uTroikaSDFGlyphSize; uniform vec4 uTroikaTotalBounds; @@ -5577,10 +5577,10 @@ gl_FragColor.a *= edgeAlpha; if (edgeAlpha == 0.0) { discard; } -`;function TIe(n){const e=WP(n,{chained:!0,extensions:{derivatives:!0},uniforms:{uTroikaSDFTexture:{value:null},uTroikaSDFTextureSize:{value:new jt},uTroikaSDFGlyphSize:{value:0},uTroikaSDFExponent:{value:0},uTroikaTotalBounds:{value:new Ts(0,0,0,0)},uTroikaClipRect:{value:new Ts(0,0,0,0)},uTroikaDistanceOffset:{value:0},uTroikaOutlineOpacity:{value:0},uTroikaFillOpacity:{value:1},uTroikaPositionOffset:{value:new jt},uTroikaCurveRadius:{value:0},uTroikaBlurRadius:{value:0},uTroikaStrokeWidth:{value:0},uTroikaStrokeColor:{value:new Fn},uTroikaStrokeOpacity:{value:1},uTroikaOrient:{value:new up},uTroikaUseGlyphColors:{value:!0},uTroikaSDFDebug:{value:!1}},vertexDefs:_Ie,vertexTransform:vIe,fragmentDefs:yIe,fragmentColorTransform:bIe,customRewriter({vertexShader:t,fragmentShader:r}){let s=/\buniform\s+vec3\s+diffuse\b/;return s.test(r)&&(r=r.replace(s,"varying vec3 vTroikaGlyphColor").replace(/\bdiffuse\b/g,"vTroikaGlyphColor"),s.test(t)||(t=t.replace(qZ,`uniform vec3 diffuse; +`;function TIe(n){const e=WP(n,{chained:!0,extensions:{derivatives:!0},uniforms:{uTroikaSDFTexture:{value:null},uTroikaSDFTextureSize:{value:new Vt},uTroikaSDFGlyphSize:{value:0},uTroikaSDFExponent:{value:0},uTroikaTotalBounds:{value:new Ts(0,0,0,0)},uTroikaClipRect:{value:new Ts(0,0,0,0)},uTroikaDistanceOffset:{value:0},uTroikaOutlineOpacity:{value:0},uTroikaFillOpacity:{value:1},uTroikaPositionOffset:{value:new Vt},uTroikaCurveRadius:{value:0},uTroikaBlurRadius:{value:0},uTroikaStrokeWidth:{value:0},uTroikaStrokeColor:{value:new Fn},uTroikaStrokeOpacity:{value:1},uTroikaOrient:{value:new up},uTroikaUseGlyphColors:{value:!0},uTroikaSDFDebug:{value:!1}},vertexDefs:_Ie,vertexTransform:vIe,fragmentDefs:yIe,fragmentColorTransform:bIe,customRewriter({vertexShader:t,fragmentShader:r}){let s=/\buniform\s+vec3\s+diffuse\b/;return s.test(r)&&(r=r.replace(s,"varying vec3 vTroikaGlyphColor").replace(/\bdiffuse\b/g,"vTroikaGlyphColor"),s.test(t)||(t=t.replace(QZ,`uniform vec3 diffuse; $& vTroikaGlyphColor = uTroikaUseGlyphColors ? aTroikaGlyphColor / 255.0 : diffuse; -`))),{vertexShader:t,fragmentShader:r}}});return e.transparent=!0,Object.defineProperties(e,{isTroikaTextMaterial:{value:!0},shadowSide:{get(){return this.side},set(){}}}),e}const R4=new f0({color:16777215,side:lp,transparent:!0}),LW=8421504,NW=new Qr,BA=new Ae,lN=new Ae,yx=[],SIe=new Ae,uN="+x+y";function DW(n){return Array.isArray(n)?n[0]:n}let nee=()=>{const n=new Hn(new c0(1,1),R4);return nee=()=>n,n},ree=()=>{const n=new Hn(new c0(1,1,32,1),R4);return ree=()=>n,n};const wIe={type:"syncstart"},EIe={type:"synccomplete"},iee=["font","fontSize","letterSpacing","lineHeight","maxWidth","overflowWrap","text","direction","textAlign","textIndent","whiteSpace","anchorX","anchorY","colorRanges","sdfGlyphSize"],xIe=iee.concat("material","color","depthOffset","clipRect","curveRadius","orientation","glyphGeometryDetail");class see extends Hn{constructor(){const e=new gIe;super(e,null),this.text="",this.anchorX=0,this.anchorY=0,this.curveRadius=0,this.direction="auto",this.font=null,this.fontSize=.1,this.letterSpacing=0,this.lineHeight="normal",this.maxWidth=1/0,this.overflowWrap="normal",this.textAlign="left",this.textIndent=0,this.whiteSpace="normal",this.material=null,this.color=null,this.colorRanges=null,this.outlineWidth=0,this.outlineColor=0,this.outlineOpacity=1,this.outlineBlur=0,this.outlineOffsetX=0,this.outlineOffsetY=0,this.strokeWidth=0,this.strokeColor=LW,this.strokeOpacity=1,this.fillOpacity=1,this.depthOffset=0,this.clipRect=null,this.orientation=uN,this.glyphGeometryDetail=1,this.sdfGlyphSize=null,this.gpuAccelerateSDF=!0,this.debugSDF=!1}sync(e){this._needsSync&&(this._needsSync=!1,this._isSyncing?(this._queuedSyncs||(this._queuedSyncs=[])).push(e):(this._isSyncing=!0,this.dispatchEvent(wIe),ZZ({text:this.text,font:this.font,fontSize:this.fontSize||.1,letterSpacing:this.letterSpacing||0,lineHeight:this.lineHeight||"normal",maxWidth:this.maxWidth,direction:this.direction||"auto",textAlign:this.textAlign,textIndent:this.textIndent,whiteSpace:this.whiteSpace,overflowWrap:this.overflowWrap,anchorX:this.anchorX,anchorY:this.anchorY,colorRanges:this.colorRanges,includeCaretPositions:!0,sdfGlyphSize:this.sdfGlyphSize,gpuAccelerateSDF:this.gpuAccelerateSDF},t=>{this._isSyncing=!1,this._textRenderInfo=t,this.geometry.updateGlyphs(t.glyphBounds,t.glyphAtlasIndices,t.blockBounds,t.chunkedBounds,t.glyphColors);const r=this._queuedSyncs;r&&(this._queuedSyncs=null,this._needsSync=!0,this.sync(()=>{r.forEach(s=>s&&s())})),this.dispatchEvent(EIe),e&&e()})))}onBeforeRender(e,t,r,s,o,l){this.sync(),o.isTroikaTextMaterial&&this._prepareForRender(o),o._hadOwnSide=o.hasOwnProperty("side"),this.geometry.setSide(o._actualSide=o.side),o.side=p_}onAfterRender(e,t,r,s,o,l){o._hadOwnSide?o.side=o._actualSide:delete o.side}dispose(){this.geometry.dispose()}get textRenderInfo(){return this._textRenderInfo||null}get material(){let e=this._derivedMaterial;const t=this._baseMaterial||this._defaultMaterial||(this._defaultMaterial=R4.clone());if((!e||e.baseMaterial!==t)&&(e=this._derivedMaterial=TIe(t),t.addEventListener("dispose",function r(){t.removeEventListener("dispose",r),e.dispose()})),this.outlineWidth||this.outlineBlur||this.outlineOffsetX||this.outlineOffsetY){let r=e._outlineMtl;return r||(r=e._outlineMtl=Object.create(e,{id:{value:e.id+.1}}),r.isTextOutlineMaterial=!0,r.depthWrite=!1,r.map=null,e.addEventListener("dispose",function s(){e.removeEventListener("dispose",s),r.dispose()})),[r,e]}else return e}set material(e){e&&e.isTroikaTextMaterial?(this._derivedMaterial=e,this._baseMaterial=e.baseMaterial):this._baseMaterial=e}get glyphGeometryDetail(){return this.geometry.detail}set glyphGeometryDetail(e){this.geometry.detail=e}get curveRadius(){return this.geometry.curveRadius}set curveRadius(e){this.geometry.curveRadius=e}get customDepthMaterial(){return DW(this.material).getDepthMaterial()}get customDistanceMaterial(){return DW(this.material).getDistanceMaterial()}_prepareForRender(e){const t=e.isTextOutlineMaterial,r=e.uniforms,s=this.textRenderInfo;if(s){const{sdfTexture:u,blockBounds:h}=s;r.uTroikaSDFTexture.value=u,r.uTroikaSDFTextureSize.value.set(u.image.width,u.image.height),r.uTroikaSDFGlyphSize.value=s.sdfGlyphSize,r.uTroikaSDFExponent.value=s.sdfExponent,r.uTroikaTotalBounds.value.fromArray(h),r.uTroikaUseGlyphColors.value=!t&&!!s.glyphColors;let f=0,g=0,y=0,b,w,C,M=0,A=0;if(t){let{outlineWidth:L,outlineOffsetX:P,outlineOffsetY:D,outlineBlur:z,outlineOpacity:U}=this;f=this._parsePercent(L)||0,g=Math.max(0,this._parsePercent(z)||0),b=U,M=this._parsePercent(P)||0,A=this._parsePercent(D)||0}else y=Math.max(0,this._parsePercent(this.strokeWidth)||0),y&&(C=this.strokeColor,r.uTroikaStrokeColor.value.set(C??LW),w=this.strokeOpacity,w==null&&(w=1)),b=this.fillOpacity;r.uTroikaDistanceOffset.value=f,r.uTroikaPositionOffset.value.set(M,A),r.uTroikaBlurRadius.value=g,r.uTroikaStrokeWidth.value=y,r.uTroikaStrokeOpacity.value=w,r.uTroikaFillOpacity.value=b??1,r.uTroikaCurveRadius.value=this.curveRadius||0;let k=this.clipRect;if(k&&Array.isArray(k)&&k.length===4)r.uTroikaClipRect.value.fromArray(k);else{const L=(this.fontSize||.1)*100;r.uTroikaClipRect.value.set(h[0]-L,h[1]-L,h[2]+L,h[3]+L)}this.geometry.applyClipRect(r.uTroikaClipRect.value)}r.uTroikaSDFDebug.value=!!this.debugSDF,e.polygonOffset=!!this.depthOffset,e.polygonOffsetFactor=e.polygonOffsetUnits=this.depthOffset||0;const o=t?this.outlineColor||0:this.color;if(o==null)delete e.color;else{const u=e.hasOwnProperty("color")?e.color:e.color=new Fn;(o!==u._input||typeof o=="object")&&u.set(u._input=o)}let l=this.orientation||uN;if(l!==e._orientation){let u=r.uTroikaOrient.value;l=l.replace(/[^-+xyz]/g,"");let h=l!==uN&&l.match(/^([-+])([xyz])([-+])([xyz])$/);if(h){let[,f,g,y,b]=h;BA.set(0,0,0)[g]=f==="-"?1:-1,lN.set(0,0,0)[b]=y==="-"?-1:1,NW.lookAt(SIe,BA.cross(lN),lN),u.setFromMatrix4(NW)}else u.identity();e._orientation=l}}_parsePercent(e){if(typeof e=="string"){let t=e.match(/^(-?[\d.]+)%$/),r=t?parseFloat(t[1]):NaN;e=(isNaN(r)?0:r/100)*this.fontSize}return e}localPositionToTextCoords(e,t=new jt){t.copy(e);const r=this.curveRadius;return r&&(t.x=Math.atan2(e.x,Math.abs(r)-Math.abs(e.z))*Math.abs(r)),t}worldPositionToTextCoords(e,t=new jt){return BA.copy(e),this.localPositionToTextCoords(this.worldToLocal(BA),t)}raycast(e,t){const{textRenderInfo:r,curveRadius:s}=this;if(r){const o=r.blockBounds,l=s?ree():nee(),u=l.geometry,{position:h,uv:f}=u.attributes;for(let g=0;g{this[r]=e[r]}),this}clone(){return new this.constructor().copy(this)}}iee.forEach(n=>{const e="_private_"+n;Object.defineProperty(see.prototype,n,{get(){return this[e]},set(t){t!==this[e]&&(this[e]=t,this._needsSync=!0)}})});const $Ie=pe.forwardRef(({anchorX:n="center",anchorY:e="middle",font:t,fontSize:r=1,children:s,characters:o,onSync:l,...u},h)=>{const f=nf(({invalidate:w})=>w),[g]=pe.useState(()=>new see),[y,b]=pe.useMemo(()=>{const w=[];let C="";return pe.Children.forEach(s,M=>{typeof M=="string"||typeof M=="number"?C+=M:w.push(M)}),[w,C]},[s]);return MMe(()=>new Promise(w=>lIe({font:t,characters:o},w)),["troika-text",t,o]),pe.useLayoutEffect(()=>void g.sync(()=>{f(),l&&l(g)})),pe.useEffect(()=>()=>g.dispose(),[g]),un("primitive",{object:g,ref:h,font:t,text:b,anchorX:n,anchorY:e,fontSize:r,...u,children:y})});var CIe=1/0,MIe=9007199254740991,AIe="[object Arguments]",IIe="[object Function]",RIe="[object GeneratorFunction]",kIe="[object Symbol]",OIe=typeof uv=="object"&&uv&&uv.Object===Object&&uv,LIe=typeof self=="object"&&self&&self.Object===Object&&self,NIe=OIe||LIe||Function("return this")();function DIe(n,e,t){switch(t.length){case 0:return n.call(e);case 1:return n.call(e,t[0]);case 2:return n.call(e,t[0],t[1]);case 3:return n.call(e,t[0],t[1],t[2])}return n.apply(e,t)}function PIe(n,e){for(var t=-1,r=n?n.length:0,s=Array(r);++t0&&t(u)?e>1?oee(u,e-1,t,r,s):BIe(s,u):r||(s[s.length]=u)}return s}function UIe(n,e){return n=Object(n),HIe(n,e,function(t,r){return r in n})}function HIe(n,e,t){for(var r=-1,s=e.length,o={};++r-1&&n%1==0&&n<=MIe}function QIe(n){var e=typeof n;return!!n&&(e=="object"||e=="function")}function aee(n){return!!n&&typeof n=="object"}function ZIe(n){return typeof n=="symbol"||aee(n)&&O4.call(n)==kIe}var eRe=GIe(function(n,e){return n==null?{}:UIe(n,PIe(oee(e,1),VIe))}),cN=eRe;const tRe=pe.forwardRef(({makeDefault:n,camera:e,regress:t,domElement:r,enableDamping:s=!0,onChange:o,onStart:l,onEnd:u,...h},f)=>{const g=nf(z=>z.invalidate),y=nf(z=>z.camera),b=nf(z=>z.gl),w=nf(z=>z.events),C=nf(z=>z.setEvents),M=nf(z=>z.set),A=nf(z=>z.get),k=nf(z=>z.performance),L=e||y,P=r||w.connected||b.domElement,D=pe.useMemo(()=>new $Ae(L),[L]);return Xm(()=>{D.enabled&&D.update()},-1),pe.useEffect(()=>(D.connect(P),()=>void D.dispose()),[P,t,D,g]),pe.useEffect(()=>{const z=H=>{g(),t&&k.regress(),o&&o(H)},U=H=>{l&&l(H)},V=H=>{u&&u(H)};return D.addEventListener("change",z),D.addEventListener("start",U),D.addEventListener("end",V),()=>{D.removeEventListener("start",U),D.removeEventListener("end",V),D.removeEventListener("change",z)}},[o,l,u,D,g,C]),pe.useEffect(()=>{if(n){const z=A().controls;return M({controls:D}),()=>M({controls:z})}},[n,D]),un("primitive",{ref:f,object:D,enableDamping:s,...h})});class nRe extends f2{constructor(e){super(e),this.onBeforeCompile=(t,r)=>{const{isWebGL2:s}=r.capabilities;t.fragmentShader=t.fragmentShader.replace("#include ",` +`))),{vertexShader:t,fragmentShader:r}}});return e.transparent=!0,Object.defineProperties(e,{isTroikaTextMaterial:{value:!0},shadowSide:{get(){return this.side},set(){}}}),e}const R4=new f0({color:16777215,side:lp,transparent:!0}),NW=8421504,DW=new Qr,BA=new Me,lN=new Me,yx=[],SIe=new Me,uN="+x+y";function PW(n){return Array.isArray(n)?n[0]:n}let ree=()=>{const n=new Hn(new c0(1,1),R4);return ree=()=>n,n},iee=()=>{const n=new Hn(new c0(1,1,32,1),R4);return iee=()=>n,n};const wIe={type:"syncstart"},EIe={type:"synccomplete"},see=["font","fontSize","letterSpacing","lineHeight","maxWidth","overflowWrap","text","direction","textAlign","textIndent","whiteSpace","anchorX","anchorY","colorRanges","sdfGlyphSize"],xIe=see.concat("material","color","depthOffset","clipRect","curveRadius","orientation","glyphGeometryDetail");class oee extends Hn{constructor(){const e=new gIe;super(e,null),this.text="",this.anchorX=0,this.anchorY=0,this.curveRadius=0,this.direction="auto",this.font=null,this.fontSize=.1,this.letterSpacing=0,this.lineHeight="normal",this.maxWidth=1/0,this.overflowWrap="normal",this.textAlign="left",this.textIndent=0,this.whiteSpace="normal",this.material=null,this.color=null,this.colorRanges=null,this.outlineWidth=0,this.outlineColor=0,this.outlineOpacity=1,this.outlineBlur=0,this.outlineOffsetX=0,this.outlineOffsetY=0,this.strokeWidth=0,this.strokeColor=NW,this.strokeOpacity=1,this.fillOpacity=1,this.depthOffset=0,this.clipRect=null,this.orientation=uN,this.glyphGeometryDetail=1,this.sdfGlyphSize=null,this.gpuAccelerateSDF=!0,this.debugSDF=!1}sync(e){this._needsSync&&(this._needsSync=!1,this._isSyncing?(this._queuedSyncs||(this._queuedSyncs=[])).push(e):(this._isSyncing=!0,this.dispatchEvent(wIe),eee({text:this.text,font:this.font,fontSize:this.fontSize||.1,letterSpacing:this.letterSpacing||0,lineHeight:this.lineHeight||"normal",maxWidth:this.maxWidth,direction:this.direction||"auto",textAlign:this.textAlign,textIndent:this.textIndent,whiteSpace:this.whiteSpace,overflowWrap:this.overflowWrap,anchorX:this.anchorX,anchorY:this.anchorY,colorRanges:this.colorRanges,includeCaretPositions:!0,sdfGlyphSize:this.sdfGlyphSize,gpuAccelerateSDF:this.gpuAccelerateSDF},t=>{this._isSyncing=!1,this._textRenderInfo=t,this.geometry.updateGlyphs(t.glyphBounds,t.glyphAtlasIndices,t.blockBounds,t.chunkedBounds,t.glyphColors);const r=this._queuedSyncs;r&&(this._queuedSyncs=null,this._needsSync=!0,this.sync(()=>{r.forEach(s=>s&&s())})),this.dispatchEvent(EIe),e&&e()})))}onBeforeRender(e,t,r,s,o,l){this.sync(),o.isTroikaTextMaterial&&this._prepareForRender(o),o._hadOwnSide=o.hasOwnProperty("side"),this.geometry.setSide(o._actualSide=o.side),o.side=p_}onAfterRender(e,t,r,s,o,l){o._hadOwnSide?o.side=o._actualSide:delete o.side}dispose(){this.geometry.dispose()}get textRenderInfo(){return this._textRenderInfo||null}get material(){let e=this._derivedMaterial;const t=this._baseMaterial||this._defaultMaterial||(this._defaultMaterial=R4.clone());if((!e||e.baseMaterial!==t)&&(e=this._derivedMaterial=TIe(t),t.addEventListener("dispose",function r(){t.removeEventListener("dispose",r),e.dispose()})),this.outlineWidth||this.outlineBlur||this.outlineOffsetX||this.outlineOffsetY){let r=e._outlineMtl;return r||(r=e._outlineMtl=Object.create(e,{id:{value:e.id+.1}}),r.isTextOutlineMaterial=!0,r.depthWrite=!1,r.map=null,e.addEventListener("dispose",function s(){e.removeEventListener("dispose",s),r.dispose()})),[r,e]}else return e}set material(e){e&&e.isTroikaTextMaterial?(this._derivedMaterial=e,this._baseMaterial=e.baseMaterial):this._baseMaterial=e}get glyphGeometryDetail(){return this.geometry.detail}set glyphGeometryDetail(e){this.geometry.detail=e}get curveRadius(){return this.geometry.curveRadius}set curveRadius(e){this.geometry.curveRadius=e}get customDepthMaterial(){return PW(this.material).getDepthMaterial()}get customDistanceMaterial(){return PW(this.material).getDistanceMaterial()}_prepareForRender(e){const t=e.isTextOutlineMaterial,r=e.uniforms,s=this.textRenderInfo;if(s){const{sdfTexture:u,blockBounds:h}=s;r.uTroikaSDFTexture.value=u,r.uTroikaSDFTextureSize.value.set(u.image.width,u.image.height),r.uTroikaSDFGlyphSize.value=s.sdfGlyphSize,r.uTroikaSDFExponent.value=s.sdfExponent,r.uTroikaTotalBounds.value.fromArray(h),r.uTroikaUseGlyphColors.value=!t&&!!s.glyphColors;let f=0,g=0,y=0,b,w,C,M=0,A=0;if(t){let{outlineWidth:L,outlineOffsetX:P,outlineOffsetY:D,outlineBlur:z,outlineOpacity:U}=this;f=this._parsePercent(L)||0,g=Math.max(0,this._parsePercent(z)||0),b=U,M=this._parsePercent(P)||0,A=this._parsePercent(D)||0}else y=Math.max(0,this._parsePercent(this.strokeWidth)||0),y&&(C=this.strokeColor,r.uTroikaStrokeColor.value.set(C??NW),w=this.strokeOpacity,w==null&&(w=1)),b=this.fillOpacity;r.uTroikaDistanceOffset.value=f,r.uTroikaPositionOffset.value.set(M,A),r.uTroikaBlurRadius.value=g,r.uTroikaStrokeWidth.value=y,r.uTroikaStrokeOpacity.value=w,r.uTroikaFillOpacity.value=b??1,r.uTroikaCurveRadius.value=this.curveRadius||0;let k=this.clipRect;if(k&&Array.isArray(k)&&k.length===4)r.uTroikaClipRect.value.fromArray(k);else{const L=(this.fontSize||.1)*100;r.uTroikaClipRect.value.set(h[0]-L,h[1]-L,h[2]+L,h[3]+L)}this.geometry.applyClipRect(r.uTroikaClipRect.value)}r.uTroikaSDFDebug.value=!!this.debugSDF,e.polygonOffset=!!this.depthOffset,e.polygonOffsetFactor=e.polygonOffsetUnits=this.depthOffset||0;const o=t?this.outlineColor||0:this.color;if(o==null)delete e.color;else{const u=e.hasOwnProperty("color")?e.color:e.color=new Fn;(o!==u._input||typeof o=="object")&&u.set(u._input=o)}let l=this.orientation||uN;if(l!==e._orientation){let u=r.uTroikaOrient.value;l=l.replace(/[^-+xyz]/g,"");let h=l!==uN&&l.match(/^([-+])([xyz])([-+])([xyz])$/);if(h){let[,f,g,y,b]=h;BA.set(0,0,0)[g]=f==="-"?1:-1,lN.set(0,0,0)[b]=y==="-"?-1:1,DW.lookAt(SIe,BA.cross(lN),lN),u.setFromMatrix4(DW)}else u.identity();e._orientation=l}}_parsePercent(e){if(typeof e=="string"){let t=e.match(/^(-?[\d.]+)%$/),r=t?parseFloat(t[1]):NaN;e=(isNaN(r)?0:r/100)*this.fontSize}return e}localPositionToTextCoords(e,t=new Vt){t.copy(e);const r=this.curveRadius;return r&&(t.x=Math.atan2(e.x,Math.abs(r)-Math.abs(e.z))*Math.abs(r)),t}worldPositionToTextCoords(e,t=new Vt){return BA.copy(e),this.localPositionToTextCoords(this.worldToLocal(BA),t)}raycast(e,t){const{textRenderInfo:r,curveRadius:s}=this;if(r){const o=r.blockBounds,l=s?iee():ree(),u=l.geometry,{position:h,uv:f}=u.attributes;for(let g=0;g{this[r]=e[r]}),this}clone(){return new this.constructor().copy(this)}}see.forEach(n=>{const e="_private_"+n;Object.defineProperty(oee.prototype,n,{get(){return this[e]},set(t){t!==this[e]&&(this[e]=t,this._needsSync=!0)}})});const $Ie=me.forwardRef(({anchorX:n="center",anchorY:e="middle",font:t,fontSize:r=1,children:s,characters:o,onSync:l,...u},h)=>{const f=nf(({invalidate:w})=>w),[g]=me.useState(()=>new oee),[y,b]=me.useMemo(()=>{const w=[];let C="";return me.Children.forEach(s,M=>{typeof M=="string"||typeof M=="number"?C+=M:w.push(M)}),[w,C]},[s]);return MMe(()=>new Promise(w=>lIe({font:t,characters:o},w)),["troika-text",t,o]),me.useLayoutEffect(()=>void g.sync(()=>{f(),l&&l(g)})),me.useEffect(()=>()=>g.dispose(),[g]),un("primitive",{object:g,ref:h,font:t,text:b,anchorX:n,anchorY:e,fontSize:r,...u,children:y})});var CIe=1/0,MIe=9007199254740991,AIe="[object Arguments]",IIe="[object Function]",RIe="[object GeneratorFunction]",kIe="[object Symbol]",OIe=typeof uv=="object"&&uv&&uv.Object===Object&&uv,LIe=typeof self=="object"&&self&&self.Object===Object&&self,NIe=OIe||LIe||Function("return this")();function DIe(n,e,t){switch(t.length){case 0:return n.call(e);case 1:return n.call(e,t[0]);case 2:return n.call(e,t[0],t[1]);case 3:return n.call(e,t[0],t[1],t[2])}return n.apply(e,t)}function PIe(n,e){for(var t=-1,r=n?n.length:0,s=Array(r);++t0&&t(u)?e>1?aee(u,e-1,t,r,s):BIe(s,u):r||(s[s.length]=u)}return s}function UIe(n,e){return n=Object(n),HIe(n,e,function(t,r){return r in n})}function HIe(n,e,t){for(var r=-1,s=e.length,o={};++r-1&&n%1==0&&n<=MIe}function QIe(n){var e=typeof n;return!!n&&(e=="object"||e=="function")}function lee(n){return!!n&&typeof n=="object"}function ZIe(n){return typeof n=="symbol"||lee(n)&&O4.call(n)==kIe}var eRe=GIe(function(n,e){return n==null?{}:UIe(n,PIe(aee(e,1),VIe))}),cN=eRe;const tRe=me.forwardRef(({makeDefault:n,camera:e,regress:t,domElement:r,enableDamping:s=!0,onChange:o,onStart:l,onEnd:u,...h},f)=>{const g=nf(z=>z.invalidate),y=nf(z=>z.camera),b=nf(z=>z.gl),w=nf(z=>z.events),C=nf(z=>z.setEvents),M=nf(z=>z.set),A=nf(z=>z.get),k=nf(z=>z.performance),L=e||y,P=r||w.connected||b.domElement,D=me.useMemo(()=>new $Ae(L),[L]);return Xm(()=>{D.enabled&&D.update()},-1),me.useEffect(()=>(D.connect(P),()=>void D.dispose()),[P,t,D,g]),me.useEffect(()=>{const z=H=>{g(),t&&k.regress(),o&&o(H)},U=H=>{l&&l(H)},V=H=>{u&&u(H)};return D.addEventListener("change",z),D.addEventListener("start",U),D.addEventListener("end",V),()=>{D.removeEventListener("start",U),D.removeEventListener("end",V),D.removeEventListener("change",z)}},[o,l,u,D,g,C]),me.useEffect(()=>{if(n){const z=A().controls;return M({controls:D}),()=>M({controls:z})}},[n,D]),un("primitive",{ref:f,object:D,enableDamping:s,...h})});class nRe extends f2{constructor(e){super(e),this.onBeforeCompile=(t,r)=>{const{isWebGL2:s}=r.capabilities;t.fragmentShader=t.fragmentShader.replace("#include ",` ${s?"#include ":`#extension GL_OES_standard_derivatives : enable #include `} vec2 cxy = 2.0 * gl_PointCoord - 1.0; @@ -5590,7 +5590,7 @@ vTroikaGlyphColor = uTroikaUseGlyphColors ? aTroikaGlyphColor / 255.0 : diffuse; gl_FragColor = vec4(gl_FragColor.rgb, mask * gl_FragColor.a ); #include #include - `)}}}const rRe=pe.forwardRef((n,e)=>{const[t]=pe.useState(()=>new nRe(null));return un("primitive",{...n,object:t,ref:e,attach:"material"})});function iRe(n){const e=n+"Geometry";return pe.forwardRef(({args:t,children:r,...s},o)=>Bh("mesh",{ref:o,...s,children:[un(e,{attach:"geometry",args:t}),r]}))}const sRe=iRe("circle");let e1,bx;const oRe=pe.createContext(null),zW=new Qr,UW=new Ae,aRe=pe.forwardRef(({children:n,range:e,limit:t=1e3,...r},s)=>{const o=pe.useRef(null),[l,u]=pe.useState([]),[[h,f,g]]=pe.useState(()=>[new Float32Array(t*3),Float32Array.from({length:t*3},()=>1),Float32Array.from({length:t},()=>1)]);pe.useEffect(()=>{o.current.geometry.attributes.position.needsUpdate=!0}),Xm(()=>{for(o.current.updateMatrix(),o.current.updateMatrixWorld(),zW.copy(o.current.matrixWorld).invert(),o.current.geometry.drawRange.count=Math.min(t,e!==void 0?e:t,l.length),e1=0;e1({getParent:()=>o,subscribe:b=>(u(w=>[...w,b]),()=>u(w=>w.filter(C=>C.current!==b.current)))}),[]);return pe.createElement("points",BP({userData:{instances:l},matrixAutoUpdate:!1,ref:M4([s,o]),raycast:()=>null},r),Bh("bufferGeometry",{children:[un("bufferAttribute",{attach:"attributes-position",count:h.length/3,array:h,itemSize:3,usage:N1}),un("bufferAttribute",{attach:"attributes-color",count:f.length/3,array:f,itemSize:3,usage:N1}),un("bufferAttribute",{attach:"attributes-size",count:g.length,array:g,itemSize:1,usage:N1})]}),pe.createElement(oRe.Provider,{value:y},n))}),lRe=pe.forwardRef(({children:n,positions:e,colors:t,sizes:r,stride:s=3,...o},l)=>{const u=pe.useRef(null);return Xm(()=>{const h=u.current.geometry.attributes;h.position.needsUpdate=!0,t&&(h.color.needsUpdate=!0),r&&(h.size.needsUpdate=!0)}),Bh("points",{ref:M4([l,u]),...o,children:[Bh("bufferGeometry",{children:[un("bufferAttribute",{attach:"attributes-position",count:e.length/s,array:e,itemSize:s,usage:N1}),t&&un("bufferAttribute",{attach:"attributes-color",count:t.length/s,array:t,itemSize:3,usage:N1}),r&&un("bufferAttribute",{attach:"attributes-size",count:r.length/s,array:r,itemSize:1,usage:N1})]}),n]})}),uRe=pe.forwardRef((n,e)=>n.positions instanceof Float32Array?un(lRe,{...n,ref:e}):un(aRe,{...n,ref:e})),HW=n=>{let e;const t=new Set,r=(l,u)=>{const h=typeof l=="function"?l(e):l;if(!Object.is(h,e)){const f=e;e=u??typeof h!="object"?h:Object.assign({},e,h),t.forEach(g=>g(e,f))}},s=()=>e,o={setState:r,getState:s,subscribe:l=>(t.add(l),()=>t.delete(l)),destroy:()=>{({BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0}&&"production")!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),t.clear()}};return e=n(r,s,o),o},cRe=n=>n?HW(n):HW;var lee={exports:{}},hN={},GW={exports:{}},dN={};/** + `)}}}const rRe=me.forwardRef((n,e)=>{const[t]=me.useState(()=>new nRe(null));return un("primitive",{...n,object:t,ref:e,attach:"material"})});function iRe(n){const e=n+"Geometry";return me.forwardRef(({args:t,children:r,...s},o)=>Bh("mesh",{ref:o,...s,children:[un(e,{attach:"geometry",args:t}),r]}))}const sRe=iRe("circle");let t1,bx;const oRe=me.createContext(null),UW=new Qr,HW=new Me,aRe=me.forwardRef(({children:n,range:e,limit:t=1e3,...r},s)=>{const o=me.useRef(null),[l,u]=me.useState([]),[[h,f,g]]=me.useState(()=>[new Float32Array(t*3),Float32Array.from({length:t*3},()=>1),Float32Array.from({length:t},()=>1)]);me.useEffect(()=>{o.current.geometry.attributes.position.needsUpdate=!0}),Xm(()=>{for(o.current.updateMatrix(),o.current.updateMatrixWorld(),UW.copy(o.current.matrixWorld).invert(),o.current.geometry.drawRange.count=Math.min(t,e!==void 0?e:t,l.length),t1=0;t1({getParent:()=>o,subscribe:b=>(u(w=>[...w,b]),()=>u(w=>w.filter(C=>C.current!==b.current)))}),[]);return me.createElement("points",BP({userData:{instances:l},matrixAutoUpdate:!1,ref:M4([s,o]),raycast:()=>null},r),Bh("bufferGeometry",{children:[un("bufferAttribute",{attach:"attributes-position",count:h.length/3,array:h,itemSize:3,usage:D1}),un("bufferAttribute",{attach:"attributes-color",count:f.length/3,array:f,itemSize:3,usage:D1}),un("bufferAttribute",{attach:"attributes-size",count:g.length,array:g,itemSize:1,usage:D1})]}),me.createElement(oRe.Provider,{value:y},n))}),lRe=me.forwardRef(({children:n,positions:e,colors:t,sizes:r,stride:s=3,...o},l)=>{const u=me.useRef(null);return Xm(()=>{const h=u.current.geometry.attributes;h.position.needsUpdate=!0,t&&(h.color.needsUpdate=!0),r&&(h.size.needsUpdate=!0)}),Bh("points",{ref:M4([l,u]),...o,children:[Bh("bufferGeometry",{children:[un("bufferAttribute",{attach:"attributes-position",count:e.length/s,array:e,itemSize:s,usage:D1}),t&&un("bufferAttribute",{attach:"attributes-color",count:t.length/s,array:t,itemSize:3,usage:D1}),r&&un("bufferAttribute",{attach:"attributes-size",count:r.length/s,array:r,itemSize:1,usage:D1})]}),n]})}),uRe=me.forwardRef((n,e)=>n.positions instanceof Float32Array?un(lRe,{...n,ref:e}):un(aRe,{...n,ref:e})),GW=n=>{let e;const t=new Set,r=(l,u)=>{const h=typeof l=="function"?l(e):l;if(!Object.is(h,e)){const f=e;e=u??typeof h!="object"?h:Object.assign({},e,h),t.forEach(g=>g(e,f))}},s=()=>e,o={setState:r,getState:s,subscribe:l=>(t.add(l),()=>t.delete(l)),destroy:()=>{({BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0}&&"production")!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),t.clear()}};return e=n(r,s,o),o},cRe=n=>n?GW(n):GW;var uee={exports:{}},hN={},WW={exports:{}},dN={};/** * @license React * use-sync-external-store-shim.production.min.js * @@ -5598,7 +5598,7 @@ vTroikaGlyphColor = uTroikaUseGlyphColors ? aTroikaGlyphColor / 255.0 : diffuse; * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var WW;function hRe(){if(WW)return dN;WW=1;var n=yt;function e(y,b){return y===b&&(y!==0||1/y===1/b)||y!==y&&b!==b}var t=typeof Object.is=="function"?Object.is:e,r=n.useState,s=n.useEffect,o=n.useLayoutEffect,l=n.useDebugValue;function u(y,b){var w=b(),C=r({inst:{value:w,getSnapshot:b}}),M=C[0].inst,A=C[1];return o(function(){M.value=w,M.getSnapshot=b,h(M)&&A({inst:M})},[y,w,b]),s(function(){return h(M)&&A({inst:M}),y(function(){h(M)&&A({inst:M})})},[y]),l(w),w}function h(y){var b=y.getSnapshot;y=y.value;try{var w=b();return!t(y,w)}catch{return!0}}function f(y,b){return b()}var g=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:u;return dN.useSyncExternalStore=n.useSyncExternalStore!==void 0?n.useSyncExternalStore:g,dN}var VW;function dRe(){return VW||(VW=1,function(n){n.exports=hRe()}(GW)),GW.exports}/** + */var VW;function hRe(){if(VW)return dN;VW=1;var n=yt;function e(y,b){return y===b&&(y!==0||1/y===1/b)||y!==y&&b!==b}var t=typeof Object.is=="function"?Object.is:e,r=n.useState,s=n.useEffect,o=n.useLayoutEffect,l=n.useDebugValue;function u(y,b){var w=b(),C=r({inst:{value:w,getSnapshot:b}}),M=C[0].inst,A=C[1];return o(function(){M.value=w,M.getSnapshot=b,h(M)&&A({inst:M})},[y,w,b]),s(function(){return h(M)&&A({inst:M}),y(function(){h(M)&&A({inst:M})})},[y]),l(w),w}function h(y){var b=y.getSnapshot;y=y.value;try{var w=b();return!t(y,w)}catch{return!0}}function f(y,b){return b()}var g=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:u;return dN.useSyncExternalStore=n.useSyncExternalStore!==void 0?n.useSyncExternalStore:g,dN}var jW;function dRe(){return jW||(jW=1,function(n){n.exports=hRe()}(WW)),WW.exports}/** * @license React * use-sync-external-store-shim/with-selector.production.min.js * @@ -5606,33 +5606,33 @@ vTroikaGlyphColor = uTroikaUseGlyphColors ? aTroikaGlyphColor / 255.0 : diffuse; * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var jW;function fRe(){if(jW)return hN;jW=1;var n=yt,e=dRe();function t(f,g){return f===g&&(f!==0||1/f===1/g)||f!==f&&g!==g}var r=typeof Object.is=="function"?Object.is:t,s=e.useSyncExternalStore,o=n.useRef,l=n.useEffect,u=n.useMemo,h=n.useDebugValue;return hN.useSyncExternalStoreWithSelector=function(f,g,y,b,w){var C=o(null);if(C.current===null){var M={hasValue:!1,value:null};C.current=M}else M=C.current;C=u(function(){function k(U){if(!L){if(L=!0,P=U,U=b(U),w!==void 0&&M.hasValue){var V=M.value;if(w(V,U))return D=V}return D=U}if(V=D,r(P,U))return V;var H=b(U);return w!==void 0&&w(V,H)?V:(P=U,D=H)}var L=!1,P,D,z=y===void 0?null:y;return[function(){return k(g())},z===null?void 0:function(){return k(z())}]},[g,y,b,w]);var A=s(f,C[0],C[1]);return l(function(){M.hasValue=!0,M.value=A},[A]),h(A),A},hN}(function(n){n.exports=fRe()})(lee);const pRe=wZ(lee.exports),{useSyncExternalStoreWithSelector:mRe}=pRe;function uee(n,e=n.getState,t){const r=mRe(n.subscribe,n.getState,n.getServerState||n.getState,e,t);return pe.useDebugValue(r),r}const YW=n=>{({BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0}&&"production")!=="production"&&typeof n!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const e=typeof n=="function"?cRe(n):n,t=(r,s)=>uee(e,r,s);return Object.assign(t,e),t},gRe=n=>n?YW(n):YW,_Re=n=>(e,t,r)=>{const s=r.subscribe;return r.subscribe=(o,l,u)=>{let h=o;if(l){const f=(u==null?void 0:u.equalityFn)||Object.is;let g=o(r.getState());h=y=>{const b=o(y);if(!f(g,b)){const w=g;l(g=b,w)}},u!=null&&u.fireImmediately&&l(g,g)}return s(h)},n(e,t,r)},vRe=_Re;function n0(n){for(var e=arguments.length,t=Array(e>1?e-1:0),r=1;r3?e.i-4:e.i:Array.isArray(n)?1:L4(n)?2:N4(n)?3:0}function jP(n,e){return gE(n)===2?n.has(e):Object.prototype.hasOwnProperty.call(n,e)}function yRe(n,e){return gE(n)===2?n.get(e):n[e]}function cee(n,e,t){var r=gE(n);r===2?n.set(e,t):r===3?(n.delete(e),n.add(t)):n[e]=t}function bRe(n,e){return n===e?n!==0||1/n==1/e:n!=n&&e!=e}function L4(n){return ERe&&n instanceof Map}function N4(n){return xRe&&n instanceof Set}function h1(n){return n.o||n.t}function D4(n){if(Array.isArray(n))return Array.prototype.slice.call(n);var e=CRe(n);delete e[zm];for(var t=z4(e),r=0;r1&&(n.set=n.add=n.clear=n.delete=TRe),Object.freeze(n),e&&tC(n,function(t,r){return P4(r,!0)},!0)),n}function TRe(){n0(2)}function B4(n){return n==null||typeof n!="object"||Object.isFrozen(n)}function h_(n){var e=MRe[n];return e||n0(18,n),e}function XW(){return nC}function fN(n,e){e&&(h_("Patches"),n.u=[],n.s=[],n.v=e)}function $R(n){YP(n),n.p.forEach(SRe),n.p=null}function YP(n){n===nC&&(nC=n.l)}function KW(n){return nC={p:[],l:nC,h:n,m:!0,_:0}}function SRe(n){var e=n[zm];e.i===0||e.i===1?e.j():e.O=!0}function pN(n,e){e._=e.p.length;var t=e.p[0],r=n!==void 0&&n!==t;return e.h.g||h_("ES5").S(e,n,r),r?(t[zm].P&&($R(e),n0(4)),nT(n)&&(n=CR(e,n),e.l||MR(e,n)),e.u&&h_("Patches").M(t[zm].t,n,e.u,e.s)):n=CR(e,t,[]),$R(e),e.u&&e.v(e.u,e.s),n!==hee?n:void 0}function CR(n,e,t){if(B4(e))return e;var r=e[zm];if(!r)return tC(e,function(o,l){return JW(n,r,e,o,l,t)},!0),e;if(r.A!==n)return e;if(!r.P)return MR(n,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var s=r.i===4||r.i===5?r.o=D4(r.k):r.o;tC(r.i===3?new Set(s):s,function(o,l){return JW(n,r,s,o,l,t)}),MR(n,s,!1),t&&n.u&&h_("Patches").R(r,t,n.u,n.s)}return r.o}function JW(n,e,t,r,s,o){if(Kw(s)){var l=CR(n,s,o&&e&&e.i!==3&&!jP(e.D,r)?o.concat(r):void 0);if(cee(t,r,l),!Kw(l))return;n.m=!1}if(nT(s)&&!B4(s)){if(!n.h.F&&n._<1)return;CR(n,s),e&&e.A.l||MR(n,s)}}function MR(n,e,t){t===void 0&&(t=!1),n.h.F&&n.m&&P4(e,t)}function mN(n,e){var t=n[zm];return(t?h1(t):n)[e]}function qW(n,e){if(e in n)for(var t=Object.getPrototypeOf(n);t;){var r=Object.getOwnPropertyDescriptor(t,e);if(r)return r;t=Object.getPrototypeOf(t)}}function XP(n){n.P||(n.P=!0,n.l&&XP(n.l))}function gN(n){n.o||(n.o=D4(n.t))}function KP(n,e,t){var r=L4(e)?h_("MapSet").N(e,t):N4(e)?h_("MapSet").T(e,t):n.g?function(s,o){var l=Array.isArray(s),u={i:l?1:0,A:o?o.A:XW(),P:!1,I:!1,D:{},l:o,t:s,k:null,o:null,j:null,C:!1},h=u,f=JP;l&&(h=[u],f=Ox);var g=Proxy.revocable(h,f),y=g.revoke,b=g.proxy;return u.k=b,u.j=y,b}(e,t):h_("ES5").J(e,t);return(t?t.A:XW()).p.push(r),r}function wRe(n){return Kw(n)||n0(22,n),function e(t){if(!nT(t))return t;var r,s=t[zm],o=gE(t);if(s){if(!s.P&&(s.i<4||!h_("ES5").K(s)))return s.t;s.I=!0,r=QW(t,o),s.I=!1}else r=QW(t,o);return tC(r,function(l,u){s&&yRe(s.t,l)===u||cee(r,l,e(u))}),o===3?new Set(r):r}(n)}function QW(n,e){switch(e){case 2:return new Map(n);case 3:return Array.from(n)}return D4(n)}var ZW,nC,F4=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",ERe=typeof Map<"u",xRe=typeof Set<"u",e9=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",hee=F4?Symbol.for("immer-nothing"):((ZW={})["immer-nothing"]=!0,ZW),t9=F4?Symbol.for("immer-draftable"):"__$immer_draftable",zm=F4?Symbol.for("immer-state"):"__$immer_state",$Re=""+Object.prototype.constructor,z4=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(n){return Object.getOwnPropertyNames(n).concat(Object.getOwnPropertySymbols(n))}:Object.getOwnPropertyNames,CRe=Object.getOwnPropertyDescriptors||function(n){var e={};return z4(n).forEach(function(t){e[t]=Object.getOwnPropertyDescriptor(n,t)}),e},MRe={},JP={get:function(n,e){if(e===zm)return n;var t=h1(n);if(!jP(t,e))return function(s,o,l){var u,h=qW(o,l);return h?"value"in h?h.value:(u=h.get)===null||u===void 0?void 0:u.call(s.k):void 0}(n,t,e);var r=t[e];return n.I||!nT(r)?r:r===mN(n.t,e)?(gN(n),n.o[e]=KP(n.A.h,r,n)):r},has:function(n,e){return e in h1(n)},ownKeys:function(n){return Reflect.ownKeys(h1(n))},set:function(n,e,t){var r=qW(h1(n),e);if(r!=null&&r.set)return r.set.call(n.k,t),!0;if(!n.P){var s=mN(h1(n),e),o=s==null?void 0:s[zm];if(o&&o.t===t)return n.o[e]=t,n.D[e]=!1,!0;if(bRe(t,s)&&(t!==void 0||jP(n.t,e)))return!0;gN(n),XP(n)}return n.o[e]===t&&typeof t!="number"&&(t!==void 0||e in n.o)||(n.o[e]=t,n.D[e]=!0,!0)},deleteProperty:function(n,e){return mN(n.t,e)!==void 0||e in n.t?(n.D[e]=!1,gN(n),XP(n)):delete n.D[e],n.o&&delete n.o[e],!0},getOwnPropertyDescriptor:function(n,e){var t=h1(n),r=Reflect.getOwnPropertyDescriptor(t,e);return r&&{writable:!0,configurable:n.i!==1||e!=="length",enumerable:r.enumerable,value:t[e]}},defineProperty:function(){n0(11)},getPrototypeOf:function(n){return Object.getPrototypeOf(n.t)},setPrototypeOf:function(){n0(12)}},Ox={};tC(JP,function(n,e){Ox[n]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}}),Ox.deleteProperty=function(n,e){return Ox.set.call(this,n,e,void 0)},Ox.set=function(n,e,t){return JP.set.call(this,n[0],e,t,n[0])};var ARe=function(){function n(t){var r=this;this.g=e9,this.F=!0,this.produce=function(s,o,l){if(typeof s=="function"&&typeof o!="function"){var u=o;o=s;var h=r;return function(M){var A=this;M===void 0&&(M=u);for(var k=arguments.length,L=Array(k>1?k-1:0),P=1;P1?g-1:0),b=1;b=0;s--){var o=r[s];if(o.path.length===0&&o.op==="replace"){t=o.value;break}}s>-1&&(r=r.slice(s+1));var l=h_("Patches").$;return Kw(t)?l(t,r):this.produce(t,function(u){return l(u,r)})},n}(),Um=new ARe,IRe=Um.produce;Um.produceWithPatches.bind(Um);Um.setAutoFreeze.bind(Um);Um.setUseProxies.bind(Um);Um.applyPatches.bind(Um);Um.createDraft.bind(Um);Um.finishDraft.bind(Um);const RRe=n=>(e,t,r)=>(r.setState=(s,o,...l)=>{const u=typeof s=="function"?IRe(s):s;return e(u,o,...l)},n(r.setState,t,r)),kRe=RRe;class ORe{constructor(){this._previousTime=0,this._currentTime=0,this._delta=0,this._elapsed=0,this._timescale=1,this._useFixedDelta=!1,this._fixedDelta=16.67,this._usePageVisibilityAPI=typeof document<"u"&&document.hidden!==void 0,this._usePageVisibilityAPI===!0&&(this._pageVisibilityHandler=LRe.bind(this),document.addEventListener("visibilitychange",this._pageVisibilityHandler,!1))}disableFixedDelta(){return this._useFixedDelta=!1,this}dispose(){return this._usePageVisibilityAPI===!0&&document.removeEventListener("visibilitychange",this._pageVisibilityHandler),this}enableFixedDelta(){return this._useFixedDelta=!0,this}getDelta(){return this._delta/1e3}getElapsed(){return this._elapsed/1e3}getFixedDelta(){return this._fixedDelta/1e3}getTimescale(){return this._timescale}reset(){return this._currentTime=this._now(),this}setFixedDelta(e){return this._fixedDelta=e*1e3,this}setTimescale(e){return this._timescale=e,this}update(){return this._useFixedDelta===!0?this._delta=this._fixedDelta:(this._previousTime=this._currentTime,this._currentTime=this._now(),this._delta=this._currentTime-this._previousTime),this._delta*=this._timescale,this._elapsed+=this._delta,this}_now(){return(typeof performance>"u"?Date:performance).now()}}function LRe(){document.hidden===!1&&this.reset()}var pg={exports:{}};/** + */var YW;function fRe(){if(YW)return hN;YW=1;var n=yt,e=dRe();function t(f,g){return f===g&&(f!==0||1/f===1/g)||f!==f&&g!==g}var r=typeof Object.is=="function"?Object.is:t,s=e.useSyncExternalStore,o=n.useRef,l=n.useEffect,u=n.useMemo,h=n.useDebugValue;return hN.useSyncExternalStoreWithSelector=function(f,g,y,b,w){var C=o(null);if(C.current===null){var M={hasValue:!1,value:null};C.current=M}else M=C.current;C=u(function(){function k(U){if(!L){if(L=!0,P=U,U=b(U),w!==void 0&&M.hasValue){var V=M.value;if(w(V,U))return D=V}return D=U}if(V=D,r(P,U))return V;var H=b(U);return w!==void 0&&w(V,H)?V:(P=U,D=H)}var L=!1,P,D,z=y===void 0?null:y;return[function(){return k(g())},z===null?void 0:function(){return k(z())}]},[g,y,b,w]);var A=s(f,C[0],C[1]);return l(function(){M.hasValue=!0,M.value=A},[A]),h(A),A},hN}(function(n){n.exports=fRe()})(uee);const pRe=EZ(uee.exports),{useSyncExternalStoreWithSelector:mRe}=pRe;function cee(n,e=n.getState,t){const r=mRe(n.subscribe,n.getState,n.getServerState||n.getState,e,t);return me.useDebugValue(r),r}const XW=n=>{({BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0}&&"production")!=="production"&&typeof n!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const e=typeof n=="function"?cRe(n):n,t=(r,s)=>cee(e,r,s);return Object.assign(t,e),t},gRe=n=>n?XW(n):XW,_Re=n=>(e,t,r)=>{const s=r.subscribe;return r.subscribe=(o,l,u)=>{let h=o;if(l){const f=(u==null?void 0:u.equalityFn)||Object.is;let g=o(r.getState());h=y=>{const b=o(y);if(!f(g,b)){const w=g;l(g=b,w)}},u!=null&&u.fireImmediately&&l(g,g)}return s(h)},n(e,t,r)},vRe=_Re;function n0(n){for(var e=arguments.length,t=Array(e>1?e-1:0),r=1;r3?e.i-4:e.i:Array.isArray(n)?1:L4(n)?2:N4(n)?3:0}function jP(n,e){return gE(n)===2?n.has(e):Object.prototype.hasOwnProperty.call(n,e)}function yRe(n,e){return gE(n)===2?n.get(e):n[e]}function hee(n,e,t){var r=gE(n);r===2?n.set(e,t):r===3?(n.delete(e),n.add(t)):n[e]=t}function bRe(n,e){return n===e?n!==0||1/n==1/e:n!=n&&e!=e}function L4(n){return ERe&&n instanceof Map}function N4(n){return xRe&&n instanceof Set}function d1(n){return n.o||n.t}function D4(n){if(Array.isArray(n))return Array.prototype.slice.call(n);var e=CRe(n);delete e[zm];for(var t=z4(e),r=0;r1&&(n.set=n.add=n.clear=n.delete=TRe),Object.freeze(n),e&&tC(n,function(t,r){return P4(r,!0)},!0)),n}function TRe(){n0(2)}function B4(n){return n==null||typeof n!="object"||Object.isFrozen(n)}function h_(n){var e=MRe[n];return e||n0(18,n),e}function KW(){return nC}function fN(n,e){e&&(h_("Patches"),n.u=[],n.s=[],n.v=e)}function $R(n){YP(n),n.p.forEach(SRe),n.p=null}function YP(n){n===nC&&(nC=n.l)}function JW(n){return nC={p:[],l:nC,h:n,m:!0,_:0}}function SRe(n){var e=n[zm];e.i===0||e.i===1?e.j():e.O=!0}function pN(n,e){e._=e.p.length;var t=e.p[0],r=n!==void 0&&n!==t;return e.h.g||h_("ES5").S(e,n,r),r?(t[zm].P&&($R(e),n0(4)),rT(n)&&(n=CR(e,n),e.l||MR(e,n)),e.u&&h_("Patches").M(t[zm].t,n,e.u,e.s)):n=CR(e,t,[]),$R(e),e.u&&e.v(e.u,e.s),n!==dee?n:void 0}function CR(n,e,t){if(B4(e))return e;var r=e[zm];if(!r)return tC(e,function(o,l){return qW(n,r,e,o,l,t)},!0),e;if(r.A!==n)return e;if(!r.P)return MR(n,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var s=r.i===4||r.i===5?r.o=D4(r.k):r.o;tC(r.i===3?new Set(s):s,function(o,l){return qW(n,r,s,o,l,t)}),MR(n,s,!1),t&&n.u&&h_("Patches").R(r,t,n.u,n.s)}return r.o}function qW(n,e,t,r,s,o){if(Kw(s)){var l=CR(n,s,o&&e&&e.i!==3&&!jP(e.D,r)?o.concat(r):void 0);if(hee(t,r,l),!Kw(l))return;n.m=!1}if(rT(s)&&!B4(s)){if(!n.h.F&&n._<1)return;CR(n,s),e&&e.A.l||MR(n,s)}}function MR(n,e,t){t===void 0&&(t=!1),n.h.F&&n.m&&P4(e,t)}function mN(n,e){var t=n[zm];return(t?d1(t):n)[e]}function QW(n,e){if(e in n)for(var t=Object.getPrototypeOf(n);t;){var r=Object.getOwnPropertyDescriptor(t,e);if(r)return r;t=Object.getPrototypeOf(t)}}function XP(n){n.P||(n.P=!0,n.l&&XP(n.l))}function gN(n){n.o||(n.o=D4(n.t))}function KP(n,e,t){var r=L4(e)?h_("MapSet").N(e,t):N4(e)?h_("MapSet").T(e,t):n.g?function(s,o){var l=Array.isArray(s),u={i:l?1:0,A:o?o.A:KW(),P:!1,I:!1,D:{},l:o,t:s,k:null,o:null,j:null,C:!1},h=u,f=JP;l&&(h=[u],f=Ox);var g=Proxy.revocable(h,f),y=g.revoke,b=g.proxy;return u.k=b,u.j=y,b}(e,t):h_("ES5").J(e,t);return(t?t.A:KW()).p.push(r),r}function wRe(n){return Kw(n)||n0(22,n),function e(t){if(!rT(t))return t;var r,s=t[zm],o=gE(t);if(s){if(!s.P&&(s.i<4||!h_("ES5").K(s)))return s.t;s.I=!0,r=ZW(t,o),s.I=!1}else r=ZW(t,o);return tC(r,function(l,u){s&&yRe(s.t,l)===u||hee(r,l,e(u))}),o===3?new Set(r):r}(n)}function ZW(n,e){switch(e){case 2:return new Map(n);case 3:return Array.from(n)}return D4(n)}var e9,nC,F4=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",ERe=typeof Map<"u",xRe=typeof Set<"u",t9=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",dee=F4?Symbol.for("immer-nothing"):((e9={})["immer-nothing"]=!0,e9),n9=F4?Symbol.for("immer-draftable"):"__$immer_draftable",zm=F4?Symbol.for("immer-state"):"__$immer_state",$Re=""+Object.prototype.constructor,z4=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(n){return Object.getOwnPropertyNames(n).concat(Object.getOwnPropertySymbols(n))}:Object.getOwnPropertyNames,CRe=Object.getOwnPropertyDescriptors||function(n){var e={};return z4(n).forEach(function(t){e[t]=Object.getOwnPropertyDescriptor(n,t)}),e},MRe={},JP={get:function(n,e){if(e===zm)return n;var t=d1(n);if(!jP(t,e))return function(s,o,l){var u,h=QW(o,l);return h?"value"in h?h.value:(u=h.get)===null||u===void 0?void 0:u.call(s.k):void 0}(n,t,e);var r=t[e];return n.I||!rT(r)?r:r===mN(n.t,e)?(gN(n),n.o[e]=KP(n.A.h,r,n)):r},has:function(n,e){return e in d1(n)},ownKeys:function(n){return Reflect.ownKeys(d1(n))},set:function(n,e,t){var r=QW(d1(n),e);if(r!=null&&r.set)return r.set.call(n.k,t),!0;if(!n.P){var s=mN(d1(n),e),o=s==null?void 0:s[zm];if(o&&o.t===t)return n.o[e]=t,n.D[e]=!1,!0;if(bRe(t,s)&&(t!==void 0||jP(n.t,e)))return!0;gN(n),XP(n)}return n.o[e]===t&&typeof t!="number"&&(t!==void 0||e in n.o)||(n.o[e]=t,n.D[e]=!0,!0)},deleteProperty:function(n,e){return mN(n.t,e)!==void 0||e in n.t?(n.D[e]=!1,gN(n),XP(n)):delete n.D[e],n.o&&delete n.o[e],!0},getOwnPropertyDescriptor:function(n,e){var t=d1(n),r=Reflect.getOwnPropertyDescriptor(t,e);return r&&{writable:!0,configurable:n.i!==1||e!=="length",enumerable:r.enumerable,value:t[e]}},defineProperty:function(){n0(11)},getPrototypeOf:function(n){return Object.getPrototypeOf(n.t)},setPrototypeOf:function(){n0(12)}},Ox={};tC(JP,function(n,e){Ox[n]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}}),Ox.deleteProperty=function(n,e){return Ox.set.call(this,n,e,void 0)},Ox.set=function(n,e,t){return JP.set.call(this,n[0],e,t,n[0])};var ARe=function(){function n(t){var r=this;this.g=t9,this.F=!0,this.produce=function(s,o,l){if(typeof s=="function"&&typeof o!="function"){var u=o;o=s;var h=r;return function(M){var A=this;M===void 0&&(M=u);for(var k=arguments.length,L=Array(k>1?k-1:0),P=1;P1?g-1:0),b=1;b=0;s--){var o=r[s];if(o.path.length===0&&o.op==="replace"){t=o.value;break}}s>-1&&(r=r.slice(s+1));var l=h_("Patches").$;return Kw(t)?l(t,r):this.produce(t,function(u){return l(u,r)})},n}(),Um=new ARe,IRe=Um.produce;Um.produceWithPatches.bind(Um);Um.setAutoFreeze.bind(Um);Um.setUseProxies.bind(Um);Um.applyPatches.bind(Um);Um.createDraft.bind(Um);Um.finishDraft.bind(Um);const RRe=n=>(e,t,r)=>(r.setState=(s,o,...l)=>{const u=typeof s=="function"?IRe(s):s;return e(u,o,...l)},n(r.setState,t,r)),kRe=RRe;class ORe{constructor(){this._previousTime=0,this._currentTime=0,this._delta=0,this._elapsed=0,this._timescale=1,this._useFixedDelta=!1,this._fixedDelta=16.67,this._usePageVisibilityAPI=typeof document<"u"&&document.hidden!==void 0,this._usePageVisibilityAPI===!0&&(this._pageVisibilityHandler=LRe.bind(this),document.addEventListener("visibilitychange",this._pageVisibilityHandler,!1))}disableFixedDelta(){return this._useFixedDelta=!1,this}dispose(){return this._usePageVisibilityAPI===!0&&document.removeEventListener("visibilitychange",this._pageVisibilityHandler),this}enableFixedDelta(){return this._useFixedDelta=!0,this}getDelta(){return this._delta/1e3}getElapsed(){return this._elapsed/1e3}getFixedDelta(){return this._fixedDelta/1e3}getTimescale(){return this._timescale}reset(){return this._currentTime=this._now(),this}setFixedDelta(e){return this._fixedDelta=e*1e3,this}setTimescale(e){return this._timescale=e,this}update(){return this._useFixedDelta===!0?this._delta=this._fixedDelta:(this._previousTime=this._currentTime,this._currentTime=this._now(),this._delta=this._currentTime-this._previousTime),this._delta*=this._timescale,this._elapsed+=this._delta,this}_now(){return(typeof performance>"u"?Date:performance).now()}}function LRe(){document.hidden===!1&&this.reset()}var pg={exports:{}};/** * @license * Lodash * Copyright OpenJS Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */(function(n,e){(function(){var t,r="4.17.21",s=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",l="Expected a function",u="Invalid `variable` option passed into `_.template`",h="__lodash_hash_undefined__",f=500,g="__lodash_placeholder__",y=1,b=2,w=4,C=1,M=2,A=1,k=2,L=4,P=8,D=16,z=32,U=64,V=128,H=256,oe=512,le=30,Z="...",q=800,he=16,ae=1,ue=2,ge=3,we=1/0,J=9007199254740991,re=17976931348623157e292,ie=NaN,fe=4294967295,Te=fe-1,Fe=fe>>>1,Ie=[["ary",V],["bind",A],["bindKey",k],["curry",P],["curryRight",D],["flip",oe],["partial",z],["partialRight",U],["rearg",H]],Je="[object Arguments]",Re="[object Array]",Qe="[object AsyncFunction]",nt="[object Boolean]",ft="[object Date]",lt="[object DOMException]",ze="[object Error]",Ce="[object Function]",He="[object GeneratorFunction]",rt="[object Map]",it="[object Number]",Nt="[object Null]",kt="[object Object]",vt="[object Promise]",Mt="[object Proxy]",At="[object RegExp]",mt="[object Set]",xe="[object String]",se="[object Symbol]",$e="[object Undefined]",ht="[object WeakMap]",St="[object WeakSet]",It="[object ArrayBuffer]",pt="[object DataView]",Ke="[object Float32Array]",Le="[object Float64Array]",Q="[object Int8Array]",te="[object Int16Array]",me="[object Int32Array]",ke="[object Uint8Array]",Xe="[object Uint8ClampedArray]",Wt="[object Uint16Array]",Ge="[object Uint32Array]",tn=/\b__p \+= '';/g,_t=/\b(__p \+=) '' \+/g,Jt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Kt=/&(?:amp|lt|gt|quot|#39);/g,On=/[&<>"']/g,ii=RegExp(Kt.source),Pr=RegExp(On.source),Ei=/<%-([\s\S]+?)%>/g,xr=/<%([\s\S]+?)%>/g,mr=/<%=([\s\S]+?)%>/g,ne=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Se=/^\w*$/,We=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ot=/[\\^$.*+?()[\]{}|]/g,zt=RegExp(ot.source),sn=/^\s+/,Nn=/\s/,Pe=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,gt=/\{\n\/\* \[wrapped with (.+)\] \*/,Ct=/,? & /,bt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Vt=/[()=,{}\[\]\/\s]/,Wn=/\\(\\)?/g,rr=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,_r=/\w*$/,$r=/^[-+]0x[0-9a-f]+$/i,si=/^0b[01]+$/i,Br=/^\[object .+?Constructor\]$/,Yr=/^0o[0-7]+$/i,Ss=/^(?:0|[1-9]\d*)$/,Oa=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Eo=/($^)/,Yl=/['\n\r\u2028\u2029\\]/g,nn="\\ud800-\\udfff",Rr="\\u0300-\\u036f",el="\\ufe20-\\ufe2f",La="\\u20d0-\\u20ff",Fs=Rr+el+La,zs="\\u2700-\\u27bf",Di="a-z\\xdf-\\xf6\\xf8-\\xff",kr="\\xac\\xb1\\xd7\\xf7",An="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Ir="\\u2000-\\u206f",Gr=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",yr="A-Z\\xc0-\\xd6\\xd8-\\xde",Pi="\\ufe0e\\ufe0f",ws=kr+An+Ir+Gr,fi="['’]",gs="["+nn+"]",tl="["+ws+"]",Na="["+Fs+"]",fc="\\d+",pc="["+zs+"]",Xs="["+Di+"]",Jo="[^"+nn+ws+fc+zs+Di+yr+"]",Xl="\\ud83c[\\udffb-\\udfff]",gu="(?:"+Na+"|"+Xl+")",mh="[^"+nn+"]",qo="(?:\\ud83c[\\udde6-\\uddff]){2}",vr="[\\ud800-\\udbff][\\udc00-\\udfff]",xi="["+yr+"]",Dc="\\u200d",gh="(?:"+Xs+"|"+Jo+")",Pc="(?:"+xi+"|"+Jo+")",El="(?:"+fi+"(?:d|ll|m|re|s|t|ve))?",_u="(?:"+fi+"(?:D|LL|M|RE|S|T|VE))?",xl=gu+"?",$l="["+Pi+"]?",br="(?:"+Dc+"(?:"+[mh,qo,vr].join("|")+")"+$l+xl+")*",Tr="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Kl="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",nl=$l+xl+br,rl="(?:"+[pc,qo,vr].join("|")+")"+nl,vu="(?:"+[mh+Na+"?",Na,qo,vr,gs].join("|")+")",Qi=RegExp(fi,"g"),_s=RegExp(Na,"g"),il=RegExp(Xl+"(?="+Xl+")|"+vu+nl,"g"),Cd=RegExp([xi+"?"+Xs+"+"+El+"(?="+[tl,xi,"$"].join("|")+")",Pc+"+"+_u+"(?="+[tl,xi+gh,"$"].join("|")+")",xi+"?"+gh+"+"+El,xi+"+"+_u,Kl,Tr,fc,rl].join("|"),"g"),io=RegExp("["+Dc+nn+Fs+Pi+"]"),zu=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ca=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],yu=-1,or={};or[Ke]=or[Le]=or[Q]=or[te]=or[me]=or[ke]=or[Xe]=or[Wt]=or[Ge]=!0,or[Je]=or[Re]=or[It]=or[nt]=or[pt]=or[ft]=or[ze]=or[Ce]=or[rt]=or[it]=or[kt]=or[At]=or[mt]=or[xe]=or[ht]=!1;var Gn={};Gn[Je]=Gn[Re]=Gn[It]=Gn[pt]=Gn[nt]=Gn[ft]=Gn[Ke]=Gn[Le]=Gn[Q]=Gn[te]=Gn[me]=Gn[rt]=Gn[it]=Gn[kt]=Gn[At]=Gn[mt]=Gn[xe]=Gn[se]=Gn[ke]=Gn[Xe]=Gn[Wt]=Gn[Ge]=!0,Gn[ze]=Gn[Ce]=Gn[ht]=!1;var Es={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},so={"&":"&","<":"<",">":">",'"':""","'":"'"},Uu={"&":"&","<":"<",">":">",""":'"',"'":"'"},bu={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},_h=parseFloat,Da=parseInt,ha=typeof uv=="object"&&uv&&uv.Object===Object&&uv,Hu=typeof self=="object"&&self&&self.Object===Object&&self,wr=ha||Hu||Function("return this")(),Rs=e&&!e.nodeType&&e,bi=Rs&&!0&&n&&!n.nodeType&&n,$i=bi&&bi.exports===Rs,da=$i&&ha.process,Zr=function(){try{var ye=bi&&bi.require&&bi.require("util").types;return ye||da&&da.binding&&da.binding("util")}catch{}}(),Tu=Zr&&Zr.isArrayBuffer,xo=Zr&&Zr.isDate,Su=Zr&&Zr.isMap,sl=Zr&&Zr.isRegExp,Bi=Zr&&Zr.isSet,Ci=Zr&&Zr.isTypedArray;function Vn(ye,je,Be){switch(Be.length){case 0:return ye.call(je);case 1:return ye.call(je,Be[0]);case 2:return ye.call(je,Be[0],Be[1]);case 3:return ye.call(je,Be[0],Be[1],Be[2])}return ye.apply(je,Be)}function Mi(ye,je,Be,Ot){for(var rn=-1,In=ye==null?0:ye.length;++rn-1}function vh(ye,je,Be){for(var Ot=-1,rn=ye==null?0:ye.length;++Ot-1;);return Be}function fa(ye,je){for(var Be=ye.length;Be--&&ks(je,ye[Be],0)>-1;);return Be}function Eu(ye,je){for(var Be=ye.length,Ot=0;Be--;)ye[Be]===je&&++Ot;return Ot}var cf=Er(Es),hf=Er(so);function pd(ye){return"\\"+bu[ye]}function Wu(ye,je){return ye==null?t:ye[je]}function ol(ye){return io.test(ye)}function Fc(ye){return zu.test(ye)}function zh(ye){for(var je,Be=[];!(je=ye.next()).done;)Be.push(je.value);return Be}function Vu(ye){var je=-1,Be=Array(ye.size);return ye.forEach(function(Ot,rn){Be[++je]=[rn,Ot]}),Be}function Zl(ye,je){return function(Be){return ye(je(Be))}}function Us(ye,je){for(var Be=-1,Ot=ye.length,rn=0,In=[];++Be-1}function Yh(c,m){var E=this.__data__,N=ys(E,c);return N<0?(++this.size,E.push([c,m])):E[N][1]=m,this}os.prototype.clear=Yc,os.prototype.delete=na,os.prototype.get=Od,os.prototype.has=Ld,os.prototype.set=Yh;function Gs(c){var m=-1,E=c==null?0:c.length;for(this.clear();++m=m?c:m)),c}function ki(c,m,E,N,G,K){var ce,_e=m&y,Ee=m&b,et=m&w;if(E&&(ce=G?E(c,N,G,K):E(c)),ce!==t)return ce;if(!ri(c))return c;var tt=kn(c);if(tt){if(ce=Jm(c),!_e)return ni(c,ce)}else{var ct=hs(c),Rt=ct==Ce||ct==He;if(ah(c))return eh(c,_e);if(ct==kt||ct==Je||Rt&&!G){if(ce=Ee||Rt?{}:xc(c),!_e)return Ee?yd(c,fl(ce,c)):qh(c,as(ce,c))}else{if(!Gn[ct])return G?c:{};ce=Zs(c,ct,_e)}}K||(K=new gi);var Xt=K.get(c);if(Xt)return Xt;K.set(c,ce),A_(c)?c.forEach(function(dn){ce.add(ki(dn,m,E,dn,c,K))}):td(c)&&c.forEach(function(dn,Yn){ce.set(Yn,ki(dn,m,E,Yn,c,K))});var pn=et?Ee?Mr:cr:Ee?rs:wi,Ln=tt?t:pn(c);return Xr(Ln||c,function(dn,Yn){Ln&&(Yn=dn,dn=c[Yn]),$o(ce,Yn,ki(dn,m,E,Yn,c,K))}),ce}function Nd(c){var m=wi(c);return function(E){return Xc(E,c,m)}}function Xc(c,m,E){var N=E.length;if(c==null)return!N;for(c=vn(c);N--;){var G=E[N],K=m[G],ce=c[G];if(ce===t&&!(G in c)||!K(ce))return!1}return!0}function Kh(c,m,E){if(typeof c!="function")throw new Ti(l);return gf(function(){c.apply(t,E)},m)}function Uo(c,m,E,N){var G=-1,K=Pa,ce=!0,_e=c.length,Ee=[],et=m.length;if(!_e)return Ee;E&&(m=hr(m,Wr(E))),N?(K=vh,ce=!1):m.length>=s&&(K=Sr,ce=!1,m=new Fo(m));e:for(;++G<_e;){var tt=c[G],ct=E==null?tt:E(tt);if(tt=N||tt!==0?tt:0,ce&&ct===ct){for(var Rt=et;Rt--;)if(m[Rt]===ct)continue e;Ee.push(tt)}else K(m,ct,N)||Ee.push(tt)}return Ee}var Co=Qh(ls),df=Qh(Va,!0);function Cu(c,m){var E=!0;return Co(c,function(N,G,K){return E=!!m(N,G,K),E}),E}function Ol(c,m,E){for(var N=-1,G=c.length;++NG?0:G+E),N=N===t||N>G?G:Mn(N),N<0&&(N+=G),N=E>N?0:I0(N);E0&&E(_e)?m>1?Kr(_e,m-1,E,N,G):Qo(G,_e):N||(G[G.length]=_e)}return G}var ou=Ec(),Ju=Ec(!0);function ls(c,m){return c&&ou(c,m,wi)}function Va(c,m){return c&&Ju(c,m,wi)}function $s(c,m){return Vi(m,function(E){return Mc(c[E])})}function Cs(c,m){m=ia(m,c);for(var E=0,N=m.length;c!=null&&Em}function bc(c,m){return c!=null&&qn.call(c,m)}function ff(c,m){return c!=null&&m in vn(c)}function Eh(c,m,E){return c>=Ii(m,E)&&c=120&&tt.length>=120)?new Fo(ce&&tt):t}tt=c[0];var ct=-1,Rt=_e[0];e:for(;++ct-1;)_e!==c&&ju.call(_e,Ee,1),ju.call(c,Ee,1);return c}function bs(c,m){for(var E=c?m.length:0,N=E-1;E--;){var G=m[E];if(E==N||G!==K){var K=G;Ka(G)?ju.call(c,G,1):Qc(c,G)}}return c}function Os(c,m){return c+nu(Il()*(m-c+1))}function Ya(c,m,E,N){for(var G=-1,K=ei(Yu((m-c)/(E||1)),0),ce=Be(K);K--;)ce[N?K:++G]=c,c+=E;return ce}function Vs(c,m){var E="";if(!c||m<1||m>J)return E;do m%2&&(E+=c),m=nu(m/2),m&&(c+=c);while(m);return E}function fn(c,m){return Bd(nm(c,m,ko),c+"")}function Jc(c){return hl(Tf(c))}function wn(c,m){var E=Tf(c);return dr(E,Wa(m,0,E.length))}function vi(c,m,E,N){if(!ri(c))return c;m=ia(m,c);for(var G=-1,K=m.length,ce=K-1,_e=c;_e!=null&&++GG?0:G+m),E=E>G?G:E,E<0&&(E+=G),G=m>E?0:E-m>>>0,m>>>=0;for(var K=Be(G);++N>>1,ce=c[K];ce!==null&&!aa(ce)&&(E?ce<=m:ce=s){var et=m?null:Dr(c);if(et)return eu(et);ce=!1,G=Sr,Ee=new Fo}else Ee=m?[]:_e;e:for(;++N=N?c:Ft(c,m,E)}var Iu=Vh||function(c){return wr.clearTimeout(c)};function eh(c,m){if(m)return c.slice();var E=c.length,N=Gh?Gh(E):new c.constructor(E);return c.copy(N),N}function wc(c){var m=new c.constructor(c.byteLength);return new Hc(m).set(new Hc(c)),m}function Go(c,m){var E=m?wc(c.buffer):c.buffer;return new c.constructor(E,c.byteOffset,c.byteLength)}function _o(c){var m=new c.constructor(c.source,_r.exec(c));return m.lastIndex=c.lastIndex,m}function rc(c){return Zi?vn(Zi.call(c)):{}}function Dl(c,m){var E=m?wc(c.buffer):c.buffer;return new c.constructor(E,c.byteOffset,c.length)}function vo(c,m){if(c!==m){var E=c!==t,N=c===null,G=c===c,K=aa(c),ce=m!==t,_e=m===null,Ee=m===m,et=aa(m);if(!_e&&!et&&!K&&c>m||K&&ce&&Ee&&!_e&&!et||N&&ce&&Ee||!E&&Ee||!G)return 1;if(!N&&!K&&!et&&c=_e)return Ee;var et=E[N];return Ee*(et=="desc"?-1:1)}}return c.index-m.index}function Xa(c,m,E,N){for(var G=-1,K=c.length,ce=E.length,_e=-1,Ee=m.length,et=ei(K-ce,0),tt=Be(Ee+et),ct=!N;++_e1?E[G-1]:t,ce=G>2?E[2]:t;for(K=c.length>3&&typeof K=="function"?(G--,K):t,ce&&Ur(E[0],E[1],ce)&&(K=G<3?t:K,G=1),m=vn(m);++N-1?G[K?m[ce]:ce]:t}}function B(c){return zn(function(m){var E=m.length,N=E,G=Cr.prototype.thru;for(c&&m.reverse();N--;){var K=m[N];if(typeof K!="function")throw new Ti(l);if(G&&!ce&&pf(K)=="wrapper")var ce=new Cr([],!0)}for(N=ce?N:E;++N1&&er.reverse(),tt&&Ee_e))return!1;var et=K.get(c),tt=K.get(m);if(et&&tt)return et==m&&tt==c;var ct=-1,Rt=!0,Xt=E&M?new Fo:t;for(K.set(c,m),K.set(m,c);++ct<_e;){var pn=c[ct],Ln=m[ct];if(N)var dn=ce?N(Ln,pn,ct,m,c,K):N(pn,Ln,ct,c,m,K);if(dn!==t){if(dn)continue;Rt=!1;break}if(Xt){if(!Bc(m,function(Yn,er){if(!Sr(Xt,er)&&(pn===Yn||G(pn,Yn,E,N,K)))return Xt.push(er)})){Rt=!1;break}}else if(!(pn===Ln||G(pn,Ln,E,N,K))){Rt=!1;break}}return K.delete(c),K.delete(m),Rt}function En(c,m,E,N,G,K,ce){switch(E){case pt:if(c.byteLength!=m.byteLength||c.byteOffset!=m.byteOffset)return!1;c=c.buffer,m=m.buffer;case It:return!(c.byteLength!=m.byteLength||!K(new Hc(c),new Hc(m)));case nt:case ft:case it:return Ca(+c,+m);case ze:return c.name==m.name&&c.message==m.message;case At:case xe:return c==m+"";case rt:var _e=Vu;case mt:var Ee=N&C;if(_e||(_e=eu),c.size!=m.size&&!Ee)return!1;var et=ce.get(c);if(et)return et==m;N|=M,ce.set(c,m);var tt=on(_e(c),_e(m),N,G,K,ce);return ce.delete(c),tt;case se:if(Zi)return Zi.call(c)==Zi.call(m)}return!1}function Rn(c,m,E,N,G,K){var ce=E&C,_e=cr(c),Ee=_e.length,et=cr(m),tt=et.length;if(Ee!=tt&&!ce)return!1;for(var ct=Ee;ct--;){var Rt=_e[ct];if(!(ce?Rt in m:qn.call(m,Rt)))return!1}var Xt=K.get(c),pn=K.get(m);if(Xt&&pn)return Xt==m&&pn==c;var Ln=!0;K.set(c,m),K.set(m,c);for(var dn=ce;++ct1?"& ":"")+m[N],m=m.join(E>2?", ":" "),c.replace(Pe,`{ + */(function(n,e){(function(){var t,r="4.17.21",s=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",l="Expected a function",u="Invalid `variable` option passed into `_.template`",h="__lodash_hash_undefined__",f=500,g="__lodash_placeholder__",y=1,b=2,w=4,C=1,M=2,A=1,k=2,L=4,P=8,D=16,z=32,U=64,V=128,H=256,oe=512,le=30,Z="...",q=800,he=16,ae=1,ue=2,ge=3,we=1/0,J=9007199254740991,re=17976931348623157e292,se=NaN,fe=4294967295,Te=fe-1,Fe=fe>>>1,Ie=[["ary",V],["bind",A],["bindKey",k],["curry",P],["curryRight",D],["flip",oe],["partial",z],["partialRight",U],["rearg",H]],qe="[object Arguments]",Re="[object Array]",Ze="[object AsyncFunction]",rt="[object Boolean]",ft="[object Date]",ut="[object DOMException]",ze="[object Error]",$e="[object Function]",He="[object GeneratorFunction]",it="[object Map]",st="[object Number]",Nt="[object Null]",kt="[object Object]",vt="[object Promise]",Ct="[object Proxy]",At="[object RegExp]",gt="[object Set]",xe="[object String]",ie="[object Symbol]",Pe="[object Undefined]",Ye="[object WeakMap]",St="[object WeakSet]",It="[object ArrayBuffer]",mt="[object DataView]",Ke="[object Float32Array]",Oe="[object Float64Array]",Q="[object Int8Array]",te="[object Int16Array]",pe="[object Int32Array]",Ae="[object Uint8Array]",Je="[object Uint8ClampedArray]",jt="[object Uint16Array]",Ge="[object Uint32Array]",qt=/\b__p \+= '';/g,pt=/\b(__p \+=) '' \+/g,Jt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Xt=/&(?:amp|lt|gt|quot|#39);/g,xn=/[&<>"']/g,ii=RegExp(Xt.source),Pr=RegExp(xn.source),Ei=/<%-([\s\S]+?)%>/g,xr=/<%([\s\S]+?)%>/g,mr=/<%=([\s\S]+?)%>/g,ne=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Se=/^\w*$/,We=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,at=/[\\^$.*+?()[\]{}|]/g,zt=RegExp(at.source),sn=/^\s+/,Nn=/\s/,De=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,_t=/\{\n\/\* \[wrapped with (.+)\] \*/,Mt=/,? & /,bt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Wt=/[()=,{}\[\]\/\s]/,Wn=/\\(\\)?/g,rr=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,_r=/\w*$/,$r=/^[-+]0x[0-9a-f]+$/i,si=/^0b[01]+$/i,Br=/^\[object .+?Constructor\]$/,Yr=/^0o[0-7]+$/i,Ss=/^(?:0|[1-9]\d*)$/,Oa=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Eo=/($^)/,Yl=/['\n\r\u2028\u2029\\]/g,nn="\\ud800-\\udfff",Rr="\\u0300-\\u036f",el="\\ufe20-\\ufe2f",La="\\u20d0-\\u20ff",Fs=Rr+el+La,zs="\\u2700-\\u27bf",Di="a-z\\xdf-\\xf6\\xf8-\\xff",kr="\\xac\\xb1\\xd7\\xf7",In="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Ir="\\u2000-\\u206f",Gr=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",yr="A-Z\\xc0-\\xd6\\xd8-\\xde",Pi="\\ufe0e\\ufe0f",ws=kr+In+Ir+Gr,fi="['’]",gs="["+nn+"]",tl="["+ws+"]",Na="["+Fs+"]",fc="\\d+",pc="["+zs+"]",Xs="["+Di+"]",Jo="[^"+nn+ws+fc+zs+Di+yr+"]",Xl="\\ud83c[\\udffb-\\udfff]",gu="(?:"+Na+"|"+Xl+")",mh="[^"+nn+"]",qo="(?:\\ud83c[\\udde6-\\uddff]){2}",vr="[\\ud800-\\udbff][\\udc00-\\udfff]",xi="["+yr+"]",Dc="\\u200d",gh="(?:"+Xs+"|"+Jo+")",Pc="(?:"+xi+"|"+Jo+")",El="(?:"+fi+"(?:d|ll|m|re|s|t|ve))?",_u="(?:"+fi+"(?:D|LL|M|RE|S|T|VE))?",xl=gu+"?",$l="["+Pi+"]?",br="(?:"+Dc+"(?:"+[mh,qo,vr].join("|")+")"+$l+xl+")*",Tr="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Kl="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",nl=$l+xl+br,rl="(?:"+[pc,qo,vr].join("|")+")"+nl,vu="(?:"+[mh+Na+"?",Na,qo,vr,gs].join("|")+")",Qi=RegExp(fi,"g"),_s=RegExp(Na,"g"),il=RegExp(Xl+"(?="+Xl+")|"+vu+nl,"g"),Cd=RegExp([xi+"?"+Xs+"+"+El+"(?="+[tl,xi,"$"].join("|")+")",Pc+"+"+_u+"(?="+[tl,xi+gh,"$"].join("|")+")",xi+"?"+gh+"+"+El,xi+"+"+_u,Kl,Tr,fc,rl].join("|"),"g"),io=RegExp("["+Dc+nn+Fs+Pi+"]"),zu=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ca=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],yu=-1,or={};or[Ke]=or[Oe]=or[Q]=or[te]=or[pe]=or[Ae]=or[Je]=or[jt]=or[Ge]=!0,or[qe]=or[Re]=or[It]=or[rt]=or[mt]=or[ft]=or[ze]=or[$e]=or[it]=or[st]=or[kt]=or[At]=or[gt]=or[xe]=or[Ye]=!1;var Gn={};Gn[qe]=Gn[Re]=Gn[It]=Gn[mt]=Gn[rt]=Gn[ft]=Gn[Ke]=Gn[Oe]=Gn[Q]=Gn[te]=Gn[pe]=Gn[it]=Gn[st]=Gn[kt]=Gn[At]=Gn[gt]=Gn[xe]=Gn[ie]=Gn[Ae]=Gn[Je]=Gn[jt]=Gn[Ge]=!0,Gn[ze]=Gn[$e]=Gn[Ye]=!1;var Es={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},so={"&":"&","<":"<",">":">",'"':""","'":"'"},Uu={"&":"&","<":"<",">":">",""":'"',"'":"'"},bu={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},_h=parseFloat,Da=parseInt,ha=typeof uv=="object"&&uv&&uv.Object===Object&&uv,Hu=typeof self=="object"&&self&&self.Object===Object&&self,wr=ha||Hu||Function("return this")(),Rs=e&&!e.nodeType&&e,bi=Rs&&!0&&n&&!n.nodeType&&n,$i=bi&&bi.exports===Rs,da=$i&&ha.process,Zr=function(){try{var ye=bi&&bi.require&&bi.require("util").types;return ye||da&&da.binding&&da.binding("util")}catch{}}(),Tu=Zr&&Zr.isArrayBuffer,xo=Zr&&Zr.isDate,Su=Zr&&Zr.isMap,sl=Zr&&Zr.isRegExp,Bi=Zr&&Zr.isSet,Ci=Zr&&Zr.isTypedArray;function Vn(ye,je,Be){switch(Be.length){case 0:return ye.call(je);case 1:return ye.call(je,Be[0]);case 2:return ye.call(je,Be[0],Be[1]);case 3:return ye.call(je,Be[0],Be[1],Be[2])}return ye.apply(je,Be)}function Mi(ye,je,Be,Ot){for(var rn=-1,Rn=ye==null?0:ye.length;++rn-1}function vh(ye,je,Be){for(var Ot=-1,rn=ye==null?0:ye.length;++Ot-1;);return Be}function fa(ye,je){for(var Be=ye.length;Be--&&ks(je,ye[Be],0)>-1;);return Be}function Eu(ye,je){for(var Be=ye.length,Ot=0;Be--;)ye[Be]===je&&++Ot;return Ot}var cf=Er(Es),hf=Er(so);function pd(ye){return"\\"+bu[ye]}function Wu(ye,je){return ye==null?t:ye[je]}function ol(ye){return io.test(ye)}function Fc(ye){return zu.test(ye)}function zh(ye){for(var je,Be=[];!(je=ye.next()).done;)Be.push(je.value);return Be}function Vu(ye){var je=-1,Be=Array(ye.size);return ye.forEach(function(Ot,rn){Be[++je]=[rn,Ot]}),Be}function Zl(ye,je){return function(Be){return ye(je(Be))}}function Us(ye,je){for(var Be=-1,Ot=ye.length,rn=0,Rn=[];++Be-1}function Yh(c,m){var E=this.__data__,N=ys(E,c);return N<0?(++this.size,E.push([c,m])):E[N][1]=m,this}os.prototype.clear=Yc,os.prototype.delete=na,os.prototype.get=Od,os.prototype.has=Ld,os.prototype.set=Yh;function Gs(c){var m=-1,E=c==null?0:c.length;for(this.clear();++m=m?c:m)),c}function ki(c,m,E,N,G,K){var ce,_e=m&y,Ee=m&b,tt=m&w;if(E&&(ce=G?E(c,N,G,K):E(c)),ce!==t)return ce;if(!ri(c))return c;var nt=On(c);if(nt){if(ce=Jm(c),!_e)return ni(c,ce)}else{var ht=hs(c),Rt=ht==$e||ht==He;if(ah(c))return eh(c,_e);if(ht==kt||ht==qe||Rt&&!G){if(ce=Ee||Rt?{}:xc(c),!_e)return Ee?yd(c,fl(ce,c)):qh(c,as(ce,c))}else{if(!Gn[ht])return G?c:{};ce=Zs(c,ht,_e)}}K||(K=new gi);var Kt=K.get(c);if(Kt)return Kt;K.set(c,ce),A_(c)?c.forEach(function(dn){ce.add(ki(dn,m,E,dn,c,K))}):td(c)&&c.forEach(function(dn,Yn){ce.set(Yn,ki(dn,m,E,Yn,c,K))});var pn=tt?Ee?Mr:cr:Ee?rs:wi,Ln=nt?t:pn(c);return Xr(Ln||c,function(dn,Yn){Ln&&(Yn=dn,dn=c[Yn]),$o(ce,Yn,ki(dn,m,E,Yn,c,K))}),ce}function Nd(c){var m=wi(c);return function(E){return Xc(E,c,m)}}function Xc(c,m,E){var N=E.length;if(c==null)return!N;for(c=vn(c);N--;){var G=E[N],K=m[G],ce=c[G];if(ce===t&&!(G in c)||!K(ce))return!1}return!0}function Kh(c,m,E){if(typeof c!="function")throw new Ti(l);return gf(function(){c.apply(t,E)},m)}function Uo(c,m,E,N){var G=-1,K=Pa,ce=!0,_e=c.length,Ee=[],tt=m.length;if(!_e)return Ee;E&&(m=hr(m,Wr(E))),N?(K=vh,ce=!1):m.length>=s&&(K=Sr,ce=!1,m=new Fo(m));e:for(;++G<_e;){var nt=c[G],ht=E==null?nt:E(nt);if(nt=N||nt!==0?nt:0,ce&&ht===ht){for(var Rt=tt;Rt--;)if(m[Rt]===ht)continue e;Ee.push(nt)}else K(m,ht,N)||Ee.push(nt)}return Ee}var Co=Qh(ls),df=Qh(Va,!0);function Cu(c,m){var E=!0;return Co(c,function(N,G,K){return E=!!m(N,G,K),E}),E}function Ol(c,m,E){for(var N=-1,G=c.length;++NG?0:G+E),N=N===t||N>G?G:An(N),N<0&&(N+=G),N=E>N?0:I0(N);E0&&E(_e)?m>1?Kr(_e,m-1,E,N,G):Qo(G,_e):N||(G[G.length]=_e)}return G}var ou=Ec(),Ju=Ec(!0);function ls(c,m){return c&&ou(c,m,wi)}function Va(c,m){return c&&Ju(c,m,wi)}function $s(c,m){return Vi(m,function(E){return Mc(c[E])})}function Cs(c,m){m=ia(m,c);for(var E=0,N=m.length;c!=null&&Em}function bc(c,m){return c!=null&&qn.call(c,m)}function ff(c,m){return c!=null&&m in vn(c)}function Eh(c,m,E){return c>=Ii(m,E)&&c=120&&nt.length>=120)?new Fo(ce&&nt):t}nt=c[0];var ht=-1,Rt=_e[0];e:for(;++ht-1;)_e!==c&&ju.call(_e,Ee,1),ju.call(c,Ee,1);return c}function bs(c,m){for(var E=c?m.length:0,N=E-1;E--;){var G=m[E];if(E==N||G!==K){var K=G;Ka(G)?ju.call(c,G,1):Qc(c,G)}}return c}function Os(c,m){return c+nu(Il()*(m-c+1))}function Ya(c,m,E,N){for(var G=-1,K=ei(Yu((m-c)/(E||1)),0),ce=Be(K);K--;)ce[N?K:++G]=c,c+=E;return ce}function Vs(c,m){var E="";if(!c||m<1||m>J)return E;do m%2&&(E+=c),m=nu(m/2),m&&(c+=c);while(m);return E}function fn(c,m){return Bd(nm(c,m,ko),c+"")}function Jc(c){return hl(Tf(c))}function wn(c,m){var E=Tf(c);return dr(E,Wa(m,0,E.length))}function vi(c,m,E,N){if(!ri(c))return c;m=ia(m,c);for(var G=-1,K=m.length,ce=K-1,_e=c;_e!=null&&++GG?0:G+m),E=E>G?G:E,E<0&&(E+=G),G=m>E?0:E-m>>>0,m>>>=0;for(var K=Be(G);++N>>1,ce=c[K];ce!==null&&!aa(ce)&&(E?ce<=m:ce=s){var tt=m?null:Dr(c);if(tt)return eu(tt);ce=!1,G=Sr,Ee=new Fo}else Ee=m?[]:_e;e:for(;++N=N?c:Ft(c,m,E)}var Iu=Vh||function(c){return wr.clearTimeout(c)};function eh(c,m){if(m)return c.slice();var E=c.length,N=Gh?Gh(E):new c.constructor(E);return c.copy(N),N}function wc(c){var m=new c.constructor(c.byteLength);return new Hc(m).set(new Hc(c)),m}function Go(c,m){var E=m?wc(c.buffer):c.buffer;return new c.constructor(E,c.byteOffset,c.byteLength)}function _o(c){var m=new c.constructor(c.source,_r.exec(c));return m.lastIndex=c.lastIndex,m}function rc(c){return Zi?vn(Zi.call(c)):{}}function Dl(c,m){var E=m?wc(c.buffer):c.buffer;return new c.constructor(E,c.byteOffset,c.length)}function vo(c,m){if(c!==m){var E=c!==t,N=c===null,G=c===c,K=aa(c),ce=m!==t,_e=m===null,Ee=m===m,tt=aa(m);if(!_e&&!tt&&!K&&c>m||K&&ce&&Ee&&!_e&&!tt||N&&ce&&Ee||!E&&Ee||!G)return 1;if(!N&&!K&&!tt&&c=_e)return Ee;var tt=E[N];return Ee*(tt=="desc"?-1:1)}}return c.index-m.index}function Xa(c,m,E,N){for(var G=-1,K=c.length,ce=E.length,_e=-1,Ee=m.length,tt=ei(K-ce,0),nt=Be(Ee+tt),ht=!N;++_e1?E[G-1]:t,ce=G>2?E[2]:t;for(K=c.length>3&&typeof K=="function"?(G--,K):t,ce&&Ur(E[0],E[1],ce)&&(K=G<3?t:K,G=1),m=vn(m);++N-1?G[K?m[ce]:ce]:t}}function B(c){return zn(function(m){var E=m.length,N=E,G=Cr.prototype.thru;for(c&&m.reverse();N--;){var K=m[N];if(typeof K!="function")throw new Ti(l);if(G&&!ce&&pf(K)=="wrapper")var ce=new Cr([],!0)}for(N=ce?N:E;++N1&&er.reverse(),nt&&Ee_e))return!1;var tt=K.get(c),nt=K.get(m);if(tt&&nt)return tt==m&&nt==c;var ht=-1,Rt=!0,Kt=E&M?new Fo:t;for(K.set(c,m),K.set(m,c);++ht<_e;){var pn=c[ht],Ln=m[ht];if(N)var dn=ce?N(Ln,pn,ht,m,c,K):N(pn,Ln,ht,c,m,K);if(dn!==t){if(dn)continue;Rt=!1;break}if(Kt){if(!Bc(m,function(Yn,er){if(!Sr(Kt,er)&&(pn===Yn||G(pn,Yn,E,N,K)))return Kt.push(er)})){Rt=!1;break}}else if(!(pn===Ln||G(pn,Ln,E,N,K))){Rt=!1;break}}return K.delete(c),K.delete(m),Rt}function En(c,m,E,N,G,K,ce){switch(E){case mt:if(c.byteLength!=m.byteLength||c.byteOffset!=m.byteOffset)return!1;c=c.buffer,m=m.buffer;case It:return!(c.byteLength!=m.byteLength||!K(new Hc(c),new Hc(m)));case rt:case ft:case st:return Ca(+c,+m);case ze:return c.name==m.name&&c.message==m.message;case At:case xe:return c==m+"";case it:var _e=Vu;case gt:var Ee=N&C;if(_e||(_e=eu),c.size!=m.size&&!Ee)return!1;var tt=ce.get(c);if(tt)return tt==m;N|=M,ce.set(c,m);var nt=on(_e(c),_e(m),N,G,K,ce);return ce.delete(c),nt;case ie:if(Zi)return Zi.call(c)==Zi.call(m)}return!1}function kn(c,m,E,N,G,K){var ce=E&C,_e=cr(c),Ee=_e.length,tt=cr(m),nt=tt.length;if(Ee!=nt&&!ce)return!1;for(var ht=Ee;ht--;){var Rt=_e[ht];if(!(ce?Rt in m:qn.call(m,Rt)))return!1}var Kt=K.get(c),pn=K.get(m);if(Kt&&pn)return Kt==m&&pn==c;var Ln=!0;K.set(c,m),K.set(m,c);for(var dn=ce;++ht1?"& ":"")+m[N],m=m.join(E>2?", ":" "),c.replace(De,`{ /* [wrapped with `+m+`] */ -`)}function Dd(c){return kn(c)||Yd(c)||!!(md&&c&&c[md])}function Ka(c,m){var E=typeof c;return m=m??J,!!m&&(E=="number"||E!="symbol"&&Ss.test(c))&&c>-1&&c%1==0&&c0){if(++m>=q)return arguments[0]}else m=0;return c.apply(t,arguments)}}function dr(c,m){var E=-1,N=c.length,G=N-1;for(m=m===t?N:m;++E1?c[m-1]:t;return E=typeof E=="function"?(c.pop(),E):t,Rp(c,E)});function Ou(c){var m=X(c);return m.__chain__=!0,m}function Og(c,m){return m(c),c}function jf(c,m){return m(c)}var ed=zn(function(c){var m=c.length,E=m?c[0]:0,N=this.__wrapped__,G=function(K){return Xh(K,c)};return m>1||this.__actions__.length||!(N instanceof mn)||!Ka(E)?this.thru(G):(N=N.slice(E,+E+(m?1:0)),N.__actions__.push({func:jf,args:[G],thisArg:t}),new Cr(N,this.__chain__).thru(function(K){return m&&!K.length&&K.push(t),K}))});function hm(){return Ou(this)}function Yf(){return new Cr(this.value(),this.__chain__)}function Xf(){this.__values__===t&&(this.__values__=Bv(this.value()));var c=this.__index__>=this.__values__.length,m=c?t:this.__values__[this.__index__++];return{done:c,value:m}}function kp(){return this}function bd(c){for(var m,E=this;E instanceof ga;){var N=Fd(E);N.__index__=0,N.__values__=t,m?G.__wrapped__=N:m=N;var G=N;E=E.__wrapped__}return G.__wrapped__=c,m}function yf(){var c=this.__wrapped__;if(c instanceof mn){var m=c;return this.__actions__.length&&(m=new mn(this)),m=m.reverse(),m.__actions__.push({func:jf,args:[$a],thisArg:t}),new Cr(m,this.__chain__)}return this.thru($a)}function eg(){return Zc(this.__wrapped__,this.__actions__)}var kv=Ta(function(c,m,E){qn.call(c,E)?++c[E]:zo(c,E,1)});function Lg(c,m,E){var N=kn(c)?wu:Cu;return E&&Ur(c,m,E)&&(m=t),N(c,ln(m,3))}function Vd(c,m){var E=kn(c)?Vi:yc;return E(c,ln(m,3))}var Li=I(zd),dm=I(Ud);function tg(c,m){return Kr(Si(c,m),1)}function Ng(c,m){return Kr(Si(c,m),we)}function Ov(c,m,E){return E=E===t?1:Mn(E),Kr(Si(c,m),E)}function ng(c,m){var E=kn(c)?Xr:Co;return E(c,ln(m,3))}function Op(c,m){var E=kn(c)?dd:df;return E(c,ln(m,3))}var rg=Ta(function(c,m,E){qn.call(c,E)?c[E].push(m):zo(c,E,[m])});function Kf(c,m,E,N){c=Hi(c)?c:Tf(c),E=E&&!N?Mn(E):0;var G=c.length;return E<0&&(E=ei(G+E,0)),vm(c)?E<=G&&c.indexOf(m,E)>-1:!!G&&ks(c,m,E)>-1}var Jf=fn(function(c,m,E){var N=-1,G=typeof m=="function",K=Hi(c)?Be(c.length):[];return Co(c,function(ce){K[++N]=G?Vn(m,ce,E):Pn(ce,m,E)}),K}),fm=Ta(function(c,m,E){zo(c,E,m)});function Si(c,m){var E=kn(c)?hr:Mu;return E(c,ln(m,3))}function qf(c,m,E,N){return c==null?[]:(kn(m)||(m=m==null?[]:[m]),E=N?t:E,kn(E)||(E=E==null?[]:[E]),Zu(c,m,E))}var pm=Ta(function(c,m,E){c[E?0:1].push(m)},function(){return[[],[]]});function mm(c,m,E){var N=kn(c)?fd:oo,G=arguments.length<3;return N(c,ln(m,4),E,G,Co)}function Lp(c,m,E){var N=kn(c)?lf:oo,G=arguments.length<3;return N(c,ln(m,4),E,G,df)}function Dg(c,m){var E=kn(c)?Vi:yc;return E(c,Et(ln(m,3)))}function v(c){var m=kn(c)?hl:Jc;return m(c)}function T(c,m,E){(E?Ur(c,m,E):m===t)?m=1:m=Mn(m);var N=kn(c)?vc:wn;return N(c,m)}function R(c){var m=kn(c)?wp:Nl;return m(c)}function F(c){if(c==null)return 0;if(Hi(c))return vm(c)?is(c):c.length;var m=hs(c);return m==rt||m==mt?c.size:ho(c).length}function Y(c,m,E){var N=kn(c)?Bc:pl;return E&&Ur(c,m,E)&&(m=t),N(c,ln(m,3))}var ee=fn(function(c,m){if(c==null)return[];var E=m.length;return E>1&&Ur(c,m[0],m[1])?m=[]:E>2&&Ur(m[0],m[1],m[2])&&(m=[m[0]]),Zu(c,Kr(m,1),[])}),be=zi||function(){return wr.Date.now()};function Ye(c,m){if(typeof m!="function")throw new Ti(l);return c=Mn(c),function(){if(--c<1)return m.apply(this,arguments)}}function at(c,m,E){return m=E?t:m,m=c&&m==null?c.length:m,Me(c,V,t,t,t,t,m)}function Lt(c,m){var E;if(typeof m!="function")throw new Ti(l);return c=Mn(c),function(){return--c>0&&(E=m.apply(this,arguments)),c<=1&&(m=t),E}}var Zt=fn(function(c,m,E){var N=A;if(E.length){var G=Us(E,Mh(Zt));N|=z}return Me(c,N,m,E,G)}),hn=fn(function(c,m,E){var N=A|k;if(E.length){var G=Us(E,Mh(hn));N|=z}return Me(m,N,c,E,G)});function an(c,m,E){m=E?t:m;var N=Me(c,P,t,t,t,t,t,m);return N.placeholder=an.placeholder,N}function Dn(c,m,E){m=E?t:m;var N=Me(c,D,t,t,t,t,t,m);return N.placeholder=Dn.placeholder,N}function Zn(c,m,E){var N,G,K,ce,_e,Ee,et=0,tt=!1,ct=!1,Rt=!0;if(typeof c!="function")throw new Ti(l);m=Ki(m)||0,ri(E)&&(tt=!!E.leading,ct="maxWait"in E,K=ct?ei(Ki(E.maxWait)||0,m):K,Rt="trailing"in E?!!E.trailing:Rt);function Xt(yi){var Hl=N,Ic=G;return N=G=t,et=yi,ce=c.apply(Ic,Hl),ce}function pn(yi){return et=yi,_e=gf(Yn,m),tt?Xt(yi):ce}function Ln(yi){var Hl=yi-Ee,Ic=yi-et,Yv=m-Hl;return ct?Ii(Yv,K-Ic):Yv}function dn(yi){var Hl=yi-Ee,Ic=yi-et;return Ee===t||Hl>=m||Hl<0||ct&&Ic>=K}function Yn(){var yi=be();if(dn(yi))return er(yi);_e=gf(Yn,Ln(yi))}function er(yi){return _e=t,Rt&&N?Xt(yi):(N=G=t,ce)}function la(){_e!==t&&Iu(_e),et=0,N=Ee=G=_e=t}function to(){return _e===t?ce:er(be())}function Ds(){var yi=be(),Hl=dn(yi);if(N=arguments,G=this,Ee=yi,Hl){if(_e===t)return pn(Ee);if(ct)return Iu(_e),_e=gf(Yn,m),Xt(Ee)}return _e===t&&(_e=gf(Yn,m)),ce}return Ds.cancel=la,Ds.flush=to,Ds}var ir=fn(function(c,m){return Kh(c,1,m)}),Io=fn(function(c,m,E){return Kh(c,Ki(m)||0,E)});function xt(c){return Me(c,oe)}function dt(c,m){if(typeof c!="function"||m!=null&&typeof m!="function")throw new Ti(l);var E=function(){var N=arguments,G=m?m.apply(this,N):N[0],K=E.cache;if(K.has(G))return K.get(G);var ce=c.apply(this,N);return E.cache=K.set(G,ce)||K,ce};return E.cache=new(dt.Cache||Gs),E}dt.Cache=Gs;function Et(c){if(typeof c!="function")throw new Ti(l);return function(){var m=arguments;switch(m.length){case 0:return!c.call(this);case 1:return!c.call(this,m[0]);case 2:return!c.call(this,m[0],m[1]);case 3:return!c.call(this,m[0],m[1],m[2])}return!c.apply(this,m)}}function Sn(c){return Lt(2,c)}var lr=Ch(function(c,m){m=m.length==1&&kn(m[0])?hr(m[0],Wr(ln())):hr(Kr(m,1),Wr(ln()));var E=m.length;return fn(function(N){for(var G=-1,K=Ii(N.length,E);++G=m}),Yd=tr(function(){return arguments}())?tr:function(c){return di(c)&&qn.call(c,"callee")&&!gc.call(c,"callee")},kn=Be.isArray,Lv=Tu?Wr(Tu):Nr;function Hi(c){return c!=null&&Ah(c.length)&&!Mc(c)}function Jr(c){return di(c)&&Hi(c)}function ab(c){return c===!0||c===!1||di(c)&&_i(c)==nt}var ah=Id||wm,gT=xo?Wr(xo):ti;function bf(c){return di(c)&&c.nodeType===1&&!Hr(c)}function M_(c){if(c==null)return!0;if(Hi(c)&&(kn(c)||typeof c=="string"||typeof c.splice=="function"||ah(c)||Jd(c)||Yd(c)))return!c.length;var m=hs(c);if(m==rt||m==mt)return!c.size;if($c(c))return!ho(c).length;for(var E in c)if(qn.call(c,E))return!1;return!0}function Gi(c,m){return qr(c,m)}function Ro(c,m,E){E=typeof E=="function"?E:t;var N=E?E(c,m):t;return N===t?qr(c,m,t,E):!!N}function C0(c){if(!di(c))return!1;var m=_i(c);return m==ze||m==lt||typeof c.message=="string"&&typeof c.name=="string"&&!Hr(c)}function Nv(c){return typeof c=="number"&&Al(c)}function Mc(c){if(!ri(c))return!1;var m=_i(c);return m==Ce||m==He||m==Qe||m==Mt}function M0(c){return typeof c=="number"&&c==Mn(c)}function Ah(c){return typeof c=="number"&&c>-1&&c%1==0&&c<=J}function ri(c){var m=typeof c;return c!=null&&(m=="object"||m=="function")}function di(c){return c!=null&&typeof c=="object"}var td=Su?Wr(Su):us;function As(c,m){return c===m||ts(c,m,em(m))}function _m(c,m,E){return E=typeof E=="function"?E:t,ts(c,m,em(m),E)}function Dv(c){return Xd(c)&&c!=+c}function Pv(c){if(S_(c))throw new rn(o);return au(c)}function A0(c){return c===null}function SE(c){return c==null}function Xd(c){return typeof c=="number"||di(c)&&_i(c)==it}function Hr(c){if(!di(c)||_i(c)!=kt)return!1;var m=Ha(c);if(m===null)return!0;var E=qn.call(m,"constructor")&&m.constructor;return typeof E=="function"&&E instanceof E&&$u.call(E)==Ua}var Kd=sl?Wr(sl):qu;function qa(c){return M0(c)&&c>=-J&&c<=J}var A_=Bi?Wr(Bi):Tc;function vm(c){return typeof c=="string"||!kn(c)&&di(c)&&_i(c)==xe}function aa(c){return typeof c=="symbol"||di(c)&&_i(c)==se}var Jd=Ci?Wr(Ci):Qu;function _T(c){return c===t}function vT(c){return di(c)&&hs(c)==ht}function nd(c){return di(c)&&_i(c)==St}var lb=bn(ba),Zf=bn(function(c,m){return c<=m});function Bv(c){if(!c)return[];if(Hi(c))return vm(c)?Fr(c):ni(c);if(ea&&c[ea])return zh(c[ea]());var m=hs(c),E=m==rt?Vu:m==mt?eu:Tf;return E(c)}function Ac(c){if(!c)return c===0?c:0;if(c=Ki(c),c===we||c===-we){var m=c<0?-1:1;return m*re}return c===c?c:0}function Mn(c){var m=Ac(c),E=m%1;return m===m?E?m-E:m:0}function I0(c){return c?Wa(Mn(c),0,fe):0}function Ki(c){if(typeof c=="number")return c;if(aa(c))return ie;if(ri(c)){var m=typeof c.valueOf=="function"?c.valueOf():c;c=ri(m)?m+"":m}if(typeof c!="string")return c===0?c:+c;c=Fh(c);var E=si.test(c);return E||Yr.test(c)?Da(c.slice(2),E?2:8):$r.test(c)?ie:+c}function ub(c){return cs(c,rs(c))}function ut(c){return c?Wa(Mn(c),-J,J):c===0?c:0}function sr(c){return c==null?"":oi(c)}var I_=Sa(function(c,m){if($c(m)||Hi(m)){cs(m,wi(m),c);return}for(var E in m)qn.call(m,E)&&$o(c,E,m[E])}),R_=Sa(function(c,m){cs(m,rs(m),c)}),rd=Sa(function(c,m,E,N){cs(m,rs(m),c,N)}),ig=Sa(function(c,m,E,N){cs(m,wi(m),c,N)}),Fv=zn(Xh);function R0(c,m){var E=xs(c);return m==null?E:as(E,m)}var cb=fn(function(c,m){c=vn(c);var E=-1,N=m.length,G=N>2?m[2]:t;for(G&&Ur(m[0],m[1],G)&&(N=1);++E1),K}),cs(c,Mr(c),E),N&&(E=ki(E,y|b|w,Ht));for(var G=m.length;G--;)Qc(E,m[G]);return E});function k0(c,m){return N_(c,Et(ln(m)))}var en=zn(function(c,m){return c==null?{}:ec(c,m)});function N_(c,m){if(c==null)return{};var E=hr(Mr(c),function(N){return[N]});return m=ln(m),xh(c,E,function(N,G){return m(N,G[0])})}function wE(c,m,E){m=ia(m,c);var N=-1,G=m.length;for(G||(G=1,c=t);++Nm){var N=c;c=m,m=N}if(E||c%1||m%1){var G=Il();return Ii(c+G*(m-c+_h("1e-"+((G+"").length-1))),m)}return Os(c,m)}var mb=d(function(c,m,E){return m=m.toLowerCase(),c+(E?Sm(m):m)});function Sm(c){return P0(sr(c).toLowerCase())}function Uv(c){return c=sr(c),c&&c.replace(Oa,cf).replace(_s,"")}function gb(c,m,E){c=sr(c),m=oi(m);var N=c.length;E=E===t?N:Wa(Mn(E),0,N);var G=E;return E-=m.length,E>=0&&c.slice(E,G)==m}function _b(c){return c=sr(c),c&&Pr.test(c)?c.replace(On,hf):c}function vb(c){return c=sr(c),c&&zt.test(c)?c.replace(ot,"\\$&"):c}var B_=d(function(c,m,E){return c+(E?"-":"")+m.toLowerCase()}),CE=d(function(c,m,E){return c+(E?" ":"")+m.toLowerCase()}),CT=x("toLowerCase");function ME(c,m,E){c=sr(c),m=Mn(m);var N=m?is(c):0;if(!m||N>=m)return c;var G=(m-N)/2;return wt(nu(G),E)+c+wt(Yu(G),E)}function AE(c,m,E){c=sr(c),m=Mn(m);var N=m?is(c):0;return m&&N>>0,E?(c=sr(c),c&&(typeof m=="string"||m!=null&&!Kd(m))&&(m=oi(m),!m&&ol(c))?go(Fr(c),0,E):c.split(m,E)):[]}var F_=d(function(c,m,E){return c+(E?" ":"")+P0(m)});function AT(c,m,E){return c=sr(c),E=E==null?0:Wa(Mn(E),0,c.length),m=oi(m),c.slice(E,E+m.length)==m}function Sb(c,m,E){var N=X.templateSettings;E&&Ur(c,m,E)&&(m=t),c=sr(c),m=rd({},m,N,Ne);var G=rd({},m.imports,N.imports,Ne),K=wi(G),ce=Ai(G,K),_e,Ee,et=0,tt=m.interpolate||Eo,ct="__p += '",Rt=zr((m.escape||Eo).source+"|"+tt.source+"|"+(tt===mr?rr:Eo).source+"|"+(m.evaluate||Eo).source+"|$","g"),Xt="//# sourceURL="+(qn.call(m,"sourceURL")?(m.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++yu+"]")+` -`;c.replace(Rt,function(dn,Yn,er,la,to,Ds){return er||(er=la),ct+=c.slice(et,Ds).replace(Yl,pd),Yn&&(_e=!0,ct+=`' + +`)}function Dd(c){return On(c)||Yd(c)||!!(md&&c&&c[md])}function Ka(c,m){var E=typeof c;return m=m??J,!!m&&(E=="number"||E!="symbol"&&Ss.test(c))&&c>-1&&c%1==0&&c0){if(++m>=q)return arguments[0]}else m=0;return c.apply(t,arguments)}}function dr(c,m){var E=-1,N=c.length,G=N-1;for(m=m===t?N:m;++E1?c[m-1]:t;return E=typeof E=="function"?(c.pop(),E):t,Rp(c,E)});function Ou(c){var m=X(c);return m.__chain__=!0,m}function Og(c,m){return m(c),c}function jf(c,m){return m(c)}var ed=zn(function(c){var m=c.length,E=m?c[0]:0,N=this.__wrapped__,G=function(K){return Xh(K,c)};return m>1||this.__actions__.length||!(N instanceof mn)||!Ka(E)?this.thru(G):(N=N.slice(E,+E+(m?1:0)),N.__actions__.push({func:jf,args:[G],thisArg:t}),new Cr(N,this.__chain__).thru(function(K){return m&&!K.length&&K.push(t),K}))});function hm(){return Ou(this)}function Yf(){return new Cr(this.value(),this.__chain__)}function Xf(){this.__values__===t&&(this.__values__=Bv(this.value()));var c=this.__index__>=this.__values__.length,m=c?t:this.__values__[this.__index__++];return{done:c,value:m}}function kp(){return this}function bd(c){for(var m,E=this;E instanceof ga;){var N=Fd(E);N.__index__=0,N.__values__=t,m?G.__wrapped__=N:m=N;var G=N;E=E.__wrapped__}return G.__wrapped__=c,m}function yf(){var c=this.__wrapped__;if(c instanceof mn){var m=c;return this.__actions__.length&&(m=new mn(this)),m=m.reverse(),m.__actions__.push({func:jf,args:[$a],thisArg:t}),new Cr(m,this.__chain__)}return this.thru($a)}function eg(){return Zc(this.__wrapped__,this.__actions__)}var kv=Ta(function(c,m,E){qn.call(c,E)?++c[E]:zo(c,E,1)});function Lg(c,m,E){var N=On(c)?wu:Cu;return E&&Ur(c,m,E)&&(m=t),N(c,ln(m,3))}function Vd(c,m){var E=On(c)?Vi:yc;return E(c,ln(m,3))}var Li=I(zd),dm=I(Ud);function tg(c,m){return Kr(Si(c,m),1)}function Ng(c,m){return Kr(Si(c,m),we)}function Ov(c,m,E){return E=E===t?1:An(E),Kr(Si(c,m),E)}function ng(c,m){var E=On(c)?Xr:Co;return E(c,ln(m,3))}function Op(c,m){var E=On(c)?dd:df;return E(c,ln(m,3))}var rg=Ta(function(c,m,E){qn.call(c,E)?c[E].push(m):zo(c,E,[m])});function Kf(c,m,E,N){c=Hi(c)?c:Tf(c),E=E&&!N?An(E):0;var G=c.length;return E<0&&(E=ei(G+E,0)),vm(c)?E<=G&&c.indexOf(m,E)>-1:!!G&&ks(c,m,E)>-1}var Jf=fn(function(c,m,E){var N=-1,G=typeof m=="function",K=Hi(c)?Be(c.length):[];return Co(c,function(ce){K[++N]=G?Vn(m,ce,E):Pn(ce,m,E)}),K}),fm=Ta(function(c,m,E){zo(c,E,m)});function Si(c,m){var E=On(c)?hr:Mu;return E(c,ln(m,3))}function qf(c,m,E,N){return c==null?[]:(On(m)||(m=m==null?[]:[m]),E=N?t:E,On(E)||(E=E==null?[]:[E]),Zu(c,m,E))}var pm=Ta(function(c,m,E){c[E?0:1].push(m)},function(){return[[],[]]});function mm(c,m,E){var N=On(c)?fd:oo,G=arguments.length<3;return N(c,ln(m,4),E,G,Co)}function Lp(c,m,E){var N=On(c)?lf:oo,G=arguments.length<3;return N(c,ln(m,4),E,G,df)}function Dg(c,m){var E=On(c)?Vi:yc;return E(c,Et(ln(m,3)))}function v(c){var m=On(c)?hl:Jc;return m(c)}function T(c,m,E){(E?Ur(c,m,E):m===t)?m=1:m=An(m);var N=On(c)?vc:wn;return N(c,m)}function R(c){var m=On(c)?wp:Nl;return m(c)}function F(c){if(c==null)return 0;if(Hi(c))return vm(c)?is(c):c.length;var m=hs(c);return m==it||m==gt?c.size:ho(c).length}function Y(c,m,E){var N=On(c)?Bc:pl;return E&&Ur(c,m,E)&&(m=t),N(c,ln(m,3))}var ee=fn(function(c,m){if(c==null)return[];var E=m.length;return E>1&&Ur(c,m[0],m[1])?m=[]:E>2&&Ur(m[0],m[1],m[2])&&(m=[m[0]]),Zu(c,Kr(m,1),[])}),be=zi||function(){return wr.Date.now()};function Xe(c,m){if(typeof m!="function")throw new Ti(l);return c=An(c),function(){if(--c<1)return m.apply(this,arguments)}}function lt(c,m,E){return m=E?t:m,m=c&&m==null?c.length:m,Ce(c,V,t,t,t,t,m)}function Lt(c,m){var E;if(typeof m!="function")throw new Ti(l);return c=An(c),function(){return--c>0&&(E=m.apply(this,arguments)),c<=1&&(m=t),E}}var en=fn(function(c,m,E){var N=A;if(E.length){var G=Us(E,Mh(en));N|=z}return Ce(c,N,m,E,G)}),hn=fn(function(c,m,E){var N=A|k;if(E.length){var G=Us(E,Mh(hn));N|=z}return Ce(m,N,c,E,G)});function an(c,m,E){m=E?t:m;var N=Ce(c,P,t,t,t,t,t,m);return N.placeholder=an.placeholder,N}function Dn(c,m,E){m=E?t:m;var N=Ce(c,D,t,t,t,t,t,m);return N.placeholder=Dn.placeholder,N}function Zn(c,m,E){var N,G,K,ce,_e,Ee,tt=0,nt=!1,ht=!1,Rt=!0;if(typeof c!="function")throw new Ti(l);m=Ki(m)||0,ri(E)&&(nt=!!E.leading,ht="maxWait"in E,K=ht?ei(Ki(E.maxWait)||0,m):K,Rt="trailing"in E?!!E.trailing:Rt);function Kt(yi){var Hl=N,Ic=G;return N=G=t,tt=yi,ce=c.apply(Ic,Hl),ce}function pn(yi){return tt=yi,_e=gf(Yn,m),nt?Kt(yi):ce}function Ln(yi){var Hl=yi-Ee,Ic=yi-tt,Yv=m-Hl;return ht?Ii(Yv,K-Ic):Yv}function dn(yi){var Hl=yi-Ee,Ic=yi-tt;return Ee===t||Hl>=m||Hl<0||ht&&Ic>=K}function Yn(){var yi=be();if(dn(yi))return er(yi);_e=gf(Yn,Ln(yi))}function er(yi){return _e=t,Rt&&N?Kt(yi):(N=G=t,ce)}function la(){_e!==t&&Iu(_e),tt=0,N=Ee=G=_e=t}function to(){return _e===t?ce:er(be())}function Ds(){var yi=be(),Hl=dn(yi);if(N=arguments,G=this,Ee=yi,Hl){if(_e===t)return pn(Ee);if(ht)return Iu(_e),_e=gf(Yn,m),Kt(Ee)}return _e===t&&(_e=gf(Yn,m)),ce}return Ds.cancel=la,Ds.flush=to,Ds}var ir=fn(function(c,m){return Kh(c,1,m)}),Io=fn(function(c,m,E){return Kh(c,Ki(m)||0,E)});function xt(c){return Ce(c,oe)}function dt(c,m){if(typeof c!="function"||m!=null&&typeof m!="function")throw new Ti(l);var E=function(){var N=arguments,G=m?m.apply(this,N):N[0],K=E.cache;if(K.has(G))return K.get(G);var ce=c.apply(this,N);return E.cache=K.set(G,ce)||K,ce};return E.cache=new(dt.Cache||Gs),E}dt.Cache=Gs;function Et(c){if(typeof c!="function")throw new Ti(l);return function(){var m=arguments;switch(m.length){case 0:return!c.call(this);case 1:return!c.call(this,m[0]);case 2:return!c.call(this,m[0],m[1]);case 3:return!c.call(this,m[0],m[1],m[2])}return!c.apply(this,m)}}function Sn(c){return Lt(2,c)}var lr=Ch(function(c,m){m=m.length==1&&On(m[0])?hr(m[0],Wr(ln())):hr(Kr(m,1),Wr(ln()));var E=m.length;return fn(function(N){for(var G=-1,K=Ii(N.length,E);++G=m}),Yd=tr(function(){return arguments}())?tr:function(c){return di(c)&&qn.call(c,"callee")&&!gc.call(c,"callee")},On=Be.isArray,Lv=Tu?Wr(Tu):Nr;function Hi(c){return c!=null&&Ah(c.length)&&!Mc(c)}function Jr(c){return di(c)&&Hi(c)}function ab(c){return c===!0||c===!1||di(c)&&_i(c)==rt}var ah=Id||wm,_T=xo?Wr(xo):ti;function bf(c){return di(c)&&c.nodeType===1&&!Hr(c)}function M_(c){if(c==null)return!0;if(Hi(c)&&(On(c)||typeof c=="string"||typeof c.splice=="function"||ah(c)||Jd(c)||Yd(c)))return!c.length;var m=hs(c);if(m==it||m==gt)return!c.size;if($c(c))return!ho(c).length;for(var E in c)if(qn.call(c,E))return!1;return!0}function Gi(c,m){return qr(c,m)}function Ro(c,m,E){E=typeof E=="function"?E:t;var N=E?E(c,m):t;return N===t?qr(c,m,t,E):!!N}function C0(c){if(!di(c))return!1;var m=_i(c);return m==ze||m==ut||typeof c.message=="string"&&typeof c.name=="string"&&!Hr(c)}function Nv(c){return typeof c=="number"&&Al(c)}function Mc(c){if(!ri(c))return!1;var m=_i(c);return m==$e||m==He||m==Ze||m==Ct}function M0(c){return typeof c=="number"&&c==An(c)}function Ah(c){return typeof c=="number"&&c>-1&&c%1==0&&c<=J}function ri(c){var m=typeof c;return c!=null&&(m=="object"||m=="function")}function di(c){return c!=null&&typeof c=="object"}var td=Su?Wr(Su):us;function As(c,m){return c===m||ts(c,m,em(m))}function _m(c,m,E){return E=typeof E=="function"?E:t,ts(c,m,em(m),E)}function Dv(c){return Xd(c)&&c!=+c}function Pv(c){if(S_(c))throw new rn(o);return au(c)}function A0(c){return c===null}function SE(c){return c==null}function Xd(c){return typeof c=="number"||di(c)&&_i(c)==st}function Hr(c){if(!di(c)||_i(c)!=kt)return!1;var m=Ha(c);if(m===null)return!0;var E=qn.call(m,"constructor")&&m.constructor;return typeof E=="function"&&E instanceof E&&$u.call(E)==Ua}var Kd=sl?Wr(sl):qu;function qa(c){return M0(c)&&c>=-J&&c<=J}var A_=Bi?Wr(Bi):Tc;function vm(c){return typeof c=="string"||!On(c)&&di(c)&&_i(c)==xe}function aa(c){return typeof c=="symbol"||di(c)&&_i(c)==ie}var Jd=Ci?Wr(Ci):Qu;function vT(c){return c===t}function yT(c){return di(c)&&hs(c)==Ye}function nd(c){return di(c)&&_i(c)==St}var lb=bn(ba),Zf=bn(function(c,m){return c<=m});function Bv(c){if(!c)return[];if(Hi(c))return vm(c)?Fr(c):ni(c);if(ea&&c[ea])return zh(c[ea]());var m=hs(c),E=m==it?Vu:m==gt?eu:Tf;return E(c)}function Ac(c){if(!c)return c===0?c:0;if(c=Ki(c),c===we||c===-we){var m=c<0?-1:1;return m*re}return c===c?c:0}function An(c){var m=Ac(c),E=m%1;return m===m?E?m-E:m:0}function I0(c){return c?Wa(An(c),0,fe):0}function Ki(c){if(typeof c=="number")return c;if(aa(c))return se;if(ri(c)){var m=typeof c.valueOf=="function"?c.valueOf():c;c=ri(m)?m+"":m}if(typeof c!="string")return c===0?c:+c;c=Fh(c);var E=si.test(c);return E||Yr.test(c)?Da(c.slice(2),E?2:8):$r.test(c)?se:+c}function ub(c){return cs(c,rs(c))}function ct(c){return c?Wa(An(c),-J,J):c===0?c:0}function sr(c){return c==null?"":oi(c)}var I_=Sa(function(c,m){if($c(m)||Hi(m)){cs(m,wi(m),c);return}for(var E in m)qn.call(m,E)&&$o(c,E,m[E])}),R_=Sa(function(c,m){cs(m,rs(m),c)}),rd=Sa(function(c,m,E,N){cs(m,rs(m),c,N)}),ig=Sa(function(c,m,E,N){cs(m,wi(m),c,N)}),Fv=zn(Xh);function R0(c,m){var E=xs(c);return m==null?E:as(E,m)}var cb=fn(function(c,m){c=vn(c);var E=-1,N=m.length,G=N>2?m[2]:t;for(G&&Ur(m[0],m[1],G)&&(N=1);++E1),K}),cs(c,Mr(c),E),N&&(E=ki(E,y|b|w,Ht));for(var G=m.length;G--;)Qc(E,m[G]);return E});function k0(c,m){return N_(c,Et(ln(m)))}var tn=zn(function(c,m){return c==null?{}:ec(c,m)});function N_(c,m){if(c==null)return{};var E=hr(Mr(c),function(N){return[N]});return m=ln(m),xh(c,E,function(N,G){return m(N,G[0])})}function wE(c,m,E){m=ia(m,c);var N=-1,G=m.length;for(G||(G=1,c=t);++Nm){var N=c;c=m,m=N}if(E||c%1||m%1){var G=Il();return Ii(c+G*(m-c+_h("1e-"+((G+"").length-1))),m)}return Os(c,m)}var mb=d(function(c,m,E){return m=m.toLowerCase(),c+(E?Sm(m):m)});function Sm(c){return P0(sr(c).toLowerCase())}function Uv(c){return c=sr(c),c&&c.replace(Oa,cf).replace(_s,"")}function gb(c,m,E){c=sr(c),m=oi(m);var N=c.length;E=E===t?N:Wa(An(E),0,N);var G=E;return E-=m.length,E>=0&&c.slice(E,G)==m}function _b(c){return c=sr(c),c&&Pr.test(c)?c.replace(xn,hf):c}function vb(c){return c=sr(c),c&&zt.test(c)?c.replace(at,"\\$&"):c}var B_=d(function(c,m,E){return c+(E?"-":"")+m.toLowerCase()}),CE=d(function(c,m,E){return c+(E?" ":"")+m.toLowerCase()}),MT=x("toLowerCase");function ME(c,m,E){c=sr(c),m=An(m);var N=m?is(c):0;if(!m||N>=m)return c;var G=(m-N)/2;return wt(nu(G),E)+c+wt(Yu(G),E)}function AE(c,m,E){c=sr(c),m=An(m);var N=m?is(c):0;return m&&N>>0,E?(c=sr(c),c&&(typeof m=="string"||m!=null&&!Kd(m))&&(m=oi(m),!m&&ol(c))?go(Fr(c),0,E):c.split(m,E)):[]}var F_=d(function(c,m,E){return c+(E?" ":"")+P0(m)});function IT(c,m,E){return c=sr(c),E=E==null?0:Wa(An(E),0,c.length),m=oi(m),c.slice(E,E+m.length)==m}function Sb(c,m,E){var N=X.templateSettings;E&&Ur(c,m,E)&&(m=t),c=sr(c),m=rd({},m,N,Le);var G=rd({},m.imports,N.imports,Le),K=wi(G),ce=Ai(G,K),_e,Ee,tt=0,nt=m.interpolate||Eo,ht="__p += '",Rt=zr((m.escape||Eo).source+"|"+nt.source+"|"+(nt===mr?rr:Eo).source+"|"+(m.evaluate||Eo).source+"|$","g"),Kt="//# sourceURL="+(qn.call(m,"sourceURL")?(m.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++yu+"]")+` +`;c.replace(Rt,function(dn,Yn,er,la,to,Ds){return er||(er=la),ht+=c.slice(tt,Ds).replace(Yl,pd),Yn&&(_e=!0,ht+=`' + __e(`+Yn+`) + -'`),to&&(Ee=!0,ct+=`'; +'`),to&&(Ee=!0,ht+=`'; `+to+`; -__p += '`),er&&(ct+=`' + +__p += '`),er&&(ht+=`' + ((__t = (`+er+`)) == null ? '' : __t) + -'`),et=Ds+dn.length,dn}),ct+=`'; -`;var pn=qn.call(m,"variable")&&m.variable;if(!pn)ct=`with (obj) { -`+ct+` +'`),tt=Ds+dn.length,dn}),ht+=`'; +`;var pn=qn.call(m,"variable")&&m.variable;if(!pn)ht=`with (obj) { +`+ht+` } -`;else if(Vt.test(pn))throw new rn(u);ct=(Ee?ct.replace(tn,""):ct).replace(_t,"$1").replace(Jt,"$1;"),ct="function("+(pn||"obj")+`) { +`;else if(Wt.test(pn))throw new rn(u);ht=(Ee?ht.replace(qt,""):ht).replace(pt,"$1").replace(Jt,"$1;"),ht="function("+(pn||"obj")+`) { `+(pn?"":`obj || (obj = {}); `)+"var __t, __p = ''"+(_e?", __e = _.escape":"")+(Ee?`, __j = Array.prototype.join; function print() { __p += __j.call(arguments, '') } `:`; -`)+ct+`return __p -}`;var Ln=B0(function(){return In(K,Xt+"return "+ct).apply(t,ce)});if(Ln.source=ct,C0(Ln))throw Ln;return Ln}function sd(c){return sr(c).toLowerCase()}function Dp(c){return sr(c).toUpperCase()}function IT(c,m,E){if(c=sr(c),c&&(E||m===t))return Fh(c);if(!c||!(m=oi(m)))return c;var N=Fr(c),G=Fr(m),K=ji(N,G),ce=fa(N,G)+1;return go(N,K,ce).join("")}function Hv(c,m,E){if(c=sr(c),c&&(E||m===t))return c.slice(0,Cl(c)+1);if(!c||!(m=oi(m)))return c;var N=Fr(c),G=fa(N,Fr(m))+1;return go(N,0,G).join("")}function RT(c,m,E){if(c=sr(c),c&&(E||m===t))return c.replace(sn,"");if(!c||!(m=oi(m)))return c;var N=Fr(c),G=ji(N,Fr(m));return go(N,G).join("")}function N0(c,m){var E=le,N=Z;if(ri(m)){var G="separator"in m?m.separator:G;E="length"in m?Mn(m.length):E,N="omission"in m?oi(m.omission):N}c=sr(c);var K=c.length;if(ol(c)){var ce=Fr(c);K=ce.length}if(E>=K)return c;var _e=E-is(N);if(_e<1)return N;var Ee=ce?go(ce,0,_e).join(""):c.slice(0,_e);if(G===t)return Ee+N;if(ce&&(_e+=Ee.length-_e),Kd(G)){if(c.slice(_e).search(G)){var et,tt=Ee;for(G.global||(G=zr(G.source,sr(_r.exec(G))+"g")),G.lastIndex=0;et=G.exec(tt);)var ct=et.index;Ee=Ee.slice(0,ct===t?_e:ct)}}else if(c.indexOf(oi(G),_e)!=_e){var Rt=Ee.lastIndexOf(G);Rt>-1&&(Ee=Ee.slice(0,Rt))}return Ee+N}function Gv(c){return c=sr(c),c&&ii.test(c)?c.replace(Kt,za):c}var D0=d(function(c,m,E){return c+(E?" ":"")+m.toUpperCase()}),P0=x("toUpperCase");function wb(c,m,E){return c=sr(c),m=E?t:m,m===t?Fc(c)?bh(c):Tp(c):c.match(m)||[]}var B0=fn(function(c,m){try{return Vn(c,t,m)}catch(E){return C0(E)?E:new rn(E)}}),Eb=zn(function(c,m){return Xr(m,function(E){E=yo(E),zo(c,E,Zt(c[E],c))}),c});function xb(c){var m=c==null?0:c.length,E=ln();return c=m?hr(c,function(N){if(typeof N[1]!="function")throw new Ti(l);return[E(N[0]),N[1]]}):[],fn(function(N){for(var G=-1;++GJ)return[];var E=fe,N=Ii(c,fe);m=ln(m),c-=fe;for(var G=ql(N,m);++E0||m<0)?new mn(E):(c<0?E=E.takeRight(-c):c&&(E=E.drop(c)),m!==t&&(m=Mn(m),E=m<0?E.dropRight(-m):E.take(m-c)),E)},mn.prototype.takeRightWhile=function(c){return this.reverse().takeWhile(c).reverse()},mn.prototype.toArray=function(){return this.take(fe)},ls(mn.prototype,function(c,m){var E=/^(?:filter|find|map|reject)|While$/.test(m),N=/^(?:head|last)$/.test(m),G=X[N?"take"+(m=="last"?"Right":""):m],K=N||/^find/.test(m);!G||(X.prototype[m]=function(){var ce=this.__wrapped__,_e=N?[1]:arguments,Ee=ce instanceof mn,et=_e[0],tt=Ee||kn(ce),ct=function(Yn){var er=G.apply(X,Qo([Yn],_e));return N&&Rt?er[0]:er};tt&&E&&typeof et=="function"&&et.length!=1&&(Ee=tt=!1);var Rt=this.__chain__,Xt=!!this.__actions__.length,pn=K&&!Rt,Ln=Ee&&!Xt;if(!K&&tt){ce=Ln?ce:new mn(this);var dn=c.apply(ce,_e);return dn.__actions__.push({func:jf,args:[ct],thisArg:t}),new Cr(dn,Rt)}return pn&&Ln?c.apply(this,_e):(dn=this.thru(ct),pn?N?dn.value()[0]:dn.value():dn)})}),Xr(["pop","push","shift","sort","splice","unshift"],function(c){var m=lo[c],E=/^(?:push|sort|unshift)$/.test(c)?"tap":"thru",N=/^(?:pop|shift)$/.test(c);X.prototype[c]=function(){var G=arguments;if(N&&!this.__chain__){var K=this.value();return m.apply(kn(K)?K:[],G)}return this[E](function(ce){return m.apply(kn(ce)?ce:[],G)})}}),ls(mn.prototype,function(c,m){var E=X[m];if(E){var N=E.name+"";qn.call(kl,N)||(kl[N]=[]),kl[N].push({name:m,func:E})}}),kl[W(t,k).name]=[{name:"wrapper",func:t}],mn.prototype.clone=zf,mn.prototype.reverse=cl,mn.prototype.value=Ri,X.prototype.at=ed,X.prototype.chain=hm,X.prototype.commit=Yf,X.prototype.next=Xf,X.prototype.plant=bd,X.prototype.reverse=yf,X.prototype.toJSON=X.prototype.valueOf=X.prototype.value=eg,X.prototype.first=X.prototype.head,ea&&(X.prototype[ea]=kp),X},pi=Ad();bi?((bi.exports=pi)._=pi,Rs._=pi):wr._=pi}).call(uv)})(pg,pg.exports);const NRe=pg.exports,DRe=(n,e)=>({clock:new ORe,items:{},tfs:{},hulls:{},lines:{},texts:{},points:{},widgets:{},onMove:(t,r,s,o)=>n(l=>{console.log(o),l[r][t].position={...o.position},l[r][t].rotation=o.quaternion,l[r][t].rotation.x=o.quaternion.x,l[r][t].rotation.y=o.quaternion.y,l[r][t].rotation.z=o.quaternion.z,l[r][t].rotation.w=o.quaternion.w,l[r][t].scale={...o.scale}}),onClick:(t,r,s,o)=>{r||console.log(`id: ${t} clicked!`,s),e().items[t]&&!r&&o.stopPropagation()},onPointerOver:(t,r,s)=>{},onPointerOut:(t,r,s)=>{},pause:()=>n(t=>{t.clock.setTimescale(0)}),play:t=>n(r=>{r.clock.setTimescale(t||1)}),reset:t=>n(r=>{console.log(`setting time to ${t}`),r.clock._elapsed=t?t*1e3:0}),clearItems:()=>n(t=>({items:{}})),clearLines:()=>n(t=>({lines:{}})),clearTfs:()=>n(t=>({tfs:{}})),clearHulls:()=>n(t=>({hulls:{}})),clearTexts:()=>n(t=>({texts:{}})),clearPoints:()=>n(t=>({points:{}})),setItems:t=>n(r=>({items:t})),setLines:t=>n(r=>({lines:t})),setTfs:t=>n(r=>({tfs:t})),setHulls:t=>n(r=>({hulls:t})),setTexts:t=>n(r=>({texts:t})),setPoints:t=>n(r=>({points:t})),removeItem:t=>n(r=>{delete r.items[t]}),removeLine:t=>n(r=>{delete r.lines[t]}),removeTf:t=>n(r=>{delete r.tfs[t]}),removeHull:t=>n(r=>{delete r.hulls[t]}),removeText:t=>n(r=>{delete r.texts[t]}),removePoint:t=>n(r=>{delete r.points[t]}),setItem:(t,r)=>n(s=>{s.items[t]=r}),setLine:(t,r)=>n(s=>{s.lines[t]=r}),setTf:(t,r)=>n(s=>{s.tfs[t]=r}),setHull:(t,r)=>n(s=>{s.hulls[t]=r}),setText:(t,r)=>n(s=>{s.texts[t]=r}),setPoint:(t,r)=>n(s=>{s.points[t]=r}),setProperty:(t,r)=>n(s=>{NRe.set(s,t,r)})}),PRe=kRe(vRe(DRe)),BRe=gRe(PRe),dee=pe.createContext(),No=(n,e)=>{const t=pe.useContext(dee);return uee(t,n,e)},FRe=({store:n,children:e,debug:t=!1})=>(t&&console.log("SceneProvider regenerated"),un(dee.Provider,{value:n||BRe,children:e})),zRe=yt.forwardRef((n,e)=>un("ambientLight",{ref:e,...n}));yt.forwardRef((n,e)=>un("pointLight",{ref:e,...n}));const URe=yt.forwardRef((n,e)=>un("directionalLight",{ref:e,...n})),d_=(n,e,t,r)=>{var s=new Fn;return s.setRGB(n/255,e/255,t/255),r<=.99?new J$({color:s.getHex(),opacity:r+.1,transparent:!0,depthWrite:!0,blendSrc:t2,blendDst:n2,blendEquation:VF,blending:mv}):new J$({color:s.getHex(),opacity:r,blending:mv})},CI=pg.exports.memoize(n=>{var e=new Fn(n),t=` +`)+ht+`return __p +}`;var Ln=B0(function(){return Rn(K,Kt+"return "+ht).apply(t,ce)});if(Ln.source=ht,C0(Ln))throw Ln;return Ln}function sd(c){return sr(c).toLowerCase()}function Dp(c){return sr(c).toUpperCase()}function RT(c,m,E){if(c=sr(c),c&&(E||m===t))return Fh(c);if(!c||!(m=oi(m)))return c;var N=Fr(c),G=Fr(m),K=ji(N,G),ce=fa(N,G)+1;return go(N,K,ce).join("")}function Hv(c,m,E){if(c=sr(c),c&&(E||m===t))return c.slice(0,Cl(c)+1);if(!c||!(m=oi(m)))return c;var N=Fr(c),G=fa(N,Fr(m))+1;return go(N,0,G).join("")}function kT(c,m,E){if(c=sr(c),c&&(E||m===t))return c.replace(sn,"");if(!c||!(m=oi(m)))return c;var N=Fr(c),G=ji(N,Fr(m));return go(N,G).join("")}function N0(c,m){var E=le,N=Z;if(ri(m)){var G="separator"in m?m.separator:G;E="length"in m?An(m.length):E,N="omission"in m?oi(m.omission):N}c=sr(c);var K=c.length;if(ol(c)){var ce=Fr(c);K=ce.length}if(E>=K)return c;var _e=E-is(N);if(_e<1)return N;var Ee=ce?go(ce,0,_e).join(""):c.slice(0,_e);if(G===t)return Ee+N;if(ce&&(_e+=Ee.length-_e),Kd(G)){if(c.slice(_e).search(G)){var tt,nt=Ee;for(G.global||(G=zr(G.source,sr(_r.exec(G))+"g")),G.lastIndex=0;tt=G.exec(nt);)var ht=tt.index;Ee=Ee.slice(0,ht===t?_e:ht)}}else if(c.indexOf(oi(G),_e)!=_e){var Rt=Ee.lastIndexOf(G);Rt>-1&&(Ee=Ee.slice(0,Rt))}return Ee+N}function Gv(c){return c=sr(c),c&&ii.test(c)?c.replace(Xt,za):c}var D0=d(function(c,m,E){return c+(E?" ":"")+m.toUpperCase()}),P0=x("toUpperCase");function wb(c,m,E){return c=sr(c),m=E?t:m,m===t?Fc(c)?bh(c):Tp(c):c.match(m)||[]}var B0=fn(function(c,m){try{return Vn(c,t,m)}catch(E){return C0(E)?E:new rn(E)}}),Eb=zn(function(c,m){return Xr(m,function(E){E=yo(E),zo(c,E,en(c[E],c))}),c});function xb(c){var m=c==null?0:c.length,E=ln();return c=m?hr(c,function(N){if(typeof N[1]!="function")throw new Ti(l);return[E(N[0]),N[1]]}):[],fn(function(N){for(var G=-1;++GJ)return[];var E=fe,N=Ii(c,fe);m=ln(m),c-=fe;for(var G=ql(N,m);++E0||m<0)?new mn(E):(c<0?E=E.takeRight(-c):c&&(E=E.drop(c)),m!==t&&(m=An(m),E=m<0?E.dropRight(-m):E.take(m-c)),E)},mn.prototype.takeRightWhile=function(c){return this.reverse().takeWhile(c).reverse()},mn.prototype.toArray=function(){return this.take(fe)},ls(mn.prototype,function(c,m){var E=/^(?:filter|find|map|reject)|While$/.test(m),N=/^(?:head|last)$/.test(m),G=X[N?"take"+(m=="last"?"Right":""):m],K=N||/^find/.test(m);!G||(X.prototype[m]=function(){var ce=this.__wrapped__,_e=N?[1]:arguments,Ee=ce instanceof mn,tt=_e[0],nt=Ee||On(ce),ht=function(Yn){var er=G.apply(X,Qo([Yn],_e));return N&&Rt?er[0]:er};nt&&E&&typeof tt=="function"&&tt.length!=1&&(Ee=nt=!1);var Rt=this.__chain__,Kt=!!this.__actions__.length,pn=K&&!Rt,Ln=Ee&&!Kt;if(!K&&nt){ce=Ln?ce:new mn(this);var dn=c.apply(ce,_e);return dn.__actions__.push({func:jf,args:[ht],thisArg:t}),new Cr(dn,Rt)}return pn&&Ln?c.apply(this,_e):(dn=this.thru(ht),pn?N?dn.value()[0]:dn.value():dn)})}),Xr(["pop","push","shift","sort","splice","unshift"],function(c){var m=lo[c],E=/^(?:push|sort|unshift)$/.test(c)?"tap":"thru",N=/^(?:pop|shift)$/.test(c);X.prototype[c]=function(){var G=arguments;if(N&&!this.__chain__){var K=this.value();return m.apply(On(K)?K:[],G)}return this[E](function(ce){return m.apply(On(ce)?ce:[],G)})}}),ls(mn.prototype,function(c,m){var E=X[m];if(E){var N=E.name+"";qn.call(kl,N)||(kl[N]=[]),kl[N].push({name:m,func:E})}}),kl[W(t,k).name]=[{name:"wrapper",func:t}],mn.prototype.clone=zf,mn.prototype.reverse=cl,mn.prototype.value=Ri,X.prototype.at=ed,X.prototype.chain=hm,X.prototype.commit=Yf,X.prototype.next=Xf,X.prototype.plant=bd,X.prototype.reverse=yf,X.prototype.toJSON=X.prototype.valueOf=X.prototype.value=eg,X.prototype.first=X.prototype.head,ea&&(X.prototype[ea]=kp),X},pi=Ad();bi?((bi.exports=pi)._=pi,Rs._=pi):wr._=pi}).call(uv)})(pg,pg.exports);const NRe=pg.exports,DRe=(n,e)=>({clock:new ORe,items:{},tfs:{},hulls:{},lines:{},texts:{},points:{},widgets:{},onMove:(t,r,s,o)=>n(l=>{console.log(o),l[r][t].position={...o.position},l[r][t].rotation=o.quaternion,l[r][t].rotation.x=o.quaternion.x,l[r][t].rotation.y=o.quaternion.y,l[r][t].rotation.z=o.quaternion.z,l[r][t].rotation.w=o.quaternion.w,l[r][t].scale={...o.scale}}),onClick:(t,r,s,o)=>{r||console.log(`id: ${t} clicked!`,s),e().items[t]&&!r&&o.stopPropagation()},onPointerOver:(t,r,s)=>{},onPointerOut:(t,r,s)=>{},pause:()=>n(t=>{t.clock.setTimescale(0)}),play:t=>n(r=>{r.clock.setTimescale(t||1)}),reset:t=>n(r=>{console.log(`setting time to ${t}`),r.clock._elapsed=t?t*1e3:0}),clearItems:()=>n(t=>({items:{}})),clearLines:()=>n(t=>({lines:{}})),clearTfs:()=>n(t=>({tfs:{}})),clearHulls:()=>n(t=>({hulls:{}})),clearTexts:()=>n(t=>({texts:{}})),clearPoints:()=>n(t=>({points:{}})),setItems:t=>n(r=>({items:t})),setLines:t=>n(r=>({lines:t})),setTfs:t=>n(r=>({tfs:t})),setHulls:t=>n(r=>({hulls:t})),setTexts:t=>n(r=>({texts:t})),setPoints:t=>n(r=>({points:t})),removeItem:t=>n(r=>{delete r.items[t]}),removeLine:t=>n(r=>{delete r.lines[t]}),removeTf:t=>n(r=>{delete r.tfs[t]}),removeHull:t=>n(r=>{delete r.hulls[t]}),removeText:t=>n(r=>{delete r.texts[t]}),removePoint:t=>n(r=>{delete r.points[t]}),setItem:(t,r)=>n(s=>{s.items[t]=r}),setLine:(t,r)=>n(s=>{s.lines[t]=r}),setTf:(t,r)=>n(s=>{s.tfs[t]=r}),setHull:(t,r)=>n(s=>{s.hulls[t]=r}),setText:(t,r)=>n(s=>{s.texts[t]=r}),setPoint:(t,r)=>n(s=>{s.points[t]=r}),setProperty:(t,r)=>n(s=>{NRe.set(s,t,r)})}),PRe=kRe(vRe(DRe)),BRe=gRe(PRe),fee=me.createContext(),No=(n,e)=>{const t=me.useContext(fee);return cee(t,n,e)},FRe=({store:n,children:e,debug:t=!1})=>(t&&console.log("SceneProvider regenerated"),un(fee.Provider,{value:n||BRe,children:e})),zRe=yt.forwardRef((n,e)=>un("ambientLight",{ref:e,...n}));yt.forwardRef((n,e)=>un("pointLight",{ref:e,...n}));const URe=yt.forwardRef((n,e)=>un("directionalLight",{ref:e,...n})),d_=(n,e,t,r)=>{var s=new Fn;return s.setRGB(n/255,e/255,t/255),r<=.99?new J$({color:s.getHex(),opacity:r+.1,transparent:!0,depthWrite:!0,blendSrc:t2,blendDst:n2,blendEquation:VF,blending:mv}):new J$({color:s.getHex(),opacity:r,blending:mv})},CI=pg.exports.memoize(n=>{var e=new Fn(n),t=` varying vec3 vVertexWorldPosition; varying vec3 vVertexNormal; @@ -5661,12 +5661,12 @@ function print() { __p += __j.call(arguments, '') } viewCameraToVertex = normalize(viewCameraToVertex); float intensity = pow(coeficient + dot(vVertexNormal, viewCameraToVertex), power); gl_FragColor = vec4(glowColor, intensity); - }`,s=new xd({uniforms:{coeficient:{type:"f",value:1.2},power:{type:"f",value:4},glowColor:{type:"c",value:e}},vertexShader:t,fragmentShader:r,blending:_R,transparent:!0,depthWrite:!1,depthTest:!1});return s});function HRe(n){var e=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;n=n.replace(e,function(r,s,o,l){return s+s+o+o+l+l});var t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(n);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null}const t1=new w4,Hp=new Ae,dy=new Ae,Du=new Sl,n9={X:new Ae(1,0,0),Y:new Ae(0,1,0),Z:new Ae(0,0,1)},_N={type:"change"},r9={type:"mouseDown"},i9={type:"mouseUp",mode:null},s9={type:"objectChange"};class GRe extends ro{constructor(e,t){super(),t===void 0&&(console.warn('THREE.TransformControls: The second parameter "domElement" is now mandatory.'),t=document),this.isTransformControls=!0,this.visible=!1,this.domElement=t,this.domElement.style.touchAction="none";const r=new KRe;this._gizmo=r,this.add(r);const s=new JRe;this._plane=s,this.add(s);const o=this;function l(L,P){let D=P;Object.defineProperty(o,L,{get:function(){return D!==void 0?D:P},set:function(z){D!==z&&(D=z,s[L]=z,r[L]=z,o.dispatchEvent({type:L+"-changed",value:z}),o.dispatchEvent(_N))}}),o[L]=P,s[L]=P,r[L]=P}l("camera",e),l("object",void 0),l("enabled",!0),l("axis",null),l("mode","translate"),l("translationSnap",null),l("rotationSnap",null),l("scaleSnap",null),l("space","world"),l("size",1),l("dragging",!1),l("showX",!0),l("showY",!0),l("showZ",!0);const u=new Ae,h=new Ae,f=new Sl,g=new Sl,y=new Ae,b=new Sl,w=new Ae,C=new Ae,M=new Ae,A=0,k=new Ae;l("worldPosition",u),l("worldPositionStart",h),l("worldQuaternion",f),l("worldQuaternionStart",g),l("cameraPosition",y),l("cameraQuaternion",b),l("pointStart",w),l("pointEnd",C),l("rotationAxis",M),l("rotationAngle",A),l("eye",k),this._offset=new Ae,this._startNorm=new Ae,this._endNorm=new Ae,this._cameraScale=new Ae,this._parentPosition=new Ae,this._parentQuaternion=new Sl,this._parentQuaternionInv=new Sl,this._parentScale=new Ae,this._worldScaleStart=new Ae,this._worldQuaternionInv=new Sl,this._worldScale=new Ae,this._positionStart=new Ae,this._quaternionStart=new Sl,this._scaleStart=new Ae,this._getPointer=WRe.bind(this),this._onPointerDown=jRe.bind(this),this._onPointerHover=VRe.bind(this),this._onPointerMove=YRe.bind(this),this._onPointerUp=XRe.bind(this),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointermove",this._onPointerHover),this.domElement.addEventListener("pointerup",this._onPointerUp)}updateMatrixWorld(){this.object!==void 0&&(this.object.updateMatrixWorld(),this.object.parent===null?console.error("TransformControls: The attached 3D object must be a part of the scene graph."):this.object.parent.matrixWorld.decompose(this._parentPosition,this._parentQuaternion,this._parentScale),this.object.matrixWorld.decompose(this.worldPosition,this.worldQuaternion,this._worldScale),this._parentQuaternionInv.copy(this._parentQuaternion).invert(),this._worldQuaternionInv.copy(this.worldQuaternion).invert()),this.camera.updateMatrixWorld(),this.camera.matrixWorld.decompose(this.cameraPosition,this.cameraQuaternion,this._cameraScale),this.camera.isOrthographicCamera?this.camera.getWorldDirection(this.eye):this.eye.copy(this.cameraPosition).sub(this.worldPosition).normalize(),super.updateMatrixWorld(this)}pointerHover(e){if(this.object===void 0||this.dragging===!0)return;t1.setFromCamera(e,this.camera);const t=vN(this._gizmo.picker[this.mode],t1);t?this.axis=t.object.name:this.axis=null}pointerDown(e){if(!(this.object===void 0||this.dragging===!0||e.button!==0)&&this.axis!==null){t1.setFromCamera(e,this.camera);const t=vN(this._plane,t1,!0);t&&(this.object.updateMatrixWorld(),this.object.parent.updateMatrixWorld(),this._positionStart.copy(this.object.position),this._quaternionStart.copy(this.object.quaternion),this._scaleStart.copy(this.object.scale),this.object.matrixWorld.decompose(this.worldPositionStart,this.worldQuaternionStart,this._worldScaleStart),this.pointStart.copy(t.point).sub(this.worldPositionStart)),this.dragging=!0,r9.mode=this.mode,this.dispatchEvent(r9)}}pointerMove(e){const t=this.axis,r=this.mode,s=this.object;let o=this.space;if(r==="scale"?o="local":(t==="E"||t==="XYZE"||t==="XYZ")&&(o="world"),s===void 0||t===null||this.dragging===!1||e.button!==-1)return;t1.setFromCamera(e,this.camera);const l=vN(this._plane,t1,!0);if(l){if(this.pointEnd.copy(l.point).sub(this.worldPositionStart),r==="translate")this._offset.copy(this.pointEnd).sub(this.pointStart),o==="local"&&t!=="XYZ"&&this._offset.applyQuaternion(this._worldQuaternionInv),t.indexOf("X")===-1&&(this._offset.x=0),t.indexOf("Y")===-1&&(this._offset.y=0),t.indexOf("Z")===-1&&(this._offset.z=0),o==="local"&&t!=="XYZ"?this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale):this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale),s.position.copy(this._offset).add(this._positionStart),this.translationSnap&&(o==="local"&&(s.position.applyQuaternion(Du.copy(this._quaternionStart).invert()),t.search("X")!==-1&&(s.position.x=Math.round(s.position.x/this.translationSnap)*this.translationSnap),t.search("Y")!==-1&&(s.position.y=Math.round(s.position.y/this.translationSnap)*this.translationSnap),t.search("Z")!==-1&&(s.position.z=Math.round(s.position.z/this.translationSnap)*this.translationSnap),s.position.applyQuaternion(this._quaternionStart)),o==="world"&&(s.parent&&s.position.add(Hp.setFromMatrixPosition(s.parent.matrixWorld)),t.search("X")!==-1&&(s.position.x=Math.round(s.position.x/this.translationSnap)*this.translationSnap),t.search("Y")!==-1&&(s.position.y=Math.round(s.position.y/this.translationSnap)*this.translationSnap),t.search("Z")!==-1&&(s.position.z=Math.round(s.position.z/this.translationSnap)*this.translationSnap),s.parent&&s.position.sub(Hp.setFromMatrixPosition(s.parent.matrixWorld))));else if(r==="scale"){if(t.search("XYZ")!==-1){let u=this.pointEnd.length()/this.pointStart.length();this.pointEnd.dot(this.pointStart)<0&&(u*=-1),dy.set(u,u,u)}else Hp.copy(this.pointStart),dy.copy(this.pointEnd),Hp.applyQuaternion(this._worldQuaternionInv),dy.applyQuaternion(this._worldQuaternionInv),dy.divide(Hp),t.search("X")===-1&&(dy.x=1),t.search("Y")===-1&&(dy.y=1),t.search("Z")===-1&&(dy.z=1);s.scale.copy(this._scaleStart).multiply(dy),this.scaleSnap&&(t.search("X")!==-1&&(s.scale.x=Math.round(s.scale.x/this.scaleSnap)*this.scaleSnap||this.scaleSnap),t.search("Y")!==-1&&(s.scale.y=Math.round(s.scale.y/this.scaleSnap)*this.scaleSnap||this.scaleSnap),t.search("Z")!==-1&&(s.scale.z=Math.round(s.scale.z/this.scaleSnap)*this.scaleSnap||this.scaleSnap))}else if(r==="rotate"){this._offset.copy(this.pointEnd).sub(this.pointStart);const u=20/this.worldPosition.distanceTo(Hp.setFromMatrixPosition(this.camera.matrixWorld));t==="E"?(this.rotationAxis.copy(this.eye),this.rotationAngle=this.pointEnd.angleTo(this.pointStart),this._startNorm.copy(this.pointStart).normalize(),this._endNorm.copy(this.pointEnd).normalize(),this.rotationAngle*=this._endNorm.cross(this._startNorm).dot(this.eye)<0?1:-1):t==="XYZE"?(this.rotationAxis.copy(this._offset).cross(this.eye).normalize(),this.rotationAngle=this._offset.dot(Hp.copy(this.rotationAxis).cross(this.eye))*u):(t==="X"||t==="Y"||t==="Z")&&(this.rotationAxis.copy(n9[t]),Hp.copy(n9[t]),o==="local"&&Hp.applyQuaternion(this.worldQuaternion),this.rotationAngle=this._offset.dot(Hp.cross(this.eye).normalize())*u),this.rotationSnap&&(this.rotationAngle=Math.round(this.rotationAngle/this.rotationSnap)*this.rotationSnap),o==="local"&&t!=="E"&&t!=="XYZE"?(s.quaternion.copy(this._quaternionStart),s.quaternion.multiply(Du.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this._parentQuaternionInv),s.quaternion.copy(Du.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),s.quaternion.multiply(this._quaternionStart).normalize())}this.dispatchEvent(_N),this.dispatchEvent(s9)}}pointerUp(e){e.button===0&&(this.dragging&&this.axis!==null&&(i9.mode=this.mode,this.dispatchEvent(i9)),this.dragging=!1,this.axis=null)}dispose(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerHover),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.traverse(function(e){e.geometry&&e.geometry.dispose(),e.material&&e.material.dispose()})}attach(e){return this.object=e,this.visible=!0,this}detach(){return this.object=void 0,this.visible=!1,this.axis=null,this}reset(){!this.enabled||this.dragging&&(this.object.position.copy(this._positionStart),this.object.quaternion.copy(this._quaternionStart),this.object.scale.copy(this._scaleStart),this.dispatchEvent(_N),this.dispatchEvent(s9),this.pointStart.copy(this.pointEnd))}getRaycaster(){return t1}getMode(){return this.mode}setMode(e){this.mode=e}setTranslationSnap(e){this.translationSnap=e}setRotationSnap(e){this.rotationSnap=e}setScaleSnap(e){this.scaleSnap=e}setSize(e){this.size=e}setSpace(e){this.space=e}update(){console.warn("THREE.TransformControls: update function has no more functionality and therefore has been deprecated.")}}function WRe(n){if(this.domElement.ownerDocument.pointerLockElement)return{x:0,y:0,button:n.button};{const e=this.domElement.getBoundingClientRect();return{x:(n.clientX-e.left)/e.width*2-1,y:-(n.clientY-e.top)/e.height*2+1,button:n.button}}}function VRe(n){if(this.enabled)switch(n.pointerType){case"mouse":case"pen":this.pointerHover(this._getPointer(n));break}}function jRe(n){!this.enabled||(document.pointerLockElement||this.domElement.setPointerCapture(n.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.pointerHover(this._getPointer(n)),this.pointerDown(this._getPointer(n)))}function YRe(n){!this.enabled||this.pointerMove(this._getPointer(n))}function XRe(n){!this.enabled||(this.domElement.releasePointerCapture(n.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.pointerUp(this._getPointer(n)))}function vN(n,e,t){const r=e.intersectObject(n,!0);for(let s=0;s.9&&(o.visible=!1)),this.axis==="Y"&&(Du.setFromEuler(FA.set(0,0,Math.PI/2)),o.quaternion.copy(t).multiply(Du),Math.abs(Tl.copy(d1).applyQuaternion(t).dot(this.eye))>.9&&(o.visible=!1)),this.axis==="Z"&&(Du.setFromEuler(FA.set(0,Math.PI/2,0)),o.quaternion.copy(t).multiply(Du),Math.abs(Tl.copy(Nx).applyQuaternion(t).dot(this.eye))>.9&&(o.visible=!1)),this.axis==="XYZE"&&(Du.setFromEuler(FA.set(0,Math.PI/2,0)),Tl.copy(this.rotationAxis),o.quaternion.setFromRotationMatrix(a9.lookAt(o9,Tl,d1)),o.quaternion.multiply(Du),o.visible=this.dragging),this.axis==="E"&&(o.visible=!1)):o.name==="START"?(o.position.copy(this.worldPositionStart),o.visible=this.dragging):o.name==="END"?(o.position.copy(this.worldPosition),o.visible=this.dragging):o.name==="DELTA"?(o.position.copy(this.worldPositionStart),o.quaternion.copy(this.worldQuaternionStart),Hp.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),Hp.applyQuaternion(this.worldQuaternionStart.clone().invert()),o.scale.copy(Hp),o.visible=this.dragging):(o.quaternion.copy(t),this.dragging?o.position.copy(this.worldPositionStart):o.position.copy(this.worldPosition),this.axis&&(o.visible=this.axis.search(o.name)!==-1));continue}o.quaternion.copy(t),this.mode==="translate"||this.mode==="scale"?(o.name==="X"&&Math.abs(Tl.copy(Lx).applyQuaternion(t).dot(this.eye))>.99&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="Y"&&Math.abs(Tl.copy(d1).applyQuaternion(t).dot(this.eye))>.99&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="Z"&&Math.abs(Tl.copy(Nx).applyQuaternion(t).dot(this.eye))>.99&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="XY"&&Math.abs(Tl.copy(Nx).applyQuaternion(t).dot(this.eye))<.2&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="YZ"&&Math.abs(Tl.copy(Lx).applyQuaternion(t).dot(this.eye))<.2&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="XZ"&&Math.abs(Tl.copy(d1).applyQuaternion(t).dot(this.eye))<.2&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1)):this.mode==="rotate"&&(zA.copy(t),Tl.copy(this.eye).applyQuaternion(Du.copy(t).invert()),o.name.search("E")!==-1&&o.quaternion.setFromRotationMatrix(a9.lookAt(this.eye,o9,d1)),o.name==="X"&&(Du.setFromAxisAngle(Lx,Math.atan2(-Tl.y,Tl.z)),Du.multiplyQuaternions(zA,Du),o.quaternion.copy(Du)),o.name==="Y"&&(Du.setFromAxisAngle(d1,Math.atan2(Tl.x,Tl.z)),Du.multiplyQuaternions(zA,Du),o.quaternion.copy(Du)),o.name==="Z"&&(Du.setFromAxisAngle(Nx,Math.atan2(Tl.y,Tl.x)),Du.multiplyQuaternions(zA,Du),o.quaternion.copy(Du))),o.visible=o.visible&&(o.name.indexOf("X")===-1||this.showX),o.visible=o.visible&&(o.name.indexOf("Y")===-1||this.showY),o.visible=o.visible&&(o.name.indexOf("Z")===-1||this.showZ),o.visible=o.visible&&(o.name.indexOf("E")===-1||this.showX&&this.showY&&this.showZ),o.material._color=o.material._color||o.material.color.clone(),o.material._opacity=o.material._opacity||o.material.opacity,o.material.color.copy(o.material._color),o.material.opacity=o.material._opacity,this.enabled&&this.axis&&(o.name===this.axis||this.axis.split("").some(function(u){return o.name===u}))&&(o.material.color.setHex(16776960),o.material.opacity=1)}super.updateMatrixWorld(e)}}class JRe extends Hn{constructor(){super(new c0(1e5,1e5,2,2),new f0({visible:!1,wireframe:!0,side:lp,transparent:!0,opacity:.1,toneMapped:!1})),this.isTransformControlsPlane=!0,this.type="TransformControlsPlane"}updateMatrixWorld(e){let t=this.space;switch(this.position.copy(this.worldPosition),this.mode==="scale"&&(t="local"),UA.copy(Lx).applyQuaternion(t==="local"?this.worldQuaternion:MI),Tx.copy(d1).applyQuaternion(t==="local"?this.worldQuaternion:MI),Sx.copy(Nx).applyQuaternion(t==="local"?this.worldQuaternion:MI),Tl.copy(Tx),this.mode){case"translate":case"scale":switch(this.axis){case"X":Tl.copy(this.eye).cross(UA),X0.copy(UA).cross(Tl);break;case"Y":Tl.copy(this.eye).cross(Tx),X0.copy(Tx).cross(Tl);break;case"Z":Tl.copy(this.eye).cross(Sx),X0.copy(Sx).cross(Tl);break;case"XY":X0.copy(Sx);break;case"YZ":X0.copy(UA);break;case"XZ":Tl.copy(Sx),X0.copy(Tx);break;case"XYZ":case"E":X0.set(0,0,0);break}break;case"rotate":default:X0.set(0,0,0)}X0.length()===0?this.quaternion.copy(this.cameraQuaternion):(l9.lookAt(Hp.set(0,0,0),X0,Tl),this.quaternion.setFromRotationMatrix(l9)),super.updateMatrixWorld(e)}}const yN=1,qRe=n=>{let{x:e,y:t,z:r}=n===void 0?{}:n;return e=e===void 0?yN:e,t=t===void 0?yN:t,r=r===void 0?yN:r,new CAe(e,t,r,2,.05)},QRe=.5,ZRe=n=>{let{radius:e}=n===void 0?{}:n;return e=e===void 0?QRe:e,new h0(e,32,32)},fee=.5,pee=1,eke=n=>{let{radius:e,height:t}=n===void 0?{}:n;return e=e===void 0?fee:e,t=t===void 0?pee:t,new Gl(e,e,t,32,1,!1)},tke=.4,nke=.05,rke=.2,ike=.6,S2=n=>{let{length:e,radius:t}=n===void 0?{}:n;e=e===void 0?1:e,t=t===void 0?1:t;const r=tke*e,s=rke*.5*t,o=new Gl(0,s,r,32,1),l=ike*e,u=nke*.5*t,h=new Gl(u,u,l,32,1);var f=new Qr;return f.setPosition(new Ae(0,l*.5,0)),h.applyMatrix4(f),f.setPosition(new Ae(0,l+r*.5,0)),o.applyMatrix4(f),VZ([o,h])},ske=n=>{let{radius:e,height:t}=n===void 0?{}:n;e=e===void 0?fee:e,t=t===void 0?pee:t;const r=new Gl(e,e,t,32,1,!0),s=new h0(e,32,32,Math.PI,Math.PI),o=new h0(e,32,32,Math.PI,Math.PI);var l=new Qr;l.makeRotationX(Math.PI/2),l.setPosition(0,t/2,0);var u=new Qr;return u.makeRotationX(-Math.PI/2),u.setPosition(0,-t/2,0),s.applyMatrix4(l),o.applyMatrix4(u),VZ([r,s,o])},rC=(n,e,t)=>{if(n.current&&e){const r=typeof e.r=="function"?e.r(t)/255:e.r/255,s=typeof e.g=="function"?e.g(t)/255:e.g/255,o=typeof e.b=="function"?e.b(t)/255:e.b/255,l=typeof e.a=="function"?e.a(t):e.a;n.current.material.color.setRGB(r,s,o),n.current.material.opacity=l,n.current.material.transparent=l!==1}},oke=n=>{let e=null;if(n.shape)n.shape==="cube"?e=qRe(n.shapeParams):n.shape==="cylinder"?e=eke(n.shapeParams):n.shape==="sphere"?e=ZRe(n.shapeParams):n.shape==="capsule"?e=ske(n.shapeParams):n.shape==="arrow"&&(e=S2(n.shapeParams));else return[];return[{geometry:e,type:"part"}]};function _E(...n){const e=pe.useRef();return pe.useEffect(()=>{n.forEach(t=>{!t||(typeof t=="function"?t(e.current):t.current=e.current)})},[n]),e}function Nf(n,e){if(Object.is(n,e))return!0;if(typeof n!="object"||n===null||typeof e!="object"||e===null)return!1;if(n instanceof Map&&e instanceof Map){if(n.size!==e.size)return!1;for(const[r,s]of n)if(!Object.is(s,e.get(r)))return!1;return!0}if(n instanceof Set&&e instanceof Set){if(n.size!==e.size)return!1;for(const r of n)if(!e.has(r))return!1;return!0}const t=Object.keys(n);if(t.length!==Object.keys(e).length)return!1;for(let r=0;r{const f=pe.useRef(null),g=_E(h,f),y=No(pe.useCallback(C=>C.tfs[n],[n]),Nf),b=No(C=>C.clock);Xm(pe.useCallback(()=>{const C=b.getElapsed()*1e3;g.current&&(g.current.position.set(t?t.x:typeof y.position.x=="function"?y.position.x(C):y.position.x,t?t.y:typeof y.position.y=="function"?y.position.y(C):y.position.y,t?t.z:typeof y.position.z=="function"?y.position.z(C):y.position.z),g.current.quaternion.set(r?r.x:typeof y.rotation.x=="function"?y.rotation.x(C):y.rotation.x,r?r.y:typeof y.rotation.y=="function"?y.rotation.y(C):y.rotation.y,r?r.z:typeof y.rotation.z=="function"?y.rotation.z(C):y.rotation.z,r?r.w:typeof y.rotation.w=="function"?y.rotation.w(C):y.rotation.w),g.current.scale.set(s?s.x:y.scale?typeof y.scale.x=="function"?y.scale.x(C):y.scale.x:0,s?s.y:y.scale?typeof y.scale.y=="function"?y.scale.y(C):y.scale.y:0,s?s.z:y.scale?typeof y.scale.z=="function"?y.scale.z(C):y.scale.z:0))},[y,t,r,s,g,b]));const w=S2();return Bh("group",{ref:g,dispose:null,up:[0,0,1],children:[e&&Bh(PC,{children:[un("axesHelper",{size:1}),un("mesh",{geometry:w,material:o?CI(l):d_(255,0,0,1),scale:[.2,.5,.2],rotation:[0,0,-Math.PI/2]},`${n}ArrowX`),un("mesh",{geometry:w,material:o?CI(l):d_(0,255,0,1),scale:[.2,.5,.2],rotation:[0,Math.PI/2,0]},`${n}ArrowY`),un("mesh",{geometry:w,material:o?CI(l):d_(0,0,255,1),scale:[.2,.5,.2],rotation:[Math.PI/2,0,0]},`${n}ArrowZ`)]}),u]})});function lke({displayTfs:n,children:e}){const t=S2();return Bh("group",{dispose:null,up:[0,0,1],children:[n&&Bh(PC,{children:[un("axesHelper",{size:1}),un("mesh",{geometry:t,material:d_(255,0,0,1),scale:[.2,.5,.2],rotation:[0,0,-Math.PI/2]},"$WorldArrowX"),un("mesh",{geometry:t,material:d_(0,255,0,1),scale:[.2,.5,.2],rotation:[0,Math.PI/2,0]},"$WorldArrowY"),un("mesh",{geometry:t,material:d_(0,0,255,1),scale:[.2,.5,.2],rotation:[Math.PI/2,0,0]},"$WorldArrowZ")]}),e]})}function uke({displayTfs:n,children:e}){const t=S2();return Bh("group",{dispose:null,up:[0,0,1],children:[n&&Bh(PC,{children:[un("axesHelper",{size:1}),un("mesh",{geometry:t,material:d_(255,0,0,1),scale:[.2,.5,.2],rotation:[0,0,-Math.PI/2]},"$WorldArrowX"),un("mesh",{geometry:t,material:d_(0,255,0,1),scale:[.2,.5,.2],rotation:[0,Math.PI/2,0]},"$WorldArrowY"),un("mesh",{geometry:t,material:d_(0,0,255,1),scale:[.2,.5,.2],rotation:[Math.PI/2,0,0]},"$WorldArrowZ")]}),e]})}/** + }`,s=new xd({uniforms:{coeficient:{type:"f",value:1.2},power:{type:"f",value:4},glowColor:{type:"c",value:e}},vertexShader:t,fragmentShader:r,blending:_R,transparent:!0,depthWrite:!1,depthTest:!1});return s});function HRe(n){var e=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;n=n.replace(e,function(r,s,o,l){return s+s+o+o+l+l});var t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(n);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null}const n1=new w4,Hp=new Me,dy=new Me,Du=new Sl,r9={X:new Me(1,0,0),Y:new Me(0,1,0),Z:new Me(0,0,1)},_N={type:"change"},i9={type:"mouseDown"},s9={type:"mouseUp",mode:null},o9={type:"objectChange"};class GRe extends ro{constructor(e,t){super(),t===void 0&&(console.warn('THREE.TransformControls: The second parameter "domElement" is now mandatory.'),t=document),this.isTransformControls=!0,this.visible=!1,this.domElement=t,this.domElement.style.touchAction="none";const r=new KRe;this._gizmo=r,this.add(r);const s=new JRe;this._plane=s,this.add(s);const o=this;function l(L,P){let D=P;Object.defineProperty(o,L,{get:function(){return D!==void 0?D:P},set:function(z){D!==z&&(D=z,s[L]=z,r[L]=z,o.dispatchEvent({type:L+"-changed",value:z}),o.dispatchEvent(_N))}}),o[L]=P,s[L]=P,r[L]=P}l("camera",e),l("object",void 0),l("enabled",!0),l("axis",null),l("mode","translate"),l("translationSnap",null),l("rotationSnap",null),l("scaleSnap",null),l("space","world"),l("size",1),l("dragging",!1),l("showX",!0),l("showY",!0),l("showZ",!0);const u=new Me,h=new Me,f=new Sl,g=new Sl,y=new Me,b=new Sl,w=new Me,C=new Me,M=new Me,A=0,k=new Me;l("worldPosition",u),l("worldPositionStart",h),l("worldQuaternion",f),l("worldQuaternionStart",g),l("cameraPosition",y),l("cameraQuaternion",b),l("pointStart",w),l("pointEnd",C),l("rotationAxis",M),l("rotationAngle",A),l("eye",k),this._offset=new Me,this._startNorm=new Me,this._endNorm=new Me,this._cameraScale=new Me,this._parentPosition=new Me,this._parentQuaternion=new Sl,this._parentQuaternionInv=new Sl,this._parentScale=new Me,this._worldScaleStart=new Me,this._worldQuaternionInv=new Sl,this._worldScale=new Me,this._positionStart=new Me,this._quaternionStart=new Sl,this._scaleStart=new Me,this._getPointer=WRe.bind(this),this._onPointerDown=jRe.bind(this),this._onPointerHover=VRe.bind(this),this._onPointerMove=YRe.bind(this),this._onPointerUp=XRe.bind(this),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointermove",this._onPointerHover),this.domElement.addEventListener("pointerup",this._onPointerUp)}updateMatrixWorld(){this.object!==void 0&&(this.object.updateMatrixWorld(),this.object.parent===null?console.error("TransformControls: The attached 3D object must be a part of the scene graph."):this.object.parent.matrixWorld.decompose(this._parentPosition,this._parentQuaternion,this._parentScale),this.object.matrixWorld.decompose(this.worldPosition,this.worldQuaternion,this._worldScale),this._parentQuaternionInv.copy(this._parentQuaternion).invert(),this._worldQuaternionInv.copy(this.worldQuaternion).invert()),this.camera.updateMatrixWorld(),this.camera.matrixWorld.decompose(this.cameraPosition,this.cameraQuaternion,this._cameraScale),this.camera.isOrthographicCamera?this.camera.getWorldDirection(this.eye):this.eye.copy(this.cameraPosition).sub(this.worldPosition).normalize(),super.updateMatrixWorld(this)}pointerHover(e){if(this.object===void 0||this.dragging===!0)return;n1.setFromCamera(e,this.camera);const t=vN(this._gizmo.picker[this.mode],n1);t?this.axis=t.object.name:this.axis=null}pointerDown(e){if(!(this.object===void 0||this.dragging===!0||e.button!==0)&&this.axis!==null){n1.setFromCamera(e,this.camera);const t=vN(this._plane,n1,!0);t&&(this.object.updateMatrixWorld(),this.object.parent.updateMatrixWorld(),this._positionStart.copy(this.object.position),this._quaternionStart.copy(this.object.quaternion),this._scaleStart.copy(this.object.scale),this.object.matrixWorld.decompose(this.worldPositionStart,this.worldQuaternionStart,this._worldScaleStart),this.pointStart.copy(t.point).sub(this.worldPositionStart)),this.dragging=!0,i9.mode=this.mode,this.dispatchEvent(i9)}}pointerMove(e){const t=this.axis,r=this.mode,s=this.object;let o=this.space;if(r==="scale"?o="local":(t==="E"||t==="XYZE"||t==="XYZ")&&(o="world"),s===void 0||t===null||this.dragging===!1||e.button!==-1)return;n1.setFromCamera(e,this.camera);const l=vN(this._plane,n1,!0);if(l){if(this.pointEnd.copy(l.point).sub(this.worldPositionStart),r==="translate")this._offset.copy(this.pointEnd).sub(this.pointStart),o==="local"&&t!=="XYZ"&&this._offset.applyQuaternion(this._worldQuaternionInv),t.indexOf("X")===-1&&(this._offset.x=0),t.indexOf("Y")===-1&&(this._offset.y=0),t.indexOf("Z")===-1&&(this._offset.z=0),o==="local"&&t!=="XYZ"?this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale):this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale),s.position.copy(this._offset).add(this._positionStart),this.translationSnap&&(o==="local"&&(s.position.applyQuaternion(Du.copy(this._quaternionStart).invert()),t.search("X")!==-1&&(s.position.x=Math.round(s.position.x/this.translationSnap)*this.translationSnap),t.search("Y")!==-1&&(s.position.y=Math.round(s.position.y/this.translationSnap)*this.translationSnap),t.search("Z")!==-1&&(s.position.z=Math.round(s.position.z/this.translationSnap)*this.translationSnap),s.position.applyQuaternion(this._quaternionStart)),o==="world"&&(s.parent&&s.position.add(Hp.setFromMatrixPosition(s.parent.matrixWorld)),t.search("X")!==-1&&(s.position.x=Math.round(s.position.x/this.translationSnap)*this.translationSnap),t.search("Y")!==-1&&(s.position.y=Math.round(s.position.y/this.translationSnap)*this.translationSnap),t.search("Z")!==-1&&(s.position.z=Math.round(s.position.z/this.translationSnap)*this.translationSnap),s.parent&&s.position.sub(Hp.setFromMatrixPosition(s.parent.matrixWorld))));else if(r==="scale"){if(t.search("XYZ")!==-1){let u=this.pointEnd.length()/this.pointStart.length();this.pointEnd.dot(this.pointStart)<0&&(u*=-1),dy.set(u,u,u)}else Hp.copy(this.pointStart),dy.copy(this.pointEnd),Hp.applyQuaternion(this._worldQuaternionInv),dy.applyQuaternion(this._worldQuaternionInv),dy.divide(Hp),t.search("X")===-1&&(dy.x=1),t.search("Y")===-1&&(dy.y=1),t.search("Z")===-1&&(dy.z=1);s.scale.copy(this._scaleStart).multiply(dy),this.scaleSnap&&(t.search("X")!==-1&&(s.scale.x=Math.round(s.scale.x/this.scaleSnap)*this.scaleSnap||this.scaleSnap),t.search("Y")!==-1&&(s.scale.y=Math.round(s.scale.y/this.scaleSnap)*this.scaleSnap||this.scaleSnap),t.search("Z")!==-1&&(s.scale.z=Math.round(s.scale.z/this.scaleSnap)*this.scaleSnap||this.scaleSnap))}else if(r==="rotate"){this._offset.copy(this.pointEnd).sub(this.pointStart);const u=20/this.worldPosition.distanceTo(Hp.setFromMatrixPosition(this.camera.matrixWorld));t==="E"?(this.rotationAxis.copy(this.eye),this.rotationAngle=this.pointEnd.angleTo(this.pointStart),this._startNorm.copy(this.pointStart).normalize(),this._endNorm.copy(this.pointEnd).normalize(),this.rotationAngle*=this._endNorm.cross(this._startNorm).dot(this.eye)<0?1:-1):t==="XYZE"?(this.rotationAxis.copy(this._offset).cross(this.eye).normalize(),this.rotationAngle=this._offset.dot(Hp.copy(this.rotationAxis).cross(this.eye))*u):(t==="X"||t==="Y"||t==="Z")&&(this.rotationAxis.copy(r9[t]),Hp.copy(r9[t]),o==="local"&&Hp.applyQuaternion(this.worldQuaternion),this.rotationAngle=this._offset.dot(Hp.cross(this.eye).normalize())*u),this.rotationSnap&&(this.rotationAngle=Math.round(this.rotationAngle/this.rotationSnap)*this.rotationSnap),o==="local"&&t!=="E"&&t!=="XYZE"?(s.quaternion.copy(this._quaternionStart),s.quaternion.multiply(Du.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this._parentQuaternionInv),s.quaternion.copy(Du.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),s.quaternion.multiply(this._quaternionStart).normalize())}this.dispatchEvent(_N),this.dispatchEvent(o9)}}pointerUp(e){e.button===0&&(this.dragging&&this.axis!==null&&(s9.mode=this.mode,this.dispatchEvent(s9)),this.dragging=!1,this.axis=null)}dispose(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerHover),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.traverse(function(e){e.geometry&&e.geometry.dispose(),e.material&&e.material.dispose()})}attach(e){return this.object=e,this.visible=!0,this}detach(){return this.object=void 0,this.visible=!1,this.axis=null,this}reset(){!this.enabled||this.dragging&&(this.object.position.copy(this._positionStart),this.object.quaternion.copy(this._quaternionStart),this.object.scale.copy(this._scaleStart),this.dispatchEvent(_N),this.dispatchEvent(o9),this.pointStart.copy(this.pointEnd))}getRaycaster(){return n1}getMode(){return this.mode}setMode(e){this.mode=e}setTranslationSnap(e){this.translationSnap=e}setRotationSnap(e){this.rotationSnap=e}setScaleSnap(e){this.scaleSnap=e}setSize(e){this.size=e}setSpace(e){this.space=e}update(){console.warn("THREE.TransformControls: update function has no more functionality and therefore has been deprecated.")}}function WRe(n){if(this.domElement.ownerDocument.pointerLockElement)return{x:0,y:0,button:n.button};{const e=this.domElement.getBoundingClientRect();return{x:(n.clientX-e.left)/e.width*2-1,y:-(n.clientY-e.top)/e.height*2+1,button:n.button}}}function VRe(n){if(this.enabled)switch(n.pointerType){case"mouse":case"pen":this.pointerHover(this._getPointer(n));break}}function jRe(n){!this.enabled||(document.pointerLockElement||this.domElement.setPointerCapture(n.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.pointerHover(this._getPointer(n)),this.pointerDown(this._getPointer(n)))}function YRe(n){!this.enabled||this.pointerMove(this._getPointer(n))}function XRe(n){!this.enabled||(this.domElement.releasePointerCapture(n.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.pointerUp(this._getPointer(n)))}function vN(n,e,t){const r=e.intersectObject(n,!0);for(let s=0;s.9&&(o.visible=!1)),this.axis==="Y"&&(Du.setFromEuler(FA.set(0,0,Math.PI/2)),o.quaternion.copy(t).multiply(Du),Math.abs(Tl.copy(f1).applyQuaternion(t).dot(this.eye))>.9&&(o.visible=!1)),this.axis==="Z"&&(Du.setFromEuler(FA.set(0,Math.PI/2,0)),o.quaternion.copy(t).multiply(Du),Math.abs(Tl.copy(Nx).applyQuaternion(t).dot(this.eye))>.9&&(o.visible=!1)),this.axis==="XYZE"&&(Du.setFromEuler(FA.set(0,Math.PI/2,0)),Tl.copy(this.rotationAxis),o.quaternion.setFromRotationMatrix(l9.lookAt(a9,Tl,f1)),o.quaternion.multiply(Du),o.visible=this.dragging),this.axis==="E"&&(o.visible=!1)):o.name==="START"?(o.position.copy(this.worldPositionStart),o.visible=this.dragging):o.name==="END"?(o.position.copy(this.worldPosition),o.visible=this.dragging):o.name==="DELTA"?(o.position.copy(this.worldPositionStart),o.quaternion.copy(this.worldQuaternionStart),Hp.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),Hp.applyQuaternion(this.worldQuaternionStart.clone().invert()),o.scale.copy(Hp),o.visible=this.dragging):(o.quaternion.copy(t),this.dragging?o.position.copy(this.worldPositionStart):o.position.copy(this.worldPosition),this.axis&&(o.visible=this.axis.search(o.name)!==-1));continue}o.quaternion.copy(t),this.mode==="translate"||this.mode==="scale"?(o.name==="X"&&Math.abs(Tl.copy(Lx).applyQuaternion(t).dot(this.eye))>.99&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="Y"&&Math.abs(Tl.copy(f1).applyQuaternion(t).dot(this.eye))>.99&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="Z"&&Math.abs(Tl.copy(Nx).applyQuaternion(t).dot(this.eye))>.99&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="XY"&&Math.abs(Tl.copy(Nx).applyQuaternion(t).dot(this.eye))<.2&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="YZ"&&Math.abs(Tl.copy(Lx).applyQuaternion(t).dot(this.eye))<.2&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="XZ"&&Math.abs(Tl.copy(f1).applyQuaternion(t).dot(this.eye))<.2&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1)):this.mode==="rotate"&&(zA.copy(t),Tl.copy(this.eye).applyQuaternion(Du.copy(t).invert()),o.name.search("E")!==-1&&o.quaternion.setFromRotationMatrix(l9.lookAt(this.eye,a9,f1)),o.name==="X"&&(Du.setFromAxisAngle(Lx,Math.atan2(-Tl.y,Tl.z)),Du.multiplyQuaternions(zA,Du),o.quaternion.copy(Du)),o.name==="Y"&&(Du.setFromAxisAngle(f1,Math.atan2(Tl.x,Tl.z)),Du.multiplyQuaternions(zA,Du),o.quaternion.copy(Du)),o.name==="Z"&&(Du.setFromAxisAngle(Nx,Math.atan2(Tl.y,Tl.x)),Du.multiplyQuaternions(zA,Du),o.quaternion.copy(Du))),o.visible=o.visible&&(o.name.indexOf("X")===-1||this.showX),o.visible=o.visible&&(o.name.indexOf("Y")===-1||this.showY),o.visible=o.visible&&(o.name.indexOf("Z")===-1||this.showZ),o.visible=o.visible&&(o.name.indexOf("E")===-1||this.showX&&this.showY&&this.showZ),o.material._color=o.material._color||o.material.color.clone(),o.material._opacity=o.material._opacity||o.material.opacity,o.material.color.copy(o.material._color),o.material.opacity=o.material._opacity,this.enabled&&this.axis&&(o.name===this.axis||this.axis.split("").some(function(u){return o.name===u}))&&(o.material.color.setHex(16776960),o.material.opacity=1)}super.updateMatrixWorld(e)}}class JRe extends Hn{constructor(){super(new c0(1e5,1e5,2,2),new f0({visible:!1,wireframe:!0,side:lp,transparent:!0,opacity:.1,toneMapped:!1})),this.isTransformControlsPlane=!0,this.type="TransformControlsPlane"}updateMatrixWorld(e){let t=this.space;switch(this.position.copy(this.worldPosition),this.mode==="scale"&&(t="local"),UA.copy(Lx).applyQuaternion(t==="local"?this.worldQuaternion:MI),Tx.copy(f1).applyQuaternion(t==="local"?this.worldQuaternion:MI),Sx.copy(Nx).applyQuaternion(t==="local"?this.worldQuaternion:MI),Tl.copy(Tx),this.mode){case"translate":case"scale":switch(this.axis){case"X":Tl.copy(this.eye).cross(UA),X0.copy(UA).cross(Tl);break;case"Y":Tl.copy(this.eye).cross(Tx),X0.copy(Tx).cross(Tl);break;case"Z":Tl.copy(this.eye).cross(Sx),X0.copy(Sx).cross(Tl);break;case"XY":X0.copy(Sx);break;case"YZ":X0.copy(UA);break;case"XZ":Tl.copy(Sx),X0.copy(Tx);break;case"XYZ":case"E":X0.set(0,0,0);break}break;case"rotate":default:X0.set(0,0,0)}X0.length()===0?this.quaternion.copy(this.cameraQuaternion):(u9.lookAt(Hp.set(0,0,0),X0,Tl),this.quaternion.setFromRotationMatrix(u9)),super.updateMatrixWorld(e)}}const yN=1,qRe=n=>{let{x:e,y:t,z:r}=n===void 0?{}:n;return e=e===void 0?yN:e,t=t===void 0?yN:t,r=r===void 0?yN:r,new CAe(e,t,r,2,.05)},QRe=.5,ZRe=n=>{let{radius:e}=n===void 0?{}:n;return e=e===void 0?QRe:e,new h0(e,32,32)},pee=.5,mee=1,eke=n=>{let{radius:e,height:t}=n===void 0?{}:n;return e=e===void 0?pee:e,t=t===void 0?mee:t,new Gl(e,e,t,32,1,!1)},tke=.4,nke=.05,rke=.2,ike=.6,S2=n=>{let{length:e,radius:t}=n===void 0?{}:n;e=e===void 0?1:e,t=t===void 0?1:t;const r=tke*e,s=rke*.5*t,o=new Gl(0,s,r,32,1),l=ike*e,u=nke*.5*t,h=new Gl(u,u,l,32,1);var f=new Qr;return f.setPosition(new Me(0,l*.5,0)),h.applyMatrix4(f),f.setPosition(new Me(0,l+r*.5,0)),o.applyMatrix4(f),jZ([o,h])},ske=n=>{let{radius:e,height:t}=n===void 0?{}:n;e=e===void 0?pee:e,t=t===void 0?mee:t;const r=new Gl(e,e,t,32,1,!0),s=new h0(e,32,32,Math.PI,Math.PI),o=new h0(e,32,32,Math.PI,Math.PI);var l=new Qr;l.makeRotationX(Math.PI/2),l.setPosition(0,t/2,0);var u=new Qr;return u.makeRotationX(-Math.PI/2),u.setPosition(0,-t/2,0),s.applyMatrix4(l),o.applyMatrix4(u),jZ([r,s,o])},rC=(n,e,t)=>{if(n.current&&e){const r=typeof e.r=="function"?e.r(t)/255:e.r/255,s=typeof e.g=="function"?e.g(t)/255:e.g/255,o=typeof e.b=="function"?e.b(t)/255:e.b/255,l=typeof e.a=="function"?e.a(t):e.a;n.current.material.color.setRGB(r,s,o),n.current.material.opacity=l,n.current.material.transparent=l!==1}},oke=n=>{let e=null;if(n.shape)n.shape==="cube"?e=qRe(n.shapeParams):n.shape==="cylinder"?e=eke(n.shapeParams):n.shape==="sphere"?e=ZRe(n.shapeParams):n.shape==="capsule"?e=ske(n.shapeParams):n.shape==="arrow"&&(e=S2(n.shapeParams));else return[];return[{geometry:e,type:"part"}]};function _E(...n){const e=me.useRef();return me.useEffect(()=>{n.forEach(t=>{!t||(typeof t=="function"?t(e.current):t.current=e.current)})},[n]),e}function Nf(n,e){if(Object.is(n,e))return!0;if(typeof n!="object"||n===null||typeof e!="object"||e===null)return!1;if(n instanceof Map&&e instanceof Map){if(n.size!==e.size)return!1;for(const[r,s]of n)if(!Object.is(s,e.get(r)))return!1;return!0}if(n instanceof Set&&e instanceof Set){if(n.size!==e.size)return!1;for(const r of n)if(!e.has(r))return!1;return!0}const t=Object.keys(n);if(t.length!==Object.keys(e).length)return!1;for(let r=0;r{const f=me.useRef(null),g=_E(h,f),y=No(me.useCallback(C=>C.tfs[n],[n]),Nf),b=No(C=>C.clock);Xm(me.useCallback(()=>{const C=b.getElapsed()*1e3;g.current&&(g.current.position.set(t?t.x:typeof y.position.x=="function"?y.position.x(C):y.position.x,t?t.y:typeof y.position.y=="function"?y.position.y(C):y.position.y,t?t.z:typeof y.position.z=="function"?y.position.z(C):y.position.z),g.current.quaternion.set(r?r.x:typeof y.rotation.x=="function"?y.rotation.x(C):y.rotation.x,r?r.y:typeof y.rotation.y=="function"?y.rotation.y(C):y.rotation.y,r?r.z:typeof y.rotation.z=="function"?y.rotation.z(C):y.rotation.z,r?r.w:typeof y.rotation.w=="function"?y.rotation.w(C):y.rotation.w),g.current.scale.set(s?s.x:y.scale?typeof y.scale.x=="function"?y.scale.x(C):y.scale.x:0,s?s.y:y.scale?typeof y.scale.y=="function"?y.scale.y(C):y.scale.y:0,s?s.z:y.scale?typeof y.scale.z=="function"?y.scale.z(C):y.scale.z:0))},[y,t,r,s,g,b]));const w=S2();return Bh("group",{ref:g,dispose:null,up:[0,0,1],children:[e&&Bh(PC,{children:[un("axesHelper",{size:1}),un("mesh",{geometry:w,material:o?CI(l):d_(255,0,0,1),scale:[.2,.5,.2],rotation:[0,0,-Math.PI/2]},`${n}ArrowX`),un("mesh",{geometry:w,material:o?CI(l):d_(0,255,0,1),scale:[.2,.5,.2],rotation:[0,Math.PI/2,0]},`${n}ArrowY`),un("mesh",{geometry:w,material:o?CI(l):d_(0,0,255,1),scale:[.2,.5,.2],rotation:[Math.PI/2,0,0]},`${n}ArrowZ`)]}),u]})});function lke({displayTfs:n,children:e}){const t=S2();return Bh("group",{dispose:null,up:[0,0,1],children:[n&&Bh(PC,{children:[un("axesHelper",{size:1}),un("mesh",{geometry:t,material:d_(255,0,0,1),scale:[.2,.5,.2],rotation:[0,0,-Math.PI/2]},"$WorldArrowX"),un("mesh",{geometry:t,material:d_(0,255,0,1),scale:[.2,.5,.2],rotation:[0,Math.PI/2,0]},"$WorldArrowY"),un("mesh",{geometry:t,material:d_(0,0,255,1),scale:[.2,.5,.2],rotation:[Math.PI/2,0,0]},"$WorldArrowZ")]}),e]})}function uke({displayTfs:n,children:e}){const t=S2();return Bh("group",{dispose:null,up:[0,0,1],children:[n&&Bh(PC,{children:[un("axesHelper",{size:1}),un("mesh",{geometry:t,material:d_(255,0,0,1),scale:[.2,.5,.2],rotation:[0,0,-Math.PI/2]},"$WorldArrowX"),un("mesh",{geometry:t,material:d_(0,255,0,1),scale:[.2,.5,.2],rotation:[0,Math.PI/2,0]},"$WorldArrowY"),un("mesh",{geometry:t,material:d_(0,0,255,1),scale:[.2,.5,.2],rotation:[Math.PI/2,0,0]},"$WorldArrowZ")]}),e]})}/** * postprocessing v6.30.1 build Fri Feb 24 2023 * https://github.com/pmndrs/postprocessing * Copyright 2015-2023 Raoul van Rüschen * @license Zlib - */var cke="varying vec2 vUv;void main(){vUv=position.xy*0.5+0.5;gl_Position=vec4(position.xy,1.0,1.0);}";function u9(n,e){let t="texel";if(n!==null){const r=Number.parseInt(hE);if(!(e&&r>=133&&r!==135&&n.format===jp&&n.type===af&&n.encoding===ms))switch(n.encoding){case ms:t="sRGBToLinear(texel)";break;case xg:t="texel";break;default:throw new Error(`Unsupported encoding: ${n.encoding}`)}}return t}var Is={SKIP:9,SET:30,ADD:0,ALPHA:1,AVERAGE:2,COLOR:3,COLOR_BURN:4,COLOR_DODGE:5,DARKEN:6,DIFFERENCE:7,DIVIDE:8,DST:9,EXCLUSION:10,HARD_LIGHT:11,HARD_MIX:12,HUE:13,INVERT:14,INVERT_RGB:15,LIGHTEN:16,LINEAR_BURN:17,LINEAR_DODGE:18,LINEAR_LIGHT:19,LUMINOSITY:20,MULTIPLY:21,NEGATION:22,NORMAL:23,OVERLAY:24,PIN_LIGHT:25,REFLECT:26,SATURATION:27,SCREEN:28,SOFT_LIGHT:29,SRC:30,SUBTRACT:31,VIVID_LIGHT:32},H1={NONE:0,DEPTH:1,CONVOLUTION:2},Lo={FRAGMENT_HEAD:"FRAGMENT_HEAD",FRAGMENT_MAIN_UV:"FRAGMENT_MAIN_UV",FRAGMENT_MAIN_IMAGE:"FRAGMENT_MAIN_IMAGE",VERTEX_HEAD:"VERTEX_HEAD",VERTEX_MAIN_SUPPORT:"VERTEX_MAIN_SUPPORT"},U4={VERY_SMALL:0,SMALL:1,MEDIUM:2,LARGE:3,VERY_LARGE:4,HUGE:5},hke=`#ifdef FRAMEBUFFER_PRECISION_HIGH + */var cke="varying vec2 vUv;void main(){vUv=position.xy*0.5+0.5;gl_Position=vec4(position.xy,1.0,1.0);}";function c9(n,e){let t="texel";if(n!==null){const r=Number.parseInt(hE);if(!(e&&r>=133&&r!==135&&n.format===jp&&n.type===af&&n.encoding===ms))switch(n.encoding){case ms:t="sRGBToLinear(texel)";break;case xg:t="texel";break;default:throw new Error(`Unsupported encoding: ${n.encoding}`)}}return t}var Is={SKIP:9,SET:30,ADD:0,ALPHA:1,AVERAGE:2,COLOR:3,COLOR_BURN:4,COLOR_DODGE:5,DARKEN:6,DIFFERENCE:7,DIVIDE:8,DST:9,EXCLUSION:10,HARD_LIGHT:11,HARD_MIX:12,HUE:13,INVERT:14,INVERT_RGB:15,LIGHTEN:16,LINEAR_BURN:17,LINEAR_DODGE:18,LINEAR_LIGHT:19,LUMINOSITY:20,MULTIPLY:21,NEGATION:22,NORMAL:23,OVERLAY:24,PIN_LIGHT:25,REFLECT:26,SATURATION:27,SCREEN:28,SOFT_LIGHT:29,SRC:30,SUBTRACT:31,VIVID_LIGHT:32},G1={NONE:0,DEPTH:1,CONVOLUTION:2},Lo={FRAGMENT_HEAD:"FRAGMENT_HEAD",FRAGMENT_MAIN_UV:"FRAGMENT_MAIN_UV",FRAGMENT_MAIN_IMAGE:"FRAGMENT_MAIN_IMAGE",VERTEX_HEAD:"VERTEX_HEAD",VERTEX_MAIN_SUPPORT:"VERTEX_MAIN_SUPPORT"},U4={VERY_SMALL:0,SMALL:1,MEDIUM:2,LARGE:3,VERY_LARGE:4,HUGE:5},hke=`#ifdef FRAMEBUFFER_PRECISION_HIGH uniform mediump sampler2D inputBuffer; #else uniform lowp sampler2D inputBuffer; @@ -5683,7 +5683,7 @@ uniform lowp sampler2D inputBuffer; uniform float opacity;varying vec2 vUv;void main(){vec4 texel=texture2D(inputBuffer,vUv);gl_FragColor=opacity*texel; #include #include -}`,mee=class extends xd{constructor(){super({name:"CopyMaterial",uniforms:{inputBuffer:new no(null),opacity:new no(1)},blending:pp,depthWrite:!1,depthTest:!1,fragmentShader:mke,vertexShader:cke}),this.toneMapped=!1}set inputBuffer(n){this.uniforms.inputBuffer.value=n}setInputBuffer(n){this.uniforms.inputBuffer.value=n}getOpacity(n){return this.uniforms.opacity.value}setOpacity(n){this.uniforms.opacity.value=n}},gke=`#include +}`,gee=class extends xd{constructor(){super({name:"CopyMaterial",uniforms:{inputBuffer:new no(null),opacity:new no(1)},blending:pp,depthWrite:!1,depthTest:!1,fragmentShader:mke,vertexShader:cke}),this.toneMapped=!1}set inputBuffer(n){this.uniforms.inputBuffer.value=n}setInputBuffer(n){this.uniforms.inputBuffer.value=n}getOpacity(n){return this.uniforms.opacity.value}setOpacity(n){this.uniforms.opacity.value=n}},gke=`#include #include #ifdef GL_FRAGMENT_PRECISION_HIGH uniform highp sampler2D depthBuffer; @@ -5736,7 +5736,7 @@ vec3 n[]=vec3[4](texture2D(normalBuffer,vUv0).rgb,texture2D(normalBuffer,vUv1).r #else vec3 n[]=vec3[4](vec3(0.0),vec3(0.0),vec3(0.0),vec3(0.0)); #endif -gl_FragColor=vec4(n[index],d[index]);}`,bke="uniform vec2 texelSize;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 uv=position.xy*0.5+0.5;vUv0=uv;vUv1=vec2(uv.x,uv.y+texelSize.y);vUv2=vec2(uv.x+texelSize.x,uv.y);vUv3=uv+texelSize;gl_Position=vec4(position.xy,1.0,1.0);}",Tke=class extends xd{constructor(){super({name:"DepthDownsamplingMaterial",defines:{DEPTH_PACKING:"0"},uniforms:{depthBuffer:new no(null),normalBuffer:new no(null),texelSize:new no(new jt)},blending:pp,depthWrite:!1,depthTest:!1,fragmentShader:yke,vertexShader:bke}),this.toneMapped=!1}set depthBuffer(n){this.uniforms.depthBuffer.value=n}set depthPacking(n){this.defines.DEPTH_PACKING=n.toFixed(0),this.needsUpdate=!0}setDepthBuffer(n,e=nb){this.depthBuffer=n,this.depthPacking=e}set normalBuffer(n){this.uniforms.normalBuffer.value=n,n!==null?this.defines.DOWNSAMPLE_NORMALS="1":delete this.defines.DOWNSAMPLE_NORMALS,this.needsUpdate=!0}setNormalBuffer(n){this.normalBuffer=n}setTexelSize(n,e){this.uniforms.texelSize.value.set(n,e)}setSize(n,e){this.uniforms.texelSize.value.set(1/n,1/e)}},Ske=`#include +gl_FragColor=vec4(n[index],d[index]);}`,bke="uniform vec2 texelSize;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 uv=position.xy*0.5+0.5;vUv0=uv;vUv1=vec2(uv.x,uv.y+texelSize.y);vUv2=vec2(uv.x+texelSize.x,uv.y);vUv3=uv+texelSize;gl_Position=vec4(position.xy,1.0,1.0);}",Tke=class extends xd{constructor(){super({name:"DepthDownsamplingMaterial",defines:{DEPTH_PACKING:"0"},uniforms:{depthBuffer:new no(null),normalBuffer:new no(null),texelSize:new no(new Vt)},blending:pp,depthWrite:!1,depthTest:!1,fragmentShader:yke,vertexShader:bke}),this.toneMapped=!1}set depthBuffer(n){this.uniforms.depthBuffer.value=n}set depthPacking(n){this.defines.DEPTH_PACKING=n.toFixed(0),this.needsUpdate=!0}setDepthBuffer(n,e=nb){this.depthBuffer=n,this.depthPacking=e}set normalBuffer(n){this.uniforms.normalBuffer.value=n,n!==null?this.defines.DOWNSAMPLE_NORMALS="1":delete this.defines.DOWNSAMPLE_NORMALS,this.needsUpdate=!0}setNormalBuffer(n){this.normalBuffer=n}setTexelSize(n,e){this.uniforms.texelSize.value.set(n,e)}setSize(n,e){this.uniforms.texelSize.value.set(1/n,1/e)}},Ske=`#include #include #include #define packFloatToRGBA(v) packDepthToRGBA(v) @@ -5777,25 +5777,25 @@ return orthographicDepthToViewZ(depth,cameraNear,cameraFar); #include #endif #include -}`,wke="uniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv;VERTEX_HEADvoid main(){vUv=position.xy*0.5+0.5;VERTEX_MAIN_SUPPORTgl_Position=vec4(position.xy,1.0,1.0);}",Eke=class extends xd{constructor(n,e,t,r,s=!1){super({name:"EffectMaterial",defines:{THREE_REVISION:hE.replace(/\D+/g,""),DEPTH_PACKING:"0",ENCODE_OUTPUT:"1"},uniforms:{inputBuffer:new no(null),depthBuffer:new no(null),resolution:new no(new jt),texelSize:new no(new jt),cameraNear:new no(.3),cameraFar:new no(1e3),aspect:new no(1),time:new no(0)},blending:pp,depthWrite:!1,depthTest:!1,dithering:s}),this.toneMapped=!1,n&&this.setShaderParts(n),e&&this.setDefines(e),t&&this.setUniforms(t),this.copyCameraSettings(r)}set inputBuffer(n){this.uniforms.inputBuffer.value=n}setInputBuffer(n){this.uniforms.inputBuffer.value=n}get depthBuffer(){return this.uniforms.depthBuffer.value}set depthBuffer(n){this.uniforms.depthBuffer.value=n}get depthPacking(){return Number(this.defines.DEPTH_PACKING)}set depthPacking(n){this.defines.DEPTH_PACKING=n.toFixed(0),this.needsUpdate=!0}setDepthBuffer(n,e=nb){this.depthBuffer=n,this.depthPacking=e}setShaderData(n){this.setShaderParts(n.shaderParts),this.setDefines(n.defines),this.setUniforms(n.uniforms),this.setExtensions(n.extensions)}setShaderParts(n){var e,t,r,s,o;return this.fragmentShader=Ske.replace(Lo.FRAGMENT_HEAD,(e=n.get(Lo.FRAGMENT_HEAD))!=null?e:"").replace(Lo.FRAGMENT_MAIN_UV,(t=n.get(Lo.FRAGMENT_MAIN_UV))!=null?t:"").replace(Lo.FRAGMENT_MAIN_IMAGE,(r=n.get(Lo.FRAGMENT_MAIN_IMAGE))!=null?r:""),this.vertexShader=wke.replace(Lo.VERTEX_HEAD,(s=n.get(Lo.VERTEX_HEAD))!=null?s:"").replace(Lo.VERTEX_MAIN_SUPPORT,(o=n.get(Lo.VERTEX_MAIN_SUPPORT))!=null?o:""),this.needsUpdate=!0,this}setDefines(n){for(const e of n.entries())this.defines[e[0]]=e[1];return this.needsUpdate=!0,this}setUniforms(n){for(const e of n.entries())this.uniforms[e[0]]=e[1];return this}setExtensions(n){this.extensions={};for(const e of n)this.extensions[e]=!0;return this}get encodeOutput(){return this.defines.ENCODE_OUTPUT!==void 0}set encodeOutput(n){this.encodeOutput!==n&&(n?this.defines.ENCODE_OUTPUT="1":delete this.defines.ENCODE_OUTPUT,this.needsUpdate=!0)}isOutputEncodingEnabled(n){return this.encodeOutput}setOutputEncodingEnabled(n){this.encodeOutput=n}get time(){return this.uniforms.time.value}set time(n){this.uniforms.time.value=n}setDeltaTime(n){this.uniforms.time.value+=n}adoptCameraSettings(n){this.copyCameraSettings(n)}copyCameraSettings(n){n&&(this.uniforms.cameraNear.value=n.near,this.uniforms.cameraFar.value=n.far,n instanceof Za?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}setSize(n,e){const t=this.uniforms;t.resolution.value.set(n,e),t.texelSize.value.set(1/n,1/e),t.aspect.value=n/e}static get Section(){return Lo}},xke="uniform lowp sampler2D inputBuffer;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 c0=texture2D(inputBuffer,vUv0).rg;vec2 c1=texture2D(inputBuffer,vUv1).rg;vec2 c2=texture2D(inputBuffer,vUv2).rg;vec2 c3=texture2D(inputBuffer,vUv3).rg;float d0=(c0.x-c1.x)*0.5;float d1=(c2.x-c3.x)*0.5;float d=length(vec2(d0,d1));float a0=min(c0.y,c1.y);float a1=min(c2.y,c3.y);float visibilityFactor=min(a0,a1);gl_FragColor.rg=(1.0-visibilityFactor>0.001)?vec2(d,0.0):vec2(0.0,d);}",$ke="uniform vec2 texelSize;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 uv=position.xy*0.5+0.5;vUv0=vec2(uv.x+texelSize.x,uv.y);vUv1=vec2(uv.x-texelSize.x,uv.y);vUv2=vec2(uv.x,uv.y+texelSize.y);vUv3=vec2(uv.x,uv.y-texelSize.y);gl_Position=vec4(position.xy,1.0,1.0);}",Cke=class extends xd{constructor(n=new jt){super({name:"OutlineMaterial",uniforms:{inputBuffer:new no(null),texelSize:new no(new jt)},blending:pp,depthWrite:!1,depthTest:!1,fragmentShader:xke,vertexShader:$ke}),this.toneMapped=!1,this.uniforms.texelSize.value.set(n.x,n.y),this.uniforms.maskTexture=this.uniforms.inputBuffer}set inputBuffer(n){this.uniforms.inputBuffer.value=n}setInputBuffer(n){this.uniforms.inputBuffer.value=n}setTexelSize(n,e){this.uniforms.texelSize.value.set(n,e)}setSize(n,e){this.uniforms.texelSize.value.set(1/n,1/e)}},Mke=new fE,fy=null;function Ake(){if(fy===null){const n=new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),e=new Float32Array([0,0,2,0,0,2]);fy=new ui,fy.setAttribute!==void 0?(fy.setAttribute("position",new Do(n,3)),fy.setAttribute("uv",new Do(e,2))):(fy.addAttribute("position",new Do(n,3)),fy.addAttribute("uv",new Do(e,2)))}return fy}var Km=class{constructor(n="Pass",e=new V$,t=Mke){this.name=n,this.renderer=null,this.scene=e,this.camera=t,this.screen=null,this.rtt=!0,this.needsSwap=!0,this.needsDepthTexture=!1,this.enabled=!0}get renderToScreen(){return!this.rtt}set renderToScreen(n){if(this.rtt===n){const e=this.fullscreenMaterial;e!==null&&(e.needsUpdate=!0),this.rtt=!n}}set mainScene(n){}set mainCamera(n){}setRenderer(n){this.renderer=n}isEnabled(){return this.enabled}setEnabled(n){this.enabled=n}get fullscreenMaterial(){return this.screen!==null?this.screen.material:null}set fullscreenMaterial(n){let e=this.screen;e!==null?e.material=n:(e=new Hn(Ake(),n),e.frustumCulled=!1,this.scene===null&&(this.scene=new V$),this.scene.add(e),this.screen=e)}getFullscreenMaterial(){return this.fullscreenMaterial}setFullscreenMaterial(n){this.fullscreenMaterial=n}getDepthTexture(){return null}setDepthTexture(n,e=nb){}render(n,e,t,r,s){throw new Error("Render method not implemented!")}setSize(n,e){}initialize(n,e,t){}dispose(){for(const n of Object.keys(this)){const e=this[n];(e instanceof Nc||e instanceof hd||e instanceof dc||e instanceof Km)&&this[n].dispose()}}},Ike=class extends Km{constructor(n,e=!0){super("CopyPass"),this.fullscreenMaterial=new mee,this.needsSwap=!1,this.renderTarget=n,n===void 0&&(this.renderTarget=new Nc(1,1,{minFilter:wl,magFilter:wl,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="CopyPass.Target"),this.autoResize=e}get resize(){return this.autoResize}set resize(n){this.autoResize=n}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}setAutoResizeEnabled(n){this.autoResize=n}render(n,e,t,r,s){this.fullscreenMaterial.inputBuffer=e.texture,n.setRenderTarget(this.renderToScreen?null:this.renderTarget),n.render(this.scene,this.camera)}setSize(n,e){this.autoResize&&this.renderTarget.setSize(n,e)}initialize(n,e,t){t!==void 0&&(this.renderTarget.texture.type=t,t!==af?this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1":n.outputEncoding===ms&&(this.renderTarget.texture.encoding=ms))}},Rke=class extends Km{constructor(){super("ClearMaskPass",null,null),this.needsSwap=!1}render(n,e,t,r,s){const o=n.state.buffers.stencil;o.setLocked(!1),o.setTest(!1)}},c9=new Fn,H4=class extends Km{constructor(n=!0,e=!0,t=!1){super("ClearPass",null,null),this.needsSwap=!1,this.color=n,this.depth=e,this.stencil=t,this.overrideClearColor=null,this.overrideClearAlpha=-1}setClearFlags(n,e,t){this.color=n,this.depth=e,this.stencil=t}getOverrideClearColor(){return this.overrideClearColor}setOverrideClearColor(n){this.overrideClearColor=n}getOverrideClearAlpha(){return this.overrideClearAlpha}setOverrideClearAlpha(n){this.overrideClearAlpha=n}render(n,e,t,r,s){const o=this.overrideClearColor,l=this.overrideClearAlpha,u=n.getClearAlpha(),h=o!==null,f=l>=0;h?(n.getClearColor(c9),n.setClearColor(o,f?l:u)):f&&n.setClearAlpha(l),n.setRenderTarget(this.renderToScreen?null:e),n.clear(this.color,this.depth,this.stencil),h?n.setClearColor(c9,u):f&&n.setClearAlpha(u)}},py=-1,cp=class extends jm{constructor(n,e=py,t=py,r=1){super(),this.resizable=n,this.baseSize=new jt(1,1),this.preferredSize=new jt(e,t),this.target=this.preferredSize,this.s=r,this.effectiveSize=new jt,this.addEventListener("change",()=>this.updateEffectiveSize()),this.updateEffectiveSize()}updateEffectiveSize(){const n=this.baseSize,e=this.preferredSize,t=this.effectiveSize,r=this.scale;e.width!==py?t.width=e.width:e.height!==py?t.width=Math.round(e.height*(n.width/Math.max(n.height,1))):t.width=Math.round(n.width*r),e.height!==py?t.height=e.height:e.width!==py?t.height=Math.round(e.width/Math.max(n.width/Math.max(n.height,1),1)):t.height=Math.round(n.height*r)}get width(){return this.effectiveSize.width}set width(n){this.preferredWidth=n}get height(){return this.effectiveSize.height}set height(n){this.preferredHeight=n}getWidth(){return this.width}getHeight(){return this.height}get scale(){return this.s}set scale(n){this.s!==n&&(this.s=n,this.preferredSize.setScalar(py),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getScale(){return this.scale}setScale(n){this.scale=n}get baseWidth(){return this.baseSize.width}set baseWidth(n){this.baseSize.width!==n&&(this.baseSize.width=n,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getBaseWidth(){return this.baseWidth}setBaseWidth(n){this.baseWidth=n}get baseHeight(){return this.baseSize.height}set baseHeight(n){this.baseSize.height!==n&&(this.baseSize.height=n,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getBaseHeight(){return this.baseHeight}setBaseHeight(n){this.baseHeight=n}setBaseSize(n,e){(this.baseSize.width!==n||this.baseSize.height!==e)&&(this.baseSize.set(n,e),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}get preferredWidth(){return this.preferredSize.width}set preferredWidth(n){this.preferredSize.width!==n&&(this.preferredSize.width=n,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getPreferredWidth(){return this.preferredWidth}setPreferredWidth(n){this.preferredWidth=n}get preferredHeight(){return this.preferredSize.height}set preferredHeight(n){this.preferredSize.height!==n&&(this.preferredSize.height=n,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getPreferredHeight(){return this.preferredHeight}setPreferredHeight(n){this.preferredHeight=n}setPreferredSize(n,e){(this.preferredSize.width!==n||this.preferredSize.height!==e)&&(this.preferredSize.set(n,e),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}copy(n){this.s=n.scale,this.baseSize.set(n.baseWidth,n.baseHeight),this.preferredSize.set(n.preferredWidth,n.preferredHeight),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height)}static get AUTO_SIZE(){return py}},bN=!1,h9=class{constructor(n=null){this.originalMaterials=new Map,this.material=null,this.materials=null,this.materialsBackSide=null,this.materialsDoubleSide=null,this.materialsFlatShaded=null,this.materialsFlatShadedBackSide=null,this.materialsFlatShadedDoubleSide=null,this.setMaterial(n),this.meshCount=0,this.replaceMaterial=e=>{if(e.isMesh){let t;if(e.material.flatShading)switch(e.material.side){case lp:t=this.materialsFlatShadedDoubleSide;break;case cd:t=this.materialsFlatShadedBackSide;break;default:t=this.materialsFlatShaded;break}else switch(e.material.side){case lp:t=this.materialsDoubleSide;break;case cd:t=this.materialsBackSide;break;default:t=this.materials;break}this.originalMaterials.set(e,e.material),e.isSkinnedMesh?e.material=t[2]:e.isInstancedMesh?e.material=t[1]:e.material=t[0],++this.meshCount}}}setMaterial(n){if(this.disposeMaterials(),this.material=n,n!==null){const e=this.materials=[n.clone(),n.clone(),n.clone()];for(const t of e)t.uniforms=Object.assign({},n.uniforms),t.side=p_;e[2].skinning=!0,this.materialsBackSide=e.map(t=>{const r=t.clone();return r.uniforms=Object.assign({},n.uniforms),r.side=cd,r}),this.materialsDoubleSide=e.map(t=>{const r=t.clone();return r.uniforms=Object.assign({},n.uniforms),r.side=lp,r}),this.materialsFlatShaded=e.map(t=>{const r=t.clone();return r.uniforms=Object.assign({},n.uniforms),r.flatShading=!0,r}),this.materialsFlatShadedBackSide=e.map(t=>{const r=t.clone();return r.uniforms=Object.assign({},n.uniforms),r.flatShading=!0,r.side=cd,r}),this.materialsFlatShadedDoubleSide=e.map(t=>{const r=t.clone();return r.uniforms=Object.assign({},n.uniforms),r.flatShading=!0,r.side=lp,r})}}render(n,e,t){const r=n.shadowMap.enabled;if(n.shadowMap.enabled=!1,bN){const s=this.originalMaterials;this.meshCount=0,e.traverse(this.replaceMaterial),n.render(e,t);for(const o of s)o[0].material=o[1];this.meshCount!==s.size&&s.clear()}else{const s=e.overrideMaterial;e.overrideMaterial=this.material,n.render(e,t),e.overrideMaterial=s}n.shadowMap.enabled=r}disposeMaterials(){if(this.material!==null){const n=this.materials.concat(this.materialsBackSide).concat(this.materialsDoubleSide).concat(this.materialsFlatShaded).concat(this.materialsFlatShadedBackSide).concat(this.materialsFlatShadedDoubleSide);for(const e of n)e.dispose()}}dispose(){this.originalMaterials.clear(),this.disposeMaterials()}static get workaroundEnabled(){return bN}static set workaroundEnabled(n){bN=n}},w2=class extends Km{constructor(n,e,t=null){super("RenderPass",n,e),this.needsSwap=!1,this.clearPass=new H4,this.overrideMaterialManager=t===null?null:new h9(t),this.ignoreBackground=!1,this.skipShadowMapUpdate=!1,this.selection=null}set mainScene(n){this.scene=n}set mainCamera(n){this.camera=n}get renderToScreen(){return super.renderToScreen}set renderToScreen(n){super.renderToScreen=n,this.clearPass.renderToScreen=n}get overrideMaterial(){const n=this.overrideMaterialManager;return n!==null?n.material:null}set overrideMaterial(n){const e=this.overrideMaterialManager;n!==null?e!==null?e.setMaterial(n):this.overrideMaterialManager=new h9(n):e!==null&&(e.dispose(),this.overrideMaterialManager=null)}getOverrideMaterial(){return this.overrideMaterial}setOverrideMaterial(n){this.overrideMaterial=n}get clear(){return this.clearPass.enabled}set clear(n){this.clearPass.enabled=n}getSelection(){return this.selection}setSelection(n){this.selection=n}isBackgroundDisabled(){return this.ignoreBackground}setBackgroundDisabled(n){this.ignoreBackground=n}isShadowMapDisabled(){return this.skipShadowMapUpdate}setShadowMapDisabled(n){this.skipShadowMapUpdate=n}getClearPass(){return this.clearPass}render(n,e,t,r,s){const o=this.scene,l=this.camera,u=this.selection,h=l.layers.mask,f=o.background,g=n.shadowMap.autoUpdate,y=this.renderToScreen?null:e;u!==null&&l.layers.set(u.getLayer()),this.skipShadowMapUpdate&&(n.shadowMap.autoUpdate=!1),(this.ignoreBackground||this.clearPass.overrideClearColor!==null)&&(o.background=null),this.clearPass.enabled&&this.clearPass.render(n,e),n.setRenderTarget(y),this.overrideMaterialManager!==null?this.overrideMaterialManager.render(n,o,l):n.render(o,l),l.layers.mask=h,o.background=f,n.shadowMap.autoUpdate=g}},kke=class extends Km{constructor(n,e,{renderTarget:t,resolutionScale:r=1,width:s=cp.AUTO_SIZE,height:o=cp.AUTO_SIZE,resolutionX:l=s,resolutionY:u=o}={}){super("DepthPass"),this.needsSwap=!1,this.renderPass=new w2(n,e,new NC({depthPacking:Nw}));const h=this.renderPass;h.skipShadowMapUpdate=!0,h.ignoreBackground=!0;const f=h.getClearPass();f.overrideClearColor=new Fn(16777215),f.overrideClearAlpha=1,this.renderTarget=t,this.renderTarget===void 0&&(this.renderTarget=new Nc(1,1,{minFilter:Wl,magFilter:Wl}),this.renderTarget.texture.name="DepthPass.Target");const g=this.resolution=new cp(this,l,u,r);g.addEventListener("change",y=>this.setSize(g.baseWidth,g.baseHeight))}set mainScene(n){this.renderPass.mainScene=n}set mainCamera(n){this.renderPass.mainCamera=n}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}getResolutionScale(){return this.resolution.scale}setResolutionScale(n){this.resolution.scale=n}render(n,e,t,r,s){const o=this.renderToScreen?null:this.renderTarget;this.renderPass.render(n,o)}setSize(n,e){const t=this.resolution;t.setBaseSize(n,e),this.renderTarget.setSize(t.width,t.height)}},Oke=class extends Km{constructor({normalBuffer:n=null,resolutionScale:e=.5,width:t=cp.AUTO_SIZE,height:r=cp.AUTO_SIZE,resolutionX:s=t,resolutionY:o=r}={}){super("DepthDownsamplingPass");const l=new Tke;l.normalBuffer=n,this.fullscreenMaterial=l,this.needsDepthTexture=!0,this.needsSwap=!1,this.renderTarget=new Nc(1,1,{minFilter:Wl,magFilter:Wl,depthBuffer:!1,type:r_}),this.renderTarget.texture.name="DepthDownsamplingPass.Target",this.renderTarget.texture.generateMipmaps=!1;const u=this.resolution=new cp(this,s,o,e);u.addEventListener("change",h=>this.setSize(u.baseWidth,u.baseHeight))}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}setDepthTexture(n,e=nb){this.fullscreenMaterial.depthBuffer=n,this.fullscreenMaterial.depthPacking=e}render(n,e,t,r,s){n.setRenderTarget(this.renderToScreen?null:this.renderTarget),n.render(this.scene,this.camera)}setSize(n,e){const t=this.resolution;t.setBaseSize(n,e),this.renderTarget.setSize(t.width,t.height),this.fullscreenMaterial.setSize(n,e)}initialize(n,e,t){const r=n.getContext();if(!(r.getExtension("EXT_color_buffer_float")||r.getExtension("EXT_color_buffer_half_float")))throw new Error("Rendering to float texture is not supported.")}};function d9(n,e,t){for(const r of e){const s="$1"+n+r.charAt(0).toUpperCase()+r.slice(1),o=new RegExp("([^\\.])(\\b"+r+"\\b)","g");for(const l of t.entries())l[1]!==null&&t.set(l[0],l[1].replace(o,s))}}function Lke(n,e,t){var r,s,o,l,u;let h=e.getFragmentShader(),f=e.getVertexShader();const g=h!==void 0&&/mainImage/.test(h),y=h!==void 0&&/mainUv/.test(h);if(t.attributes|=e.getAttributes(),h===void 0)throw new Error(`Missing fragment shader (${e.name})`);if(y&&t.attributes&H1.CONVOLUTION)throw new Error(`Effects that transform UVs are incompatible with convolution effects (${e.name})`);if(!g&&!y)throw new Error(`Could not find mainImage or mainUv function (${e.name})`);{const b=/\w+\s+(\w+)\([\w\s,]*\)\s*{/g,w=t.shaderParts;let C=(r=w.get(Lo.FRAGMENT_HEAD))!=null?r:"",M=(s=w.get(Lo.FRAGMENT_MAIN_UV))!=null?s:"",A=(o=w.get(Lo.FRAGMENT_MAIN_IMAGE))!=null?o:"",k=(l=w.get(Lo.VERTEX_HEAD))!=null?l:"",L=(u=w.get(Lo.VERTEX_MAIN_SUPPORT))!=null?u:"";const P=new Set,D=new Set;if(y&&(M+=` ${n}MainUv(UV); +}`,wke="uniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv;VERTEX_HEADvoid main(){vUv=position.xy*0.5+0.5;VERTEX_MAIN_SUPPORTgl_Position=vec4(position.xy,1.0,1.0);}",Eke=class extends xd{constructor(n,e,t,r,s=!1){super({name:"EffectMaterial",defines:{THREE_REVISION:hE.replace(/\D+/g,""),DEPTH_PACKING:"0",ENCODE_OUTPUT:"1"},uniforms:{inputBuffer:new no(null),depthBuffer:new no(null),resolution:new no(new Vt),texelSize:new no(new Vt),cameraNear:new no(.3),cameraFar:new no(1e3),aspect:new no(1),time:new no(0)},blending:pp,depthWrite:!1,depthTest:!1,dithering:s}),this.toneMapped=!1,n&&this.setShaderParts(n),e&&this.setDefines(e),t&&this.setUniforms(t),this.copyCameraSettings(r)}set inputBuffer(n){this.uniforms.inputBuffer.value=n}setInputBuffer(n){this.uniforms.inputBuffer.value=n}get depthBuffer(){return this.uniforms.depthBuffer.value}set depthBuffer(n){this.uniforms.depthBuffer.value=n}get depthPacking(){return Number(this.defines.DEPTH_PACKING)}set depthPacking(n){this.defines.DEPTH_PACKING=n.toFixed(0),this.needsUpdate=!0}setDepthBuffer(n,e=nb){this.depthBuffer=n,this.depthPacking=e}setShaderData(n){this.setShaderParts(n.shaderParts),this.setDefines(n.defines),this.setUniforms(n.uniforms),this.setExtensions(n.extensions)}setShaderParts(n){var e,t,r,s,o;return this.fragmentShader=Ske.replace(Lo.FRAGMENT_HEAD,(e=n.get(Lo.FRAGMENT_HEAD))!=null?e:"").replace(Lo.FRAGMENT_MAIN_UV,(t=n.get(Lo.FRAGMENT_MAIN_UV))!=null?t:"").replace(Lo.FRAGMENT_MAIN_IMAGE,(r=n.get(Lo.FRAGMENT_MAIN_IMAGE))!=null?r:""),this.vertexShader=wke.replace(Lo.VERTEX_HEAD,(s=n.get(Lo.VERTEX_HEAD))!=null?s:"").replace(Lo.VERTEX_MAIN_SUPPORT,(o=n.get(Lo.VERTEX_MAIN_SUPPORT))!=null?o:""),this.needsUpdate=!0,this}setDefines(n){for(const e of n.entries())this.defines[e[0]]=e[1];return this.needsUpdate=!0,this}setUniforms(n){for(const e of n.entries())this.uniforms[e[0]]=e[1];return this}setExtensions(n){this.extensions={};for(const e of n)this.extensions[e]=!0;return this}get encodeOutput(){return this.defines.ENCODE_OUTPUT!==void 0}set encodeOutput(n){this.encodeOutput!==n&&(n?this.defines.ENCODE_OUTPUT="1":delete this.defines.ENCODE_OUTPUT,this.needsUpdate=!0)}isOutputEncodingEnabled(n){return this.encodeOutput}setOutputEncodingEnabled(n){this.encodeOutput=n}get time(){return this.uniforms.time.value}set time(n){this.uniforms.time.value=n}setDeltaTime(n){this.uniforms.time.value+=n}adoptCameraSettings(n){this.copyCameraSettings(n)}copyCameraSettings(n){n&&(this.uniforms.cameraNear.value=n.near,this.uniforms.cameraFar.value=n.far,n instanceof Za?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}setSize(n,e){const t=this.uniforms;t.resolution.value.set(n,e),t.texelSize.value.set(1/n,1/e),t.aspect.value=n/e}static get Section(){return Lo}},xke="uniform lowp sampler2D inputBuffer;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 c0=texture2D(inputBuffer,vUv0).rg;vec2 c1=texture2D(inputBuffer,vUv1).rg;vec2 c2=texture2D(inputBuffer,vUv2).rg;vec2 c3=texture2D(inputBuffer,vUv3).rg;float d0=(c0.x-c1.x)*0.5;float d1=(c2.x-c3.x)*0.5;float d=length(vec2(d0,d1));float a0=min(c0.y,c1.y);float a1=min(c2.y,c3.y);float visibilityFactor=min(a0,a1);gl_FragColor.rg=(1.0-visibilityFactor>0.001)?vec2(d,0.0):vec2(0.0,d);}",$ke="uniform vec2 texelSize;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 uv=position.xy*0.5+0.5;vUv0=vec2(uv.x+texelSize.x,uv.y);vUv1=vec2(uv.x-texelSize.x,uv.y);vUv2=vec2(uv.x,uv.y+texelSize.y);vUv3=vec2(uv.x,uv.y-texelSize.y);gl_Position=vec4(position.xy,1.0,1.0);}",Cke=class extends xd{constructor(n=new Vt){super({name:"OutlineMaterial",uniforms:{inputBuffer:new no(null),texelSize:new no(new Vt)},blending:pp,depthWrite:!1,depthTest:!1,fragmentShader:xke,vertexShader:$ke}),this.toneMapped=!1,this.uniforms.texelSize.value.set(n.x,n.y),this.uniforms.maskTexture=this.uniforms.inputBuffer}set inputBuffer(n){this.uniforms.inputBuffer.value=n}setInputBuffer(n){this.uniforms.inputBuffer.value=n}setTexelSize(n,e){this.uniforms.texelSize.value.set(n,e)}setSize(n,e){this.uniforms.texelSize.value.set(1/n,1/e)}},Mke=new fE,fy=null;function Ake(){if(fy===null){const n=new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),e=new Float32Array([0,0,2,0,0,2]);fy=new ui,fy.setAttribute!==void 0?(fy.setAttribute("position",new Do(n,3)),fy.setAttribute("uv",new Do(e,2))):(fy.addAttribute("position",new Do(n,3)),fy.addAttribute("uv",new Do(e,2)))}return fy}var Km=class{constructor(n="Pass",e=new V$,t=Mke){this.name=n,this.renderer=null,this.scene=e,this.camera=t,this.screen=null,this.rtt=!0,this.needsSwap=!0,this.needsDepthTexture=!1,this.enabled=!0}get renderToScreen(){return!this.rtt}set renderToScreen(n){if(this.rtt===n){const e=this.fullscreenMaterial;e!==null&&(e.needsUpdate=!0),this.rtt=!n}}set mainScene(n){}set mainCamera(n){}setRenderer(n){this.renderer=n}isEnabled(){return this.enabled}setEnabled(n){this.enabled=n}get fullscreenMaterial(){return this.screen!==null?this.screen.material:null}set fullscreenMaterial(n){let e=this.screen;e!==null?e.material=n:(e=new Hn(Ake(),n),e.frustumCulled=!1,this.scene===null&&(this.scene=new V$),this.scene.add(e),this.screen=e)}getFullscreenMaterial(){return this.fullscreenMaterial}setFullscreenMaterial(n){this.fullscreenMaterial=n}getDepthTexture(){return null}setDepthTexture(n,e=nb){}render(n,e,t,r,s){throw new Error("Render method not implemented!")}setSize(n,e){}initialize(n,e,t){}dispose(){for(const n of Object.keys(this)){const e=this[n];(e instanceof Nc||e instanceof hd||e instanceof dc||e instanceof Km)&&this[n].dispose()}}},Ike=class extends Km{constructor(n,e=!0){super("CopyPass"),this.fullscreenMaterial=new gee,this.needsSwap=!1,this.renderTarget=n,n===void 0&&(this.renderTarget=new Nc(1,1,{minFilter:wl,magFilter:wl,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="CopyPass.Target"),this.autoResize=e}get resize(){return this.autoResize}set resize(n){this.autoResize=n}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}setAutoResizeEnabled(n){this.autoResize=n}render(n,e,t,r,s){this.fullscreenMaterial.inputBuffer=e.texture,n.setRenderTarget(this.renderToScreen?null:this.renderTarget),n.render(this.scene,this.camera)}setSize(n,e){this.autoResize&&this.renderTarget.setSize(n,e)}initialize(n,e,t){t!==void 0&&(this.renderTarget.texture.type=t,t!==af?this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1":n.outputEncoding===ms&&(this.renderTarget.texture.encoding=ms))}},Rke=class extends Km{constructor(){super("ClearMaskPass",null,null),this.needsSwap=!1}render(n,e,t,r,s){const o=n.state.buffers.stencil;o.setLocked(!1),o.setTest(!1)}},h9=new Fn,H4=class extends Km{constructor(n=!0,e=!0,t=!1){super("ClearPass",null,null),this.needsSwap=!1,this.color=n,this.depth=e,this.stencil=t,this.overrideClearColor=null,this.overrideClearAlpha=-1}setClearFlags(n,e,t){this.color=n,this.depth=e,this.stencil=t}getOverrideClearColor(){return this.overrideClearColor}setOverrideClearColor(n){this.overrideClearColor=n}getOverrideClearAlpha(){return this.overrideClearAlpha}setOverrideClearAlpha(n){this.overrideClearAlpha=n}render(n,e,t,r,s){const o=this.overrideClearColor,l=this.overrideClearAlpha,u=n.getClearAlpha(),h=o!==null,f=l>=0;h?(n.getClearColor(h9),n.setClearColor(o,f?l:u)):f&&n.setClearAlpha(l),n.setRenderTarget(this.renderToScreen?null:e),n.clear(this.color,this.depth,this.stencil),h?n.setClearColor(h9,u):f&&n.setClearAlpha(u)}},py=-1,cp=class extends jm{constructor(n,e=py,t=py,r=1){super(),this.resizable=n,this.baseSize=new Vt(1,1),this.preferredSize=new Vt(e,t),this.target=this.preferredSize,this.s=r,this.effectiveSize=new Vt,this.addEventListener("change",()=>this.updateEffectiveSize()),this.updateEffectiveSize()}updateEffectiveSize(){const n=this.baseSize,e=this.preferredSize,t=this.effectiveSize,r=this.scale;e.width!==py?t.width=e.width:e.height!==py?t.width=Math.round(e.height*(n.width/Math.max(n.height,1))):t.width=Math.round(n.width*r),e.height!==py?t.height=e.height:e.width!==py?t.height=Math.round(e.width/Math.max(n.width/Math.max(n.height,1),1)):t.height=Math.round(n.height*r)}get width(){return this.effectiveSize.width}set width(n){this.preferredWidth=n}get height(){return this.effectiveSize.height}set height(n){this.preferredHeight=n}getWidth(){return this.width}getHeight(){return this.height}get scale(){return this.s}set scale(n){this.s!==n&&(this.s=n,this.preferredSize.setScalar(py),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getScale(){return this.scale}setScale(n){this.scale=n}get baseWidth(){return this.baseSize.width}set baseWidth(n){this.baseSize.width!==n&&(this.baseSize.width=n,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getBaseWidth(){return this.baseWidth}setBaseWidth(n){this.baseWidth=n}get baseHeight(){return this.baseSize.height}set baseHeight(n){this.baseSize.height!==n&&(this.baseSize.height=n,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getBaseHeight(){return this.baseHeight}setBaseHeight(n){this.baseHeight=n}setBaseSize(n,e){(this.baseSize.width!==n||this.baseSize.height!==e)&&(this.baseSize.set(n,e),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}get preferredWidth(){return this.preferredSize.width}set preferredWidth(n){this.preferredSize.width!==n&&(this.preferredSize.width=n,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getPreferredWidth(){return this.preferredWidth}setPreferredWidth(n){this.preferredWidth=n}get preferredHeight(){return this.preferredSize.height}set preferredHeight(n){this.preferredSize.height!==n&&(this.preferredSize.height=n,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getPreferredHeight(){return this.preferredHeight}setPreferredHeight(n){this.preferredHeight=n}setPreferredSize(n,e){(this.preferredSize.width!==n||this.preferredSize.height!==e)&&(this.preferredSize.set(n,e),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}copy(n){this.s=n.scale,this.baseSize.set(n.baseWidth,n.baseHeight),this.preferredSize.set(n.preferredWidth,n.preferredHeight),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height)}static get AUTO_SIZE(){return py}},bN=!1,d9=class{constructor(n=null){this.originalMaterials=new Map,this.material=null,this.materials=null,this.materialsBackSide=null,this.materialsDoubleSide=null,this.materialsFlatShaded=null,this.materialsFlatShadedBackSide=null,this.materialsFlatShadedDoubleSide=null,this.setMaterial(n),this.meshCount=0,this.replaceMaterial=e=>{if(e.isMesh){let t;if(e.material.flatShading)switch(e.material.side){case lp:t=this.materialsFlatShadedDoubleSide;break;case cd:t=this.materialsFlatShadedBackSide;break;default:t=this.materialsFlatShaded;break}else switch(e.material.side){case lp:t=this.materialsDoubleSide;break;case cd:t=this.materialsBackSide;break;default:t=this.materials;break}this.originalMaterials.set(e,e.material),e.isSkinnedMesh?e.material=t[2]:e.isInstancedMesh?e.material=t[1]:e.material=t[0],++this.meshCount}}}setMaterial(n){if(this.disposeMaterials(),this.material=n,n!==null){const e=this.materials=[n.clone(),n.clone(),n.clone()];for(const t of e)t.uniforms=Object.assign({},n.uniforms),t.side=p_;e[2].skinning=!0,this.materialsBackSide=e.map(t=>{const r=t.clone();return r.uniforms=Object.assign({},n.uniforms),r.side=cd,r}),this.materialsDoubleSide=e.map(t=>{const r=t.clone();return r.uniforms=Object.assign({},n.uniforms),r.side=lp,r}),this.materialsFlatShaded=e.map(t=>{const r=t.clone();return r.uniforms=Object.assign({},n.uniforms),r.flatShading=!0,r}),this.materialsFlatShadedBackSide=e.map(t=>{const r=t.clone();return r.uniforms=Object.assign({},n.uniforms),r.flatShading=!0,r.side=cd,r}),this.materialsFlatShadedDoubleSide=e.map(t=>{const r=t.clone();return r.uniforms=Object.assign({},n.uniforms),r.flatShading=!0,r.side=lp,r})}}render(n,e,t){const r=n.shadowMap.enabled;if(n.shadowMap.enabled=!1,bN){const s=this.originalMaterials;this.meshCount=0,e.traverse(this.replaceMaterial),n.render(e,t);for(const o of s)o[0].material=o[1];this.meshCount!==s.size&&s.clear()}else{const s=e.overrideMaterial;e.overrideMaterial=this.material,n.render(e,t),e.overrideMaterial=s}n.shadowMap.enabled=r}disposeMaterials(){if(this.material!==null){const n=this.materials.concat(this.materialsBackSide).concat(this.materialsDoubleSide).concat(this.materialsFlatShaded).concat(this.materialsFlatShadedBackSide).concat(this.materialsFlatShadedDoubleSide);for(const e of n)e.dispose()}}dispose(){this.originalMaterials.clear(),this.disposeMaterials()}static get workaroundEnabled(){return bN}static set workaroundEnabled(n){bN=n}},w2=class extends Km{constructor(n,e,t=null){super("RenderPass",n,e),this.needsSwap=!1,this.clearPass=new H4,this.overrideMaterialManager=t===null?null:new d9(t),this.ignoreBackground=!1,this.skipShadowMapUpdate=!1,this.selection=null}set mainScene(n){this.scene=n}set mainCamera(n){this.camera=n}get renderToScreen(){return super.renderToScreen}set renderToScreen(n){super.renderToScreen=n,this.clearPass.renderToScreen=n}get overrideMaterial(){const n=this.overrideMaterialManager;return n!==null?n.material:null}set overrideMaterial(n){const e=this.overrideMaterialManager;n!==null?e!==null?e.setMaterial(n):this.overrideMaterialManager=new d9(n):e!==null&&(e.dispose(),this.overrideMaterialManager=null)}getOverrideMaterial(){return this.overrideMaterial}setOverrideMaterial(n){this.overrideMaterial=n}get clear(){return this.clearPass.enabled}set clear(n){this.clearPass.enabled=n}getSelection(){return this.selection}setSelection(n){this.selection=n}isBackgroundDisabled(){return this.ignoreBackground}setBackgroundDisabled(n){this.ignoreBackground=n}isShadowMapDisabled(){return this.skipShadowMapUpdate}setShadowMapDisabled(n){this.skipShadowMapUpdate=n}getClearPass(){return this.clearPass}render(n,e,t,r,s){const o=this.scene,l=this.camera,u=this.selection,h=l.layers.mask,f=o.background,g=n.shadowMap.autoUpdate,y=this.renderToScreen?null:e;u!==null&&l.layers.set(u.getLayer()),this.skipShadowMapUpdate&&(n.shadowMap.autoUpdate=!1),(this.ignoreBackground||this.clearPass.overrideClearColor!==null)&&(o.background=null),this.clearPass.enabled&&this.clearPass.render(n,e),n.setRenderTarget(y),this.overrideMaterialManager!==null?this.overrideMaterialManager.render(n,o,l):n.render(o,l),l.layers.mask=h,o.background=f,n.shadowMap.autoUpdate=g}},kke=class extends Km{constructor(n,e,{renderTarget:t,resolutionScale:r=1,width:s=cp.AUTO_SIZE,height:o=cp.AUTO_SIZE,resolutionX:l=s,resolutionY:u=o}={}){super("DepthPass"),this.needsSwap=!1,this.renderPass=new w2(n,e,new NC({depthPacking:Nw}));const h=this.renderPass;h.skipShadowMapUpdate=!0,h.ignoreBackground=!0;const f=h.getClearPass();f.overrideClearColor=new Fn(16777215),f.overrideClearAlpha=1,this.renderTarget=t,this.renderTarget===void 0&&(this.renderTarget=new Nc(1,1,{minFilter:Wl,magFilter:Wl}),this.renderTarget.texture.name="DepthPass.Target");const g=this.resolution=new cp(this,l,u,r);g.addEventListener("change",y=>this.setSize(g.baseWidth,g.baseHeight))}set mainScene(n){this.renderPass.mainScene=n}set mainCamera(n){this.renderPass.mainCamera=n}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}getResolutionScale(){return this.resolution.scale}setResolutionScale(n){this.resolution.scale=n}render(n,e,t,r,s){const o=this.renderToScreen?null:this.renderTarget;this.renderPass.render(n,o)}setSize(n,e){const t=this.resolution;t.setBaseSize(n,e),this.renderTarget.setSize(t.width,t.height)}},Oke=class extends Km{constructor({normalBuffer:n=null,resolutionScale:e=.5,width:t=cp.AUTO_SIZE,height:r=cp.AUTO_SIZE,resolutionX:s=t,resolutionY:o=r}={}){super("DepthDownsamplingPass");const l=new Tke;l.normalBuffer=n,this.fullscreenMaterial=l,this.needsDepthTexture=!0,this.needsSwap=!1,this.renderTarget=new Nc(1,1,{minFilter:Wl,magFilter:Wl,depthBuffer:!1,type:r_}),this.renderTarget.texture.name="DepthDownsamplingPass.Target",this.renderTarget.texture.generateMipmaps=!1;const u=this.resolution=new cp(this,s,o,e);u.addEventListener("change",h=>this.setSize(u.baseWidth,u.baseHeight))}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}setDepthTexture(n,e=nb){this.fullscreenMaterial.depthBuffer=n,this.fullscreenMaterial.depthPacking=e}render(n,e,t,r,s){n.setRenderTarget(this.renderToScreen?null:this.renderTarget),n.render(this.scene,this.camera)}setSize(n,e){const t=this.resolution;t.setBaseSize(n,e),this.renderTarget.setSize(t.width,t.height),this.fullscreenMaterial.setSize(n,e)}initialize(n,e,t){const r=n.getContext();if(!(r.getExtension("EXT_color_buffer_float")||r.getExtension("EXT_color_buffer_half_float")))throw new Error("Rendering to float texture is not supported.")}};function f9(n,e,t){for(const r of e){const s="$1"+n+r.charAt(0).toUpperCase()+r.slice(1),o=new RegExp("([^\\.])(\\b"+r+"\\b)","g");for(const l of t.entries())l[1]!==null&&t.set(l[0],l[1].replace(o,s))}}function Lke(n,e,t){var r,s,o,l,u;let h=e.getFragmentShader(),f=e.getVertexShader();const g=h!==void 0&&/mainImage/.test(h),y=h!==void 0&&/mainUv/.test(h);if(t.attributes|=e.getAttributes(),h===void 0)throw new Error(`Missing fragment shader (${e.name})`);if(y&&t.attributes&G1.CONVOLUTION)throw new Error(`Effects that transform UVs are incompatible with convolution effects (${e.name})`);if(!g&&!y)throw new Error(`Could not find mainImage or mainUv function (${e.name})`);{const b=/\w+\s+(\w+)\([\w\s,]*\)\s*{/g,w=t.shaderParts;let C=(r=w.get(Lo.FRAGMENT_HEAD))!=null?r:"",M=(s=w.get(Lo.FRAGMENT_MAIN_UV))!=null?s:"",A=(o=w.get(Lo.FRAGMENT_MAIN_IMAGE))!=null?o:"",k=(l=w.get(Lo.VERTEX_HEAD))!=null?l:"",L=(u=w.get(Lo.VERTEX_MAIN_SUPPORT))!=null?u:"";const P=new Set,D=new Set;if(y&&(M+=` ${n}MainUv(UV); `,t.uvTransformation=!0),f!==null&&/mainSupport/.test(f)){const V=/mainSupport *\([\w\s]*?uv\s*?\)/.test(f);L+=` ${n}MainSupport(`,L+=V?`vUv); `:`); -`;for(const H of f.matchAll(/(?:varying\s+\w+\s+([\S\s]*?);)/g))for(const oe of H[1].split(/\s*,\s*/))t.varyings.add(oe),P.add(oe),D.add(oe);for(const H of f.matchAll(b))D.add(H[1])}for(const V of h.matchAll(b))D.add(V[1]);for(const V of e.defines.keys())D.add(V.replace(/\([\w\s,]*\)/g,""));for(const V of e.uniforms.keys())D.add(V);D.delete("while"),D.delete("for"),D.delete("if"),e.uniforms.forEach((V,H)=>t.uniforms.set(n+H.charAt(0).toUpperCase()+H.slice(1),V)),e.defines.forEach((V,H)=>t.defines.set(n+H.charAt(0).toUpperCase()+H.slice(1),V));const z=new Map([["fragment",h],["vertex",f]]);d9(n,D,t.defines),d9(n,D,z),h=z.get("fragment"),f=z.get("vertex");const U=e.blendMode;if(t.blendModes.set(U.blendFunction,U),g){e.inputColorSpace!==null&&e.inputColorSpace!==t.colorSpace&&(A+=e.inputColorSpace===ms?`color0 = LinearTosRGB(color0); +`;for(const H of f.matchAll(/(?:varying\s+\w+\s+([\S\s]*?);)/g))for(const oe of H[1].split(/\s*,\s*/))t.varyings.add(oe),P.add(oe),D.add(oe);for(const H of f.matchAll(b))D.add(H[1])}for(const V of h.matchAll(b))D.add(V[1]);for(const V of e.defines.keys())D.add(V.replace(/\([\w\s,]*\)/g,""));for(const V of e.uniforms.keys())D.add(V);D.delete("while"),D.delete("for"),D.delete("if"),e.uniforms.forEach((V,H)=>t.uniforms.set(n+H.charAt(0).toUpperCase()+H.slice(1),V)),e.defines.forEach((V,H)=>t.defines.set(n+H.charAt(0).toUpperCase()+H.slice(1),V));const z=new Map([["fragment",h],["vertex",f]]);f9(n,D,t.defines),f9(n,D,z),h=z.get("fragment"),f=z.get("vertex");const U=e.blendMode;if(t.blendModes.set(U.blendFunction,U),g){e.inputColorSpace!==null&&e.inputColorSpace!==t.colorSpace&&(A+=e.inputColorSpace===ms?`color0 = LinearTosRGB(color0); `:`color0 = sRGBToLinear(color0); - `),e.outputColorSpace!==null?t.colorSpace=e.outputColorSpace:e.inputColorSpace!==null&&(t.colorSpace=e.inputColorSpace);const V=/MainImage *\([\w\s,]*?depth[\w\s,]*?\)/;A+=`${n}MainImage(color0, UV, `,t.attributes&H1.DEPTH&&V.test(h)&&(A+="depth, ",t.readDepth=!0),A+=`color1); + `),e.outputColorSpace!==null?t.colorSpace=e.outputColorSpace:e.inputColorSpace!==null&&(t.colorSpace=e.inputColorSpace);const V=/MainImage *\([\w\s,]*?depth[\w\s,]*?\)/;A+=`${n}MainImage(color0, UV, `,t.attributes&G1.DEPTH&&V.test(h)&&(A+="depth, ",t.readDepth=!0),A+=`color1); `;const H=n+"BlendOpacity";t.uniforms.set(H,U.opacity),A+=`color0 = blend${U.blendFunction}(color0, color1, ${H}); `,C+=`uniform float ${H}; `}if(C+=h+` `,f!==null&&(k+=f+` -`),w.set(Lo.FRAGMENT_HEAD,C),w.set(Lo.FRAGMENT_MAIN_UV,M),w.set(Lo.FRAGMENT_MAIN_IMAGE,A),w.set(Lo.VERTEX_HEAD,k),w.set(Lo.VERTEX_MAIN_SUPPORT,L),e.extensions!==null)for(const V of e.extensions)t.extensions.add(V)}}var Nke=class extends Km{constructor(n,...e){super("EffectPass"),this.fullscreenMaterial=new Eke(null,null,null,n),this.listener=t=>this.handleEvent(t),this.effects=[],this.setEffects(e),this.skipRendering=!1,this.minTime=1,this.maxTime=Number.POSITIVE_INFINITY,this.timeScale=1}set mainScene(n){for(const e of this.effects)e.mainScene=n}set mainCamera(n){this.fullscreenMaterial.copyCameraSettings(n);for(const e of this.effects)e.mainCamera=n}get encodeOutput(){return this.fullscreenMaterial.encodeOutput}set encodeOutput(n){this.fullscreenMaterial.encodeOutput=n}get dithering(){return this.fullscreenMaterial.dithering}set dithering(n){const e=this.fullscreenMaterial;e.dithering=n,e.needsUpdate=!0}setEffects(n){for(const e of this.effects)e.removeEventListener("change",this.listener);this.effects=n.sort((e,t)=>t.attributes-e.attributes);for(const e of this.effects)e.addEventListener("change",this.listener)}updateMaterial(){const n=new Gke;let e=0;for(const l of this.effects)if(l.blendMode.blendFunction===Is.DST)n.attributes|=l.getAttributes()&H1.DEPTH;else{if(n.attributes&l.getAttributes()&H1.CONVOLUTION)throw new Error(`Convolution effects cannot be merged (${l.name})`);Lke("e"+e++,l,n)}let t=n.shaderParts.get(Lo.FRAGMENT_HEAD),r=n.shaderParts.get(Lo.FRAGMENT_MAIN_IMAGE),s=n.shaderParts.get(Lo.FRAGMENT_MAIN_UV);const o=/\bblend\b/g;for(const l of n.blendModes.values())t+=l.getShaderCode().replace(o,`blend${l.blendFunction}`)+` -`;n.attributes&H1.DEPTH?(n.readDepth&&(r=`float depth = readDepth(UV); +`),w.set(Lo.FRAGMENT_HEAD,C),w.set(Lo.FRAGMENT_MAIN_UV,M),w.set(Lo.FRAGMENT_MAIN_IMAGE,A),w.set(Lo.VERTEX_HEAD,k),w.set(Lo.VERTEX_MAIN_SUPPORT,L),e.extensions!==null)for(const V of e.extensions)t.extensions.add(V)}}var Nke=class extends Km{constructor(n,...e){super("EffectPass"),this.fullscreenMaterial=new Eke(null,null,null,n),this.listener=t=>this.handleEvent(t),this.effects=[],this.setEffects(e),this.skipRendering=!1,this.minTime=1,this.maxTime=Number.POSITIVE_INFINITY,this.timeScale=1}set mainScene(n){for(const e of this.effects)e.mainScene=n}set mainCamera(n){this.fullscreenMaterial.copyCameraSettings(n);for(const e of this.effects)e.mainCamera=n}get encodeOutput(){return this.fullscreenMaterial.encodeOutput}set encodeOutput(n){this.fullscreenMaterial.encodeOutput=n}get dithering(){return this.fullscreenMaterial.dithering}set dithering(n){const e=this.fullscreenMaterial;e.dithering=n,e.needsUpdate=!0}setEffects(n){for(const e of this.effects)e.removeEventListener("change",this.listener);this.effects=n.sort((e,t)=>t.attributes-e.attributes);for(const e of this.effects)e.addEventListener("change",this.listener)}updateMaterial(){const n=new Gke;let e=0;for(const l of this.effects)if(l.blendMode.blendFunction===Is.DST)n.attributes|=l.getAttributes()&G1.DEPTH;else{if(n.attributes&l.getAttributes()&G1.CONVOLUTION)throw new Error(`Convolution effects cannot be merged (${l.name})`);Lke("e"+e++,l,n)}let t=n.shaderParts.get(Lo.FRAGMENT_HEAD),r=n.shaderParts.get(Lo.FRAGMENT_MAIN_IMAGE),s=n.shaderParts.get(Lo.FRAGMENT_MAIN_UV);const o=/\bblend\b/g;for(const l of n.blendModes.values())t+=l.getShaderCode().replace(o,`blend${l.blendFunction}`)+` +`;n.attributes&G1.DEPTH?(n.readDepth&&(r=`float depth = readDepth(UV); `+r),this.needsDepthTexture=this.getDepthTexture()===null):this.needsDepthTexture=!1,n.colorSpace===ms&&(r+=`color0 = sRGBToLinear(color0); `),n.uvTransformation?(s=`vec2 transformedUv = vUv; `+s,n.defines.set("UV","transformedUv")):n.defines.set("UV","vUv"),n.shaderParts.set(Lo.FRAGMENT_HEAD,t),n.shaderParts.set(Lo.FRAGMENT_MAIN_IMAGE,r),n.shaderParts.set(Lo.FRAGMENT_MAIN_UV,s),n.shaderParts.forEach((l,u,h)=>h.set(u,l==null?void 0:l.trim().replace(/^#/,` -#`))),this.skipRendering=e===0,this.needsSwap=!this.skipRendering,this.fullscreenMaterial.setShaderData(n)}recompile(){this.updateMaterial()}getDepthTexture(){return this.fullscreenMaterial.depthBuffer}setDepthTexture(n,e=nb){this.fullscreenMaterial.depthBuffer=n,this.fullscreenMaterial.depthPacking=e;for(const t of this.effects)t.setDepthTexture(n,e)}render(n,e,t,r,s){for(const o of this.effects)o.update(n,e,r);if(!this.skipRendering||this.renderToScreen){const o=this.fullscreenMaterial;o.inputBuffer=e.texture,o.time+=r*this.timeScale,n.setRenderTarget(this.renderToScreen?null:t),n.render(this.scene,this.camera)}}setSize(n,e){this.fullscreenMaterial.setSize(n,e);for(const t of this.effects)t.setSize(n,e)}initialize(n,e,t){this.renderer=n;for(const r of this.effects)r.initialize(n,e,t);this.updateMaterial(),t!==void 0&&t!==af&&(this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}dispose(){super.dispose();for(const n of this.effects)n.removeEventListener("change",this.listener),n.dispose()}handleEvent(n){switch(n.type){case"change":this.recompile();break}}},Dke=class extends Km{constructor({kernelSize:n=U4.MEDIUM,resolutionScale:e=.5,width:t=cp.AUTO_SIZE,height:r=cp.AUTO_SIZE,resolutionX:s=t,resolutionY:o=r}={}){super("KawaseBlurPass"),this.renderTargetA=new Nc(1,1,{depthBuffer:!1}),this.renderTargetA.texture.name="Blur.Target.A",this.renderTargetB=this.renderTargetA.clone(),this.renderTargetB.texture.name="Blur.Target.B";const l=this.resolution=new cp(this,s,o,e);l.addEventListener("change",u=>this.setSize(l.baseWidth,l.baseHeight)),this._blurMaterial=new pke,this._blurMaterial.kernelSize=n,this.copyMaterial=new mee}getResolution(){return this.resolution}get blurMaterial(){return this._blurMaterial}set blurMaterial(n){this._blurMaterial=n}get dithering(){return this.copyMaterial.dithering}set dithering(n){this.copyMaterial.dithering=n}get kernelSize(){return this.blurMaterial.kernelSize}set kernelSize(n){this.blurMaterial.kernelSize=n}get width(){return this.resolution.width}set width(n){this.resolution.preferredWidth=n}get height(){return this.resolution.height}set height(n){this.resolution.preferredHeight=n}get scale(){return this.blurMaterial.scale}set scale(n){this.blurMaterial.scale=n}getScale(){return this.blurMaterial.scale}setScale(n){this.blurMaterial.scale=n}getKernelSize(){return this.kernelSize}setKernelSize(n){this.kernelSize=n}getResolutionScale(){return this.resolution.scale}setResolutionScale(n){this.resolution.scale=n}render(n,e,t,r,s){const o=this.scene,l=this.camera,u=this.renderTargetA,h=this.renderTargetB,f=this.blurMaterial,g=f.kernelSequence;let y=e;this.fullscreenMaterial=f;for(let b=0,w=g.length;bthis.setSize(g.baseWidth,g.baseHeight))}set mainScene(n){this.renderPass.mainScene=n}set mainCamera(n){this.renderPass.mainCamera=n}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}getResolutionScale(){return this.resolution.scale}setResolutionScale(n){this.resolution.scale=n}render(n,e,t,r,s){const o=this.renderToScreen?null:this.renderTarget;this.renderPass.render(n,o,o)}setSize(n,e){const t=this.resolution;t.setBaseSize(n,e),this.renderTarget.setSize(t.width,t.height)}},Fke=class extends Km{constructor(n,e="inputBuffer"){super("ShaderPass"),this.fullscreenMaterial=n,this.input=e}setInput(n){this.input=n}render(n,e,t,r,s){const o=this.fullscreenMaterial.uniforms;e!==null&&o!==void 0&&o[this.input]!==void 0&&(o[this.input].value=e.texture),n.setRenderTarget(this.renderToScreen?null:t),n.render(this.scene,this.camera)}initialize(n,e,t){t!==void 0&&t!==af&&(this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}},TN=1/1e3,zke=1e3,Uke=class{constructor(){this.previousTime=0,this.currentTime=0,this._delta=0,this._elapsed=0,this._fixedDelta=1e3/60,this.timescale=1,this.useFixedDelta=!1,this._autoReset=!1}get autoReset(){return this._autoReset}set autoReset(n){typeof document<"u"&&document.hidden!==void 0&&(n?document.addEventListener("visibilitychange",this):document.removeEventListener("visibilitychange",this),this._autoReset=n)}get delta(){return this._delta*TN}get fixedDelta(){return this._fixedDelta*TN}set fixedDelta(n){this._fixedDelta=n*zke}get elapsed(){return this._elapsed*TN}update(n){this.useFixedDelta?this._delta=this.fixedDelta:(this.previousTime=this.currentTime,this.currentTime=n!==void 0?n:performance.now(),this._delta=this.currentTime-this.previousTime),this._delta*=this.timescale,this._elapsed+=this._delta}reset(){this._delta=0,this._elapsed=0,this.currentTime=performance.now()}handleEvent(n){document.hidden||(this.currentTime=performance.now())}dispose(){this.autoReset=!1}},Hke=class{constructor(n=null,{depthBuffer:e=!0,stencilBuffer:t=!1,multisampling:r=0,frameBufferType:s}={}){this.renderer=null,this.inputBuffer=this.createBuffer(e,t,s,r),this.outputBuffer=this.inputBuffer.clone(),this.copyPass=new Ike,this.depthTexture=null,this.passes=[],this.timer=new Uke,this.autoRenderToScreen=!0,this.setRenderer(n)}get multisampling(){return this.inputBuffer.samples||0}set multisampling(n){const e=this.inputBuffer,t=this.multisampling;t>0&&n>0?(this.inputBuffer.samples=n,this.outputBuffer.samples=n,this.inputBuffer.dispose(),this.outputBuffer.dispose()):t!==n&&(this.inputBuffer.dispose(),this.outputBuffer.dispose(),this.inputBuffer=this.createBuffer(e.depthBuffer,e.stencilBuffer,e.texture.type,n),this.inputBuffer.depthTexture=this.depthTexture,this.outputBuffer=this.inputBuffer.clone())}getTimer(){return this.timer}getRenderer(){return this.renderer}setRenderer(n){if(this.renderer=n,n!==null){const e=n.getSize(new jt),t=n.getContext().getContextAttributes().alpha,r=this.inputBuffer.texture.type;r===af&&n.outputEncoding===ms&&(this.inputBuffer.texture.encoding=ms,this.outputBuffer.texture.encoding=ms,this.inputBuffer.dispose(),this.outputBuffer.dispose()),n.autoClear=!1,this.setSize(e.width,e.height);for(const s of this.passes)s.initialize(n,t,r)}}replaceRenderer(n,e=!0){const t=this.renderer,r=t.domElement.parentNode;return this.setRenderer(n),e&&r!==null&&(r.removeChild(t.domElement),r.appendChild(n.domElement)),t}createDepthTexture(){const n=this.depthTexture=new t4;return this.inputBuffer.depthTexture=n,this.inputBuffer.dispose(),this.inputBuffer.stencilBuffer?(n.format=Vy,n.type=Py):n.type=dv,n}deleteDepthTexture(){if(this.depthTexture!==null){this.depthTexture.dispose(),this.depthTexture=null,this.inputBuffer.depthTexture=null,this.inputBuffer.dispose();for(const n of this.passes)n.setDepthTexture(null)}}createBuffer(n,e,t,r){const s=this.renderer,o=s===null?new jt:s.getDrawingBufferSize(new jt),l={minFilter:wl,magFilter:wl,stencilBuffer:e,depthBuffer:n,type:t},u=new Nc(o.width,o.height,l);return r>0&&(u.ignoreDepthForMultisampleCopy=!1,u.samples=r),t===af&&s!==null&&s.outputEncoding===ms&&(u.texture.encoding=ms),u.texture.name="EffectComposer.Buffer",u.texture.generateMipmaps=!1,u}setMainScene(n){for(const e of this.passes)e.mainScene=n}setMainCamera(n){for(const e of this.passes)e.mainCamera=n}addPass(n,e){const t=this.passes,r=this.renderer,s=r.getDrawingBufferSize(new jt),o=r.getContext().getContextAttributes().alpha,l=this.inputBuffer.texture.type;if(n.setRenderer(r),n.setSize(s.width,s.height),n.initialize(r,o,l),this.autoRenderToScreen&&(t.length>0&&(t[t.length-1].renderToScreen=!1),n.renderToScreen&&(this.autoRenderToScreen=!1)),e!==void 0?t.splice(e,0,n):t.push(n),this.autoRenderToScreen&&(t[t.length-1].renderToScreen=!0),n.needsDepthTexture||this.depthTexture!==null)if(this.depthTexture===null){const u=this.createDepthTexture();for(n of t)n.setDepthTexture(u)}else n.setDepthTexture(this.depthTexture)}removePass(n){const e=this.passes,t=e.indexOf(n);if(t!==-1&&e.splice(t,1).length>0){if(this.depthTexture!==null){const r=(s,o)=>s||o.needsDepthTexture;e.reduce(r,!1)||(n.getDepthTexture()===this.depthTexture&&n.setDepthTexture(null),this.deleteDepthTexture())}this.autoRenderToScreen&&t===e.length&&(n.renderToScreen=!1,e.length>0&&(e[e.length-1].renderToScreen=!0))}}removeAllPasses(){const n=this.passes;this.deleteDepthTexture(),n.length>0&&(this.autoRenderToScreen&&(n[n.length-1].renderToScreen=!1),this.passes=[])}render(n){const e=this.renderer,t=this.copyPass;let r=this.inputBuffer,s=this.outputBuffer,o=!1,l,u,h;n===void 0&&(this.timer.update(),n=this.timer.delta);for(const f of this.passes)f.enabled&&(f.render(e,r,s,n,o),f.needsSwap&&(o&&(t.renderToScreen=f.renderToScreen,l=e.getContext(),u=e.state.buffers.stencil,u.setFunc(l.NOTEQUAL,1,4294967295),t.render(e,r,s,n,o),u.setFunc(l.EQUAL,1,4294967295)),h=r,r=s,s=h),f instanceof Pke?o=!0:f instanceof Rke&&(o=!1))}setSize(n,e,t){const r=this.renderer,s=r.getSize(new jt);(n===void 0||e===void 0)&&(n=s.width,e=s.height),(s.width!==n||s.height!==e)&&r.setSize(n,e,t);const o=r.getDrawingBufferSize(new jt);this.inputBuffer.setSize(o.width,o.height),this.outputBuffer.setSize(o.width,o.height);for(const l of this.passes)l.setSize(o.width,o.height)}reset(){const n=this.timer.autoReset;this.dispose(),this.autoRenderToScreen=!0,this.timer.autoReset=n}dispose(){for(const n of this.passes)n.dispose();this.passes=[],this.inputBuffer!==null&&this.inputBuffer.dispose(),this.outputBuffer!==null&&this.outputBuffer.dispose(),this.deleteDepthTexture(),this.copyPass.dispose(),this.timer.dispose()}},Gke=class{constructor(){this.shaderParts=new Map([[Lo.FRAGMENT_HEAD,null],[Lo.FRAGMENT_MAIN_UV,null],[Lo.FRAGMENT_MAIN_IMAGE,null],[Lo.VERTEX_HEAD,null],[Lo.VERTEX_MAIN_SUPPORT,null]]),this.defines=new Map,this.uniforms=new Map,this.blendModes=new Map,this.extensions=new Set,this.attributes=H1.NONE,this.varyings=new Set,this.uvTransformation=!1,this.readDepth=!1,this.colorSpace=xg}},Wke=class extends Set{constructor(n,e=10){super(),this.l=e,this.exclusive=!1,n!==void 0&&this.set(n)}get layer(){return this.l}set layer(n){const e=this.l;for(const t of this)t.layers.disable(e),t.layers.enable(n);this.l=n}getLayer(){return this.layer}setLayer(n){this.layer=n}isExclusive(){return this.exclusive}setExclusive(n){this.exclusive=n}clear(){const n=this.layer;for(const e of this)e.layers.disable(n);return super.clear()}set(n){this.clear();for(const e of n)this.add(e);return this}indexOf(n){return this.has(n)?0:-1}add(n){return this.exclusive?n.layers.set(this.layer):n.layers.enable(this.layer),super.add(n)}delete(n){return this.has(n)&&n.layers.disable(this.layer),super.delete(n)}toggle(n){let e;return this.has(n)?(this.delete(n),e=!1):(this.add(n),e=!0),e}setVisible(n){for(const e of this)n?e.layers.enable(0):e.layers.disable(0);return this}},Vke="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,x+y,opacity);}",jke="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,y,min(y.a,opacity));}",Yke="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,(x+y)*0.5,opacity);}",Xke="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(yHSL.rg,xHSL.b));return vec4(mix(x.rgb,z,opacity),y.a);}",Kke="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=mix(step(0.0,y)*(1.0-min(vec4(1.0),(1.0-x)/y)),vec4(1.0),step(1.0,x));return mix(x,z,opacity);}",Jke="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=step(0.0,x)*mix(min(vec4(1.0),x/max(1.0-y,1e-9)),vec4(1.0),step(1.0,y));return mix(x,z,opacity);}",qke="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,min(x,y),opacity);}",Qke="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,abs(x-y),opacity);}",Zke="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,x/max(y,1e-12),opacity);}",e2e="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,(x+y-2.0*x*y),opacity);}",t2e="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 a=min(x,1.0),b=min(y,1.0);vec4 z=mix(2.0*a*b,1.0-2.0*(1.0-a)*(1.0-b),step(0.5,y));return mix(x,z,opacity);}",n2e="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,step(1.0,x+y),opacity);}",r2e="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(yHSL.r,xHSL.gb));return vec4(mix(x.rgb,z,opacity),y.a);}",i2e="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,1.0-y,opacity);}",s2e="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,y*(1.0-x),opacity);}",o2e="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,max(x,y),opacity);}",a2e="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,clamp(y+x-1.0,0.0,1.0),opacity);}",l2e="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,min(x+y,1.0),opacity);}",u2e="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,clamp(2.0*y+x-1.0,0.0,1.0),opacity);}",c2e="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(xHSL.rg,yHSL.b));return vec4(mix(x.rgb,z,opacity),y.a);}",h2e="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,x*y,opacity);}",d2e="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,1.0-abs(1.0-x-y),opacity);}",f2e="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,y,opacity);}",p2e="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=mix(2.0*y*x,1.0-2.0*(1.0-y)*(1.0-x),step(0.5,x));return mix(x,z,opacity);}",m2e="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 y2=2.0*y;vec4 z=mix(mix(y2,x,step(0.5*x,y)),max(vec4(0.0),y2-1.0),step(x,(y2-1.0)));return mix(x,z,opacity);}",g2e="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=mix(min(x*x/max(1.0-y,1e-12),1.0),y,step(1.0,y));return mix(x,z,opacity);}",_2e="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(xHSL.r,yHSL.g,xHSL.b));return vec4(mix(x.rgb,z,opacity),y.a);}",v2e="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,x+y-min(x*y,1.0),opacity);}",y2e="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 y2=2.0*y;vec4 w=step(0.5,y);vec4 z=mix(x-(1.0-y2)*x*(1.0-x),mix(x+(y2-1.0)*(sqrt(x)-x),x+(y2-1.0)*x*((16.0*x-12.0)*x+3.0),w*(1.0-step(0.25,x))),w);return mix(x,z,opacity);}",b2e="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return y;}",T2e="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,max(x+y-1.0,0.0),opacity);}",S2e="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=mix(max(1.0-min((1.0-x)/(2.0*y),1.0),0.0),min(x/(2.0*(1.0-y)),1.0),step(0.5,y));return mix(x,z,opacity);}",w2e=new Map([[Is.ADD,Vke],[Is.ALPHA,jke],[Is.AVERAGE,Yke],[Is.COLOR,Xke],[Is.COLOR_BURN,Kke],[Is.COLOR_DODGE,Jke],[Is.DARKEN,qke],[Is.DIFFERENCE,Qke],[Is.DIVIDE,Zke],[Is.DST,null],[Is.EXCLUSION,e2e],[Is.HARD_LIGHT,t2e],[Is.HARD_MIX,n2e],[Is.HUE,r2e],[Is.INVERT,i2e],[Is.INVERT_RGB,s2e],[Is.LIGHTEN,o2e],[Is.LINEAR_BURN,a2e],[Is.LINEAR_DODGE,l2e],[Is.LINEAR_LIGHT,u2e],[Is.LUMINOSITY,c2e],[Is.MULTIPLY,h2e],[Is.NEGATION,d2e],[Is.NORMAL,f2e],[Is.OVERLAY,p2e],[Is.PIN_LIGHT,m2e],[Is.REFLECT,g2e],[Is.SATURATION,_2e],[Is.SCREEN,v2e],[Is.SOFT_LIGHT,y2e],[Is.SRC,b2e],[Is.SUBTRACT,T2e],[Is.VIVID_LIGHT,S2e]]),E2e=class extends jm{constructor(n,e=1){super(),this._blendFunction=n,this.opacity=new no(e)}getOpacity(){return this.opacity.value}setOpacity(n){this.opacity.value=n}get blendFunction(){return this._blendFunction}set blendFunction(n){this._blendFunction=n,this.dispatchEvent({type:"change"})}getBlendFunction(){return this.blendFunction}setBlendFunction(n){this.blendFunction=n}getShaderCode(){return w2e.get(this.blendFunction)}},x2e=class extends jm{constructor(n,e,{attributes:t=H1.NONE,blendFunction:r=Is.NORMAL,defines:s=new Map,uniforms:o=new Map,extensions:l=null,vertexShader:u=null}={}){super(),this.name=n,this.renderer=null,this.attributes=t,this.fragmentShader=e,this.vertexShader=u,this.defines=s,this.uniforms=o,this.extensions=l,this.blendMode=new E2e(r),this.blendMode.addEventListener("change",h=>this.setChanged()),this._inputColorSpace=xg,this._outputColorSpace=null}get inputColorSpace(){return this._inputColorSpace}set inputColorSpace(n){this._inputColorSpace=n,this.setChanged()}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(n){this._outputColorSpace=n,this.setChanged()}set mainScene(n){}set mainCamera(n){}getName(){return this.name}setRenderer(n){this.renderer=n}getDefines(){return this.defines}getUniforms(){return this.uniforms}getExtensions(){return this.extensions}getBlendMode(){return this.blendMode}getAttributes(){return this.attributes}setAttributes(n){this.attributes=n,this.setChanged()}getFragmentShader(){return this.fragmentShader}setFragmentShader(n){this.fragmentShader=n,this.setChanged()}getVertexShader(){return this.vertexShader}setVertexShader(n){this.vertexShader=n,this.setChanged()}setChanged(){this.dispatchEvent({type:"change"})}setDepthTexture(n,e=nb){}update(n,e,t){}setSize(n,e){}initialize(n,e,t){}dispose(){for(const n of Object.keys(this)){const e=this[n];(e instanceof Nc||e instanceof hd||e instanceof dc||e instanceof Km)&&this[n].dispose()}}};new Ae;new Qr;new Fn;var $2e=`uniform lowp sampler2D edgeTexture;uniform lowp sampler2D maskTexture;uniform vec3 visibleEdgeColor;uniform vec3 hiddenEdgeColor;uniform float pulse;uniform float edgeStrength; +#`))),this.skipRendering=e===0,this.needsSwap=!this.skipRendering,this.fullscreenMaterial.setShaderData(n)}recompile(){this.updateMaterial()}getDepthTexture(){return this.fullscreenMaterial.depthBuffer}setDepthTexture(n,e=nb){this.fullscreenMaterial.depthBuffer=n,this.fullscreenMaterial.depthPacking=e;for(const t of this.effects)t.setDepthTexture(n,e)}render(n,e,t,r,s){for(const o of this.effects)o.update(n,e,r);if(!this.skipRendering||this.renderToScreen){const o=this.fullscreenMaterial;o.inputBuffer=e.texture,o.time+=r*this.timeScale,n.setRenderTarget(this.renderToScreen?null:t),n.render(this.scene,this.camera)}}setSize(n,e){this.fullscreenMaterial.setSize(n,e);for(const t of this.effects)t.setSize(n,e)}initialize(n,e,t){this.renderer=n;for(const r of this.effects)r.initialize(n,e,t);this.updateMaterial(),t!==void 0&&t!==af&&(this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}dispose(){super.dispose();for(const n of this.effects)n.removeEventListener("change",this.listener),n.dispose()}handleEvent(n){switch(n.type){case"change":this.recompile();break}}},Dke=class extends Km{constructor({kernelSize:n=U4.MEDIUM,resolutionScale:e=.5,width:t=cp.AUTO_SIZE,height:r=cp.AUTO_SIZE,resolutionX:s=t,resolutionY:o=r}={}){super("KawaseBlurPass"),this.renderTargetA=new Nc(1,1,{depthBuffer:!1}),this.renderTargetA.texture.name="Blur.Target.A",this.renderTargetB=this.renderTargetA.clone(),this.renderTargetB.texture.name="Blur.Target.B";const l=this.resolution=new cp(this,s,o,e);l.addEventListener("change",u=>this.setSize(l.baseWidth,l.baseHeight)),this._blurMaterial=new pke,this._blurMaterial.kernelSize=n,this.copyMaterial=new gee}getResolution(){return this.resolution}get blurMaterial(){return this._blurMaterial}set blurMaterial(n){this._blurMaterial=n}get dithering(){return this.copyMaterial.dithering}set dithering(n){this.copyMaterial.dithering=n}get kernelSize(){return this.blurMaterial.kernelSize}set kernelSize(n){this.blurMaterial.kernelSize=n}get width(){return this.resolution.width}set width(n){this.resolution.preferredWidth=n}get height(){return this.resolution.height}set height(n){this.resolution.preferredHeight=n}get scale(){return this.blurMaterial.scale}set scale(n){this.blurMaterial.scale=n}getScale(){return this.blurMaterial.scale}setScale(n){this.blurMaterial.scale=n}getKernelSize(){return this.kernelSize}setKernelSize(n){this.kernelSize=n}getResolutionScale(){return this.resolution.scale}setResolutionScale(n){this.resolution.scale=n}render(n,e,t,r,s){const o=this.scene,l=this.camera,u=this.renderTargetA,h=this.renderTargetB,f=this.blurMaterial,g=f.kernelSequence;let y=e;this.fullscreenMaterial=f;for(let b=0,w=g.length;bthis.setSize(g.baseWidth,g.baseHeight))}set mainScene(n){this.renderPass.mainScene=n}set mainCamera(n){this.renderPass.mainCamera=n}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}getResolutionScale(){return this.resolution.scale}setResolutionScale(n){this.resolution.scale=n}render(n,e,t,r,s){const o=this.renderToScreen?null:this.renderTarget;this.renderPass.render(n,o,o)}setSize(n,e){const t=this.resolution;t.setBaseSize(n,e),this.renderTarget.setSize(t.width,t.height)}},Fke=class extends Km{constructor(n,e="inputBuffer"){super("ShaderPass"),this.fullscreenMaterial=n,this.input=e}setInput(n){this.input=n}render(n,e,t,r,s){const o=this.fullscreenMaterial.uniforms;e!==null&&o!==void 0&&o[this.input]!==void 0&&(o[this.input].value=e.texture),n.setRenderTarget(this.renderToScreen?null:t),n.render(this.scene,this.camera)}initialize(n,e,t){t!==void 0&&t!==af&&(this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}},TN=1/1e3,zke=1e3,Uke=class{constructor(){this.previousTime=0,this.currentTime=0,this._delta=0,this._elapsed=0,this._fixedDelta=1e3/60,this.timescale=1,this.useFixedDelta=!1,this._autoReset=!1}get autoReset(){return this._autoReset}set autoReset(n){typeof document<"u"&&document.hidden!==void 0&&(n?document.addEventListener("visibilitychange",this):document.removeEventListener("visibilitychange",this),this._autoReset=n)}get delta(){return this._delta*TN}get fixedDelta(){return this._fixedDelta*TN}set fixedDelta(n){this._fixedDelta=n*zke}get elapsed(){return this._elapsed*TN}update(n){this.useFixedDelta?this._delta=this.fixedDelta:(this.previousTime=this.currentTime,this.currentTime=n!==void 0?n:performance.now(),this._delta=this.currentTime-this.previousTime),this._delta*=this.timescale,this._elapsed+=this._delta}reset(){this._delta=0,this._elapsed=0,this.currentTime=performance.now()}handleEvent(n){document.hidden||(this.currentTime=performance.now())}dispose(){this.autoReset=!1}},Hke=class{constructor(n=null,{depthBuffer:e=!0,stencilBuffer:t=!1,multisampling:r=0,frameBufferType:s}={}){this.renderer=null,this.inputBuffer=this.createBuffer(e,t,s,r),this.outputBuffer=this.inputBuffer.clone(),this.copyPass=new Ike,this.depthTexture=null,this.passes=[],this.timer=new Uke,this.autoRenderToScreen=!0,this.setRenderer(n)}get multisampling(){return this.inputBuffer.samples||0}set multisampling(n){const e=this.inputBuffer,t=this.multisampling;t>0&&n>0?(this.inputBuffer.samples=n,this.outputBuffer.samples=n,this.inputBuffer.dispose(),this.outputBuffer.dispose()):t!==n&&(this.inputBuffer.dispose(),this.outputBuffer.dispose(),this.inputBuffer=this.createBuffer(e.depthBuffer,e.stencilBuffer,e.texture.type,n),this.inputBuffer.depthTexture=this.depthTexture,this.outputBuffer=this.inputBuffer.clone())}getTimer(){return this.timer}getRenderer(){return this.renderer}setRenderer(n){if(this.renderer=n,n!==null){const e=n.getSize(new Vt),t=n.getContext().getContextAttributes().alpha,r=this.inputBuffer.texture.type;r===af&&n.outputEncoding===ms&&(this.inputBuffer.texture.encoding=ms,this.outputBuffer.texture.encoding=ms,this.inputBuffer.dispose(),this.outputBuffer.dispose()),n.autoClear=!1,this.setSize(e.width,e.height);for(const s of this.passes)s.initialize(n,t,r)}}replaceRenderer(n,e=!0){const t=this.renderer,r=t.domElement.parentNode;return this.setRenderer(n),e&&r!==null&&(r.removeChild(t.domElement),r.appendChild(n.domElement)),t}createDepthTexture(){const n=this.depthTexture=new t4;return this.inputBuffer.depthTexture=n,this.inputBuffer.dispose(),this.inputBuffer.stencilBuffer?(n.format=Vy,n.type=Py):n.type=dv,n}deleteDepthTexture(){if(this.depthTexture!==null){this.depthTexture.dispose(),this.depthTexture=null,this.inputBuffer.depthTexture=null,this.inputBuffer.dispose();for(const n of this.passes)n.setDepthTexture(null)}}createBuffer(n,e,t,r){const s=this.renderer,o=s===null?new Vt:s.getDrawingBufferSize(new Vt),l={minFilter:wl,magFilter:wl,stencilBuffer:e,depthBuffer:n,type:t},u=new Nc(o.width,o.height,l);return r>0&&(u.ignoreDepthForMultisampleCopy=!1,u.samples=r),t===af&&s!==null&&s.outputEncoding===ms&&(u.texture.encoding=ms),u.texture.name="EffectComposer.Buffer",u.texture.generateMipmaps=!1,u}setMainScene(n){for(const e of this.passes)e.mainScene=n}setMainCamera(n){for(const e of this.passes)e.mainCamera=n}addPass(n,e){const t=this.passes,r=this.renderer,s=r.getDrawingBufferSize(new Vt),o=r.getContext().getContextAttributes().alpha,l=this.inputBuffer.texture.type;if(n.setRenderer(r),n.setSize(s.width,s.height),n.initialize(r,o,l),this.autoRenderToScreen&&(t.length>0&&(t[t.length-1].renderToScreen=!1),n.renderToScreen&&(this.autoRenderToScreen=!1)),e!==void 0?t.splice(e,0,n):t.push(n),this.autoRenderToScreen&&(t[t.length-1].renderToScreen=!0),n.needsDepthTexture||this.depthTexture!==null)if(this.depthTexture===null){const u=this.createDepthTexture();for(n of t)n.setDepthTexture(u)}else n.setDepthTexture(this.depthTexture)}removePass(n){const e=this.passes,t=e.indexOf(n);if(t!==-1&&e.splice(t,1).length>0){if(this.depthTexture!==null){const r=(s,o)=>s||o.needsDepthTexture;e.reduce(r,!1)||(n.getDepthTexture()===this.depthTexture&&n.setDepthTexture(null),this.deleteDepthTexture())}this.autoRenderToScreen&&t===e.length&&(n.renderToScreen=!1,e.length>0&&(e[e.length-1].renderToScreen=!0))}}removeAllPasses(){const n=this.passes;this.deleteDepthTexture(),n.length>0&&(this.autoRenderToScreen&&(n[n.length-1].renderToScreen=!1),this.passes=[])}render(n){const e=this.renderer,t=this.copyPass;let r=this.inputBuffer,s=this.outputBuffer,o=!1,l,u,h;n===void 0&&(this.timer.update(),n=this.timer.delta);for(const f of this.passes)f.enabled&&(f.render(e,r,s,n,o),f.needsSwap&&(o&&(t.renderToScreen=f.renderToScreen,l=e.getContext(),u=e.state.buffers.stencil,u.setFunc(l.NOTEQUAL,1,4294967295),t.render(e,r,s,n,o),u.setFunc(l.EQUAL,1,4294967295)),h=r,r=s,s=h),f instanceof Pke?o=!0:f instanceof Rke&&(o=!1))}setSize(n,e,t){const r=this.renderer,s=r.getSize(new Vt);(n===void 0||e===void 0)&&(n=s.width,e=s.height),(s.width!==n||s.height!==e)&&r.setSize(n,e,t);const o=r.getDrawingBufferSize(new Vt);this.inputBuffer.setSize(o.width,o.height),this.outputBuffer.setSize(o.width,o.height);for(const l of this.passes)l.setSize(o.width,o.height)}reset(){const n=this.timer.autoReset;this.dispose(),this.autoRenderToScreen=!0,this.timer.autoReset=n}dispose(){for(const n of this.passes)n.dispose();this.passes=[],this.inputBuffer!==null&&this.inputBuffer.dispose(),this.outputBuffer!==null&&this.outputBuffer.dispose(),this.deleteDepthTexture(),this.copyPass.dispose(),this.timer.dispose()}},Gke=class{constructor(){this.shaderParts=new Map([[Lo.FRAGMENT_HEAD,null],[Lo.FRAGMENT_MAIN_UV,null],[Lo.FRAGMENT_MAIN_IMAGE,null],[Lo.VERTEX_HEAD,null],[Lo.VERTEX_MAIN_SUPPORT,null]]),this.defines=new Map,this.uniforms=new Map,this.blendModes=new Map,this.extensions=new Set,this.attributes=G1.NONE,this.varyings=new Set,this.uvTransformation=!1,this.readDepth=!1,this.colorSpace=xg}},Wke=class extends Set{constructor(n,e=10){super(),this.l=e,this.exclusive=!1,n!==void 0&&this.set(n)}get layer(){return this.l}set layer(n){const e=this.l;for(const t of this)t.layers.disable(e),t.layers.enable(n);this.l=n}getLayer(){return this.layer}setLayer(n){this.layer=n}isExclusive(){return this.exclusive}setExclusive(n){this.exclusive=n}clear(){const n=this.layer;for(const e of this)e.layers.disable(n);return super.clear()}set(n){this.clear();for(const e of n)this.add(e);return this}indexOf(n){return this.has(n)?0:-1}add(n){return this.exclusive?n.layers.set(this.layer):n.layers.enable(this.layer),super.add(n)}delete(n){return this.has(n)&&n.layers.disable(this.layer),super.delete(n)}toggle(n){let e;return this.has(n)?(this.delete(n),e=!1):(this.add(n),e=!0),e}setVisible(n){for(const e of this)n?e.layers.enable(0):e.layers.disable(0);return this}},Vke="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,x+y,opacity);}",jke="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,y,min(y.a,opacity));}",Yke="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,(x+y)*0.5,opacity);}",Xke="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(yHSL.rg,xHSL.b));return vec4(mix(x.rgb,z,opacity),y.a);}",Kke="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=mix(step(0.0,y)*(1.0-min(vec4(1.0),(1.0-x)/y)),vec4(1.0),step(1.0,x));return mix(x,z,opacity);}",Jke="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=step(0.0,x)*mix(min(vec4(1.0),x/max(1.0-y,1e-9)),vec4(1.0),step(1.0,y));return mix(x,z,opacity);}",qke="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,min(x,y),opacity);}",Qke="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,abs(x-y),opacity);}",Zke="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,x/max(y,1e-12),opacity);}",e2e="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,(x+y-2.0*x*y),opacity);}",t2e="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 a=min(x,1.0),b=min(y,1.0);vec4 z=mix(2.0*a*b,1.0-2.0*(1.0-a)*(1.0-b),step(0.5,y));return mix(x,z,opacity);}",n2e="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,step(1.0,x+y),opacity);}",r2e="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(yHSL.r,xHSL.gb));return vec4(mix(x.rgb,z,opacity),y.a);}",i2e="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,1.0-y,opacity);}",s2e="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,y*(1.0-x),opacity);}",o2e="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,max(x,y),opacity);}",a2e="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,clamp(y+x-1.0,0.0,1.0),opacity);}",l2e="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,min(x+y,1.0),opacity);}",u2e="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,clamp(2.0*y+x-1.0,0.0,1.0),opacity);}",c2e="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(xHSL.rg,yHSL.b));return vec4(mix(x.rgb,z,opacity),y.a);}",h2e="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,x*y,opacity);}",d2e="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,1.0-abs(1.0-x-y),opacity);}",f2e="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,y,opacity);}",p2e="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=mix(2.0*y*x,1.0-2.0*(1.0-y)*(1.0-x),step(0.5,x));return mix(x,z,opacity);}",m2e="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 y2=2.0*y;vec4 z=mix(mix(y2,x,step(0.5*x,y)),max(vec4(0.0),y2-1.0),step(x,(y2-1.0)));return mix(x,z,opacity);}",g2e="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=mix(min(x*x/max(1.0-y,1e-12),1.0),y,step(1.0,y));return mix(x,z,opacity);}",_2e="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(xHSL.r,yHSL.g,xHSL.b));return vec4(mix(x.rgb,z,opacity),y.a);}",v2e="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,x+y-min(x*y,1.0),opacity);}",y2e="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 y2=2.0*y;vec4 w=step(0.5,y);vec4 z=mix(x-(1.0-y2)*x*(1.0-x),mix(x+(y2-1.0)*(sqrt(x)-x),x+(y2-1.0)*x*((16.0*x-12.0)*x+3.0),w*(1.0-step(0.25,x))),w);return mix(x,z,opacity);}",b2e="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return y;}",T2e="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,max(x+y-1.0,0.0),opacity);}",S2e="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=mix(max(1.0-min((1.0-x)/(2.0*y),1.0),0.0),min(x/(2.0*(1.0-y)),1.0),step(0.5,y));return mix(x,z,opacity);}",w2e=new Map([[Is.ADD,Vke],[Is.ALPHA,jke],[Is.AVERAGE,Yke],[Is.COLOR,Xke],[Is.COLOR_BURN,Kke],[Is.COLOR_DODGE,Jke],[Is.DARKEN,qke],[Is.DIFFERENCE,Qke],[Is.DIVIDE,Zke],[Is.DST,null],[Is.EXCLUSION,e2e],[Is.HARD_LIGHT,t2e],[Is.HARD_MIX,n2e],[Is.HUE,r2e],[Is.INVERT,i2e],[Is.INVERT_RGB,s2e],[Is.LIGHTEN,o2e],[Is.LINEAR_BURN,a2e],[Is.LINEAR_DODGE,l2e],[Is.LINEAR_LIGHT,u2e],[Is.LUMINOSITY,c2e],[Is.MULTIPLY,h2e],[Is.NEGATION,d2e],[Is.NORMAL,f2e],[Is.OVERLAY,p2e],[Is.PIN_LIGHT,m2e],[Is.REFLECT,g2e],[Is.SATURATION,_2e],[Is.SCREEN,v2e],[Is.SOFT_LIGHT,y2e],[Is.SRC,b2e],[Is.SUBTRACT,T2e],[Is.VIVID_LIGHT,S2e]]),E2e=class extends jm{constructor(n,e=1){super(),this._blendFunction=n,this.opacity=new no(e)}getOpacity(){return this.opacity.value}setOpacity(n){this.opacity.value=n}get blendFunction(){return this._blendFunction}set blendFunction(n){this._blendFunction=n,this.dispatchEvent({type:"change"})}getBlendFunction(){return this.blendFunction}setBlendFunction(n){this.blendFunction=n}getShaderCode(){return w2e.get(this.blendFunction)}},x2e=class extends jm{constructor(n,e,{attributes:t=G1.NONE,blendFunction:r=Is.NORMAL,defines:s=new Map,uniforms:o=new Map,extensions:l=null,vertexShader:u=null}={}){super(),this.name=n,this.renderer=null,this.attributes=t,this.fragmentShader=e,this.vertexShader=u,this.defines=s,this.uniforms=o,this.extensions=l,this.blendMode=new E2e(r),this.blendMode.addEventListener("change",h=>this.setChanged()),this._inputColorSpace=xg,this._outputColorSpace=null}get inputColorSpace(){return this._inputColorSpace}set inputColorSpace(n){this._inputColorSpace=n,this.setChanged()}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(n){this._outputColorSpace=n,this.setChanged()}set mainScene(n){}set mainCamera(n){}getName(){return this.name}setRenderer(n){this.renderer=n}getDefines(){return this.defines}getUniforms(){return this.uniforms}getExtensions(){return this.extensions}getBlendMode(){return this.blendMode}getAttributes(){return this.attributes}setAttributes(n){this.attributes=n,this.setChanged()}getFragmentShader(){return this.fragmentShader}setFragmentShader(n){this.fragmentShader=n,this.setChanged()}getVertexShader(){return this.vertexShader}setVertexShader(n){this.vertexShader=n,this.setChanged()}setChanged(){this.dispatchEvent({type:"change"})}setDepthTexture(n,e=nb){}update(n,e,t){}setSize(n,e){}initialize(n,e,t){}dispose(){for(const n of Object.keys(this)){const e=this[n];(e instanceof Nc||e instanceof hd||e instanceof dc||e instanceof Km)&&this[n].dispose()}}};new Me;new Qr;new Fn;var $2e=`uniform lowp sampler2D edgeTexture;uniform lowp sampler2D maskTexture;uniform vec3 visibleEdgeColor;uniform vec3 hiddenEdgeColor;uniform float pulse;uniform float edgeStrength; #ifdef USE_PATTERN uniform lowp sampler2D patternTexture;varying vec2 vUvPattern; #endif @@ -5819,14 +5819,14 @@ outputColor=vec4(color,alpha); #else outputColor=vec4(color,max(alpha,inputColor.a)); #endif -}`,C2e="uniform float patternScale;varying vec2 vUvPattern;void mainSupport(const in vec2 uv){vUvPattern=uv*vec2(aspect,1.0)*patternScale;}",M2e=class extends x2e{constructor(n,e,{blendFunction:t=Is.SCREEN,patternTexture:r=null,patternScale:s=1,edgeStrength:o=1,pulseSpeed:l=0,visibleEdgeColor:u=16777215,hiddenEdgeColor:h=2230538,kernelSize:f=U4.VERY_SMALL,blur:g=!1,xRay:y=!0,multisampling:b=0,resolutionScale:w=.5,width:C=cp.AUTO_SIZE,height:M=cp.AUTO_SIZE,resolutionX:A=C,resolutionY:k=M}={}){super("OutlineEffect",$2e,{uniforms:new Map([["maskTexture",new no(null)],["edgeTexture",new no(null)],["edgeStrength",new no(o)],["visibleEdgeColor",new no(new Fn(u))],["hiddenEdgeColor",new no(new Fn(h))],["pulse",new no(1)],["patternScale",new no(s)],["patternTexture",new no(null)]])}),this.blendMode.addEventListener("change",z=>{this.blendMode.getBlendFunction()===Is.ALPHA?this.defines.set("ALPHA","1"):this.defines.delete("ALPHA"),this.setChanged()}),this.blendMode.setBlendFunction(t),this.patternTexture=r,this.xRay=y,this.scene=n,this.camera=e,this.renderTargetMask=new Nc(1,1),this.renderTargetMask.samples=b,this.renderTargetMask.texture.name="Outline.Mask",this.uniforms.get("maskTexture").value=this.renderTargetMask.texture,this.renderTargetOutline=new Nc(1,1,{depthBuffer:!1}),this.renderTargetOutline.texture.name="Outline.Edges",this.uniforms.get("edgeTexture").value=this.renderTargetOutline.texture,this.clearPass=new H4,this.clearPass.overrideClearColor=new Fn(0),this.clearPass.overrideClearAlpha=1,this.depthPass=new kke(n,e),this.maskPass=new w2(n,e,new vke(this.depthPass.texture,e));const L=this.maskPass.clearPass;L.overrideClearColor=new Fn(16777215),L.overrideClearAlpha=1,this.blurPass=new Dke({resolutionScale:w,resolutionX:A,resolutionY:k,kernelSize:f}),this.blurPass.enabled=g;const P=this.blurPass.resolution;P.addEventListener("change",z=>this.setSize(P.baseWidth,P.baseHeight)),this.outlinePass=new Fke(new Cke);const D=this.outlinePass.fullscreenMaterial;D.inputBuffer=this.renderTargetMask.texture,this.time=0,this.active=!1,this.selection=new Wke,this.selection.layer=10,this.pulseSpeed=l}set mainScene(n){this.scene=n,this.depthPass.mainScene=n,this.maskPass.mainScene=n}set mainCamera(n){this.camera=n,this.depthPass.mainCamera=n,this.maskPass.mainCamera=n,this.maskPass.overrideMaterial.copyCameraSettings(n)}get resolution(){return this.blurPass.resolution}getResolution(){return this.blurPass.getResolution()}get multisampling(){return this.renderTargetMask.samples}set multisampling(n){this.renderTargetMask.samples=n,this.renderTargetMask.dispose()}get patternScale(){return this.uniforms.get("patternScale").value}set patternScale(n){this.uniforms.get("patternScale").value=n}get edgeStrength(){return this.uniforms.get("edgeStrength").value}set edgeStrength(n){this.uniforms.get("edgeStrength").value=n}get visibleEdgeColor(){return this.uniforms.get("visibleEdgeColor").value}set visibleEdgeColor(n){this.uniforms.get("visibleEdgeColor").value=n}get hiddenEdgeColor(){return this.uniforms.get("hiddenEdgeColor").value}set hiddenEdgeColor(n){this.uniforms.get("hiddenEdgeColor").value=n}getBlurPass(){return this.blurPass}getSelection(){return this.selection}getPulseSpeed(){return this.pulseSpeed}setPulseSpeed(n){this.pulseSpeed=n}get width(){return this.resolution.width}set width(n){this.resolution.preferredWidth=n}get height(){return this.resolution.height}set height(n){this.resolution.preferredHeight=n}get selectionLayer(){return this.selection.layer}set selectionLayer(n){this.selection.layer=n}get dithering(){return this.blurPass.dithering}set dithering(n){this.blurPass.dithering=n}get kernelSize(){return this.blurPass.kernelSize}set kernelSize(n){this.blurPass.kernelSize=n}get blur(){return this.blurPass.enabled}set blur(n){this.blurPass.enabled=n}get xRay(){return this.defines.has("X_RAY")}set xRay(n){this.xRay!==n&&(n?this.defines.set("X_RAY","1"):this.defines.delete("X_RAY"),this.setChanged())}isXRayEnabled(){return this.xRay}setXRayEnabled(n){this.xRay=n}get patternTexture(){return this.uniforms.get("patternTexture").value}set patternTexture(n){if(n!==null?(n.wrapS=n.wrapT=Lw,this.defines.set("USE_PATTERN","1"),this.setVertexShader(C2e)):(this.defines.delete("USE_PATTERN"),this.setVertexShader(null)),this.renderer!==null){const e=u9(n,this.renderer.capabilities.isWebGL2);this.defines.set("texelToLinear(texel)",e)}this.uniforms.get("patternTexture").value=n,this.setChanged()}setPatternTexture(n){this.patternTexture=n}getResolutionScale(){return this.resolution.scale}setResolutionScale(n){this.resolution.scale=n}setSelection(n){return this.selection.set(n),this}clearSelection(){return this.selection.clear(),this}selectObject(n){return this.selection.add(n),this}deselectObject(n){return this.selection.delete(n),this}update(n,e,t){const r=this.scene,s=this.camera,o=this.selection,l=this.uniforms.get("pulse"),u=r.background,h=s.layers.mask;o.size>0?(r.background=null,l.value=1,this.pulseSpeed>0&&(l.value=Math.cos(this.time*this.pulseSpeed*10)*.375+.625),this.active=!0,this.time+=t,o.setVisible(!1),this.depthPass.render(n),o.setVisible(!0),s.layers.set(o.layer),this.maskPass.render(n,this.renderTargetMask),s.layers.mask=h,r.background=u,this.outlinePass.render(n,null,this.renderTargetOutline),this.blurPass.enabled&&this.blurPass.render(n,this.renderTargetOutline,this.renderTargetOutline)):this.active&&(this.clearPass.render(n,this.renderTargetOutline),this.active=!1)}setSize(n,e){this.blurPass.setSize(n,e),this.renderTargetMask.setSize(n,e);const t=this.resolution;t.setBaseSize(n,e);const r=t.width,s=t.height;this.depthPass.setSize(r,s),this.renderTargetOutline.setSize(r,s),this.outlinePass.fullscreenMaterial.setSize(r,s)}initialize(n,e,t){const r=this.patternTexture,s=u9(r,n.capabilities.isWebGL2);this.defines.set("texelToLinear(texel)",s),this.blurPass.initialize(n,e,af),t!==void 0&&(this.depthPass.initialize(n,e,t),this.maskPass.initialize(n,e,t),this.outlinePass.initialize(n,e,t))}};new Ae;new Ae;let wx;function A2e(){if(wx!==void 0)return wx;try{var n;let e;const t=document.createElement("canvas");return wx=!!(window.WebGL2RenderingContext&&(e=t.getContext("webgl2"))),e&&((n=e.getExtension("WEBGL_lose_context"))===null||n===void 0||n.loseContext()),wx}catch{return wx=!1}}const I2e=n=>!!n.current,f9=n=>I2e(n)?n.current:n,gee=pe.createContext(null),R2e=yt.memo(pe.forwardRef((n,e)=>{let{children:t,camera:r,scene:s,resolutionScale:o,enabled:l=!0,renderPriority:u=1,autoClear:h=!0,depthBuffer:f,disableNormalPass:g,stencilBuffer:y,multisampling:b=8,frameBufferType:w=Q1}=n;const{gl:C,scene:M,camera:A,size:k}=nf();s=s||M,r=r||A;const[L,P,D]=pe.useMemo(()=>{const V=A2e(),H=new Hke(C,{depthBuffer:f,stencilBuffer:y,multisampling:b>0&&V?b:0,frameBufferType:w});H.addPass(new w2(s,r));let oe=null,le=null;return g||(le=new Bke(s,r),le.enabled=!1,H.addPass(le),o!==void 0&&V&&(oe=new Oke({normalBuffer:le.texture,resolutionScale:o}),oe.enabled=!1,H.addPass(oe))),[H,le,oe]},[r,C,f,y,b,w,s,g,o]);pe.useEffect(()=>L==null?void 0:L.setSize(k.width,k.height),[L,k]),Xm((V,H)=>{l&&(C.autoClear=h,L.render(H))},l?u:0);const z=pe.useRef(null);pe.useLayoutEffect(()=>{let V;return z.current&&z.current.__r3f&&L&&(V=new Nke(r,...z.current.__r3f.objects),V.renderToScreen=!0,L.addPass(V),P&&(P.enabled=!0),D&&(D.enabled=!0)),()=>{V&&(L==null||L.removePass(V)),P&&(P.enabled=!1),D&&(D.enabled=!1)}},[L,t,r,P,D]);const U=pe.useMemo(()=>({composer:L,normalPass:P,downSamplingPass:D,resolutionScale:o,camera:r,scene:s}),[L,P,D,o,r,s]);return pe.useImperativeHandle(e,()=>L,[L]),un(gee.Provider,{value:U,children:un("group",{ref:z,children:t})})})),G4=pe.createContext(null);function k2e(n){let{children:e,enabled:t=!0}=n;const[r,s]=pe.useState([]),o=pe.useMemo(()=>({selected:r,select:s,enabled:t}),[r,s,t]);return yt.createElement(G4.Provider,{value:o},e)}function _ee(n){let{enabled:e=!1,children:t,...r}=n;const s=pe.useRef(null),o=pe.useContext(G4);return pe.useEffect(()=>{if(o&&e){let l=!1;const u=[];if(s.current.traverse(h=>{h.type==="Mesh"&&u.push(h),o.selected.indexOf(h)===-1&&(l=!0)}),l)return o.select(h=>[...h,...u]),()=>{o.select(h=>h.filter(f=>!u.includes(f)))}}},[e,t]),un("group",{ref:s,...r,children:t})}const O2e=pe.forwardRef(function(n,e){let{selection:t=[],selectionLayer:r=10,blendFunction:s,patternTexture:o,edgeStrength:l,pulseSpeed:u,visibleEdgeColor:h,hiddenEdgeColor:f,width:g,height:y,kernelSize:b,blur:w,xRay:C,...M}=n;const A=nf(z=>z.invalidate),{scene:k,camera:L}=pe.useContext(gee),P=pe.useMemo(()=>new M2e(k,L,{blendFunction:s,patternTexture:o,edgeStrength:l,pulseSpeed:u,visibleEdgeColor:h,hiddenEdgeColor:f,width:g,height:y,kernelSize:b,blur:w,xRay:C,...M}),[s,w,L,l,y,f,b,o,u,k,h,g,C]),D=pe.useContext(G4);return pe.useEffect(()=>{if(!D&&t)return P.selection.set(Array.isArray(t)?t.map(f9):[f9(t)]),A(),()=>{P.selection.clear(),A()}},[P,t,D]),pe.useEffect(()=>{P.selectionLayer=r,A()},[P,r]),pe.useRef(),pe.useEffect(()=>{if(D&&D.enabled){var z;if((z=D.selected)!=null&&z.length)return P.selection.set(D.selected),A(),()=>{P.selection.clear(),A()}}},[D]),un("primitive",{ref:e,object:P})}),L2e=["cube","cylinder","sphere","capsule","arrow"],vee=pe.createContext(),N2e=n=>{const e=pe.useContext(vee)[n.shape];return L2e.includes(n.shape)?oke(n):e&&typeof e=="function"?e():(console.warn(`Shape not loaded: ${n.shape} (reading property 'shape' of item)`,n),[])},D2e=({meshes:n,children:e})=>un(vee.Provider,{value:n,children:e}),P2e=pe.memo(pe.forwardRef(({objectKey:n,highlightColor:e,position:t,rotation:r,scale:s,ghost:o},l)=>{const u=pe.useRef(null),h=_E(l,u),f=No(M=>M.onClick,Nf),g=No(M=>M.onPointerOver,Nf),y=No(M=>M.onPointerOut,Nf),b=No(M=>M.clock),w=No(pe.useCallback(M=>M.items[n],[n]),Nf),C=N2e(w);return Xm(pe.useCallback(()=>{const M=b.getElapsed()*1e3;h.current&&(h.current.position.set(t?t.x:typeof w.position.x=="function"?w.position.x(M):w.position.x,t?t.y:typeof w.position.y=="function"?w.position.y(M):w.position.y,t?t.z:typeof w.position.z=="function"?w.position.z(M):w.position.z),h.current.quaternion.set(r?r.x:typeof w.rotation.x=="function"?w.rotation.x(M):w.rotation.x,r?r.y:typeof w.rotation.y=="function"?w.rotation.y(M):w.rotation.y,r?r.z:typeof w.rotation.z=="function"?w.rotation.z(M):w.rotation.z,r?r.w:typeof w.rotation.w=="function"?w.rotation.w(M):w.rotation.w),h.current.scale.set(s?s.x:typeof w.scale.x=="function"?w.scale.x(M):w.scale.x,s?s.y:typeof w.scale.y=="function"?w.scale.y(M):w.scale.y,s?s.z:typeof w.scale.z=="function"?w.scale.z(M):w.scale.z),h.current.visible=typeof w.hidden=="function"?!w.hidden(M):!w.hidden)},[w,t,r,s,h,b])),un(_ee,{enabled:w.highlighted,children:Bh("group",{ref:h,up:[0,0,1],children:[un("group",{up:[0,0,1],rotation:[Math.PI/2,0,0],onPointerDown:M=>{f(n,!h.current.visible,{local:{position:h.current.position,rotation:h.current.quaternion},world:{position:h.current.getWorldPosition(new Ae),rotation:h.current.getWorldQuaternion(new Sl)}},M)},onPointerOver:M=>{g(n,!h.current.visible,M)},onPointerOut:M=>{y(n,!h.current.visible,M)},children:C.map((M,A)=>un(yee,{idx:A,groupOrPart:M,objectKey:n,ghost:o,highlightColor:e},A))}),w.showName&&un(WZ,{distanceFactor:3,position:[0,0,.2],children:un("div",{style:{opacity:.75,borderRadius:2,backgroundColor:"lightgrey",padding:5,userSelect:"none"},children:w.name})})]})})})),B2e=pe.memo(({part:n,objectKey:e,ghost:t,highlightColor:r})=>{const s=No(pe.useCallback(g=>g.items[e].wireframe,[e])),o=No(pe.useCallback(g=>g.items[e].color,[e])),l=o!==void 0,u=pe.useRef(),h=pe.useRef(),f=No(g=>g.clock);return Xm(pe.useCallback(()=>{const g=f.getElapsed()*1e3;t||(rC(h,o,g),rC(u,o,g))},[t,u,h,f,o])),t?un("mesh",{ref:h,geometry:n.geometry,material:CI(r),scale:n.scale,castShadow:!1,receiveShadow:!1},"B"):l?Bh("group",{up:[0,0,1],children:[un("mesh",{ref:h,geometry:n.geometry,scale:n.scale,castShadow:!1,receiveShadow:!1,children:un("meshLambertMaterial",{transparent:!0,wireframe:s,attach:"material",opacity:1,side:cd})},"B"),un("mesh",{ref:u,geometry:n.geometry,scale:n.scale,castShadow:!1,receiveShadow:!1,children:un("meshLambertMaterial",{transparent:!0,attach:"material",wireframe:s,opacity:1,side:p_})},"F")]}):un(PC,{children:un("mesh",{ref:u,geometry:n.geometry,material:n.material,scale:n.scale,castShadow:!0,receiveShadow:!0,wireframe:s},"I")})}),yee=pe.memo(({idx:n,groupOrPart:e,ghost:t,objectKey:r,highlightColor:s})=>e.type==="group"?un("group",{up:[0,0,1],position:e.position,rotation:e.rotation,scale:e.scale,children:e.children.map((o,l)=>un(yee,{idx:l,groupOrPart:o,objectKey:r,ghost:t,highlightColor:s},l))},n):un(B2e,{part:e,objectKey:r,highlightColor:s,ghost:t},n)),F2e=pe.forwardRef(({objectKey:n},e)=>{const t=pe.useRef(null),r=_E(e,t),{vertices:s,width:o,hidden:l}=No(pe.useCallback(u=>({vertices:u.lines[n].vertices,width:u.lines[n].width,hidden:u.lines[n].hidden}),[n]),Nf);return s.length<=1?null:un(kAe,{ref:r,visible:!l,points:s.map(u=>[u.position.x,u.position.y,u.position.z]),color:"white",vertexColors:s.map(u=>[u.color.r/255,u.color.g/255,u.color.b/255]),lineWidth:o})}),z2e=pe.forwardRef(({objectKey:n},e)=>{const t=pe.useRef(null),r=_E(e,t),s=No(C=>C.onClick,Nf),o=No(C=>C.onPointerOver,Nf),l=No(C=>C.onPointerOut,Nf),u=No(pe.useCallback(C=>C.hulls[n],[n]),Nf),h=No(pe.useCallback(C=>C.hulls[n].vertices,[n]),Nf),f=No(C=>C.clock),g=pe.useRef(),y=pe.useRef(),b=typeof h=="function"?h(0):h,w=new mW(b.map(C=>new Ae(C.x,C.y,C.z)));return Xm(pe.useCallback(()=>{const C=f.getElapsed()*1e3;rC(y,u.color,C),rC(g,u.color,C);const M=typeof h=="function"?h(C):h;if(M!==b){const k=new mW(M.map(L=>new Ae(L.x,L.y,L.z)));g.current.geometry=k,y.current.geometry=k}const A=typeof u.hidden=="function"?!u.hidden(C):!u.hidden;g.current.visible=A,y.current.visible=A},[g,y,b,u,f,h])),un(_ee,{enabled:u.highlighted,children:Bh("group",{ref:r,up:[0,0,1],children:[Bh("group",{up:[0,0,1],onPointerDown:C=>{s(n,g.current.visible,C)},onPointerOver:C=>{o(n,g.current.visible,C)},onPointerOut:C=>{l(n,g.current.visible,C)},children:[un("mesh",{ref:y,geometry:w,castShadow:!1,receiveShadow:!1,children:un("meshLambertMaterial",{transparent:!0,wireframe:u.wireframe,attach:"material",side:cd})},`${n}B`),un("mesh",{ref:g,geometry:w,castShadow:!1,receiveShadow:!1,children:un("meshLambertMaterial",{transparent:!0,attach:"material",wireframe:u.wireframe,side:p_})},`${n}F`)]}),u.showName&&un(WZ,{distanceFactor:2,position:[0,0,.5],children:un("div",{style:{opacity:.75,borderRadius:2,backgroundColor:"lightgrey"},className:"disable-text-selection",children:u.name})})]})})}),U2e=pe.forwardRef(({objectKey:n},e)=>{const t=pe.useRef(null),r=_E(e,t),s=pe.useRef(),o=No(u=>u.clock),l=No(pe.useCallback(u=>u.texts[n],[n]));return Xm(pe.useCallback(()=>{const u=o.getElapsed()*1e3;r.current&&(r.current.position.set(typeof l.position.x=="function"?l.position.x(u):l.position.x,typeof l.position.y=="function"?l.position.y(u):l.position.y,typeof l.position.z=="function"?l.position.z(u):l.position.z),r.current.visible=typeof l.hidden=="function"?!l.hidden(u):!l.hidden),s.current&&rC(s,l.color,u)},[l,r,o])),un("group",{ref:r,children:un(RAe,{follow:!0,children:un($Ie,{ref:s,depthOffset:2,scale:[.2,.2,.2],children:l.value})})})}),H2e=pe.forwardRef(({objectKey:n},e)=>{const t=pe.useRef(null),r=_E(e,t),s=No(g=>g.clock),{points:o,scale:l,hidden:u}=No(pe.useCallback(g=>({points:g.points[n].points,scale:g.points[n].scale,hidden:g.points[n].hidden}),[n]),Nf),[{positions:h,colors:f}]=pe.useState(()=>({positions:new Float32Array(o.length*3),colors:new Float32Array(o.length*3)}));return Xm(()=>{const g=s.getElapsed()*1e3;if(r.current)for(let y=0;y{const A=n==="world"?lke:n==="gizmo"?uke:ake,k=n===y?M:{},L=w?t.filter(D=>C.includes(D.key)):t,P=w&&n!==g;return Bh(A,{objectKey:n,displayTfs:e,ref:y===n?g:null,...k,ghost:f,highlightColor:h,children:[L.filter(D=>D.frame===n||n==="world"&&!D.frame).map(D=>un(W4,{activeTf:D.key,displayTfs:e,allTfs:t,allItems:r,allLines:s,allHulls:o,allTexts:l,allPoints:u,highlightColor:h,ghosts:f,targetRef:g,targetSource:b,targetId:y,filterActive:P,tfFilter:C,customProps:M},D.key)),r.filter(D=>D.frame===n||n==="world"&&!D.frame).map(D=>{const z=D.key===y&&b==="items"?M:{};return!w||D.key===y||n===y?un(P2e,{objectKey:D.key,highlightColor:h,ghost:f,ref:D.key===y?g:null,...z},D.key):null}),s.filter(D=>D.frame===n||n==="world"&&!D.frame).map(D=>{const z=D.key===y&&b==="lines"?M:{};return!w||D.key===y||n===y?un(F2e,{objectKey:D.key,ref:D.lineKey===y?g:null,...z},D.key):null}),o.filter(D=>D.frame===n||n==="world"&&!D.frame).map(D=>{const z=D.key===y&&b==="hulls"?M:{};return!w||D.key===y||n===y?un(z2e,{objectKey:D.key,highlightColor:h,ghost:f,ref:D.key===y?g:null,...z},D.key):null}),l.filter(D=>D.frame===n||n==="world"&&!D.frame).map(D=>{const z=D.key===y&&b==="texts"?M:{};return!w||D.key===y||n===y?un(U2e,{objectKey:D.key,highlightColor:h,ref:D.key===y?g:null,...z},D.key):null}),u.filter(D=>D.frame===n||n==="world"&&!D.frame).map(D=>{const z=D.key===y&&b==="points"?M:{};return!w||D.key===y||n===y?un(H2e,{objectKey:D.key,highlightColor:h,ref:D.key===y?g:null,...z},D.key):null})]})}),G2e=["enabled","axis","translationSnap","rotationSnap","scaleSnap","space","size"],W2e=["displayTfs","allTfs","allItems","allLines","allHulls","allTexts","allPoints","highlightColor"],V2e=pe.memo(({camera:n,objectInfo:e,highlightColor:t,translateSnap:r,rotateSnap:s,scaleSnap:o,onDragStart:l,onDragEnd:u,mode:h,...f})=>{const g=cN(f,G2e),y=cN(f,W2e),b=No(pe.useCallback(q=>{let he=[];e.source==="tfs"&&he.push(e.key);let ae=q[e.source][e.key].frame;for(;ae&&ae!=="world"&&ae!=="gizmo";){let ue=q.tfs[ae];he.push(ae),ae=ue.frame}return he},[e]),Nf),w=pe.useRef(),C=pe.useRef(),M=No(q=>cN(q[e.source][e.key],["position","rotation","scale"]),Nf),A=nf(({gl:q})=>q),k=nf(({camera:q})=>q),L=nf(({invalidate:q})=>q),P=n||k,[D]=pe.useState(()=>new GRe(P,A.domElement));D.translationSnap=r,D.rotationSnap=s,D.scaleSnap=o,h!=null&&h.includes("translate")?D.mode="translate":h!=null&&h.includes("rotate")?D.mode="rotate":h!=null&&h.includes("scale")&&(D.mode="scale"),h!=null&&h.includes("-x")?(D.showY=!1,D.showZ=!1):h!=null&&h.includes("-y")?(D.showX=!1,D.showZ=!1):h!=null&&h.includes("-z")&&(D.showX=!1,D.showY=!1);const[z,U]=pe.useState(!1),[V,H]=pe.useState(M),[oe,le]=pe.useState(!1);pe.useEffect(()=>{console.log("refreshing transform"),H(M)},[M,oe]);const Z=No(q=>q.onMove,Nf);return pe.useEffect(()=>{const q=he=>{var ae,ue,ge;const we=(ae=C==null?void 0:C.current)==null?void 0:ae.position,J=(ue=C==null?void 0:C.current)==null?void 0:ue.quaternion,re=(ge=C==null?void 0:C.current)==null?void 0:ge.scale;he.value&&!z?(console.log("starting transform"),U(!0),H({position:we,rotation:J,scale:re}),l&&l()):!he.value&&z&&(console.log("stopping transform"),U(!1),u&&u(),Z(e.key,e.source,{position:D.worldPosition,quaternion:D.worldQuaternion,scale:D._worldScale},{position:we?{x:we.x,y:we.y,z:we.z}:null,quaternion:J?{x:J.x,y:J.y,z:J.z,w:J.w}:null,scale:re?{x:re.x,y:re.y,z:re.z}:null}),le(!oe))};return D&&D.addEventListener("dragging-changed",q),()=>{D.removeEventListener("dragging-changed",q)}},[M,z,e]),pe.useEffect(()=>void(D==null?void 0:D.attach(C.current)),[C,D]),pe.useEffect(()=>(D&&D.addEventListener("change",L),()=>{var q;return(q=D==null?void 0:D.removeEventListener)==null?void 0:q.call(D,"change",L)}),[D,L]),D?Bh(PC,{children:[un("primitive",{ref:w,object:D,...g}),un(W4,{...y,activeTf:"world",tfFilter:b,ghosts:!0,targetRef:C,targetSource:e.source,targetId:e.key,filterActive:!0,customProps:{...V}})]}):null}),n1=(n,e)=>n.length!==e.length?!1:!n.some((t,r)=>!pg.exports.isEqual(e[r],t));function j2e({displayTfs:n=!1,displayGrid:e=!0,isPolar:t=!1,backgroundColor:r="#d0d0d0",planeColor:s="#a8a8a8",highlightColor:o="#00ffff",plane:l=0,translateSnap:u=0,rotateSnap:h=0,scaleSnap:f=0,debug:g=!1}){g&&console.log("content rerender");const y=nf(Z=>Z.camera),b=No(Z=>Z.clock,Nf);Xm(()=>{b.update()});const w=No(Z=>pg.exports.sortBy(Object.entries(Z.tfs).map(([q,he])=>({key:q,frame:he.frame,transformMode:he.transformMode,source:"tfs"})),q=>q.key),n1),C=No(Z=>pg.exports.sortBy(Object.entries(Z.items).map(([q,he])=>({key:q,frame:he.frame,transformMode:he.transformMode,source:"items"})),q=>q.key),n1),M=No(Z=>pg.exports.sortBy(Object.entries(Z.lines).map(([q,he])=>({key:q,frame:he.frame,source:"lines"})),q=>q.key),n1),A=No(Z=>pg.exports.sortBy(Object.entries(Z.hulls).map(([q,he])=>({key:q,frame:he.frame,source:"hulls"})),q=>q.key),n1),k=No(Z=>pg.exports.sortBy(Object.entries(Z.texts).map(([q,he])=>({key:q,frame:he.frame,source:"texts"})),q=>q.key),n1),L=No(Z=>pg.exports.sortBy(Object.entries(Z.points).map(([q,he])=>({key:q,frame:he.frame,source:"points"})),q=>q.key),n1),P=No(Z=>pg.exports.sortBy(Object.entries(Z.widgets).map(([q,he])=>({key:q,frame:he.frame,source:"widgets"})),q=>q.key),n1),D=[...C,...w].filter(Z=>["translate","rotate","scale","translate-x","translate-y","translate-z","rotate-x","rotate-y","rotate-z","scale-x","scale-y","scale-z"].includes(Z.transformMode)),z=pe.useRef(),U=pe.useRef(),V=pe.useRef(),H=pe.useRef(),oe=HRe(s),le=[oe.r,oe.g,oe.b,.5];return Bh(yt.Fragment,{children:[un(tRe,{ref:H,makeDefault:!0,camera:y}),un("pointLight",{ref:U,intensity:.5,position:[-1,-3,3],color:"#FFFAEE"}),un(zRe,{ref:z,intensity:.7,color:"white"}),un(URe,{ref:V,castShadow:!0,position:[5,15,15],intensity:.6,color:"#FFFAEE"}),un("spotLight",{penumbra:1,position:[-1,-1,4],intensity:.3,castShadow:!0,color:"#FFFAEE"}),un("color",{attach:"background",args:[r]}),un("fogExp2",{attach:"fog",args:[r,.01]}),un(sRe,{receiveShadow:!0,scale:1e3,position:[0,0,l-.01],material:d_(...le)}),Bh(k2e,{children:[un(R2e,{autoClear:!1,children:un(O2e,{visibleEdgeColor:o,hiddenEdgeColor:o,blur:!0,kernelSize:1,edgeStrength:50,pulseSpeed:.25,xRay:!0})}),un(W4,{activeTf:"world",displayTfs:n,allTfs:w,allItems:C,allLines:M,allHulls:A,allTexts:k,allPoints:L,allWidgets:P,highlightColor:o})]}),un("group",{position:[0,0,l],rotation:[Math.PI/2,0,0],up:[0,0,1],children:e&&(t?un("polarGridHelper",{args:[10,16,8,64,"white","gray"]}):un("gridHelper",{args:[20,20,"white","gray"]}))}),D.map(Z=>un(V2e,{objectInfo:Z,mode:Z.transformMode,displayTfs:n,allTfs:w,allItems:C,allLines:M,allHulls:A,allTexts:k,allPoints:L,allWidgets:P,translateSnap:u,rotateSnap:h,scaleSnap:f,highlightColor:o,onDragEnd:()=>{H.current&&(H.current.enabled=!0)},onDragStart:()=>{H.current&&(H.current.enabled=!1)}},`movableObjectTransform-${Z.key}`))]})}ro.DefaultUp.set(0,0,1);function Y2e({backgroundColor:n="#d0d0d0",store:e,fov:t=60,onPointerMissed:r=()=>{},meshLookup:s={},debug:o=!1,...l}){return o&&console.log("Scene rerender"),un(cAe,{camera:{up:[0,0,1],fov:t,position:[0,-3,3]},shadows:!0,style:{background:n||"#d0d0d0"},onPointerMissed:r||(()=>{}),children:un(FRe,{store:e,debug:o,children:un(D2e,{meshes:s,children:un(pe.Suspense,{children:un(j2e,{...l,backgroundColor:n,debug:o})})})})})}var V4={},X2e=aT;Object.defineProperty(V4,"__esModule",{value:!0});var bee=V4.default=void 0,K2e=X2e(MC()),J2e=De;bee=V4.default=(0,K2e.default)((0,J2e.jsx)("path",{d:"M12 5V2L8 6l4 4V7c3.31 0 6 2.69 6 6 0 2.97-2.17 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93 0-4.42-3.58-8-8-8m-6 8c0-1.65.67-3.15 1.76-4.24L6.34 7.34C4.9 8.79 4 10.79 4 13c0 4.08 3.05 7.44 7 7.93v-2.02c-2.83-.48-5-2.94-5-5.91"}),"RestartAlt");var j4={},q2e=aT;Object.defineProperty(j4,"__esModule",{value:!0});var Tee=j4.default=void 0,Q2e=q2e(MC()),Z2e=De;Tee=j4.default=(0,Q2e.default)((0,Z2e.jsx)("path",{d:"M8 5v14l11-7z"}),"PlayArrow");var Y4={},eOe=aT;Object.defineProperty(Y4,"__esModule",{value:!0});var See=Y4.default=void 0,tOe=eOe(MC()),nOe=De;See=Y4.default=(0,tOe.default)((0,nOe.jsx)("path",{d:"M6 6h12v12H6z"}),"Stop");const rOe="/gpu-programming/assets/compile-worker-DEfUxNNI.js",iOe={Left:"LEFT_ARM_CONNECTOR_1",Right:"RIGHT_ARM_CONNECTOR_1",Head:"HEAD_1",Neck:"NECK_GLOBE_BASE_1",Base:"base_link"},Wi=n=>iOe[n],sOe={s_Acceptance:"s_Acceptance.wav",s_Amazement:"s_Amazement.wav",s_Amazement2:"s_Amazement2.wav",s_Anger:"s_Anger.wav",s_Anger2:"s_Anger2.wav",s_Anger3:"s_Anger3.wav",s_Anger4:"s_Anger4.wav",s_Annoyance:"s_Annoyance.wav",s_Annoyance2:"s_Annoyance2.wav",s_Annoyance3:"s_Annoyance3.wav",s_Annoyance4:"s_Annoyance4.wav",s_Awe:"s_Awe.wav",s_Awe2:"s_Awe2.wav",s_Awe3:"s_Awe3.wav",s_Boredom:"s_Boredom.wav",s_Disapproval:"s_Disapproval.wav",s_Disgust:"s_Disgust.wav",s_Disgust2:"s_Disgust2.wav",s_Disgust3:"s_Disgust3.wav",s_DisorientedConfused:"s_DisorientedConfused.wav",s_DisorientedConfused2:"s_DisorientedConfused2.wav",s_DisorientedConfused3:"s_DisorientedConfused3.wav",s_DisorientedConfused4:"s_DisorientedConfused4.wav",s_DisorientedConfused5:"s_DisorientedConfused5.wav",s_DisorientedConfused6:"s_DisorientedConfused6.wav",s_Distraction:"s_Distraction.wav",s_Ecstacy:"s_Ecstacy.wav",s_Ecstacy2:"s_Ecstacy2.wav",s_Fear:"s_Fear.wav",s_Grief:"s_Grief.wav",s_Grief2:"s_Grief2.wav",s_Grief3:"s_Grief3.wav",s_Grief4:"s_Grief4.wav",s_Joy:"s_Joy.wav",s_Joy2:"s_Joy2.wav",s_Joy3:"s_Joy3.wav",s_Joy4:"s_Joy4.wav",s_Loathing:"s_Loathing.wav",s_Love:"s_Love.wav",s_PhraseByeBye:"s_PhraseByeBye.wav",s_PhraseEvilAhHa:"s_PhraseEvilAhHa.wav",s_PhraseHello:"s_PhraseHello.wav",s_PhraseNoNoNo:"s_PhraseNoNoNo.wav",s_PhraseOopsy:"s_PhraseOopsy.wav",s_PhraseOwOwOw:"s_PhraseOwOwOw.wav",s_PhraseOwwww:"s_PhraseOwwww.wav",s_PhraseUhOh:"s_PhraseUhOh.wav",s_Rage:"s_Rage.wav",s_Sadness:"s_Sadness.wav",s_Sadness2:"s_Sadness2.wav",s_Sadness3:"s_Sadness3.wav",s_Sadness4:"s_Sadness4.wav",s_Sadness5:"s_Sadness5.wav",s_Sadness6:"s_Sadness6.wav",s_Sadness7:"s_Sadness7.wav",s_Sleepy:"s_Sleepy.wav",s_Sleepy2:"s_Sleepy2.wav",s_Sleepy3:"s_Sleepy3.wav",s_Sleepy4:"s_Sleepy4.wav",s_SleepySnore:"s_SleepySnore.wav",s_SystemCameraShutter:"s_SystemCameraShutter.wav"},p9=n=>sOe[n],rv={e_Sleeping:"e_Sleeping.jpg",e_SleepingZZZ:"e_SleepingZZZ.jpg",e_Contempt:"e_Contempt.jpg",e_ContentLeft:"e_ContentLeft.jpg",e_ContentRight:"e_ContentRight.jpg",e_Disoriented:"e_Disoriented.jpg",e_EcstacyHilarious:"e_EcstacyHilarious.jpg",e_EcstacyStarryEyed:"e_EcstacyStarryEyed.jpg",e_JoyGoofy:"e_JoyGoofy.jpg",e_JoyGoofy2:"e_JoyGoofy2.jpg",e_JoyGoofy3:"e_JoyGoofy3.jpg",e_Love:"e_Love.jpg",e_Rage:"e_Rage.jpg",e_Rage2:"e_Rage2.jpg",e_Rage3:"e_Rage3.jpg",e_Rage4:"e_Rage4.jpg",e_RemorseShame:"e_RemorseShame.jpg",eyes_acceptance:"eyes_acceptance.jpg",eyes_admiration:"eyes_admiration.jpg",eyes_amazement:"eyes_amazement.jpg",eyes_anger:"eyes_anger.jpg",eyes_annoyed:"eyes_annoyed.jpg",eyes_anticipation:"eyes_anticipation.png",eyes_apprehension:"eyes_apprehension.jpg",eyes_apprehension_1:"eyes_apprehension_1.jpg",eyes_boredom:"eyes_boredom.jpg",eyes_default:"eyes_default.jpg",eyes_disgust:"eyes_disgust.jpg",eyes_distraction:"eyes_distraction.gif",eyes_ecstasy_frame_1:"eyes_ecstasy_frame_1.jpg",eyes_ecstasy_frame_2:"eyes_ecstasy_frame_2.jpg",eyes_fear:"eyes_fear.jpg",eyes_grief:"eyes_grief.jpg",eyes_interest:"eyes_interest.jpg",eyes_joy:"eyes_joy.jpg",eyes_loathing:"eyes_loathing.jpg",eyes_pensiveness:"eyes_pensiveness.jpg",eyes_rage:"eyes_rage.jpg",eyes_sad:"eyes_sad.jpg",eyes_serenity:"eyes_serenity.jpg",eyes_surprise:"eyes_surprise.png",eyes_terror:"eyes_terror.jpg",eyes_trust:"eyes_trust.jpg",eyes_vigilance:"eyes_vigilance.jpg"},oOe=n=>rv[n],aOe=({blocks:n,tfs:e,items:t})=>{var le;var r=e[Wi("Left")],s=e[Wi("Right")],o=e[Wi("Head")],l=e[Wi("Base")];let u={Left:{x:[r.rotation.x],y:[r.rotation.y],z:[r.rotation.z],w:[r.rotation.w]},Right:{x:[s.rotation.x],y:[s.rotation.y],z:[s.rotation.z],w:[s.rotation.w]},Head:{x:[o.rotation.x],y:[o.rotation.y],z:[o.rotation.z],w:[o.rotation.w]},Base:{position:{x:[l.position.x],y:[l.position.y],z:[l.position.z],angle:[0],distance:[0]},rotation:{x:[l.rotation.x],y:[l.rotation.y],z:[l.rotation.z],w:[l.rotation.w]}},Time:[0]},h=Object.keys(rv);for(let Z=0;Z{if(Z==="both")g(q,he,q,he);else if(he>0){var ae=Z,ue=Z==="Left"?"Right":"Left",ge={rotation:{x:u[ae].x[u[ae].x.length-1],y:u[ae].y[u[ae].y.length-1],z:u[ae].z[u[ae].z.length-1],w:u[ae].w[u[ae].w.length-1]}},we=oI(ge.rotation),J=2*ad*sI*Math.abs(we.y-q),re=J/(he/100*UO),ie={x:0,y:q-HO,z:0},fe=1;if(ie.y<0&&we.y>0||ie.y>0&&we.y<0){let Ie=(ie.y-we.y)/2,Je=ie.y-Ie;var Te=ty(0,Je*ad/180,0);u[ae].w.push(Te._w),u[ae].x.push(Te._x),u[ae].y.push(Te._y),u[ae].z.push(Te._z),u.Time.push(re/2),fe+=1}var Fe=ty(ie.x,ie.y*ad/180,ie.z);u[ae].w.push(Fe._w),u[ae].x.push(Fe._x),u[ae].y.push(Fe._y),u[ae].z.push(Fe._z);for(let Ie=0;Ie1?u.Time.push(re/2):u.Time.push(re)}},g=(Z,q,he,ae)=>{if(q>0||ae>0){var ue={rotation:{x:u.Left.x[u.Left.x.length-1],y:u.Left.y[u.Left.y.length-1],z:u.Left.z[u.Left.z.length-1],w:u.Left.w[u.Left.w.length-1]}},ge={rotation:{x:u.Right.x[u.Right.x.length-1],y:u.Right.y[u.Right.y.length-1],z:u.Right.z[u.Right.z.length-1],w:u.Right.w[u.Right.w.length-1]}},we=oI(ue.rotation),J=2*ad*sI*Math.abs(we.y-Z),re=J/(q/100*UO),ie=oI(ge.rotation),fe=2*ad*sI*Math.abs(ie.y-he),Te=fe/(ae/100*UO),Fe=q===0?Te:ae===0?re:Math.max(re,Te),Ie={x:0,y:Z-HO,z:0},Je=ty(Ie.x,Ie.y*ad/180,Ie.z),Re={x:0,y:he-HO,z:0},Qe=ty(Re.x,Re.y*ad/180,Re.z);let lt=1;if(Ie.y<0&&we.y>0||Ie.y>0&&we.y<0||Re.y<0&&ie.y>0||Re.y>0&&ie.y<0){let ze=(Ie.y-we.y)/2,Ce=(Ie.y-we.y)/2,He=Ie.y-ze,rt=Re.y-Ce;var nt=ty(0,He*ad/180,0),ft=ty(0,rt*ad/180,0);q>0?(u.Left.w.push(nt._w),u.Left.x.push(nt._x),u.Left.y.push(nt._y),u.Left.z.push(nt._z)):(u.Left.w.push(u.Left.w[u.Left.w.length-1]),u.Left.x.push(u.Left.x[u.Left.x.length-1]),u.Left.y.push(u.Left.y[u.Left.y.length-1]),u.Left.z.push(u.Left.z[u.Left.z.length-1])),ae>0?(u.Right.w.push(ft._w),u.Right.x.push(ft._x),u.Right.y.push(ft._y),u.Right.z.push(ft._z)):(u.Right.w.push(u.Right.w[u.Right.w.length-1]),u.Right.x.push(u.Right.x[u.Right.x.length-1]),u.Right.y.push(u.Right.y[u.Right.y.length-1]),u.Right.z.push(u.Right.z[u.Right.z.length-1])),u.Time.push(Fe/2),lt+=1}q>0?(u.Left.w.push(Je._w),u.Left.x.push(Je._x),u.Left.y.push(Je._y),u.Left.z.push(Je._z)):(u.Left.w.push(u.Left.w[u.Left.w.length-1]),u.Left.x.push(u.Left.x[u.Left.x.length-1]),u.Left.y.push(u.Left.y[u.Left.y.length-1]),u.Left.z.push(u.Left.z[u.Left.z.length-1])),ae>0?(u.Right.w.push(Qe._w),u.Right.x.push(Qe._x),u.Right.y.push(Qe._y),u.Right.z.push(Qe._z)):(u.Right.w.push(u.Right.w[u.Right.w.length-1]),u.Right.x.push(u.Right.x[u.Right.x.length-1]),u.Right.y.push(u.Right.y[u.Right.y.length-1]),u.Right.z.push(u.Right.z[u.Right.z.length-1]));for(let ze=0;ze1?u.Time.push(Fe/2):u.Time.push(Fe)}},y=(Z,q,he,ae)=>{if(ae>0){var ue=ty(q*ad/180,Z*ad/180,he*ad/180);u.Head.w.push(ue._w),u.Head.x.push(ue._x),u.Head.y.push(ue._y),u.Head.z.push(ue._z),u.Left.w.push(u.Left.w[u.Left.w.length-1]),u.Left.x.push(u.Left.x[u.Left.x.length-1]),u.Left.y.push(u.Left.y[u.Left.y.length-1]),u.Left.z.push(u.Left.z[u.Left.z.length-1]),u.Right.w.push(u.Right.w[u.Right.w.length-1]),u.Right.x.push(u.Right.x[u.Right.x.length-1]),u.Right.y.push(u.Right.y[u.Right.y.length-1]),u.Right.z.push(u.Right.z[u.Right.z.length-1]),u.Base.position.x.push(u.Base.position.x[u.Base.position.x.length-1]),u.Base.position.y.push(u.Base.position.y[u.Base.position.y.length-1]),u.Base.position.z.push(u.Base.position.z[u.Base.position.z.length-1]),u.Base.rotation.w.push(u.Base.rotation.w[u.Base.rotation.w.length-1]),u.Base.rotation.x.push(u.Base.rotation.x[u.Base.rotation.x.length-1]),u.Base.rotation.y.push(u.Base.rotation.y[u.Base.rotation.y.length-1]),u.Base.rotation.z.push(u.Base.rotation.z[u.Base.rotation.z.length-1]);let ge=Object.keys(rv);for(let we=0;we{if(he>0){var ae={position:{x:u.Base.position.x[u.Base.position.x.length-1],y:u.Base.position.y[u.Base.position.y.length-1],z:u.Base.position.z[u.Base.position.z.length-1]},rotation:{x:u.Base.rotation.x[u.Base.rotation.x.length-1],y:u.Base.rotation.y[u.Base.rotation.y.length-1],z:u.Base.rotation.z[u.Base.rotation.z.length-1],w:u.Base.rotation.w[u.Base.rotation.w.length-1]}},ue=q/100*cle*he/V0,ge=Z/100*ule*he/V0,we=new Pu(ae.rotation.x,ae.rotation.y,ae.rotation.z,ae.rotation.w),J=ple(we);if(ue!==0){var re={x:0,y:0,z:ue};we=ty(re.x,re.y,re.z),we.multiply(new Pu(ae.rotation.x,ae.rotation.y,ae.rotation.z,ae.rotation.w))}let ie=ae.position.x,fe=ae.position.y,Te=null;Te=new Bt(ie+Math.sin(J-ue)*ge,fe-Math.cos(J-ue)*ge,ae.position.z),u.Base.position.x.push(Te.x),u.Base.position.y.push(Te.y),u.Base.position.z.push(Te.z),u.Base.position.angle.push(ue),u.Base.position.distance.push(ge),u.Base.rotation.w.push(we._w),u.Base.rotation.x.push(we._x),u.Base.rotation.y.push(we._y),u.Base.rotation.z.push(we._z),u.Head.x.push(u.Head.x[u.Head.x.length-1]),u.Head.y.push(u.Head.y[u.Head.y.length-1]),u.Head.z.push(u.Head.z[u.Head.z.length-1]),u.Head.w.push(u.Head.w[u.Head.w.length-1]),u.Left.w.push(u.Left.w[u.Left.w.length-1]),u.Left.x.push(u.Left.x[u.Left.x.length-1]),u.Left.y.push(u.Left.y[u.Left.y.length-1]),u.Left.z.push(u.Left.z[u.Left.z.length-1]),u.Right.w.push(u.Right.w[u.Right.w.length-1]),u.Right.x.push(u.Right.x[u.Right.x.length-1]),u.Right.y.push(u.Right.y[u.Right.y.length-1]),u.Right.z.push(u.Right.z[u.Right.z.length-1]);let Fe=Object.keys(rv);for(let Ie=0;Ie{let he=Object.keys(rv);for(let ue=0;ue{let q=u.Head.x.length-1;u.Base.position.x.push(u.Base.position.x[q]),u.Base.position.y.push(u.Base.position.y[q]),u.Base.position.z.push(u.Base.position.z[q]),u.Base.rotation.w.push(u.Base.rotation.w[q]),u.Base.rotation.x.push(u.Base.rotation.x[q]),u.Base.rotation.y.push(u.Base.rotation.y[q]),u.Base.rotation.z.push(u.Base.rotation.z[q]),u.Head.x.push(u.Head.x[q]),u.Head.y.push(u.Head.y[q]),u.Head.z.push(u.Head.z[q]),u.Head.w.push(u.Head.w[q]),u.Left.w.push(u.Left.w[q]),u.Left.x.push(u.Left.x[q]),u.Left.y.push(u.Left.y[q]),u.Left.z.push(u.Left.z[q]),u.Right.w.push(u.Right.w[q]),u.Right.x.push(u.Right.x[q]),u.Right.y.push(u.Right.y[q]),u.Right.z.push(u.Right.z[q]);let he=Object.keys(rv);for(let ae=0;ae{let Z=JSON.parse(JSON.stringify(e)),q=JSON.parse(JSON.stringify(e)),he=JSON.parse(JSON.stringify(t)),ae=JSON.parse(JSON.stringify(t)),ue=u.Time.length,ge=0,we=[],J=[],re=[],ie=[],fe=[],Te=[],Fe=[],Ie=[],Je=[],Re=[],Qe=[],nt=[],ft=[],lt=[],ze=[],Ce=[],He=[],rt=[],it=[],Nt=[],kt=[],vt=Object.keys(rv);for(let $e=0;$eObject.values(n).filter(q=>q.type===Z)[0],k=Z=>n[Z],L=(Z,q)=>{const he=k(Z);let ae=k(q);if(V(he,he.type))for(V(ae,ae.type);ae.next;)ae=k(ae.next),V(ae,ae.type)},P=Z=>Z==="TRUE";function D(Z,q){return Z=Math.ceil(Z),q=Math.floor(q),Math.floor(Math.random()*(q-Z+1))+Z}function z(Z){if(Z===2||Z===3)return!0;if(Z<=1||Z%2===0||Z%3===0)return!1;for(let q=5;q*q<=Z;q+=6)if(Z%q===0||Z%(q+2)===0)return!1;return!0}function U(Z){var q;if(typeof Z!="string"&&typeof Z!="object")return Z.shadow.fields.NUM;{let he=(q=Z==null?void 0:Z.shadow)!=null&&q.id?k(Z.shadow.id):k(Z);return V(he,he.type)}}const V=(Z,q)=>{var vt,Mt,At;switch(!0){case q==="controls_if":if(!Z.inputs||!Z.inputs.IF0||!Z.inputs.DO0)throw new Error("err: controls_if not complete!");L(Z.inputs.IF0,Z.inputs.DO0);break;case q==="logic_boolean":return P(Z.fields.BOOL);case q==="logic_compare":if(!Z.inputs||!Z.inputs.A||!Z.inputs.B)throw new Error("err: logic_compare is not complete!");const mt=Z.fields.OP,xe=Z.inputs.A,se=Z.inputs.B,$e=k(xe),ht=k(se);if(mt==="EQ")return V($e,$e.type)==V(ht,ht.type);if(mt==="NEQ")return V($e,$e.type)!==V(ht,ht.type);if(mt==="LT")return V($e,$e.type)V(ht,ht.type);if(mt==="GTE")return V($e,$e.type)>=V(ht,ht.type);case q==="logic_operation":if(!Z.inputs||!Z.inputs.A||!Z.inputs.B)throw new Error("err: logic_operation is not complete!");const St=Z.fields.OP,It=Z.inputs.A,pt=Z.inputs.B,Ke=k(It),Le=k(pt);return St==="OR"?V(Ke,Ke.type)||V(Le,Le.type):V(Ke,Ke.type)&&V(Le,Le.type);case q==="logic_negate":if(!Z.inputs)throw new Error("err: logic_negate is not complete!");const Q=k(Z.inputs.BOOL);return!V(Q,Q.type);case q==="logic_boolean":return!Z.fields.BOOL!=="FALSE";case q==="logic_null":return null;case q==="logic_ternary":if(!Z.inputs||!Z.inputs.IF||!Z.inputs.THEN||!Z.inputs.ELSE)throw new Error("err: logic_ternary is not complete!");const te=Z.inputs.IF,me=Z.inputs.THEN,ke=Z.inputs.ELSE,Xe=k(te),Wt=k(me),Ge=k(ke);return V(Xe,Xe.type)?V(Wt,Wt.type):V(Ge,Ge.type);case q==="controls_repeat_ext":const _t=U(Z.inputs.TIMES);if(!Z.inputs.DO)throw new Error("err: controls_repeat_ext is not complete!");let Jt=k(Z.inputs.DO);for(let $r=0;$r<_t;$r++){V(Jt,Jt.type);let si=Jt;for(;si.next;)si=k(si.next),V(si,si.type)}return;case q==="math_number":return Z.fields.NUM;case q=="BasicSlider":case q=="ArmPositionSlider":case q=="SpeedSlider":case q=="TimeSlider":case q=="HeadPitchSlider":case q=="HeadRollSlider":case q=="HeadYawSlider":return Z.fields.FIELD_slider_value;case q==="math_number_property":const Kt=Z.fields.PROPERTY,On=U(Z.inputs.NUMBER_TO_CHECK);if(Kt==="EVEN")return On%2===0;if(Kt==="ODD")return On%2===1;if(Kt==="PRIME")return z(On);if(Kt==="WHOLE")return On%1===0;if(Kt==="POSITIVE")return On>0;if(Kt==="NEGATIVE")return On<0;if(Kt==="DIVISIBLE_BY"){if(!Z.inputs||!Z.inputs.DIVISOR)throw new Error("err: DIVISOR is not filled!");if(Z.inputs.DIVISOR===0)throw new Error("Note that divisor cannot be 0!");return On%Z.inputs.DIVISOR===0}return;case q==="math_random_int":const ii=U(Z.inputs.FROM),Pr=U(Z.inputs.TO);return D(ii,Pr);case q==="colour_picker":return aS(Z.fields.COLOUR);case q==="colour_random":let Ei=D(0,255),xr=D(0,255),mr=D(0,255);return{r:Ei,g:xr,b:mr};case q==="colour_rgb":const ne=U(Z.inputs.RED),Se=U(Z.inputs.GREEN),We=U(Z.inputs.BLUE);return{r:ne,g:Se,b:We};case q==="colour_blend":const ot=U(Z.inputs.RATIO),zt=aS(Z.inputs.COLOUR1.shadow.fields.COLOUR),sn=aS(Z.inputs.COLOUR2.shadow.fields.COLOUR),Nn=zt.r*ot,Pe=zt.g*ot,gt=zt.b*ot,Ct=sn.r,bt=sn.g,Vt=sn.b,Wn=(Ct+Nn)/(ot+1),rr=(bt+Pe)/(ot+1),_r=(Vt+gt)/(ot+1);return{r:Wn,g:rr,b:_r};case q==="ChangeLED":if(!Z.inputs||!Z.inputs.FIELD_ChangeLED)throw new Error("err: ChangeLED is not complete!");var he=k(Z.inputs.FIELD_ChangeLED),ae=null;(vt=he==null?void 0:he.fields)!=null&&vt.COLOUR?ae=aS(he.fields.COLOUR):ae=V(he,he.type);var Te={Red:ae.r,Green:ae.g,Blue:ae.b};return;case q==="TransitionLED":if(!Z.inputs||!Z.inputs.COLOR1||!Z.inputs.COLOR2)throw new Error("err: TransitionLED is not complete!");var ue=k(Z.inputs.COLOR1),ge=k(Z.inputs.COLOR2),we=null;(Mt=ue==null?void 0:ue.fields)!=null&&Mt.COLOUR?we=aS(ue.fields.COLOUR):we=V(ue,ue.type);var J=null;(At=ge==null?void 0:ge.fields)!=null&&At.COLOUR?J=aS(ge.fields.COLOUR):J=V(ge,ge.type);var it=Z.fields.FIELD_TransitionTime_TimeMs*V0,re=Z.fields.TRANSITION_TYPE,Te={Red:we.r,Green:we.g,Blue:we.b,Red2:J.r,Green2:J.g,Blue2:J.b,TransitionType:re,TimeMS:it};return;case q==="DisplayImage":if(!Z.inputs||!Z.inputs.FIELD_DisplayImage_Filename)throw new Error("err: DisplayImage is not complete!");var ie=k(Z.inputs.FIELD_DisplayImage_Filename),fe=oOe(ie.type);w(ie.type,500);return;case q==="PlayAudio":if(!Z.inputs||!Z.inputs.FIELD_PlayAudio_Filename)throw new Error("err: PlayAudio is not complete!");var ie=k(Z.inputs.FIELD_PlayAudio_Filename),fe=p9(ie.type);return;case q==="DisplayAnimation":if(!Z.inputs||!Z.inputs.FIELD_DisplayAnimation_Filename)throw new Error("err: DisplayAnimation is not complete!");var ie=k(Z.inputs.FIELD_DisplayAnimation_Filename),fe=p9(ie.type),Te={FileName:fe};readFile(Te);return;case q==="DisplayText":Z.fields.FIELD_DisplayText_Text;return;case q==="TurnOnFlashlight":return;case q==="TurnOffFlashlight":return;case q==="WaitForSeconds":var it=parseFloat(Z.fields.NumSeconds)*V0;C(it);return;case q==="MoveArm":var Fe=Z.fields.FIELD_MoveArm_Arm==="Right"?"Right":"Left",Ie=U(Z.fields.FIELD_MoveArm_Position),Ce=U(Z.fields.FIELD_MoveArm_Velocity);f(Fe,Ie,Ce);return;case q==="MoveArm2":var Ie=U(Z.fields.FIELD_MoveArm2_Position),Ce=U(Z.fields.FIELD_MoveArm2_Velocity),Fe="both";f(Fe,Ie,Ce);return;case q==="MoveArm3":var Fe=Z.fields.FIELD_MoveArm_Arm==="Right"?"Right":"Left",Ie=U(Z.fields.FIELD_MoveArm_Position),Ce=U(Z.fields.FIELD_MoveArm_Velocity);f(Fe,Ie,Ce);return;case q==="MoveArms2":var Je=U(Z.inputs.FIELD_MoveArm_LeftPosition),Re=U(Z.inputs.FIELD_MoveArm_LeftVelocity),Qe=U(Z.inputs.FIELD_MoveArm_RightPosition),nt=U(Z.inputs.FIELD_MoveArm_RightVelocity);g(Je,Re,Qe,nt);return;case q==="MoveHead":var ft=Z.fields.FIELD_MoveHead_Pitch==="D"?25:-40,it=2e3;y(ft,0,0,it);return;case q==="MoveHead3":var ft,lt,ze;ft=U(Z.inputs.FIELD_MoveHead_Pitch),lt=U(Z.inputs.FIELD_MoveHead_Roll),ze=U(Z.inputs.FIELD_MoveHead_Yaw),it=U(Z.inputs.FIELD_MoveHead_Time)*V0,y(ft,lt,ze,it);return;case q==="DriveTime":var rt=Z.fields.FIELD_DriveTime_Direction,Ce=parseInt(Z.fields.FIELD_DriveTime_Velocity),it=parseInt(Z.fields.FIELD_DriveTime_TimeMs)*V0,He=rt==="F"?Ce:-Ce;b(He,0,it);return;case q==="DriveTime2":var He=U(Z.inputs.FIELD_DriveTime_Velocity),Nt=U(Z.inputs.FIELD_DriveTime_Angular),it=U(Z.inputs.FIELD_DriveTime_TimeMs)*V0;b(He,Nt,it);return;case q==="Turn":var rt=Z.fields.FIELD_Turn_Direction,it=parseInt(Z.fields.FIELD_Turn_Duration)*V0,Nt=rt==="L"?100:-100;b(0,Nt,it);return;case q==="Turn2":var rt=Z.fields.FIELD_Turn_Direction,it=parseInt(U(Z.inputs.FIELD_Turn_Duration))*V0,Nt=rt==="L"?100:-100;b(0,Nt,it);return;case q=="Speak":var kt=k(Z.inputs.FIELD_Speak_Text);kt.fields.TEXT;return;case q=="SpeakDefault":Z.fields.FIELD_SpeakDefault_Text;return;default:return}};let oe=A("Start");for(;oe&&oe.next;)oe=k(oe.next),V(oe,oe.type);return M()};function lOe(n){const e=Bn(qi(U=>U.resetSim)),t=Bn(qi(U=>U.toggleSimOnly)),r=Bn(qi(U=>U.isConnected)),s=Bn(qi(U=>U.ip)),o=Bn(qi(U=>U.getBlocks)),l=Bn(qi(U=>U.getEndingItems)),u=Bn(qi(U=>U.clock)),h=Bn(qi(U=>U.mistyImageList)),f=Bn(qi(U=>U.mistyAudioList)),g=Bn(qi(U=>U.simOnly)),y=Bn(qi(U=>U.endingTfs)),b=Bn(qi(U=>U.setAnimationFrames)),w=Bn(qi(U=>U.setHighlightBlocks)),C=Bn(qi(U=>U.workerThread)),M=Bn(qi(U=>U.setWorkerThread)),A=Bn(qi(U=>U.llmMode));function k(U,V){s&&!g&&r&&fetch(`http://${s}/api/${U}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(V)})}const L=async()=>{u.reset_elapsed(),C&&(C.terminate(),M(null));const U=`import ${JSON.stringify(new URL(rOe,import.meta.url))}`,V=new Blob([U],{type:"application/javascript"}),H=URL.createObjectURL(V);let oe=new Worker(H,{type:"module"});oe.onmessage=function(ae){console.log("Message received from worker "+ae.data),M(null)},oe.onerror=function(ae){console.log(ae);const ge=/id: (.+)/.exec(ae.message);ge?w(ge[1]):console.log("ID not found in error message."),URL.revokeObjectURL(H)},oe.postMessage({blocks:o(),mistyAudioList:f,mistyImageList:h,tfs:y,ip:s,runOnRobot:!g}),M(oe);let{newTfs:le,newEndingTfs:Z,newItems:q,newEndingItems:he}=aOe({blocks:o(),tfs:y,items:l()});b(le,Z,q,he),uh("Click Run Code button")},P=()=>{C&&(C.terminate(),M(null),k("halt",{})),uh("Click Stop Code button")},D=()=>{k("arms/set",{LeftArmPosition:90,RightArmPosition:90,LeftArmVelocity:100,RightArmVelocity:100,Units:"Degrees"}),k("head",{Pitch:0,Yaw:0,Roll:0,Duration:1,Units:"Degrees"}),k("images/display",{FileName:"e_DefaultContent.jpg",Alpha:1}),k("text/display",{Text:""}),k("led",{Red:100,Green:70,Blue:160}),e()};let z=A?{top:"10px"}:{bottom:"0px"};return De.jsxs(L$,{style:{position:"absolute",padding:"0px",left:"10px",...z},children:[De.jsxs(DH,{style:{paddingLeft:"0px",paddingRight:"0px"},children:[!C&&De.jsx(pI,{variant:"contained","aria-label":"play",style:{backgroundColor:"#FAFAFA",marginBottom:"5px"},onClick:L,id:"runButton",children:De.jsx(Tee,{})}),C&&De.jsx(pI,{variant:"contained","aria-label":"play",style:{backgroundColor:"#FAFAFA",marginBottom:"5px"},onClick:P,id:"stopButton",children:De.jsx(See,{})}),De.jsx(pI,{variant:"contained","aria-label":"restart",style:{backgroundColor:"#FAFAFA",marginLeft:"5px",marginBottom:"5px"},onClick:D,children:De.jsx(bee,{})})]}),r&&De.jsx(DH,{style:{backgroundColor:"#FAFAFA",borderRadius:"5px",marginBottom:"5px",paddingLeft:"10px",paddingRight:"0px"},children:De.jsx(OK,{children:De.jsx(kK,{control:De.jsx(oge,{onChange:U=>t(U.target.checked)}),label:"Sim only"})})})]})}function uOe(n){const e={displayTfs:!1,displayGrid:!0,isPolar:!1,backgroundColor:"#3a3a3a",planeColor:"#3a3a3a",highlightColor:"#ffffff",plane:0,fov:60,ar:!1,vr:!1};return De.jsxs(Ey,{height:"100%",children:[De.jsx(Y2e,{style:{overflow:"hidden"},store:Bn,meshLookup:R1e,...e}),De.jsx(lOe,{})]})}var wee={exports:{}};(function(n,e){(function(t,r){r()})(Vl,function(){function t(f,g){return typeof g>"u"?g={autoBom:!1}:typeof g!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),g={autoBom:!g}),g.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(f.type)?new Blob(["\uFEFF",f],{type:f.type}):f}function r(f,g,y){var b=new XMLHttpRequest;b.open("GET",f),b.responseType="blob",b.onload=function(){h(b.response,g,y)},b.onerror=function(){console.error("could not download file")},b.send()}function s(f){var g=new XMLHttpRequest;g.open("HEAD",f,!1);try{g.send()}catch{}return 200<=g.status&&299>=g.status}function o(f){try{f.dispatchEvent(new MouseEvent("click"))}catch{var g=document.createEvent("MouseEvents");g.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),f.dispatchEvent(g)}}var l=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof Vl=="object"&&Vl.global===Vl?Vl:void 0,u=l.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),h=l.saveAs||(typeof window!="object"||window!==l?function(){}:"download"in HTMLAnchorElement.prototype&&!u?function(f,g,y){var b=l.URL||l.webkitURL,w=document.createElement("a");g=g||f.name||"download",w.download=g,w.rel="noopener",typeof f=="string"?(w.href=f,w.origin===location.origin?o(w):s(w.href)?r(f,g,y):o(w,w.target="_blank")):(w.href=b.createObjectURL(f),setTimeout(function(){b.revokeObjectURL(w.href)},4e4),setTimeout(function(){o(w)},0))}:"msSaveOrOpenBlob"in navigator?function(f,g,y){if(g=g||f.name||"download",typeof f!="string")navigator.msSaveOrOpenBlob(t(f,y),g);else if(s(f))r(f,g,y);else{var b=document.createElement("a");b.href=f,b.target="_blank",setTimeout(function(){o(b)})}}:function(f,g,y,b){if(b=b||open("","_blank"),b&&(b.document.title=b.document.body.innerText="downloading..."),typeof f=="string")return r(f,g,y);var w=f.type==="application/octet-stream",C=/constructor/i.test(l.HTMLElement)||l.safari,M=/CriOS\/[\d]+/.test(navigator.userAgent);if((M||w&&C||u)&&typeof FileReader<"u"){var A=new FileReader;A.onloadend=function(){var P=A.result;P=M?P:P.replace(/^data:[^;]*;/,"data:attachment/file;"),b?b.location.href=P:location=P,b=null},A.readAsDataURL(f)}else{var k=l.URL||l.webkitURL,L=k.createObjectURL(f);b?b.location=L:location.href=L,b=null,setTimeout(function(){k.revokeObjectURL(L)},4e4)}});l.saveAs=h.saveAs=h,n.exports=h})})(wee);var cOe=wee.exports;const m9=Xy(cOe);function Dx({title:n,children:e,style:t}){return De.jsx(Ey,{style:{padding:"5px",paddingTop:"20px",...t},children:De.jsxs(Ey,{style:{backgroundColor:"#E4E5F1",border:"3px #9394A5 solid",padding:"5px",borderRadius:"6px"},children:[De.jsx(Ey,{style:{position:"relative",display:"float",top:"-18px",left:"10px"},children:De.jsx(Ey,{children:De.jsx(f_,{display:"inline",style:{filter:"drop-shadow(0px 10px 4px rgba(0,0,0,0.25))",backgroundColor:"#E4E5F1",padding:"3px",border:"3px #9394A5 solid",borderRadius:"6px"},children:n})})}),De.jsx(L$,{children:pe.Children.map(e,r=>De.jsx("div",{style:{padding:"3px",margin:"3px"},children:r}))})]})})}function SN({label:n,buttonText:e,clickFunction:t,style:r}){return De.jsxs(oc,{container:!0,direction:"row",alignItems:"center",style:{...r},children:[De.jsx(f_,{display:"inline",style:{paddingRight:"10px",flex:"1"},children:n}),De.jsx(qp,{text:e,clickFunction:t})]})}function wN({label:n,onChangeFunction:e,fieldType:t,textFieldInput:r,style:s}){return De.jsxs(oc,{container:!0,direction:"row",alignItems:"center",style:{...s},children:[De.jsx(f_,{display:"inline",style:{paddingRight:"10px",flex:"1"},children:n}),De.jsx(PF,{value:r,type:t,onChange:e})]})}function g9({label:n,onChange:e,style:t}){return De.jsxs(oc,{container:!0,direction:"row",alignItems:"center",style:{...t},children:[De.jsx(f_,{display:"inline",style:{paddingRight:"10px",flex:"1"},children:n}),De.jsx(LF,{type:"file",onChange:e,accept:".xml"})]})}const hOe=()=>{const n=Bn(k=>k.closeModal),e=Bn(k=>k.setEndpoint),t=Bn(k=>k.setAPIKey),r=Bn(k=>k.setDeployment),s=Bn(qi(k=>k.llmDeployment)),o=Bn(qi(k=>k.llmAPIKey)),l=Bn(qi(k=>k.llmEndpoint)),u=Bn(k=>k.blocklyWorkspace),h=Bn(k=>k.toggleLLMBlockPrompt),f=Bn(qi(k=>k.displayLLMBlockPrompt)),g=Bn(qi(k=>k.chatMessageHistory)),y=Bn(qi(k=>k.setChatMessageHistory)),b=()=>{var k=new Blob([LD],{type:"text/plain;charset=utf-8"});m9.saveAs(k,"activity_log.txt")},w=()=>{console.log(g);var k=new Blob([JSON.stringify(g)],{type:"text/plain;charset=utf-8"});m9.saveAs(k,"chat_log.txt")},C=()=>{const k=Zg.Xml.domToPrettyText(Zg.Xml.workspaceToDom(u)),L=new Blob([k],{type:"text/xml"}),P=URL.createObjectURL(L),D=document.createElement("a");D.href=P,D.download="myBlocks.xml",D.click()},M=k=>{const L=new FileReader;L.onload=function(){const P=L.result;y(JSON.parse(P))},L.readAsText(k.target.files[0])},A=k=>{const L=new FileReader;L.onload=function(){const P=L.result;if(u)try{const z=new DOMParser().parseFromString(P,"text/xml");Zg.Xml.domToWorkspace(z.firstChild,u)}catch(D){console.error("Error parsing XML:",D)}else console.error("Blockly workspace not initialized")},L.readAsText(k.target.files[0])};return De.jsxs(Ey,{sx:{backgroundColor:"#585D92",padding:"5px",margin:"0",borderRadius:"10px",maxHeight:"70vh",overflowY:"scroll"},children:[De.jsxs(Dx,{title:"LLM Settings",children:[De.jsx(wN,{onChangeFunction:k=>e(k.target.value),label:"Server Endpoint",fieldType:"password",textFieldInput:l}),De.jsx(wN,{onChangeFunction:k=>t(k.target.value),label:"API Key",fieldType:"password",textFieldInput:o}),De.jsx(wN,{onChangeFunction:k=>r(k.target.value),label:"Deployment Model",fieldType:"password",textFieldInput:s})]}),De.jsxs(Dx,{title:"Downloads",children:[De.jsx(SN,{clickFunction:b,label:"Download Activity Log",buttonText:"Download"}),De.jsx(SN,{clickFunction:C,label:"Download Program",buttonText:"Download"}),De.jsx(SN,{clickFunction:w,label:"Download Chat Log",buttonText:"Download"})]}),De.jsxs(Dx,{title:"Upload",children:[De.jsx(g9,{onChange:A,label:"Upload Program"}),De.jsx(g9,{onChange:M,label:"Upload Chat Logs"})]}),De.jsx(Dx,{title:"Toggles",children:De.jsx(OK,{style:{justifyContent:"left"},children:De.jsx(kK,{style:{justifyContent:"left"},control:De.jsx(tve,{defaultChecked:f,onChange:k=>h(k.target.checked)}),label:"Enable LLM Block Prompt",labelPlacement:"start"})})}),De.jsx(qp,{clickFunction:n,text:"Close",style:{float:"right"}})]})},dOe=()=>{const n=Bn(t=>t.setActiveModal),e=Bn(t=>t.activeModal);return De.jsx(AK,{open:e===vX,onClose:(t,r)=>{r==="backdropClick"&&n("")},children:e&&De.jsx(hOe,{})})},fOe=()=>De.jsx(Ey,{sx:{backgroundColor:"#585D92",padding:"15px",margin:"0",borderRadius:"10px",maxHeight:"70vh",overflowY:"scroll"},children:De.jsx(jK,{style:{backgroundColor:"#FAFAFA",borderRadius:"5px"},maxVH:50})}),pOe=()=>{const n=Bn(t=>t.setActiveModal),e=Bn(t=>t.activeModal);return De.jsx(AK,{open:e===hle,onClose:(t,r)=>{r==="backdropClick"&&n("")},children:e&&De.jsx(fOe,{})})};function mOe(n){return De.jsx(Dx,{title:"Task Description",children:De.jsx(f_,{variant:"h6",children:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Risus in hendrerit gravida rutrum quisque. Nulla malesuada pellentesque elit eget gravida cum sociis natoque penatibus. Erat velit scelerisque in dictum non. Nisl tincidunt eget nullam non nisi est. Sed tempus urna et pharetra. Nibh sit amet commodo nulla facilisi nullam vehicula. Eget dolor morbi non arcu risus. Donec ac odio tempor orci dapibus ultrices in iaculis."})})}var li="cs",Eee={exports:{}};/*! +}`,C2e="uniform float patternScale;varying vec2 vUvPattern;void mainSupport(const in vec2 uv){vUvPattern=uv*vec2(aspect,1.0)*patternScale;}",M2e=class extends x2e{constructor(n,e,{blendFunction:t=Is.SCREEN,patternTexture:r=null,patternScale:s=1,edgeStrength:o=1,pulseSpeed:l=0,visibleEdgeColor:u=16777215,hiddenEdgeColor:h=2230538,kernelSize:f=U4.VERY_SMALL,blur:g=!1,xRay:y=!0,multisampling:b=0,resolutionScale:w=.5,width:C=cp.AUTO_SIZE,height:M=cp.AUTO_SIZE,resolutionX:A=C,resolutionY:k=M}={}){super("OutlineEffect",$2e,{uniforms:new Map([["maskTexture",new no(null)],["edgeTexture",new no(null)],["edgeStrength",new no(o)],["visibleEdgeColor",new no(new Fn(u))],["hiddenEdgeColor",new no(new Fn(h))],["pulse",new no(1)],["patternScale",new no(s)],["patternTexture",new no(null)]])}),this.blendMode.addEventListener("change",z=>{this.blendMode.getBlendFunction()===Is.ALPHA?this.defines.set("ALPHA","1"):this.defines.delete("ALPHA"),this.setChanged()}),this.blendMode.setBlendFunction(t),this.patternTexture=r,this.xRay=y,this.scene=n,this.camera=e,this.renderTargetMask=new Nc(1,1),this.renderTargetMask.samples=b,this.renderTargetMask.texture.name="Outline.Mask",this.uniforms.get("maskTexture").value=this.renderTargetMask.texture,this.renderTargetOutline=new Nc(1,1,{depthBuffer:!1}),this.renderTargetOutline.texture.name="Outline.Edges",this.uniforms.get("edgeTexture").value=this.renderTargetOutline.texture,this.clearPass=new H4,this.clearPass.overrideClearColor=new Fn(0),this.clearPass.overrideClearAlpha=1,this.depthPass=new kke(n,e),this.maskPass=new w2(n,e,new vke(this.depthPass.texture,e));const L=this.maskPass.clearPass;L.overrideClearColor=new Fn(16777215),L.overrideClearAlpha=1,this.blurPass=new Dke({resolutionScale:w,resolutionX:A,resolutionY:k,kernelSize:f}),this.blurPass.enabled=g;const P=this.blurPass.resolution;P.addEventListener("change",z=>this.setSize(P.baseWidth,P.baseHeight)),this.outlinePass=new Fke(new Cke);const D=this.outlinePass.fullscreenMaterial;D.inputBuffer=this.renderTargetMask.texture,this.time=0,this.active=!1,this.selection=new Wke,this.selection.layer=10,this.pulseSpeed=l}set mainScene(n){this.scene=n,this.depthPass.mainScene=n,this.maskPass.mainScene=n}set mainCamera(n){this.camera=n,this.depthPass.mainCamera=n,this.maskPass.mainCamera=n,this.maskPass.overrideMaterial.copyCameraSettings(n)}get resolution(){return this.blurPass.resolution}getResolution(){return this.blurPass.getResolution()}get multisampling(){return this.renderTargetMask.samples}set multisampling(n){this.renderTargetMask.samples=n,this.renderTargetMask.dispose()}get patternScale(){return this.uniforms.get("patternScale").value}set patternScale(n){this.uniforms.get("patternScale").value=n}get edgeStrength(){return this.uniforms.get("edgeStrength").value}set edgeStrength(n){this.uniforms.get("edgeStrength").value=n}get visibleEdgeColor(){return this.uniforms.get("visibleEdgeColor").value}set visibleEdgeColor(n){this.uniforms.get("visibleEdgeColor").value=n}get hiddenEdgeColor(){return this.uniforms.get("hiddenEdgeColor").value}set hiddenEdgeColor(n){this.uniforms.get("hiddenEdgeColor").value=n}getBlurPass(){return this.blurPass}getSelection(){return this.selection}getPulseSpeed(){return this.pulseSpeed}setPulseSpeed(n){this.pulseSpeed=n}get width(){return this.resolution.width}set width(n){this.resolution.preferredWidth=n}get height(){return this.resolution.height}set height(n){this.resolution.preferredHeight=n}get selectionLayer(){return this.selection.layer}set selectionLayer(n){this.selection.layer=n}get dithering(){return this.blurPass.dithering}set dithering(n){this.blurPass.dithering=n}get kernelSize(){return this.blurPass.kernelSize}set kernelSize(n){this.blurPass.kernelSize=n}get blur(){return this.blurPass.enabled}set blur(n){this.blurPass.enabled=n}get xRay(){return this.defines.has("X_RAY")}set xRay(n){this.xRay!==n&&(n?this.defines.set("X_RAY","1"):this.defines.delete("X_RAY"),this.setChanged())}isXRayEnabled(){return this.xRay}setXRayEnabled(n){this.xRay=n}get patternTexture(){return this.uniforms.get("patternTexture").value}set patternTexture(n){if(n!==null?(n.wrapS=n.wrapT=Lw,this.defines.set("USE_PATTERN","1"),this.setVertexShader(C2e)):(this.defines.delete("USE_PATTERN"),this.setVertexShader(null)),this.renderer!==null){const e=c9(n,this.renderer.capabilities.isWebGL2);this.defines.set("texelToLinear(texel)",e)}this.uniforms.get("patternTexture").value=n,this.setChanged()}setPatternTexture(n){this.patternTexture=n}getResolutionScale(){return this.resolution.scale}setResolutionScale(n){this.resolution.scale=n}setSelection(n){return this.selection.set(n),this}clearSelection(){return this.selection.clear(),this}selectObject(n){return this.selection.add(n),this}deselectObject(n){return this.selection.delete(n),this}update(n,e,t){const r=this.scene,s=this.camera,o=this.selection,l=this.uniforms.get("pulse"),u=r.background,h=s.layers.mask;o.size>0?(r.background=null,l.value=1,this.pulseSpeed>0&&(l.value=Math.cos(this.time*this.pulseSpeed*10)*.375+.625),this.active=!0,this.time+=t,o.setVisible(!1),this.depthPass.render(n),o.setVisible(!0),s.layers.set(o.layer),this.maskPass.render(n,this.renderTargetMask),s.layers.mask=h,r.background=u,this.outlinePass.render(n,null,this.renderTargetOutline),this.blurPass.enabled&&this.blurPass.render(n,this.renderTargetOutline,this.renderTargetOutline)):this.active&&(this.clearPass.render(n,this.renderTargetOutline),this.active=!1)}setSize(n,e){this.blurPass.setSize(n,e),this.renderTargetMask.setSize(n,e);const t=this.resolution;t.setBaseSize(n,e);const r=t.width,s=t.height;this.depthPass.setSize(r,s),this.renderTargetOutline.setSize(r,s),this.outlinePass.fullscreenMaterial.setSize(r,s)}initialize(n,e,t){const r=this.patternTexture,s=c9(r,n.capabilities.isWebGL2);this.defines.set("texelToLinear(texel)",s),this.blurPass.initialize(n,e,af),t!==void 0&&(this.depthPass.initialize(n,e,t),this.maskPass.initialize(n,e,t),this.outlinePass.initialize(n,e,t))}};new Me;new Me;let wx;function A2e(){if(wx!==void 0)return wx;try{var n;let e;const t=document.createElement("canvas");return wx=!!(window.WebGL2RenderingContext&&(e=t.getContext("webgl2"))),e&&((n=e.getExtension("WEBGL_lose_context"))===null||n===void 0||n.loseContext()),wx}catch{return wx=!1}}const I2e=n=>!!n.current,p9=n=>I2e(n)?n.current:n,_ee=me.createContext(null),R2e=yt.memo(me.forwardRef((n,e)=>{let{children:t,camera:r,scene:s,resolutionScale:o,enabled:l=!0,renderPriority:u=1,autoClear:h=!0,depthBuffer:f,disableNormalPass:g,stencilBuffer:y,multisampling:b=8,frameBufferType:w=Z1}=n;const{gl:C,scene:M,camera:A,size:k}=nf();s=s||M,r=r||A;const[L,P,D]=me.useMemo(()=>{const V=A2e(),H=new Hke(C,{depthBuffer:f,stencilBuffer:y,multisampling:b>0&&V?b:0,frameBufferType:w});H.addPass(new w2(s,r));let oe=null,le=null;return g||(le=new Bke(s,r),le.enabled=!1,H.addPass(le),o!==void 0&&V&&(oe=new Oke({normalBuffer:le.texture,resolutionScale:o}),oe.enabled=!1,H.addPass(oe))),[H,le,oe]},[r,C,f,y,b,w,s,g,o]);me.useEffect(()=>L==null?void 0:L.setSize(k.width,k.height),[L,k]),Xm((V,H)=>{l&&(C.autoClear=h,L.render(H))},l?u:0);const z=me.useRef(null);me.useLayoutEffect(()=>{let V;return z.current&&z.current.__r3f&&L&&(V=new Nke(r,...z.current.__r3f.objects),V.renderToScreen=!0,L.addPass(V),P&&(P.enabled=!0),D&&(D.enabled=!0)),()=>{V&&(L==null||L.removePass(V)),P&&(P.enabled=!1),D&&(D.enabled=!1)}},[L,t,r,P,D]);const U=me.useMemo(()=>({composer:L,normalPass:P,downSamplingPass:D,resolutionScale:o,camera:r,scene:s}),[L,P,D,o,r,s]);return me.useImperativeHandle(e,()=>L,[L]),un(_ee.Provider,{value:U,children:un("group",{ref:z,children:t})})})),G4=me.createContext(null);function k2e(n){let{children:e,enabled:t=!0}=n;const[r,s]=me.useState([]),o=me.useMemo(()=>({selected:r,select:s,enabled:t}),[r,s,t]);return yt.createElement(G4.Provider,{value:o},e)}function vee(n){let{enabled:e=!1,children:t,...r}=n;const s=me.useRef(null),o=me.useContext(G4);return me.useEffect(()=>{if(o&&e){let l=!1;const u=[];if(s.current.traverse(h=>{h.type==="Mesh"&&u.push(h),o.selected.indexOf(h)===-1&&(l=!0)}),l)return o.select(h=>[...h,...u]),()=>{o.select(h=>h.filter(f=>!u.includes(f)))}}},[e,t]),un("group",{ref:s,...r,children:t})}const O2e=me.forwardRef(function(n,e){let{selection:t=[],selectionLayer:r=10,blendFunction:s,patternTexture:o,edgeStrength:l,pulseSpeed:u,visibleEdgeColor:h,hiddenEdgeColor:f,width:g,height:y,kernelSize:b,blur:w,xRay:C,...M}=n;const A=nf(z=>z.invalidate),{scene:k,camera:L}=me.useContext(_ee),P=me.useMemo(()=>new M2e(k,L,{blendFunction:s,patternTexture:o,edgeStrength:l,pulseSpeed:u,visibleEdgeColor:h,hiddenEdgeColor:f,width:g,height:y,kernelSize:b,blur:w,xRay:C,...M}),[s,w,L,l,y,f,b,o,u,k,h,g,C]),D=me.useContext(G4);return me.useEffect(()=>{if(!D&&t)return P.selection.set(Array.isArray(t)?t.map(p9):[p9(t)]),A(),()=>{P.selection.clear(),A()}},[P,t,D]),me.useEffect(()=>{P.selectionLayer=r,A()},[P,r]),me.useRef(),me.useEffect(()=>{if(D&&D.enabled){var z;if((z=D.selected)!=null&&z.length)return P.selection.set(D.selected),A(),()=>{P.selection.clear(),A()}}},[D]),un("primitive",{ref:e,object:P})}),L2e=["cube","cylinder","sphere","capsule","arrow"],yee=me.createContext(),N2e=n=>{const e=me.useContext(yee)[n.shape];return L2e.includes(n.shape)?oke(n):e&&typeof e=="function"?e():(console.warn(`Shape not loaded: ${n.shape} (reading property 'shape' of item)`,n),[])},D2e=({meshes:n,children:e})=>un(yee.Provider,{value:n,children:e}),P2e=me.memo(me.forwardRef(({objectKey:n,highlightColor:e,position:t,rotation:r,scale:s,ghost:o},l)=>{const u=me.useRef(null),h=_E(l,u),f=No(M=>M.onClick,Nf),g=No(M=>M.onPointerOver,Nf),y=No(M=>M.onPointerOut,Nf),b=No(M=>M.clock),w=No(me.useCallback(M=>M.items[n],[n]),Nf),C=N2e(w);return Xm(me.useCallback(()=>{const M=b.getElapsed()*1e3;h.current&&(h.current.position.set(t?t.x:typeof w.position.x=="function"?w.position.x(M):w.position.x,t?t.y:typeof w.position.y=="function"?w.position.y(M):w.position.y,t?t.z:typeof w.position.z=="function"?w.position.z(M):w.position.z),h.current.quaternion.set(r?r.x:typeof w.rotation.x=="function"?w.rotation.x(M):w.rotation.x,r?r.y:typeof w.rotation.y=="function"?w.rotation.y(M):w.rotation.y,r?r.z:typeof w.rotation.z=="function"?w.rotation.z(M):w.rotation.z,r?r.w:typeof w.rotation.w=="function"?w.rotation.w(M):w.rotation.w),h.current.scale.set(s?s.x:typeof w.scale.x=="function"?w.scale.x(M):w.scale.x,s?s.y:typeof w.scale.y=="function"?w.scale.y(M):w.scale.y,s?s.z:typeof w.scale.z=="function"?w.scale.z(M):w.scale.z),h.current.visible=typeof w.hidden=="function"?!w.hidden(M):!w.hidden)},[w,t,r,s,h,b])),un(vee,{enabled:w.highlighted,children:Bh("group",{ref:h,up:[0,0,1],children:[un("group",{up:[0,0,1],rotation:[Math.PI/2,0,0],onPointerDown:M=>{f(n,!h.current.visible,{local:{position:h.current.position,rotation:h.current.quaternion},world:{position:h.current.getWorldPosition(new Me),rotation:h.current.getWorldQuaternion(new Sl)}},M)},onPointerOver:M=>{g(n,!h.current.visible,M)},onPointerOut:M=>{y(n,!h.current.visible,M)},children:C.map((M,A)=>un(bee,{idx:A,groupOrPart:M,objectKey:n,ghost:o,highlightColor:e},A))}),w.showName&&un(VZ,{distanceFactor:3,position:[0,0,.2],children:un("div",{style:{opacity:.75,borderRadius:2,backgroundColor:"lightgrey",padding:5,userSelect:"none"},children:w.name})})]})})})),B2e=me.memo(({part:n,objectKey:e,ghost:t,highlightColor:r})=>{const s=No(me.useCallback(g=>g.items[e].wireframe,[e])),o=No(me.useCallback(g=>g.items[e].color,[e])),l=o!==void 0,u=me.useRef(),h=me.useRef(),f=No(g=>g.clock);return Xm(me.useCallback(()=>{const g=f.getElapsed()*1e3;t||(rC(h,o,g),rC(u,o,g))},[t,u,h,f,o])),t?un("mesh",{ref:h,geometry:n.geometry,material:CI(r),scale:n.scale,castShadow:!1,receiveShadow:!1},"B"):l?Bh("group",{up:[0,0,1],children:[un("mesh",{ref:h,geometry:n.geometry,scale:n.scale,castShadow:!1,receiveShadow:!1,children:un("meshLambertMaterial",{transparent:!0,wireframe:s,attach:"material",opacity:1,side:cd})},"B"),un("mesh",{ref:u,geometry:n.geometry,scale:n.scale,castShadow:!1,receiveShadow:!1,children:un("meshLambertMaterial",{transparent:!0,attach:"material",wireframe:s,opacity:1,side:p_})},"F")]}):un(PC,{children:un("mesh",{ref:u,geometry:n.geometry,material:n.material,scale:n.scale,castShadow:!0,receiveShadow:!0,wireframe:s},"I")})}),bee=me.memo(({idx:n,groupOrPart:e,ghost:t,objectKey:r,highlightColor:s})=>e.type==="group"?un("group",{up:[0,0,1],position:e.position,rotation:e.rotation,scale:e.scale,children:e.children.map((o,l)=>un(bee,{idx:l,groupOrPart:o,objectKey:r,ghost:t,highlightColor:s},l))},n):un(B2e,{part:e,objectKey:r,highlightColor:s,ghost:t},n)),F2e=me.forwardRef(({objectKey:n},e)=>{const t=me.useRef(null),r=_E(e,t),{vertices:s,width:o,hidden:l}=No(me.useCallback(u=>({vertices:u.lines[n].vertices,width:u.lines[n].width,hidden:u.lines[n].hidden}),[n]),Nf);return s.length<=1?null:un(kAe,{ref:r,visible:!l,points:s.map(u=>[u.position.x,u.position.y,u.position.z]),color:"white",vertexColors:s.map(u=>[u.color.r/255,u.color.g/255,u.color.b/255]),lineWidth:o})}),z2e=me.forwardRef(({objectKey:n},e)=>{const t=me.useRef(null),r=_E(e,t),s=No(C=>C.onClick,Nf),o=No(C=>C.onPointerOver,Nf),l=No(C=>C.onPointerOut,Nf),u=No(me.useCallback(C=>C.hulls[n],[n]),Nf),h=No(me.useCallback(C=>C.hulls[n].vertices,[n]),Nf),f=No(C=>C.clock),g=me.useRef(),y=me.useRef(),b=typeof h=="function"?h(0):h,w=new gW(b.map(C=>new Me(C.x,C.y,C.z)));return Xm(me.useCallback(()=>{const C=f.getElapsed()*1e3;rC(y,u.color,C),rC(g,u.color,C);const M=typeof h=="function"?h(C):h;if(M!==b){const k=new gW(M.map(L=>new Me(L.x,L.y,L.z)));g.current.geometry=k,y.current.geometry=k}const A=typeof u.hidden=="function"?!u.hidden(C):!u.hidden;g.current.visible=A,y.current.visible=A},[g,y,b,u,f,h])),un(vee,{enabled:u.highlighted,children:Bh("group",{ref:r,up:[0,0,1],children:[Bh("group",{up:[0,0,1],onPointerDown:C=>{s(n,g.current.visible,C)},onPointerOver:C=>{o(n,g.current.visible,C)},onPointerOut:C=>{l(n,g.current.visible,C)},children:[un("mesh",{ref:y,geometry:w,castShadow:!1,receiveShadow:!1,children:un("meshLambertMaterial",{transparent:!0,wireframe:u.wireframe,attach:"material",side:cd})},`${n}B`),un("mesh",{ref:g,geometry:w,castShadow:!1,receiveShadow:!1,children:un("meshLambertMaterial",{transparent:!0,attach:"material",wireframe:u.wireframe,side:p_})},`${n}F`)]}),u.showName&&un(VZ,{distanceFactor:2,position:[0,0,.5],children:un("div",{style:{opacity:.75,borderRadius:2,backgroundColor:"lightgrey"},className:"disable-text-selection",children:u.name})})]})})}),U2e=me.forwardRef(({objectKey:n},e)=>{const t=me.useRef(null),r=_E(e,t),s=me.useRef(),o=No(u=>u.clock),l=No(me.useCallback(u=>u.texts[n],[n]));return Xm(me.useCallback(()=>{const u=o.getElapsed()*1e3;r.current&&(r.current.position.set(typeof l.position.x=="function"?l.position.x(u):l.position.x,typeof l.position.y=="function"?l.position.y(u):l.position.y,typeof l.position.z=="function"?l.position.z(u):l.position.z),r.current.visible=typeof l.hidden=="function"?!l.hidden(u):!l.hidden),s.current&&rC(s,l.color,u)},[l,r,o])),un("group",{ref:r,children:un(RAe,{follow:!0,children:un($Ie,{ref:s,depthOffset:2,scale:[.2,.2,.2],children:l.value})})})}),H2e=me.forwardRef(({objectKey:n},e)=>{const t=me.useRef(null),r=_E(e,t),s=No(g=>g.clock),{points:o,scale:l,hidden:u}=No(me.useCallback(g=>({points:g.points[n].points,scale:g.points[n].scale,hidden:g.points[n].hidden}),[n]),Nf),[{positions:h,colors:f}]=me.useState(()=>({positions:new Float32Array(o.length*3),colors:new Float32Array(o.length*3)}));return Xm(()=>{const g=s.getElapsed()*1e3;if(r.current)for(let y=0;y{const A=n==="world"?lke:n==="gizmo"?uke:ake,k=n===y?M:{},L=w?t.filter(D=>C.includes(D.key)):t,P=w&&n!==g;return Bh(A,{objectKey:n,displayTfs:e,ref:y===n?g:null,...k,ghost:f,highlightColor:h,children:[L.filter(D=>D.frame===n||n==="world"&&!D.frame).map(D=>un(W4,{activeTf:D.key,displayTfs:e,allTfs:t,allItems:r,allLines:s,allHulls:o,allTexts:l,allPoints:u,highlightColor:h,ghosts:f,targetRef:g,targetSource:b,targetId:y,filterActive:P,tfFilter:C,customProps:M},D.key)),r.filter(D=>D.frame===n||n==="world"&&!D.frame).map(D=>{const z=D.key===y&&b==="items"?M:{};return!w||D.key===y||n===y?un(P2e,{objectKey:D.key,highlightColor:h,ghost:f,ref:D.key===y?g:null,...z},D.key):null}),s.filter(D=>D.frame===n||n==="world"&&!D.frame).map(D=>{const z=D.key===y&&b==="lines"?M:{};return!w||D.key===y||n===y?un(F2e,{objectKey:D.key,ref:D.lineKey===y?g:null,...z},D.key):null}),o.filter(D=>D.frame===n||n==="world"&&!D.frame).map(D=>{const z=D.key===y&&b==="hulls"?M:{};return!w||D.key===y||n===y?un(z2e,{objectKey:D.key,highlightColor:h,ghost:f,ref:D.key===y?g:null,...z},D.key):null}),l.filter(D=>D.frame===n||n==="world"&&!D.frame).map(D=>{const z=D.key===y&&b==="texts"?M:{};return!w||D.key===y||n===y?un(U2e,{objectKey:D.key,highlightColor:h,ref:D.key===y?g:null,...z},D.key):null}),u.filter(D=>D.frame===n||n==="world"&&!D.frame).map(D=>{const z=D.key===y&&b==="points"?M:{};return!w||D.key===y||n===y?un(H2e,{objectKey:D.key,highlightColor:h,ref:D.key===y?g:null,...z},D.key):null})]})}),G2e=["enabled","axis","translationSnap","rotationSnap","scaleSnap","space","size"],W2e=["displayTfs","allTfs","allItems","allLines","allHulls","allTexts","allPoints","highlightColor"],V2e=me.memo(({camera:n,objectInfo:e,highlightColor:t,translateSnap:r,rotateSnap:s,scaleSnap:o,onDragStart:l,onDragEnd:u,mode:h,...f})=>{const g=cN(f,G2e),y=cN(f,W2e),b=No(me.useCallback(q=>{let he=[];e.source==="tfs"&&he.push(e.key);let ae=q[e.source][e.key].frame;for(;ae&&ae!=="world"&&ae!=="gizmo";){let ue=q.tfs[ae];he.push(ae),ae=ue.frame}return he},[e]),Nf),w=me.useRef(),C=me.useRef(),M=No(q=>cN(q[e.source][e.key],["position","rotation","scale"]),Nf),A=nf(({gl:q})=>q),k=nf(({camera:q})=>q),L=nf(({invalidate:q})=>q),P=n||k,[D]=me.useState(()=>new GRe(P,A.domElement));D.translationSnap=r,D.rotationSnap=s,D.scaleSnap=o,h!=null&&h.includes("translate")?D.mode="translate":h!=null&&h.includes("rotate")?D.mode="rotate":h!=null&&h.includes("scale")&&(D.mode="scale"),h!=null&&h.includes("-x")?(D.showY=!1,D.showZ=!1):h!=null&&h.includes("-y")?(D.showX=!1,D.showZ=!1):h!=null&&h.includes("-z")&&(D.showX=!1,D.showY=!1);const[z,U]=me.useState(!1),[V,H]=me.useState(M),[oe,le]=me.useState(!1);me.useEffect(()=>{console.log("refreshing transform"),H(M)},[M,oe]);const Z=No(q=>q.onMove,Nf);return me.useEffect(()=>{const q=he=>{var ae,ue,ge;const we=(ae=C==null?void 0:C.current)==null?void 0:ae.position,J=(ue=C==null?void 0:C.current)==null?void 0:ue.quaternion,re=(ge=C==null?void 0:C.current)==null?void 0:ge.scale;he.value&&!z?(console.log("starting transform"),U(!0),H({position:we,rotation:J,scale:re}),l&&l()):!he.value&&z&&(console.log("stopping transform"),U(!1),u&&u(),Z(e.key,e.source,{position:D.worldPosition,quaternion:D.worldQuaternion,scale:D._worldScale},{position:we?{x:we.x,y:we.y,z:we.z}:null,quaternion:J?{x:J.x,y:J.y,z:J.z,w:J.w}:null,scale:re?{x:re.x,y:re.y,z:re.z}:null}),le(!oe))};return D&&D.addEventListener("dragging-changed",q),()=>{D.removeEventListener("dragging-changed",q)}},[M,z,e]),me.useEffect(()=>void(D==null?void 0:D.attach(C.current)),[C,D]),me.useEffect(()=>(D&&D.addEventListener("change",L),()=>{var q;return(q=D==null?void 0:D.removeEventListener)==null?void 0:q.call(D,"change",L)}),[D,L]),D?Bh(PC,{children:[un("primitive",{ref:w,object:D,...g}),un(W4,{...y,activeTf:"world",tfFilter:b,ghosts:!0,targetRef:C,targetSource:e.source,targetId:e.key,filterActive:!0,customProps:{...V}})]}):null}),r1=(n,e)=>n.length!==e.length?!1:!n.some((t,r)=>!pg.exports.isEqual(e[r],t));function j2e({displayTfs:n=!1,displayGrid:e=!0,isPolar:t=!1,backgroundColor:r="#d0d0d0",planeColor:s="#a8a8a8",highlightColor:o="#00ffff",plane:l=0,translateSnap:u=0,rotateSnap:h=0,scaleSnap:f=0,debug:g=!1}){g&&console.log("content rerender");const y=nf(Z=>Z.camera),b=No(Z=>Z.clock,Nf);Xm(()=>{b.update()});const w=No(Z=>pg.exports.sortBy(Object.entries(Z.tfs).map(([q,he])=>({key:q,frame:he.frame,transformMode:he.transformMode,source:"tfs"})),q=>q.key),r1),C=No(Z=>pg.exports.sortBy(Object.entries(Z.items).map(([q,he])=>({key:q,frame:he.frame,transformMode:he.transformMode,source:"items"})),q=>q.key),r1),M=No(Z=>pg.exports.sortBy(Object.entries(Z.lines).map(([q,he])=>({key:q,frame:he.frame,source:"lines"})),q=>q.key),r1),A=No(Z=>pg.exports.sortBy(Object.entries(Z.hulls).map(([q,he])=>({key:q,frame:he.frame,source:"hulls"})),q=>q.key),r1),k=No(Z=>pg.exports.sortBy(Object.entries(Z.texts).map(([q,he])=>({key:q,frame:he.frame,source:"texts"})),q=>q.key),r1),L=No(Z=>pg.exports.sortBy(Object.entries(Z.points).map(([q,he])=>({key:q,frame:he.frame,source:"points"})),q=>q.key),r1),P=No(Z=>pg.exports.sortBy(Object.entries(Z.widgets).map(([q,he])=>({key:q,frame:he.frame,source:"widgets"})),q=>q.key),r1),D=[...C,...w].filter(Z=>["translate","rotate","scale","translate-x","translate-y","translate-z","rotate-x","rotate-y","rotate-z","scale-x","scale-y","scale-z"].includes(Z.transformMode)),z=me.useRef(),U=me.useRef(),V=me.useRef(),H=me.useRef(),oe=HRe(s),le=[oe.r,oe.g,oe.b,.5];return Bh(yt.Fragment,{children:[un(tRe,{ref:H,makeDefault:!0,camera:y}),un("pointLight",{ref:U,intensity:.5,position:[-1,-3,3],color:"#FFFAEE"}),un(zRe,{ref:z,intensity:.7,color:"white"}),un(URe,{ref:V,castShadow:!0,position:[5,15,15],intensity:.6,color:"#FFFAEE"}),un("spotLight",{penumbra:1,position:[-1,-1,4],intensity:.3,castShadow:!0,color:"#FFFAEE"}),un("color",{attach:"background",args:[r]}),un("fogExp2",{attach:"fog",args:[r,.01]}),un(sRe,{receiveShadow:!0,scale:1e3,position:[0,0,l-.01],material:d_(...le)}),Bh(k2e,{children:[un(R2e,{autoClear:!1,children:un(O2e,{visibleEdgeColor:o,hiddenEdgeColor:o,blur:!0,kernelSize:1,edgeStrength:50,pulseSpeed:.25,xRay:!0})}),un(W4,{activeTf:"world",displayTfs:n,allTfs:w,allItems:C,allLines:M,allHulls:A,allTexts:k,allPoints:L,allWidgets:P,highlightColor:o})]}),un("group",{position:[0,0,l],rotation:[Math.PI/2,0,0],up:[0,0,1],children:e&&(t?un("polarGridHelper",{args:[10,16,8,64,"white","gray"]}):un("gridHelper",{args:[20,20,"white","gray"]}))}),D.map(Z=>un(V2e,{objectInfo:Z,mode:Z.transformMode,displayTfs:n,allTfs:w,allItems:C,allLines:M,allHulls:A,allTexts:k,allPoints:L,allWidgets:P,translateSnap:u,rotateSnap:h,scaleSnap:f,highlightColor:o,onDragEnd:()=>{H.current&&(H.current.enabled=!0)},onDragStart:()=>{H.current&&(H.current.enabled=!1)}},`movableObjectTransform-${Z.key}`))]})}ro.DefaultUp.set(0,0,1);function Y2e({backgroundColor:n="#d0d0d0",store:e,fov:t=60,onPointerMissed:r=()=>{},meshLookup:s={},debug:o=!1,...l}){return o&&console.log("Scene rerender"),un(cAe,{camera:{up:[0,0,1],fov:t,position:[0,-3,3]},shadows:!0,style:{background:n||"#d0d0d0"},onPointerMissed:r||(()=>{}),children:un(FRe,{store:e,debug:o,children:un(D2e,{meshes:s,children:un(me.Suspense,{children:un(j2e,{...l,backgroundColor:n,debug:o})})})})})}var V4={},X2e=lT;Object.defineProperty(V4,"__esModule",{value:!0});var Tee=V4.default=void 0,K2e=X2e(MC()),J2e=Ne;Tee=V4.default=(0,K2e.default)((0,J2e.jsx)("path",{d:"M12 5V2L8 6l4 4V7c3.31 0 6 2.69 6 6 0 2.97-2.17 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93 0-4.42-3.58-8-8-8m-6 8c0-1.65.67-3.15 1.76-4.24L6.34 7.34C4.9 8.79 4 10.79 4 13c0 4.08 3.05 7.44 7 7.93v-2.02c-2.83-.48-5-2.94-5-5.91"}),"RestartAlt");var j4={},q2e=lT;Object.defineProperty(j4,"__esModule",{value:!0});var See=j4.default=void 0,Q2e=q2e(MC()),Z2e=Ne;See=j4.default=(0,Q2e.default)((0,Z2e.jsx)("path",{d:"M8 5v14l11-7z"}),"PlayArrow");var Y4={},eOe=lT;Object.defineProperty(Y4,"__esModule",{value:!0});var wee=Y4.default=void 0,tOe=eOe(MC()),nOe=Ne;wee=Y4.default=(0,tOe.default)((0,nOe.jsx)("path",{d:"M6 6h12v12H6z"}),"Stop");const rOe="/gpu-programming/assets/compile-worker-DEfUxNNI.js",iOe={Left:"LEFT_ARM_CONNECTOR_1",Right:"RIGHT_ARM_CONNECTOR_1",Head:"HEAD_1",Neck:"NECK_GLOBE_BASE_1",Base:"base_link"},Wi=n=>iOe[n],sOe={s_Acceptance:"s_Acceptance.wav",s_Amazement:"s_Amazement.wav",s_Amazement2:"s_Amazement2.wav",s_Anger:"s_Anger.wav",s_Anger2:"s_Anger2.wav",s_Anger3:"s_Anger3.wav",s_Anger4:"s_Anger4.wav",s_Annoyance:"s_Annoyance.wav",s_Annoyance2:"s_Annoyance2.wav",s_Annoyance3:"s_Annoyance3.wav",s_Annoyance4:"s_Annoyance4.wav",s_Awe:"s_Awe.wav",s_Awe2:"s_Awe2.wav",s_Awe3:"s_Awe3.wav",s_Boredom:"s_Boredom.wav",s_Disapproval:"s_Disapproval.wav",s_Disgust:"s_Disgust.wav",s_Disgust2:"s_Disgust2.wav",s_Disgust3:"s_Disgust3.wav",s_DisorientedConfused:"s_DisorientedConfused.wav",s_DisorientedConfused2:"s_DisorientedConfused2.wav",s_DisorientedConfused3:"s_DisorientedConfused3.wav",s_DisorientedConfused4:"s_DisorientedConfused4.wav",s_DisorientedConfused5:"s_DisorientedConfused5.wav",s_DisorientedConfused6:"s_DisorientedConfused6.wav",s_Distraction:"s_Distraction.wav",s_Ecstacy:"s_Ecstacy.wav",s_Ecstacy2:"s_Ecstacy2.wav",s_Fear:"s_Fear.wav",s_Grief:"s_Grief.wav",s_Grief2:"s_Grief2.wav",s_Grief3:"s_Grief3.wav",s_Grief4:"s_Grief4.wav",s_Joy:"s_Joy.wav",s_Joy2:"s_Joy2.wav",s_Joy3:"s_Joy3.wav",s_Joy4:"s_Joy4.wav",s_Loathing:"s_Loathing.wav",s_Love:"s_Love.wav",s_PhraseByeBye:"s_PhraseByeBye.wav",s_PhraseEvilAhHa:"s_PhraseEvilAhHa.wav",s_PhraseHello:"s_PhraseHello.wav",s_PhraseNoNoNo:"s_PhraseNoNoNo.wav",s_PhraseOopsy:"s_PhraseOopsy.wav",s_PhraseOwOwOw:"s_PhraseOwOwOw.wav",s_PhraseOwwww:"s_PhraseOwwww.wav",s_PhraseUhOh:"s_PhraseUhOh.wav",s_Rage:"s_Rage.wav",s_Sadness:"s_Sadness.wav",s_Sadness2:"s_Sadness2.wav",s_Sadness3:"s_Sadness3.wav",s_Sadness4:"s_Sadness4.wav",s_Sadness5:"s_Sadness5.wav",s_Sadness6:"s_Sadness6.wav",s_Sadness7:"s_Sadness7.wav",s_Sleepy:"s_Sleepy.wav",s_Sleepy2:"s_Sleepy2.wav",s_Sleepy3:"s_Sleepy3.wav",s_Sleepy4:"s_Sleepy4.wav",s_SleepySnore:"s_SleepySnore.wav",s_SystemCameraShutter:"s_SystemCameraShutter.wav"},m9=n=>sOe[n],rv={e_Sleeping:"e_Sleeping.jpg",e_SleepingZZZ:"e_SleepingZZZ.jpg",e_Contempt:"e_Contempt.jpg",e_ContentLeft:"e_ContentLeft.jpg",e_ContentRight:"e_ContentRight.jpg",e_Disoriented:"e_Disoriented.jpg",e_EcstacyHilarious:"e_EcstacyHilarious.jpg",e_EcstacyStarryEyed:"e_EcstacyStarryEyed.jpg",e_JoyGoofy:"e_JoyGoofy.jpg",e_JoyGoofy2:"e_JoyGoofy2.jpg",e_JoyGoofy3:"e_JoyGoofy3.jpg",e_Love:"e_Love.jpg",e_Rage:"e_Rage.jpg",e_Rage2:"e_Rage2.jpg",e_Rage3:"e_Rage3.jpg",e_Rage4:"e_Rage4.jpg",e_RemorseShame:"e_RemorseShame.jpg",eyes_acceptance:"eyes_acceptance.jpg",eyes_admiration:"eyes_admiration.jpg",eyes_amazement:"eyes_amazement.jpg",eyes_anger:"eyes_anger.jpg",eyes_annoyed:"eyes_annoyed.jpg",eyes_anticipation:"eyes_anticipation.png",eyes_apprehension:"eyes_apprehension.jpg",eyes_apprehension_1:"eyes_apprehension_1.jpg",eyes_boredom:"eyes_boredom.jpg",eyes_default:"eyes_default.jpg",eyes_disgust:"eyes_disgust.jpg",eyes_distraction:"eyes_distraction.gif",eyes_ecstasy_frame_1:"eyes_ecstasy_frame_1.jpg",eyes_ecstasy_frame_2:"eyes_ecstasy_frame_2.jpg",eyes_fear:"eyes_fear.jpg",eyes_grief:"eyes_grief.jpg",eyes_interest:"eyes_interest.jpg",eyes_joy:"eyes_joy.jpg",eyes_loathing:"eyes_loathing.jpg",eyes_pensiveness:"eyes_pensiveness.jpg",eyes_rage:"eyes_rage.jpg",eyes_sad:"eyes_sad.jpg",eyes_serenity:"eyes_serenity.jpg",eyes_surprise:"eyes_surprise.png",eyes_terror:"eyes_terror.jpg",eyes_trust:"eyes_trust.jpg",eyes_vigilance:"eyes_vigilance.jpg"},oOe=n=>rv[n],aOe=({blocks:n,tfs:e,items:t})=>{var le;var r=e[Wi("Left")],s=e[Wi("Right")],o=e[Wi("Head")],l=e[Wi("Base")];let u={Left:{x:[r.rotation.x],y:[r.rotation.y],z:[r.rotation.z],w:[r.rotation.w]},Right:{x:[s.rotation.x],y:[s.rotation.y],z:[s.rotation.z],w:[s.rotation.w]},Head:{x:[o.rotation.x],y:[o.rotation.y],z:[o.rotation.z],w:[o.rotation.w]},Base:{position:{x:[l.position.x],y:[l.position.y],z:[l.position.z],angle:[0],distance:[0]},rotation:{x:[l.rotation.x],y:[l.rotation.y],z:[l.rotation.z],w:[l.rotation.w]}},Time:[0]},h=Object.keys(rv);for(let Z=0;Z{if(Z==="both")g(q,he,q,he);else if(he>0){var ae=Z,ue=Z==="Left"?"Right":"Left",ge={rotation:{x:u[ae].x[u[ae].x.length-1],y:u[ae].y[u[ae].y.length-1],z:u[ae].z[u[ae].z.length-1],w:u[ae].w[u[ae].w.length-1]}},we=oI(ge.rotation),J=2*ad*sI*Math.abs(we.y-q),re=J/(he/100*UO),se={x:0,y:q-HO,z:0},fe=1;if(se.y<0&&we.y>0||se.y>0&&we.y<0){let Ie=(se.y-we.y)/2,qe=se.y-Ie;var Te=ty(0,qe*ad/180,0);u[ae].w.push(Te._w),u[ae].x.push(Te._x),u[ae].y.push(Te._y),u[ae].z.push(Te._z),u.Time.push(re/2),fe+=1}var Fe=ty(se.x,se.y*ad/180,se.z);u[ae].w.push(Fe._w),u[ae].x.push(Fe._x),u[ae].y.push(Fe._y),u[ae].z.push(Fe._z);for(let Ie=0;Ie1?u.Time.push(re/2):u.Time.push(re)}},g=(Z,q,he,ae)=>{if(q>0||ae>0){var ue={rotation:{x:u.Left.x[u.Left.x.length-1],y:u.Left.y[u.Left.y.length-1],z:u.Left.z[u.Left.z.length-1],w:u.Left.w[u.Left.w.length-1]}},ge={rotation:{x:u.Right.x[u.Right.x.length-1],y:u.Right.y[u.Right.y.length-1],z:u.Right.z[u.Right.z.length-1],w:u.Right.w[u.Right.w.length-1]}},we=oI(ue.rotation),J=2*ad*sI*Math.abs(we.y-Z),re=J/(q/100*UO),se=oI(ge.rotation),fe=2*ad*sI*Math.abs(se.y-he),Te=fe/(ae/100*UO),Fe=q===0?Te:ae===0?re:Math.max(re,Te),Ie={x:0,y:Z-HO,z:0},qe=ty(Ie.x,Ie.y*ad/180,Ie.z),Re={x:0,y:he-HO,z:0},Ze=ty(Re.x,Re.y*ad/180,Re.z);let ut=1;if(Ie.y<0&&we.y>0||Ie.y>0&&we.y<0||Re.y<0&&se.y>0||Re.y>0&&se.y<0){let ze=(Ie.y-we.y)/2,$e=(Ie.y-we.y)/2,He=Ie.y-ze,it=Re.y-$e;var rt=ty(0,He*ad/180,0),ft=ty(0,it*ad/180,0);q>0?(u.Left.w.push(rt._w),u.Left.x.push(rt._x),u.Left.y.push(rt._y),u.Left.z.push(rt._z)):(u.Left.w.push(u.Left.w[u.Left.w.length-1]),u.Left.x.push(u.Left.x[u.Left.x.length-1]),u.Left.y.push(u.Left.y[u.Left.y.length-1]),u.Left.z.push(u.Left.z[u.Left.z.length-1])),ae>0?(u.Right.w.push(ft._w),u.Right.x.push(ft._x),u.Right.y.push(ft._y),u.Right.z.push(ft._z)):(u.Right.w.push(u.Right.w[u.Right.w.length-1]),u.Right.x.push(u.Right.x[u.Right.x.length-1]),u.Right.y.push(u.Right.y[u.Right.y.length-1]),u.Right.z.push(u.Right.z[u.Right.z.length-1])),u.Time.push(Fe/2),ut+=1}q>0?(u.Left.w.push(qe._w),u.Left.x.push(qe._x),u.Left.y.push(qe._y),u.Left.z.push(qe._z)):(u.Left.w.push(u.Left.w[u.Left.w.length-1]),u.Left.x.push(u.Left.x[u.Left.x.length-1]),u.Left.y.push(u.Left.y[u.Left.y.length-1]),u.Left.z.push(u.Left.z[u.Left.z.length-1])),ae>0?(u.Right.w.push(Ze._w),u.Right.x.push(Ze._x),u.Right.y.push(Ze._y),u.Right.z.push(Ze._z)):(u.Right.w.push(u.Right.w[u.Right.w.length-1]),u.Right.x.push(u.Right.x[u.Right.x.length-1]),u.Right.y.push(u.Right.y[u.Right.y.length-1]),u.Right.z.push(u.Right.z[u.Right.z.length-1]));for(let ze=0;ze1?u.Time.push(Fe/2):u.Time.push(Fe)}},y=(Z,q,he,ae)=>{if(ae>0){var ue=ty(q*ad/180,Z*ad/180,he*ad/180);u.Head.w.push(ue._w),u.Head.x.push(ue._x),u.Head.y.push(ue._y),u.Head.z.push(ue._z),u.Left.w.push(u.Left.w[u.Left.w.length-1]),u.Left.x.push(u.Left.x[u.Left.x.length-1]),u.Left.y.push(u.Left.y[u.Left.y.length-1]),u.Left.z.push(u.Left.z[u.Left.z.length-1]),u.Right.w.push(u.Right.w[u.Right.w.length-1]),u.Right.x.push(u.Right.x[u.Right.x.length-1]),u.Right.y.push(u.Right.y[u.Right.y.length-1]),u.Right.z.push(u.Right.z[u.Right.z.length-1]),u.Base.position.x.push(u.Base.position.x[u.Base.position.x.length-1]),u.Base.position.y.push(u.Base.position.y[u.Base.position.y.length-1]),u.Base.position.z.push(u.Base.position.z[u.Base.position.z.length-1]),u.Base.rotation.w.push(u.Base.rotation.w[u.Base.rotation.w.length-1]),u.Base.rotation.x.push(u.Base.rotation.x[u.Base.rotation.x.length-1]),u.Base.rotation.y.push(u.Base.rotation.y[u.Base.rotation.y.length-1]),u.Base.rotation.z.push(u.Base.rotation.z[u.Base.rotation.z.length-1]);let ge=Object.keys(rv);for(let we=0;we{if(he>0){var ae={position:{x:u.Base.position.x[u.Base.position.x.length-1],y:u.Base.position.y[u.Base.position.y.length-1],z:u.Base.position.z[u.Base.position.z.length-1]},rotation:{x:u.Base.rotation.x[u.Base.rotation.x.length-1],y:u.Base.rotation.y[u.Base.rotation.y.length-1],z:u.Base.rotation.z[u.Base.rotation.z.length-1],w:u.Base.rotation.w[u.Base.rotation.w.length-1]}},ue=q/100*hle*he/V0,ge=Z/100*cle*he/V0,we=new Pu(ae.rotation.x,ae.rotation.y,ae.rotation.z,ae.rotation.w),J=Z5(we);if(ue!==0){var re={x:0,y:0,z:ue};we=ty(re.x,re.y,re.z),we.multiply(new Pu(ae.rotation.x,ae.rotation.y,ae.rotation.z,ae.rotation.w))}let se=ae.position.x,fe=ae.position.y,Te=null;Te=new Pt(se+Math.sin(J-ue)*ge,fe-Math.cos(J-ue)*ge,ae.position.z),u.Base.position.x.push(Te.x),u.Base.position.y.push(Te.y),u.Base.position.z.push(Te.z),u.Base.position.angle.push(ue),u.Base.position.distance.push(ge),u.Base.rotation.w.push(we._w),u.Base.rotation.x.push(we._x),u.Base.rotation.y.push(we._y),u.Base.rotation.z.push(we._z),u.Head.x.push(u.Head.x[u.Head.x.length-1]),u.Head.y.push(u.Head.y[u.Head.y.length-1]),u.Head.z.push(u.Head.z[u.Head.z.length-1]),u.Head.w.push(u.Head.w[u.Head.w.length-1]),u.Left.w.push(u.Left.w[u.Left.w.length-1]),u.Left.x.push(u.Left.x[u.Left.x.length-1]),u.Left.y.push(u.Left.y[u.Left.y.length-1]),u.Left.z.push(u.Left.z[u.Left.z.length-1]),u.Right.w.push(u.Right.w[u.Right.w.length-1]),u.Right.x.push(u.Right.x[u.Right.x.length-1]),u.Right.y.push(u.Right.y[u.Right.y.length-1]),u.Right.z.push(u.Right.z[u.Right.z.length-1]);let Fe=Object.keys(rv);for(let Ie=0;Ie{let he=Object.keys(rv);for(let ue=0;ue{let q=u.Head.x.length-1;u.Base.position.x.push(u.Base.position.x[q]),u.Base.position.y.push(u.Base.position.y[q]),u.Base.position.z.push(u.Base.position.z[q]),u.Base.rotation.w.push(u.Base.rotation.w[q]),u.Base.rotation.x.push(u.Base.rotation.x[q]),u.Base.rotation.y.push(u.Base.rotation.y[q]),u.Base.rotation.z.push(u.Base.rotation.z[q]),u.Head.x.push(u.Head.x[q]),u.Head.y.push(u.Head.y[q]),u.Head.z.push(u.Head.z[q]),u.Head.w.push(u.Head.w[q]),u.Left.w.push(u.Left.w[q]),u.Left.x.push(u.Left.x[q]),u.Left.y.push(u.Left.y[q]),u.Left.z.push(u.Left.z[q]),u.Right.w.push(u.Right.w[q]),u.Right.x.push(u.Right.x[q]),u.Right.y.push(u.Right.y[q]),u.Right.z.push(u.Right.z[q]);let he=Object.keys(rv);for(let ae=0;ae{let Z=JSON.parse(JSON.stringify(e)),q=JSON.parse(JSON.stringify(e)),he=JSON.parse(JSON.stringify(t)),ae=JSON.parse(JSON.stringify(t)),ue=u.Time.length,ge=0,we=[],J=[],re=[],se=[],fe=[],Te=[],Fe=[],Ie=[],qe=[],Re=[],Ze=[],rt=[],ft=[],ut=[],ze=[],$e=[],He=[],it=[],st=[],Nt=[],kt=[],vt=Object.keys(rv);for(let Ye=0;YeObject.values(n).filter(q=>q.type===Z)[0],k=Z=>n[Z],L=(Z,q)=>{const he=k(Z);let ae=k(q);if(V(he,he.type))for(V(ae,ae.type);ae.next;)ae=k(ae.next),V(ae,ae.type)},P=Z=>Z==="TRUE";function D(Z,q){return Z=Math.ceil(Z),q=Math.floor(q),Math.floor(Math.random()*(q-Z+1))+Z}function z(Z){if(Z===2||Z===3)return!0;if(Z<=1||Z%2===0||Z%3===0)return!1;for(let q=5;q*q<=Z;q+=6)if(Z%q===0||Z%(q+2)===0)return!1;return!0}function U(Z){var q;if(typeof Z!="string"&&typeof Z!="object")return Z.shadow.fields.NUM;{let he=(q=Z==null?void 0:Z.shadow)!=null&&q.id?k(Z.shadow.id):k(Z);return V(he,he.type)}}const V=(Z,q)=>{var vt,Ct,At;switch(!0){case q==="controls_if":if(!Z.inputs||!Z.inputs.IF0||!Z.inputs.DO0)throw new Error("err: controls_if not complete!");L(Z.inputs.IF0,Z.inputs.DO0);break;case q==="logic_boolean":return P(Z.fields.BOOL);case q==="logic_compare":if(!Z.inputs||!Z.inputs.A||!Z.inputs.B)throw new Error("err: logic_compare is not complete!");const gt=Z.fields.OP,xe=Z.inputs.A,ie=Z.inputs.B,Pe=k(xe),Ye=k(ie);if(gt==="EQ")return V(Pe,Pe.type)==V(Ye,Ye.type);if(gt==="NEQ")return V(Pe,Pe.type)!==V(Ye,Ye.type);if(gt==="LT")return V(Pe,Pe.type)V(Ye,Ye.type);if(gt==="GTE")return V(Pe,Pe.type)>=V(Ye,Ye.type);case q==="logic_operation":if(!Z.inputs||!Z.inputs.A||!Z.inputs.B)throw new Error("err: logic_operation is not complete!");const St=Z.fields.OP,It=Z.inputs.A,mt=Z.inputs.B,Ke=k(It),Oe=k(mt);return St==="OR"?V(Ke,Ke.type)||V(Oe,Oe.type):V(Ke,Ke.type)&&V(Oe,Oe.type);case q==="logic_negate":if(!Z.inputs)throw new Error("err: logic_negate is not complete!");const Q=k(Z.inputs.BOOL);return!V(Q,Q.type);case q==="logic_boolean":return!Z.fields.BOOL!=="FALSE";case q==="logic_null":return null;case q==="logic_ternary":if(!Z.inputs||!Z.inputs.IF||!Z.inputs.THEN||!Z.inputs.ELSE)throw new Error("err: logic_ternary is not complete!");const te=Z.inputs.IF,pe=Z.inputs.THEN,Ae=Z.inputs.ELSE,Je=k(te),jt=k(pe),Ge=k(Ae);return V(Je,Je.type)?V(jt,jt.type):V(Ge,Ge.type);case q==="controls_repeat_ext":const pt=U(Z.inputs.TIMES);if(!Z.inputs.DO)throw new Error("err: controls_repeat_ext is not complete!");let Jt=k(Z.inputs.DO);for(let $r=0;$r0;if(Xt==="NEGATIVE")return xn<0;if(Xt==="DIVISIBLE_BY"){if(!Z.inputs||!Z.inputs.DIVISOR)throw new Error("err: DIVISOR is not filled!");if(Z.inputs.DIVISOR===0)throw new Error("Note that divisor cannot be 0!");return xn%Z.inputs.DIVISOR===0}return;case q==="math_random_int":const ii=U(Z.inputs.FROM),Pr=U(Z.inputs.TO);return D(ii,Pr);case q==="colour_picker":return aS(Z.fields.COLOUR);case q==="colour_random":let Ei=D(0,255),xr=D(0,255),mr=D(0,255);return{r:Ei,g:xr,b:mr};case q==="colour_rgb":const ne=U(Z.inputs.RED),Se=U(Z.inputs.GREEN),We=U(Z.inputs.BLUE);return{r:ne,g:Se,b:We};case q==="colour_blend":const at=U(Z.inputs.RATIO),zt=aS(Z.inputs.COLOUR1.shadow.fields.COLOUR),sn=aS(Z.inputs.COLOUR2.shadow.fields.COLOUR),Nn=zt.r*at,De=zt.g*at,_t=zt.b*at,Mt=sn.r,bt=sn.g,Wt=sn.b,Wn=(Mt+Nn)/(at+1),rr=(bt+De)/(at+1),_r=(Wt+_t)/(at+1);return{r:Wn,g:rr,b:_r};case q==="ChangeLED":if(!Z.inputs||!Z.inputs.FIELD_ChangeLED)throw new Error("err: ChangeLED is not complete!");var he=k(Z.inputs.FIELD_ChangeLED),ae=null;(vt=he==null?void 0:he.fields)!=null&&vt.COLOUR?ae=aS(he.fields.COLOUR):ae=V(he,he.type);var Te={Red:ae.r,Green:ae.g,Blue:ae.b};return;case q==="TransitionLED":if(!Z.inputs||!Z.inputs.COLOR1||!Z.inputs.COLOR2)throw new Error("err: TransitionLED is not complete!");var ue=k(Z.inputs.COLOR1),ge=k(Z.inputs.COLOR2),we=null;(Ct=ue==null?void 0:ue.fields)!=null&&Ct.COLOUR?we=aS(ue.fields.COLOUR):we=V(ue,ue.type);var J=null;(At=ge==null?void 0:ge.fields)!=null&&At.COLOUR?J=aS(ge.fields.COLOUR):J=V(ge,ge.type);var st=Z.fields.FIELD_TransitionTime_TimeMs*V0,re=Z.fields.TRANSITION_TYPE,Te={Red:we.r,Green:we.g,Blue:we.b,Red2:J.r,Green2:J.g,Blue2:J.b,TransitionType:re,TimeMS:st};return;case q==="DisplayImage":if(!Z.inputs||!Z.inputs.FIELD_DisplayImage_Filename)throw new Error("err: DisplayImage is not complete!");var se=k(Z.inputs.FIELD_DisplayImage_Filename),fe=oOe(se.type);w(se.type,500);return;case q==="PlayAudio":if(!Z.inputs||!Z.inputs.FIELD_PlayAudio_Filename)throw new Error("err: PlayAudio is not complete!");var se=k(Z.inputs.FIELD_PlayAudio_Filename),fe=m9(se.type);return;case q==="DisplayAnimation":if(!Z.inputs||!Z.inputs.FIELD_DisplayAnimation_Filename)throw new Error("err: DisplayAnimation is not complete!");var se=k(Z.inputs.FIELD_DisplayAnimation_Filename),fe=m9(se.type),Te={FileName:fe};readFile(Te);return;case q==="DisplayText":Z.fields.FIELD_DisplayText_Text;return;case q==="TurnOnFlashlight":return;case q==="TurnOffFlashlight":return;case q==="WaitForSeconds":var st=parseFloat(Z.fields.NumSeconds)*V0;C(st);return;case q==="MoveArm":var Fe=Z.fields.FIELD_MoveArm_Arm==="Right"?"Right":"Left",Ie=U(Z.fields.FIELD_MoveArm_Position),$e=U(Z.fields.FIELD_MoveArm_Velocity);f(Fe,Ie,$e);return;case q==="MoveArm2":var Ie=U(Z.fields.FIELD_MoveArm2_Position),$e=U(Z.fields.FIELD_MoveArm2_Velocity),Fe="both";f(Fe,Ie,$e);return;case q==="MoveArm3":var Fe=Z.fields.FIELD_MoveArm_Arm==="Right"?"Right":"Left",Ie=U(Z.fields.FIELD_MoveArm_Position),$e=U(Z.fields.FIELD_MoveArm_Velocity);f(Fe,Ie,$e);return;case q==="MoveArms2":var qe=U(Z.inputs.FIELD_MoveArm_LeftPosition),Re=U(Z.inputs.FIELD_MoveArm_LeftVelocity),Ze=U(Z.inputs.FIELD_MoveArm_RightPosition),rt=U(Z.inputs.FIELD_MoveArm_RightVelocity);g(qe,Re,Ze,rt);return;case q==="MoveHead":var ft=Z.fields.FIELD_MoveHead_Pitch==="D"?25:-40,st=2e3;y(ft,0,0,st);return;case q==="MoveHead3":var ft,ut,ze;ft=U(Z.inputs.FIELD_MoveHead_Pitch),ut=U(Z.inputs.FIELD_MoveHead_Roll),ze=U(Z.inputs.FIELD_MoveHead_Yaw),st=U(Z.inputs.FIELD_MoveHead_Time)*V0,y(ft,ut,ze,st);return;case q==="DriveTime":var it=Z.fields.FIELD_DriveTime_Direction,$e=parseInt(Z.fields.FIELD_DriveTime_Velocity),st=parseInt(Z.fields.FIELD_DriveTime_TimeMs)*V0,He=it==="F"?$e:-$e;b(He,0,st);return;case q==="DriveTime2":var He=U(Z.inputs.FIELD_DriveTime_Velocity),Nt=U(Z.inputs.FIELD_DriveTime_Angular),st=U(Z.inputs.FIELD_DriveTime_TimeMs)*V0;b(He,Nt,st);return;case q==="Turn":var it=Z.fields.FIELD_Turn_Direction,st=parseInt(Z.fields.FIELD_Turn_Duration)*V0,Nt=it==="L"?100:-100;b(0,Nt,st);return;case q==="Turn2":var it=Z.fields.FIELD_Turn_Direction,st=parseInt(U(Z.inputs.FIELD_Turn_Duration))*V0,Nt=it==="L"?100:-100;b(0,Nt,st);return;case q=="Speak":var kt=k(Z.inputs.FIELD_Speak_Text);kt.fields.TEXT;return;case q=="SpeakDefault":Z.fields.FIELD_SpeakDefault_Text;return;default:return}};let oe=A("Start");for(;oe&&oe.next;)oe=k(oe.next),V(oe,oe.type);return M()};function lOe(n){const e=Bn(qi(U=>U.resetSim)),t=Bn(qi(U=>U.toggleSimOnly)),r=Bn(qi(U=>U.isConnected)),s=Bn(qi(U=>U.ip)),o=Bn(qi(U=>U.getBlocks)),l=Bn(qi(U=>U.getEndingItems)),u=Bn(qi(U=>U.clock)),h=Bn(qi(U=>U.mistyImageList)),f=Bn(qi(U=>U.mistyAudioList)),g=Bn(qi(U=>U.simOnly)),y=Bn(qi(U=>U.endingTfs)),b=Bn(qi(U=>U.setAnimationFrames)),w=Bn(qi(U=>U.setHighlightBlocks)),C=Bn(qi(U=>U.workerThread)),M=Bn(qi(U=>U.setWorkerThread)),A=Bn(qi(U=>U.llmMode));function k(U,V){s&&!g&&r&&fetch(`http://${s}/api/${U}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(V)})}const L=async()=>{u.reset_elapsed(),C&&(C.terminate(),M(null));const U=`import ${JSON.stringify(new URL(rOe,import.meta.url))}`,V=new Blob([U],{type:"application/javascript"}),H=URL.createObjectURL(V);let oe=new Worker(H,{type:"module"});oe.onmessage=function(ae){console.log("Message received from worker "+ae.data),M(null)},oe.onerror=function(ae){console.log(ae);const ge=/id: (.+)/.exec(ae.message);ge?w(ge[1]):console.log("ID not found in error message."),URL.revokeObjectURL(H)},oe.postMessage({blocks:o(),mistyAudioList:f,mistyImageList:h,tfs:y,ip:s,runOnRobot:!g}),M(oe);let{newTfs:le,newEndingTfs:Z,newItems:q,newEndingItems:he}=aOe({blocks:o(),tfs:y,items:l()});b(le,Z,q,he),uh("Click Run Code button")},P=()=>{C&&(C.terminate(),M(null),k("halt",{})),uh("Click Stop Code button")},D=()=>{k("arms/set",{LeftArmPosition:90,RightArmPosition:90,LeftArmVelocity:100,RightArmVelocity:100,Units:"Degrees"}),k("head",{Pitch:0,Yaw:0,Roll:0,Duration:1,Units:"Degrees"}),k("images/display",{FileName:"e_DefaultContent.jpg",Alpha:1}),k("text/display",{Text:""}),k("led",{Red:100,Green:70,Blue:160}),e()};let z=A?{top:"10px"}:{bottom:"0px"};return Ne.jsxs(L$,{style:{position:"absolute",padding:"0px",left:"10px",...z},children:[Ne.jsxs(PH,{style:{paddingLeft:"0px",paddingRight:"0px"},children:[!C&&Ne.jsx(pI,{variant:"contained","aria-label":"play",style:{backgroundColor:"#FAFAFA",marginBottom:"5px"},onClick:L,id:"runButton",children:Ne.jsx(See,{})}),C&&Ne.jsx(pI,{variant:"contained","aria-label":"play",style:{backgroundColor:"#FAFAFA",marginBottom:"5px"},onClick:P,id:"stopButton",children:Ne.jsx(wee,{})}),Ne.jsx(pI,{variant:"contained","aria-label":"restart",style:{backgroundColor:"#FAFAFA",marginLeft:"5px",marginBottom:"5px"},onClick:D,children:Ne.jsx(Tee,{})})]}),r&&Ne.jsx(PH,{style:{backgroundColor:"#FAFAFA",borderRadius:"5px",marginBottom:"5px",paddingLeft:"10px",paddingRight:"0px"},children:Ne.jsx(LK,{children:Ne.jsx(OK,{control:Ne.jsx(oge,{onChange:U=>t(U.target.checked)}),label:"Sim only"})})})]})}function uOe(n){const e={displayTfs:!1,displayGrid:!0,isPolar:!1,backgroundColor:"#3a3a3a",planeColor:"#3a3a3a",highlightColor:"#ffffff",plane:0,fov:60,ar:!1,vr:!1};return Ne.jsxs(Ey,{height:"100%",children:[Ne.jsx(Y2e,{style:{overflow:"hidden"},store:Bn,meshLookup:R1e,...e}),Ne.jsx(lOe,{})]})}var Eee={exports:{}};(function(n,e){(function(t,r){r()})(Vl,function(){function t(f,g){return typeof g>"u"?g={autoBom:!1}:typeof g!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),g={autoBom:!g}),g.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(f.type)?new Blob(["\uFEFF",f],{type:f.type}):f}function r(f,g,y){var b=new XMLHttpRequest;b.open("GET",f),b.responseType="blob",b.onload=function(){h(b.response,g,y)},b.onerror=function(){console.error("could not download file")},b.send()}function s(f){var g=new XMLHttpRequest;g.open("HEAD",f,!1);try{g.send()}catch{}return 200<=g.status&&299>=g.status}function o(f){try{f.dispatchEvent(new MouseEvent("click"))}catch{var g=document.createEvent("MouseEvents");g.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),f.dispatchEvent(g)}}var l=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof Vl=="object"&&Vl.global===Vl?Vl:void 0,u=l.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),h=l.saveAs||(typeof window!="object"||window!==l?function(){}:"download"in HTMLAnchorElement.prototype&&!u?function(f,g,y){var b=l.URL||l.webkitURL,w=document.createElement("a");g=g||f.name||"download",w.download=g,w.rel="noopener",typeof f=="string"?(w.href=f,w.origin===location.origin?o(w):s(w.href)?r(f,g,y):o(w,w.target="_blank")):(w.href=b.createObjectURL(f),setTimeout(function(){b.revokeObjectURL(w.href)},4e4),setTimeout(function(){o(w)},0))}:"msSaveOrOpenBlob"in navigator?function(f,g,y){if(g=g||f.name||"download",typeof f!="string")navigator.msSaveOrOpenBlob(t(f,y),g);else if(s(f))r(f,g,y);else{var b=document.createElement("a");b.href=f,b.target="_blank",setTimeout(function(){o(b)})}}:function(f,g,y,b){if(b=b||open("","_blank"),b&&(b.document.title=b.document.body.innerText="downloading..."),typeof f=="string")return r(f,g,y);var w=f.type==="application/octet-stream",C=/constructor/i.test(l.HTMLElement)||l.safari,M=/CriOS\/[\d]+/.test(navigator.userAgent);if((M||w&&C||u)&&typeof FileReader<"u"){var A=new FileReader;A.onloadend=function(){var P=A.result;P=M?P:P.replace(/^data:[^;]*;/,"data:attachment/file;"),b?b.location.href=P:location=P,b=null},A.readAsDataURL(f)}else{var k=l.URL||l.webkitURL,L=k.createObjectURL(f);b?b.location=L:location.href=L,b=null,setTimeout(function(){k.revokeObjectURL(L)},4e4)}});l.saveAs=h.saveAs=h,n.exports=h})})(Eee);var cOe=Eee.exports;const g9=Xy(cOe);function Dx({title:n,children:e,style:t}){return Ne.jsx(Ey,{style:{padding:"5px",paddingTop:"20px",...t},children:Ne.jsxs(Ey,{style:{backgroundColor:"#E4E5F1",border:"3px #9394A5 solid",padding:"5px",borderRadius:"6px"},children:[Ne.jsx(Ey,{style:{position:"relative",display:"float",top:"-18px",left:"10px"},children:Ne.jsx(Ey,{children:Ne.jsx(f_,{display:"inline",style:{filter:"drop-shadow(0px 10px 4px rgba(0,0,0,0.25))",backgroundColor:"#E4E5F1",padding:"3px",border:"3px #9394A5 solid",borderRadius:"6px"},children:n})})}),Ne.jsx(L$,{children:me.Children.map(e,r=>Ne.jsx("div",{style:{padding:"3px",margin:"3px"},children:r}))})]})})}function SN({label:n,buttonText:e,clickFunction:t,style:r}){return Ne.jsxs(oc,{container:!0,direction:"row",alignItems:"center",style:{...r},children:[Ne.jsx(f_,{display:"inline",style:{paddingRight:"10px",flex:"1"},children:n}),Ne.jsx(qp,{text:e,clickFunction:t})]})}function wN({label:n,onChangeFunction:e,fieldType:t,textFieldInput:r,style:s}){return Ne.jsxs(oc,{container:!0,direction:"row",alignItems:"center",style:{...s},children:[Ne.jsx(f_,{display:"inline",style:{paddingRight:"10px",flex:"1"},children:n}),Ne.jsx(PF,{value:r,type:t,onChange:e})]})}function _9({label:n,onChange:e,style:t}){return Ne.jsxs(oc,{container:!0,direction:"row",alignItems:"center",style:{...t},children:[Ne.jsx(f_,{display:"inline",style:{paddingRight:"10px",flex:"1"},children:n}),Ne.jsx(LF,{type:"file",onChange:e,accept:".xml"})]})}const hOe=()=>{const n=Bn(k=>k.closeModal),e=Bn(k=>k.setEndpoint),t=Bn(k=>k.setAPIKey),r=Bn(k=>k.setDeployment),s=Bn(qi(k=>k.llmDeployment)),o=Bn(qi(k=>k.llmAPIKey)),l=Bn(qi(k=>k.llmEndpoint)),u=Bn(k=>k.blocklyWorkspace),h=Bn(k=>k.toggleLLMBlockPrompt),f=Bn(qi(k=>k.displayLLMBlockPrompt)),g=Bn(qi(k=>k.chatMessageHistory)),y=Bn(qi(k=>k.setChatMessageHistory)),b=()=>{var k=new Blob([LD],{type:"text/plain;charset=utf-8"});g9.saveAs(k,"activity_log.txt")},w=()=>{console.log(g);var k=new Blob([JSON.stringify(g)],{type:"text/plain;charset=utf-8"});g9.saveAs(k,"chat_log.txt")},C=()=>{const k=Zg.Xml.domToPrettyText(Zg.Xml.workspaceToDom(u)),L=new Blob([k],{type:"text/xml"}),P=URL.createObjectURL(L),D=document.createElement("a");D.href=P,D.download="myBlocks.xml",D.click()},M=k=>{const L=new FileReader;L.onload=function(){const P=L.result;y(JSON.parse(P))},L.readAsText(k.target.files[0])},A=k=>{const L=new FileReader;L.onload=function(){const P=L.result;if(u)try{const z=new DOMParser().parseFromString(P,"text/xml");Zg.Xml.domToWorkspace(z.firstChild,u)}catch(D){console.error("Error parsing XML:",D)}else console.error("Blockly workspace not initialized")},L.readAsText(k.target.files[0])};return Ne.jsxs(Ey,{sx:{backgroundColor:"#585D92",padding:"5px",margin:"0",borderRadius:"10px",maxHeight:"70vh",overflowY:"scroll"},children:[Ne.jsxs(Dx,{title:"LLM Settings",children:[Ne.jsx(wN,{onChangeFunction:k=>e(k.target.value),label:"Server Endpoint",fieldType:"password",textFieldInput:l}),Ne.jsx(wN,{onChangeFunction:k=>t(k.target.value),label:"API Key",fieldType:"password",textFieldInput:o}),Ne.jsx(wN,{onChangeFunction:k=>r(k.target.value),label:"Deployment Model",fieldType:"password",textFieldInput:s})]}),Ne.jsxs(Dx,{title:"Downloads",children:[Ne.jsx(SN,{clickFunction:b,label:"Download Activity Log",buttonText:"Download"}),Ne.jsx(SN,{clickFunction:C,label:"Download Program",buttonText:"Download"}),Ne.jsx(SN,{clickFunction:w,label:"Download Chat Log",buttonText:"Download"})]}),Ne.jsxs(Dx,{title:"Upload",children:[Ne.jsx(_9,{onChange:A,label:"Upload Program"}),Ne.jsx(_9,{onChange:M,label:"Upload Chat Logs"})]}),Ne.jsx(Dx,{title:"Toggles",children:Ne.jsx(LK,{style:{justifyContent:"left"},children:Ne.jsx(OK,{style:{justifyContent:"left"},control:Ne.jsx(tve,{defaultChecked:f,onChange:k=>h(k.target.checked)}),label:"Enable LLM Block Prompt",labelPlacement:"start"})})}),Ne.jsx(qp,{clickFunction:n,text:"Close",style:{float:"right"}})]})},dOe=()=>{const n=Bn(t=>t.setActiveModal),e=Bn(t=>t.activeModal);return Ne.jsx(IK,{open:e===yX,onClose:(t,r)=>{r==="backdropClick"&&n("")},children:e&&Ne.jsx(hOe,{})})},fOe=()=>Ne.jsx(Ey,{sx:{backgroundColor:"#585D92",padding:"15px",margin:"0",borderRadius:"10px",maxHeight:"70vh",overflowY:"scroll"},children:Ne.jsx(YK,{style:{backgroundColor:"#FAFAFA",borderRadius:"5px"},maxVH:50})}),pOe=()=>{const n=Bn(t=>t.setActiveModal),e=Bn(t=>t.activeModal);return Ne.jsx(IK,{open:e===dle,onClose:(t,r)=>{r==="backdropClick"&&n("")},children:e&&Ne.jsx(fOe,{})})};function mOe(n){return Ne.jsx(Dx,{title:"Task Description",children:Ne.jsx(f_,{variant:"h6",children:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Risus in hendrerit gravida rutrum quisque. Nulla malesuada pellentesque elit eget gravida cum sociis natoque penatibus. Erat velit scelerisque in dictum non. Nisl tincidunt eget nullam non nisi est. Sed tempus urna et pharetra. Nibh sit amet commodo nulla facilisi nullam vehicula. Eget dolor morbi non arcu risus. Donec ac odio tempor orci dapibus ultrices in iaculis."})})}var li="cs",xee={exports:{}};/*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames -*/(function(n){(function(){var e={}.hasOwnProperty;function t(){for(var o="",l=0;l=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function TOe(n,e){if(n==null)return{};var t={},r=Object.keys(n),s,o;for(o=0;o=0)&&(t[s]=n[s]);return t}var Cee=function(e){var t=e.status,r=e.size,s=r===void 0?"md":r,o=e.className,l=e.name,u=e.selected,h=e.children,f=bOe(e,_Oe),g="".concat(li,"-status"),y=yt.createElement("div",{className:"".concat(g,"__bullet")}),b=l||h;return yt.createElement("div",qP({},f,{"aria-selected":u===!0?"":null,className:Ps(g,"".concat(g,"--").concat(s),"".concat(g,"--").concat(t),_9({},"".concat(g,"--selected"),u),_9({},"".concat(g,"--named"),b),o)}),y,b&&yt.createElement("div",{className:"".concat(g,"__name")},l||h))};function sC(n){"@babel/helpers - typeof";return sC=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},sC(n)}var SOe=["name","src","size","status","className","active","children"];function QP(){return QP=Object.assign?Object.assign.bind():function(n){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function COe(n,e){if(n==null)return{};var t={},r=Object.keys(n),s,o;for(o=0;o=0)&&(t[s]=n[s]);return t}function MOe(n,e){var t=n.name,r=t===void 0?"":t,s=n.src,o=s===void 0?"":s,l=n.size,u=l===void 0?"md":l,h=n.status,f=n.className,g=n.active,y=g===void 0?!1:g,b=n.children,w=$Oe(n,SOe),C="".concat(li,"-avatar"),M=typeof u<"u"?" ".concat(C,"--").concat(u):"",A=pe.useRef();return pe.useImperativeHandle(e,function(){return{focus:function(){return A.current.focus()}}}),yt.createElement("div",QP({ref:A},w,{className:Ps("".concat(C).concat(M),wOe({},"".concat(C,"--active"),y),f)}),b||yt.createElement(yt.Fragment,null,yt.createElement("img",{src:o,alt:r}),typeof h=="string"&&yt.createElement(Cee,{status:h,size:u})," "))}var UC=pe.forwardRef(MOe);UC.displayName="Avatar";UC.propTypes={children:qt.node,name:qt.string,src:qt.string,size:qt.oneOf($ee),status:qt.oneOf(xee),active:qt.bool,className:qt.string};function v9(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),t.push.apply(t,r)}return t}function HA(n){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function NOe(n,e){if(n==null)return{};var t={},r=Object.keys(n),s,o;for(o=0;o=0)&&(t[s]=n[s]);return t}var Iee=function(e){var t=e.children,r=e.size,s=r===void 0?"md":r,o=e.className,l=e.max,u=e.activeIndex,h=e.hoverToFront,f=LOe(e,OOe),g="".concat(li,"-avatar-group"),y=typeof l=="number"&&yt.Children.count(t)>l?yt.Children.toArray(t).reverse().slice(0,l):yt.Children.toArray(t).reverse(),b=typeof u=="number"?y.length-u-1:void 0;return yt.createElement("div",ZP({},f,{className:Ps(g,"".concat(g,"--").concat(s),o)}),y.map(function(w,C){var M=typeof b=="number"?{active:b===C}:{};return h===!0&&(M.className=Ps("".concat(li,"-avatar--active-on-hover"),w.props.className)),yt.cloneElement(w,M)}))};Iee.displayName="AvatarGroup";var DOe=["children","className","icon","border","labelPosition"];function eB(){return eB=Object.assign?Object.assign.bind():function(n){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function BOe(n,e){if(n==null)return{};var t={},r=Object.keys(n),s,o;for(o=0;o=0)&&(t[s]=n[s]);return t}var X4=function(e){var t=e.children,r=t===void 0?void 0:t,s=e.className,o=s===void 0?"":s,l=e.icon,u=l===void 0?void 0:l,h=e.border,f=h===void 0?!1:h,g=e.labelPosition,y=g===void 0?void 0:g,b=POe(e,DOe),w="".concat(li,"-button"),C=typeof y<"u"?y:"right",M=yt.Children.count(r)>0?"".concat(w,"--").concat(C):"",A=f===!0?"".concat(w,"--border"):"";return yt.createElement("button",eB({},b,{className:Ps(w,M,A,o)}),C==="left"&&r,u,C==="right"&&r)};/*! +*/(function(n){(function(){var e={}.hasOwnProperty;function t(){for(var o="",l=0;l=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function TOe(n,e){if(n==null)return{};var t={},r=Object.keys(n),s,o;for(o=0;o=0)&&(t[s]=n[s]);return t}var Mee=function(e){var t=e.status,r=e.size,s=r===void 0?"md":r,o=e.className,l=e.name,u=e.selected,h=e.children,f=bOe(e,_Oe),g="".concat(li,"-status"),y=yt.createElement("div",{className:"".concat(g,"__bullet")}),b=l||h;return yt.createElement("div",qP({},f,{"aria-selected":u===!0?"":null,className:Ps(g,"".concat(g,"--").concat(s),"".concat(g,"--").concat(t),v9({},"".concat(g,"--selected"),u),v9({},"".concat(g,"--named"),b),o)}),y,b&&yt.createElement("div",{className:"".concat(g,"__name")},l||h))};function sC(n){"@babel/helpers - typeof";return sC=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},sC(n)}var SOe=["name","src","size","status","className","active","children"];function QP(){return QP=Object.assign?Object.assign.bind():function(n){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function COe(n,e){if(n==null)return{};var t={},r=Object.keys(n),s,o;for(o=0;o=0)&&(t[s]=n[s]);return t}function MOe(n,e){var t=n.name,r=t===void 0?"":t,s=n.src,o=s===void 0?"":s,l=n.size,u=l===void 0?"md":l,h=n.status,f=n.className,g=n.active,y=g===void 0?!1:g,b=n.children,w=$Oe(n,SOe),C="".concat(li,"-avatar"),M=typeof u<"u"?" ".concat(C,"--").concat(u):"",A=me.useRef();return me.useImperativeHandle(e,function(){return{focus:function(){return A.current.focus()}}}),yt.createElement("div",QP({ref:A},w,{className:Ps("".concat(C).concat(M),wOe({},"".concat(C,"--active"),y),f)}),b||yt.createElement(yt.Fragment,null,yt.createElement("img",{src:o,alt:r}),typeof h=="string"&&yt.createElement(Mee,{status:h,size:u})," "))}var UC=me.forwardRef(MOe);UC.displayName="Avatar";UC.propTypes={children:Qt.node,name:Qt.string,src:Qt.string,size:Qt.oneOf(Cee),status:Qt.oneOf($ee),active:Qt.bool,className:Qt.string};function y9(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),t.push.apply(t,r)}return t}function HA(n){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function NOe(n,e){if(n==null)return{};var t={},r=Object.keys(n),s,o;for(o=0;o=0)&&(t[s]=n[s]);return t}var Ree=function(e){var t=e.children,r=e.size,s=r===void 0?"md":r,o=e.className,l=e.max,u=e.activeIndex,h=e.hoverToFront,f=LOe(e,OOe),g="".concat(li,"-avatar-group"),y=typeof l=="number"&&yt.Children.count(t)>l?yt.Children.toArray(t).reverse().slice(0,l):yt.Children.toArray(t).reverse(),b=typeof u=="number"?y.length-u-1:void 0;return yt.createElement("div",ZP({},f,{className:Ps(g,"".concat(g,"--").concat(s),o)}),y.map(function(w,C){var M=typeof b=="number"?{active:b===C}:{};return h===!0&&(M.className=Ps("".concat(li,"-avatar--active-on-hover"),w.props.className)),yt.cloneElement(w,M)}))};Ree.displayName="AvatarGroup";var DOe=["children","className","icon","border","labelPosition"];function eB(){return eB=Object.assign?Object.assign.bind():function(n){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function BOe(n,e){if(n==null)return{};var t={},r=Object.keys(n),s,o;for(o=0;o=0)&&(t[s]=n[s]);return t}var X4=function(e){var t=e.children,r=t===void 0?void 0:t,s=e.className,o=s===void 0?"":s,l=e.icon,u=l===void 0?void 0:l,h=e.border,f=h===void 0?!1:h,g=e.labelPosition,y=g===void 0?void 0:g,b=POe(e,DOe),w="".concat(li,"-button"),C=typeof y<"u"?y:"right",M=yt.Children.count(r)>0?"".concat(w,"--").concat(C):"",A=f===!0?"".concat(w,"--border"):"";return yt.createElement("button",eB({},b,{className:Ps(w,M,A,o)}),C==="left"&&r,u,C==="right"&&r)};/*! * Font Awesome Free 5.15.4 by @fontawesome - https://fontawesome.com * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) - */function s$(n){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?s$=function(e){return typeof e}:s$=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s$(n)}function FOe(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function y9(n,e){for(var t=0;t"u"?setTimeout:setImmediate,Px=[],rB;function nLe(){for(var n=0;n-1;s--){var o=t[s],l=(o.tagName||"").toUpperCase();["STYLE","LINK"].indexOf(l)>-1&&(r=o)}return hp.head.insertBefore(e,r),n}}var lLe="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";function kR(){for(var n=12,e="";n-- >0;)e+=lLe[Math.random()*62|0];return e}function Gee(n){return"".concat(n).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function uLe(n){return Object.keys(n||{}).reduce(function(e,t){return e+"".concat(t,'="').concat(Gee(n[t]),'" ')},"").trim()}function Wee(n){return Object.keys(n||{}).reduce(function(e,t){return e+"".concat(t,": ").concat(n[t],";")},"")}function Vee(n){return n.size!==rw.size||n.x!==rw.x||n.y!==rw.y||n.rotate!==rw.rotate||n.flipX||n.flipY}function jee(n){var e=n.transform,t=n.containerWidth,r=n.iconWidth,s={transform:"translate(".concat(t/2," 256)")},o="translate(".concat(e.x*32,", ").concat(e.y*32,") "),l="scale(".concat(e.size/16*(e.flipX?-1:1),", ").concat(e.size/16*(e.flipY?-1:1),") "),u="rotate(".concat(e.rotate," 0 0)"),h={transform:"".concat(o," ").concat(l," ").concat(u)},f={transform:"translate(".concat(r/2*-1," -256)")};return{outer:s,inner:h,path:f}}var xN={x:0,y:0,width:"100%",height:"100%"};function w9(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return n.attributes&&(n.attributes.fill||e)&&(n.attributes.fill="black"),n}function cLe(n){return n.tag==="g"?n.children:[n]}function hLe(n){var e=n.children,t=n.attributes,r=n.main,s=n.mask,o=n.maskId,l=n.transform,u=r.width,h=r.icon,f=s.width,g=s.icon,y=jee({transform:l,containerWidth:f,iconWidth:u}),b={tag:"rect",attributes:Yo({},xN,{fill:"white"})},w=h.children?{children:h.children.map(w9)}:{},C={tag:"g",attributes:Yo({},y.inner),children:[w9(Yo({tag:h.tag,attributes:Yo({},h.attributes,y.path)},w))]},M={tag:"g",attributes:Yo({},y.outer),children:[C]},A="mask-".concat(o||kR()),k="clip-".concat(o||kR()),L={tag:"mask",attributes:Yo({},xN,{id:A,maskUnits:"userSpaceOnUse",maskContentUnits:"userSpaceOnUse"}),children:[b,M]},P={tag:"defs",children:[{tag:"clipPath",attributes:{id:k},children:cLe(g)},L]};return e.push(P,{tag:"rect",attributes:Yo({fill:"currentColor","clip-path":"url(#".concat(k,")"),mask:"url(#".concat(A,")")},xN)}),{children:e,attributes:t}}function dLe(n){var e=n.children,t=n.attributes,r=n.main,s=n.transform,o=n.styles,l=Wee(o);if(l.length>0&&(t.style=l),Vee(s)){var u=jee({transform:s,containerWidth:r.width,iconWidth:r.width});e.push({tag:"g",attributes:Yo({},u.outer),children:[{tag:"g",attributes:Yo({},u.inner),children:[{tag:r.icon.tag,children:r.icon.children,attributes:Yo({},r.icon.attributes,u.path)}]}]})}else e.push(r.icon);return{children:e,attributes:t}}function fLe(n){var e=n.children,t=n.main,r=n.mask,s=n.attributes,o=n.styles,l=n.transform;if(Vee(l)&&t.found&&!r.found){var u=t.width,h=t.height,f={x:u/h/2,y:.5};s.style=Wee(Yo({},o,{"transform-origin":"".concat(f.x+l.x/16,"em ").concat(f.y+l.y/16,"em")}))}return[{tag:"svg",attributes:s,children:e}]}function pLe(n){var e=n.prefix,t=n.iconName,r=n.children,s=n.attributes,o=n.symbol,l=o===!0?"".concat(e,"-").concat(Bm.familyPrefix,"-").concat(t):o;return[{tag:"svg",attributes:{style:"display: none;"},children:[{tag:"symbol",attributes:Yo({},s,{id:l}),children:r}]}]}function mLe(n){var e=n.icons,t=e.main,r=e.mask,s=n.prefix,o=n.iconName,l=n.transform,u=n.symbol,h=n.title,f=n.maskId,g=n.titleId,y=n.extra,b=n.watchable,w=b===void 0?!1:b,C=r.found?r:t,M=C.width,A=C.height,k=s==="fak",L=k?"":"fa-w-".concat(Math.ceil(M/A*16)),P=[Bm.replacementClass,o?"".concat(Bm.familyPrefix,"-").concat(o):"",L].filter(function(le){return y.classes.indexOf(le)===-1}).filter(function(le){return le!==""||!!le}).concat(y.classes).join(" "),D={children:[],attributes:Yo({},y.attributes,{"data-prefix":s,"data-icon":o,class:P,role:y.attributes.role||"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 ".concat(M," ").concat(A)})},z=k&&!~y.classes.indexOf("fa-fw")?{width:"".concat(M/A*16*.0625,"em")}:{};w&&(D.attributes[YOe]=""),h&&D.children.push({tag:"title",attributes:{id:D.attributes["aria-labelledby"]||"title-".concat(g||kR())},children:[h]});var U=Yo({},D,{prefix:s,iconName:o,main:t,mask:r,maskId:f,transform:l,symbol:u,styles:Yo({},z,y.styles)}),V=r.found&&t.found?hLe(U):dLe(U),H=V.children,oe=V.attributes;return U.children=H,U.attributes=oe,u?pLe(U):fLe(U)}var E9=function(){};Bm.measurePerformance&&GA&&GA.mark&&GA.measure;var gLe=function(e,t){return function(r,s,o,l){return e.call(t,r,s,o,l)}},$N=function(e,t,r,s){var o=Object.keys(e),l=o.length,u=s!==void 0?gLe(t,s):t,h,f,g;for(r===void 0?(h=1,g=e[o[0]]):(h=0,g=r);h2&&arguments[2]!==void 0?arguments[2]:{},r=t.skipHooks,s=r===void 0?!1:r,o=Object.keys(e).reduce(function(l,u){var h=e[u],f=!!h.icon;return f?l[h.iconName]=h.icon:l[u]=h,l},{});typeof i_.hooks.addPack=="function"&&!s?i_.hooks.addPack(n,o):i_.styles[n]=Yo({},i_.styles[n]||{},o),n==="fas"&&Yee("fa",e)}var x9=i_.styles,_Le=i_.shims,Xee=function(){var e=function(s){return $N(x9,function(o,l,u){return o[u]=$N(l,s,{}),o},{})};e(function(r,s,o){return s[3]&&(r[s[3]]=o),r}),e(function(r,s,o){var l=s[2];return r[o]=o,l.forEach(function(u){r[u]=o}),r});var t="far"in x9;$N(_Le,function(r,s){var o=s[0],l=s[1],u=s[2];return l==="far"&&!t&&(l="fas"),r[o]={prefix:l,iconName:u},r},{})};Xee();i_.styles;function $9(n,e,t){if(n&&n[e]&&n[e][t])return{prefix:e,iconName:t,icon:n[e][t]}}function Kee(n){var e=n.tag,t=n.attributes,r=t===void 0?{}:t,s=n.children,o=s===void 0?[]:s;return typeof n=="string"?Gee(n):"<".concat(e," ").concat(uLe(r),">").concat(o.map(Kee).join(""),"")}var vLe=function(e){var t={size:16,x:0,y:0,flipX:!1,flipY:!1,rotate:0};return e?e.toLowerCase().split(" ").reduce(function(r,s){var o=s.toLowerCase().split("-"),l=o[0],u=o.slice(1).join("-");if(l&&u==="h")return r.flipX=!0,r;if(l&&u==="v")return r.flipY=!0,r;if(u=parseFloat(u),isNaN(u))return r;switch(l){case"grow":r.size=r.size+u;break;case"shrink":r.size=r.size-u;break;case"left":r.x=r.x-u;break;case"right":r.x=r.x+u;break;case"up":r.y=r.y-u;break;case"down":r.y=r.y+u;break;case"rotate":r.rotate=r.rotate+u;break}return r},t):t};function iB(n){this.name="MissingIcon",this.message=n||"Icon unavailable",this.stack=new Error().stack}iB.prototype=Object.create(Error.prototype);iB.prototype.constructor=iB;var x2={fill:"currentColor"},Jee={attributeType:"XML",repeatCount:"indefinite",dur:"2s"};Yo({},x2,{d:"M156.5,447.7l-12.6,29.5c-18.7-9.5-35.9-21.2-51.5-34.9l22.7-22.7C127.6,430.5,141.5,440,156.5,447.7z M40.6,272H8.5 c1.4,21.2,5.4,41.7,11.7,61.1L50,321.2C45.1,305.5,41.8,289,40.6,272z M40.6,240c1.4-18.8,5.2-37,11.1-54.1l-29.5-12.6 C14.7,194.3,10,216.7,8.5,240H40.6z M64.3,156.5c7.8-14.9,17.2-28.8,28.1-41.5L69.7,92.3c-13.7,15.6-25.5,32.8-34.9,51.5 L64.3,156.5z M397,419.6c-13.9,12-29.4,22.3-46.1,30.4l11.9,29.8c20.7-9.9,39.8-22.6,56.9-37.6L397,419.6z M115,92.4 c13.9-12,29.4-22.3,46.1-30.4l-11.9-29.8c-20.7,9.9-39.8,22.6-56.8,37.6L115,92.4z M447.7,355.5c-7.8,14.9-17.2,28.8-28.1,41.5 l22.7,22.7c13.7-15.6,25.5-32.9,34.9-51.5L447.7,355.5z M471.4,272c-1.4,18.8-5.2,37-11.1,54.1l29.5,12.6 c7.5-21.1,12.2-43.5,13.6-66.8H471.4z M321.2,462c-15.7,5-32.2,8.2-49.2,9.4v32.1c21.2-1.4,41.7-5.4,61.1-11.7L321.2,462z M240,471.4c-18.8-1.4-37-5.2-54.1-11.1l-12.6,29.5c21.1,7.5,43.5,12.2,66.8,13.6V471.4z M462,190.8c5,15.7,8.2,32.2,9.4,49.2h32.1 c-1.4-21.2-5.4-41.7-11.7-61.1L462,190.8z M92.4,397c-12-13.9-22.3-29.4-30.4-46.1l-29.8,11.9c9.9,20.7,22.6,39.8,37.6,56.9 L92.4,397z M272,40.6c18.8,1.4,36.9,5.2,54.1,11.1l12.6-29.5C317.7,14.7,295.3,10,272,8.5V40.6z M190.8,50 c15.7-5,32.2-8.2,49.2-9.4V8.5c-21.2,1.4-41.7,5.4-61.1,11.7L190.8,50z M442.3,92.3L419.6,115c12,13.9,22.3,29.4,30.5,46.1 l29.8-11.9C470,128.5,457.3,109.4,442.3,92.3z M397,92.4l22.7-22.7c-15.6-13.7-32.8-25.5-51.5-34.9l-12.6,29.5 C370.4,72.1,384.4,81.5,397,92.4z"});var Z4=Yo({},Jee,{attributeName:"opacity"});Yo({},x2,{cx:"256",cy:"364",r:"28"}),Yo({},Jee,{attributeName:"r",values:"28;14;28;28;14;28;"}),Yo({},Z4,{values:"1;0;1;1;0;1;"});Yo({},x2,{opacity:"1",d:"M263.7,312h-16c-6.6,0-12-5.4-12-12c0-71,77.4-63.9,77.4-107.8c0-20-17.8-40.2-57.4-40.2c-29.1,0-44.3,9.6-59.2,28.7 c-3.9,5-11.1,6-16.2,2.4l-13.1-9.2c-5.6-3.9-6.9-11.8-2.6-17.2c21.2-27.2,46.4-44.7,91.2-44.7c52.3,0,97.4,29.8,97.4,80.2 c0,67.6-77.4,63.5-77.4,107.8C275.7,306.6,270.3,312,263.7,312z"}),Yo({},Z4,{values:"1;0;0;0;0;1;"});Yo({},x2,{opacity:"0",d:"M232.5,134.5l7,168c0.3,6.4,5.6,11.5,12,11.5h9c6.4,0,11.7-5.1,12-11.5l7-168c0.3-6.8-5.2-12.5-12-12.5h-23 C237.7,122,232.2,127.7,232.5,134.5z"}),Yo({},Z4,{values:"0;0;1;1;0;0;"});i_.styles;function C9(n){var e=n[0],t=n[1],r=n.slice(4),s=Ree(r,1),o=s[0],l=null;return Array.isArray(o)?l={tag:"g",attributes:{class:"".concat(Bm.familyPrefix,"-").concat(EN.GROUP)},children:[{tag:"path",attributes:{class:"".concat(Bm.familyPrefix,"-").concat(EN.SECONDARY),fill:"currentColor",d:o[0]}},{tag:"path",attributes:{class:"".concat(Bm.familyPrefix,"-").concat(EN.PRIMARY),fill:"currentColor",d:o[1]}}]}:l={tag:"path",attributes:{fill:"currentColor",d:o}},{found:!0,width:e,height:t,icon:l}}i_.styles;var yLe=`svg:not(:root).svg-inline--fa { + */function s$(n){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?s$=function(e){return typeof e}:s$=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s$(n)}function FOe(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function b9(n,e){for(var t=0;t"u"?setTimeout:setImmediate,Px=[],rB;function nLe(){for(var n=0;n-1;s--){var o=t[s],l=(o.tagName||"").toUpperCase();["STYLE","LINK"].indexOf(l)>-1&&(r=o)}return hp.head.insertBefore(e,r),n}}var lLe="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";function kR(){for(var n=12,e="";n-- >0;)e+=lLe[Math.random()*62|0];return e}function Wee(n){return"".concat(n).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function uLe(n){return Object.keys(n||{}).reduce(function(e,t){return e+"".concat(t,'="').concat(Wee(n[t]),'" ')},"").trim()}function Vee(n){return Object.keys(n||{}).reduce(function(e,t){return e+"".concat(t,": ").concat(n[t],";")},"")}function jee(n){return n.size!==rw.size||n.x!==rw.x||n.y!==rw.y||n.rotate!==rw.rotate||n.flipX||n.flipY}function Yee(n){var e=n.transform,t=n.containerWidth,r=n.iconWidth,s={transform:"translate(".concat(t/2," 256)")},o="translate(".concat(e.x*32,", ").concat(e.y*32,") "),l="scale(".concat(e.size/16*(e.flipX?-1:1),", ").concat(e.size/16*(e.flipY?-1:1),") "),u="rotate(".concat(e.rotate," 0 0)"),h={transform:"".concat(o," ").concat(l," ").concat(u)},f={transform:"translate(".concat(r/2*-1," -256)")};return{outer:s,inner:h,path:f}}var xN={x:0,y:0,width:"100%",height:"100%"};function E9(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return n.attributes&&(n.attributes.fill||e)&&(n.attributes.fill="black"),n}function cLe(n){return n.tag==="g"?n.children:[n]}function hLe(n){var e=n.children,t=n.attributes,r=n.main,s=n.mask,o=n.maskId,l=n.transform,u=r.width,h=r.icon,f=s.width,g=s.icon,y=Yee({transform:l,containerWidth:f,iconWidth:u}),b={tag:"rect",attributes:Yo({},xN,{fill:"white"})},w=h.children?{children:h.children.map(E9)}:{},C={tag:"g",attributes:Yo({},y.inner),children:[E9(Yo({tag:h.tag,attributes:Yo({},h.attributes,y.path)},w))]},M={tag:"g",attributes:Yo({},y.outer),children:[C]},A="mask-".concat(o||kR()),k="clip-".concat(o||kR()),L={tag:"mask",attributes:Yo({},xN,{id:A,maskUnits:"userSpaceOnUse",maskContentUnits:"userSpaceOnUse"}),children:[b,M]},P={tag:"defs",children:[{tag:"clipPath",attributes:{id:k},children:cLe(g)},L]};return e.push(P,{tag:"rect",attributes:Yo({fill:"currentColor","clip-path":"url(#".concat(k,")"),mask:"url(#".concat(A,")")},xN)}),{children:e,attributes:t}}function dLe(n){var e=n.children,t=n.attributes,r=n.main,s=n.transform,o=n.styles,l=Vee(o);if(l.length>0&&(t.style=l),jee(s)){var u=Yee({transform:s,containerWidth:r.width,iconWidth:r.width});e.push({tag:"g",attributes:Yo({},u.outer),children:[{tag:"g",attributes:Yo({},u.inner),children:[{tag:r.icon.tag,children:r.icon.children,attributes:Yo({},r.icon.attributes,u.path)}]}]})}else e.push(r.icon);return{children:e,attributes:t}}function fLe(n){var e=n.children,t=n.main,r=n.mask,s=n.attributes,o=n.styles,l=n.transform;if(jee(l)&&t.found&&!r.found){var u=t.width,h=t.height,f={x:u/h/2,y:.5};s.style=Vee(Yo({},o,{"transform-origin":"".concat(f.x+l.x/16,"em ").concat(f.y+l.y/16,"em")}))}return[{tag:"svg",attributes:s,children:e}]}function pLe(n){var e=n.prefix,t=n.iconName,r=n.children,s=n.attributes,o=n.symbol,l=o===!0?"".concat(e,"-").concat(Bm.familyPrefix,"-").concat(t):o;return[{tag:"svg",attributes:{style:"display: none;"},children:[{tag:"symbol",attributes:Yo({},s,{id:l}),children:r}]}]}function mLe(n){var e=n.icons,t=e.main,r=e.mask,s=n.prefix,o=n.iconName,l=n.transform,u=n.symbol,h=n.title,f=n.maskId,g=n.titleId,y=n.extra,b=n.watchable,w=b===void 0?!1:b,C=r.found?r:t,M=C.width,A=C.height,k=s==="fak",L=k?"":"fa-w-".concat(Math.ceil(M/A*16)),P=[Bm.replacementClass,o?"".concat(Bm.familyPrefix,"-").concat(o):"",L].filter(function(le){return y.classes.indexOf(le)===-1}).filter(function(le){return le!==""||!!le}).concat(y.classes).join(" "),D={children:[],attributes:Yo({},y.attributes,{"data-prefix":s,"data-icon":o,class:P,role:y.attributes.role||"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 ".concat(M," ").concat(A)})},z=k&&!~y.classes.indexOf("fa-fw")?{width:"".concat(M/A*16*.0625,"em")}:{};w&&(D.attributes[YOe]=""),h&&D.children.push({tag:"title",attributes:{id:D.attributes["aria-labelledby"]||"title-".concat(g||kR())},children:[h]});var U=Yo({},D,{prefix:s,iconName:o,main:t,mask:r,maskId:f,transform:l,symbol:u,styles:Yo({},z,y.styles)}),V=r.found&&t.found?hLe(U):dLe(U),H=V.children,oe=V.attributes;return U.children=H,U.attributes=oe,u?pLe(U):fLe(U)}var x9=function(){};Bm.measurePerformance&&GA&&GA.mark&&GA.measure;var gLe=function(e,t){return function(r,s,o,l){return e.call(t,r,s,o,l)}},$N=function(e,t,r,s){var o=Object.keys(e),l=o.length,u=s!==void 0?gLe(t,s):t,h,f,g;for(r===void 0?(h=1,g=e[o[0]]):(h=0,g=r);h2&&arguments[2]!==void 0?arguments[2]:{},r=t.skipHooks,s=r===void 0?!1:r,o=Object.keys(e).reduce(function(l,u){var h=e[u],f=!!h.icon;return f?l[h.iconName]=h.icon:l[u]=h,l},{});typeof i_.hooks.addPack=="function"&&!s?i_.hooks.addPack(n,o):i_.styles[n]=Yo({},i_.styles[n]||{},o),n==="fas"&&Xee("fa",e)}var $9=i_.styles,_Le=i_.shims,Kee=function(){var e=function(s){return $N($9,function(o,l,u){return o[u]=$N(l,s,{}),o},{})};e(function(r,s,o){return s[3]&&(r[s[3]]=o),r}),e(function(r,s,o){var l=s[2];return r[o]=o,l.forEach(function(u){r[u]=o}),r});var t="far"in $9;$N(_Le,function(r,s){var o=s[0],l=s[1],u=s[2];return l==="far"&&!t&&(l="fas"),r[o]={prefix:l,iconName:u},r},{})};Kee();i_.styles;function C9(n,e,t){if(n&&n[e]&&n[e][t])return{prefix:e,iconName:t,icon:n[e][t]}}function Jee(n){var e=n.tag,t=n.attributes,r=t===void 0?{}:t,s=n.children,o=s===void 0?[]:s;return typeof n=="string"?Wee(n):"<".concat(e," ").concat(uLe(r),">").concat(o.map(Jee).join(""),"")}var vLe=function(e){var t={size:16,x:0,y:0,flipX:!1,flipY:!1,rotate:0};return e?e.toLowerCase().split(" ").reduce(function(r,s){var o=s.toLowerCase().split("-"),l=o[0],u=o.slice(1).join("-");if(l&&u==="h")return r.flipX=!0,r;if(l&&u==="v")return r.flipY=!0,r;if(u=parseFloat(u),isNaN(u))return r;switch(l){case"grow":r.size=r.size+u;break;case"shrink":r.size=r.size-u;break;case"left":r.x=r.x-u;break;case"right":r.x=r.x+u;break;case"up":r.y=r.y-u;break;case"down":r.y=r.y+u;break;case"rotate":r.rotate=r.rotate+u;break}return r},t):t};function iB(n){this.name="MissingIcon",this.message=n||"Icon unavailable",this.stack=new Error().stack}iB.prototype=Object.create(Error.prototype);iB.prototype.constructor=iB;var x2={fill:"currentColor"},qee={attributeType:"XML",repeatCount:"indefinite",dur:"2s"};Yo({},x2,{d:"M156.5,447.7l-12.6,29.5c-18.7-9.5-35.9-21.2-51.5-34.9l22.7-22.7C127.6,430.5,141.5,440,156.5,447.7z M40.6,272H8.5 c1.4,21.2,5.4,41.7,11.7,61.1L50,321.2C45.1,305.5,41.8,289,40.6,272z M40.6,240c1.4-18.8,5.2-37,11.1-54.1l-29.5-12.6 C14.7,194.3,10,216.7,8.5,240H40.6z M64.3,156.5c7.8-14.9,17.2-28.8,28.1-41.5L69.7,92.3c-13.7,15.6-25.5,32.8-34.9,51.5 L64.3,156.5z M397,419.6c-13.9,12-29.4,22.3-46.1,30.4l11.9,29.8c20.7-9.9,39.8-22.6,56.9-37.6L397,419.6z M115,92.4 c13.9-12,29.4-22.3,46.1-30.4l-11.9-29.8c-20.7,9.9-39.8,22.6-56.8,37.6L115,92.4z M447.7,355.5c-7.8,14.9-17.2,28.8-28.1,41.5 l22.7,22.7c13.7-15.6,25.5-32.9,34.9-51.5L447.7,355.5z M471.4,272c-1.4,18.8-5.2,37-11.1,54.1l29.5,12.6 c7.5-21.1,12.2-43.5,13.6-66.8H471.4z M321.2,462c-15.7,5-32.2,8.2-49.2,9.4v32.1c21.2-1.4,41.7-5.4,61.1-11.7L321.2,462z M240,471.4c-18.8-1.4-37-5.2-54.1-11.1l-12.6,29.5c21.1,7.5,43.5,12.2,66.8,13.6V471.4z M462,190.8c5,15.7,8.2,32.2,9.4,49.2h32.1 c-1.4-21.2-5.4-41.7-11.7-61.1L462,190.8z M92.4,397c-12-13.9-22.3-29.4-30.4-46.1l-29.8,11.9c9.9,20.7,22.6,39.8,37.6,56.9 L92.4,397z M272,40.6c18.8,1.4,36.9,5.2,54.1,11.1l12.6-29.5C317.7,14.7,295.3,10,272,8.5V40.6z M190.8,50 c15.7-5,32.2-8.2,49.2-9.4V8.5c-21.2,1.4-41.7,5.4-61.1,11.7L190.8,50z M442.3,92.3L419.6,115c12,13.9,22.3,29.4,30.5,46.1 l29.8-11.9C470,128.5,457.3,109.4,442.3,92.3z M397,92.4l22.7-22.7c-15.6-13.7-32.8-25.5-51.5-34.9l-12.6,29.5 C370.4,72.1,384.4,81.5,397,92.4z"});var Z4=Yo({},qee,{attributeName:"opacity"});Yo({},x2,{cx:"256",cy:"364",r:"28"}),Yo({},qee,{attributeName:"r",values:"28;14;28;28;14;28;"}),Yo({},Z4,{values:"1;0;1;1;0;1;"});Yo({},x2,{opacity:"1",d:"M263.7,312h-16c-6.6,0-12-5.4-12-12c0-71,77.4-63.9,77.4-107.8c0-20-17.8-40.2-57.4-40.2c-29.1,0-44.3,9.6-59.2,28.7 c-3.9,5-11.1,6-16.2,2.4l-13.1-9.2c-5.6-3.9-6.9-11.8-2.6-17.2c21.2-27.2,46.4-44.7,91.2-44.7c52.3,0,97.4,29.8,97.4,80.2 c0,67.6-77.4,63.5-77.4,107.8C275.7,306.6,270.3,312,263.7,312z"}),Yo({},Z4,{values:"1;0;0;0;0;1;"});Yo({},x2,{opacity:"0",d:"M232.5,134.5l7,168c0.3,6.4,5.6,11.5,12,11.5h9c6.4,0,11.7-5.1,12-11.5l7-168c0.3-6.8-5.2-12.5-12-12.5h-23 C237.7,122,232.2,127.7,232.5,134.5z"}),Yo({},Z4,{values:"0;0;1;1;0;0;"});i_.styles;function M9(n){var e=n[0],t=n[1],r=n.slice(4),s=kee(r,1),o=s[0],l=null;return Array.isArray(o)?l={tag:"g",attributes:{class:"".concat(Bm.familyPrefix,"-").concat(EN.GROUP)},children:[{tag:"path",attributes:{class:"".concat(Bm.familyPrefix,"-").concat(EN.SECONDARY),fill:"currentColor",d:o[0]}},{tag:"path",attributes:{class:"".concat(Bm.familyPrefix,"-").concat(EN.PRIMARY),fill:"currentColor",d:o[1]}}]}:l={tag:"path",attributes:{fill:"currentColor",d:o}},{found:!0,width:e,height:t,icon:l}}i_.styles;var yLe=`svg:not(:root).svg-inline--fa { overflow: visible; } @@ -6277,19 +6277,19 @@ outputColor=vec4(color,max(alpha,inputColor.a)); .fad.fa-inverse { color: #fff; -}`;function bLe(){var n=Lee,e=Nee,t=Bm.familyPrefix,r=Bm.replacementClass,s=yLe;if(t!==n||r!==e){var o=new RegExp("\\.".concat(n,"\\-"),"g"),l=new RegExp("\\--".concat(n,"\\-"),"g"),u=new RegExp("\\.".concat(e),"g");s=s.replace(o,".".concat(t,"-")).replace(l,"--".concat(t,"-")).replace(u,".".concat(r))}return s}var TLe=function(){function n(){FOe(this,n),this.definitions={}}return zOe(n,[{key:"add",value:function(){for(var t=this,r=arguments.length,s=new Array(r),o=0;o1&&arguments[1]!==void 0?arguments[1]:{},r=(e||{}).icon?e:M9(e||{}),s=t.mask;return s&&(s=(s||{}).icon?s:M9(s||{})),n(r,Yo({},t,{mask:s}))}}var xLe=new TLe,A9=!1,sB={transform:function(e){return vLe(e)}},$Le=ELe(function(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=e.transform,r=t===void 0?rw:t,s=e.symbol,o=s===void 0?!1:s,l=e.mask,u=l===void 0?null:l,h=e.maskId,f=h===void 0?null:h,g=e.title,y=g===void 0?null:g,b=e.titleId,w=b===void 0?null:b,C=e.classes,M=C===void 0?[]:C,A=e.attributes,k=A===void 0?{}:A,L=e.styles,P=L===void 0?{}:L;if(n){var D=n.prefix,z=n.iconName,U=n.icon;return wLe(Yo({type:"icon"},n),function(){return SLe(),Bm.autoA11y&&(y?k["aria-labelledby"]="".concat(Bm.replacementClass,"-title-").concat(w||kR()):(k["aria-hidden"]="true",k.focusable="false")),mLe({icons:{main:C9(U),mask:u?C9(u.icon):{found:!1,width:null,height:null,icon:{}}},prefix:D,iconName:z,transform:Yo({},rw,r),symbol:o,title:y,maskId:f,titleId:w,extra:{attributes:k,styles:P,classes:M}})})}});function I9(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),t.push.apply(t,r)}return t}function $y(n){for(var e=1;e=0)&&(t[s]=n[s]);return t}function qee(n,e){if(n==null)return{};var t=CLe(n,e),r,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(s=0;s=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function oB(n){return MLe(n)||ALe(n)||ILe(n)||RLe()}function MLe(n){if(Array.isArray(n))return aB(n)}function ALe(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function ILe(n,e){if(n){if(typeof n=="string")return aB(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);if(t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set")return Array.from(n);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return aB(n,e)}}function aB(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=new Array(e);t2&&arguments[2]!==void 0?arguments[2]:{};if(typeof e=="string")return e;var r=(e.children||[]).map(function(h){return Zee(n,h)}),s=Object.keys(e.attributes||{}).reduce(function(h,f){var g=e.attributes[f];switch(f){case"class":h.attrs.className=g,delete e.attributes.class;break;case"style":h.attrs.style=DLe(g);break;default:f.indexOf("aria-")===0||f.indexOf("data-")===0?h.attrs[f.toLowerCase()]=g:h.attrs[Qee(f)]=g}return h},{attrs:{}}),o=t.style,l=o===void 0?{}:o,u=qee(t,LLe);return s.attrs.style=$y($y({},s.attrs.style),l),n.apply(void 0,[e.tag,$y($y({},s.attrs),u)].concat(oB(r)))}var ete=!1;try{ete=!0}catch{}function PLe(){if(!ete&&console&&typeof console.error=="function"){var n;(n=console).error.apply(n,arguments)}}function R9(n){if(n&&OR(n)==="object"&&n.prefix&&n.iconName&&n.icon)return n;if(sB.icon)return sB.icon(n);if(n===null)return null;if(n&&OR(n)==="object"&&n.prefix&&n.iconName)return n;if(Array.isArray(n)&&n.length===2)return{prefix:n[0],iconName:n[1]};if(typeof n=="string")return{prefix:"fas",iconName:n}}function CN(n,e){return Array.isArray(e)&&e.length>0||!Array.isArray(e)&&e?iw({},n,e):{}}var BLe=["forwardedRef"];function g_(n){var e=n.forwardedRef,t=qee(n,BLe),r=t.icon,s=t.mask,o=t.symbol,l=t.className,u=t.title,h=t.titleId,f=t.maskId,g=R9(r),y=CN("classes",[].concat(oB(kLe(t)),oB(l.split(" ")))),b=CN("transform",typeof t.transform=="string"?sB.transform(t.transform):t.transform),w=CN("mask",R9(s)),C=$Le(g,$y($y($y($y({},y),b),w),{},{symbol:o,title:u,titleId:h,maskId:f}));if(!C)return PLe("Could not find icon",g),null;var M=C.abstract,A={ref:e};return Object.keys(t).forEach(function(k){g_.defaultProps.hasOwnProperty(k)||(A[k]=t[k])}),FLe(M[0],A)}g_.displayName="FontAwesomeIcon";g_.propTypes={beat:qt.bool,border:qt.bool,beatFade:qt.bool,bounce:qt.bool,className:qt.string,fade:qt.bool,flash:qt.bool,mask:qt.oneOfType([qt.object,qt.array,qt.string]),maskId:qt.string,fixedWidth:qt.bool,inverse:qt.bool,flip:qt.oneOf([!0,!1,"horizontal","vertical","both"]),icon:qt.oneOfType([qt.object,qt.array,qt.string]),listItem:qt.bool,pull:qt.oneOf(["right","left"]),pulse:qt.bool,rotation:qt.oneOf([0,90,180,270]),shake:qt.bool,size:qt.oneOf(["2xs","xs","sm","lg","xl","2xl","1x","2x","3x","4x","5x","6x","7x","8x","9x","10x"]),spin:qt.bool,spinPulse:qt.bool,spinReverse:qt.bool,symbol:qt.oneOfType([qt.bool,qt.string]),title:qt.string,titleId:qt.string,transform:qt.oneOfType([qt.string,qt.object]),swapOpacity:qt.bool};g_.defaultProps={border:!1,className:"",mask:null,maskId:null,fixedWidth:!1,inverse:!1,flip:!1,icon:null,listItem:!1,pull:null,pulse:!1,rotation:null,size:null,spin:!1,spinPulse:!1,spinReverse:!1,beat:!1,fade:!1,beatFade:!1,bounce:!1,shake:!1,symbol:!1,title:"",titleId:null,transform:null,swapOpacity:!1};var FLe=Zee.bind(null,yt.createElement),tte={};(function(n){Object.defineProperty(n,"__esModule",{value:!0});var e="fas",t="arrow-up",r=448,s=512,o=[],l="f062",u="M34.9 289.5l-22.2-22.2c-9.4-9.4-9.4-24.6 0-33.9L207 39c9.4-9.4 24.6-9.4 33.9 0l194.3 194.3c9.4 9.4 9.4 24.6 0 33.9L413 289.4c-9.5 9.5-25 9.3-34.3-.4L264 168.6V456c0 13.3-10.7 24-24 24h-32c-13.3 0-24-10.7-24-24V168.6L69.2 289.1c-9.3 9.8-24.8 10-34.3.4z";n.definition={prefix:e,iconName:t,icon:[r,s,o,l,u]},n.faArrowUp=n.definition,n.prefix=e,n.iconName=t,n.width=r,n.height=s,n.ligatures=o,n.unicode=l,n.svgPathData=u})(tte);var nte={};(function(n){Object.defineProperty(n,"__esModule",{value:!0});var e="fas",t="arrow-right",r=448,s=512,o=[],l="f061",u="M190.5 66.9l22.2-22.2c9.4-9.4 24.6-9.4 33.9 0L441 239c9.4 9.4 9.4 24.6 0 33.9L246.6 467.3c-9.4 9.4-24.6 9.4-33.9 0l-22.2-22.2c-9.5-9.5-9.3-25 .4-34.3L311.4 296H24c-13.3 0-24-10.7-24-24v-32c0-13.3 10.7-24 24-24h287.4L190.9 101.2c-9.8-9.3-10-24.8-.4-34.3z";n.definition={prefix:e,iconName:t,icon:[r,s,o,l,u]},n.faArrowRight=n.definition,n.prefix=e,n.iconName=t,n.width=r,n.height=s,n.ligatures=o,n.unicode=l,n.svgPathData=u})(nte);var rte={};(function(n){Object.defineProperty(n,"__esModule",{value:!0});var e="fas",t="arrow-down",r=448,s=512,o=[],l="f063",u="M413.1 222.5l22.2 22.2c9.4 9.4 9.4 24.6 0 33.9L241 473c-9.4 9.4-24.6 9.4-33.9 0L12.7 278.6c-9.4-9.4-9.4-24.6 0-33.9l22.2-22.2c9.5-9.5 25-9.3 34.3.4L184 343.4V56c0-13.3 10.7-24 24-24h32c13.3 0 24 10.7 24 24v287.4l114.8-120.5c9.3-9.8 24.8-10 34.3-.4z";n.definition={prefix:e,iconName:t,icon:[r,s,o,l,u]},n.faArrowDown=n.definition,n.prefix=e,n.iconName=t,n.width=r,n.height=s,n.ligatures=o,n.unicode=l,n.svgPathData=u})(rte);var ite={};(function(n){Object.defineProperty(n,"__esModule",{value:!0});var e="fas",t="arrow-left",r=448,s=512,o=[],l="f060",u="M257.5 445.1l-22.2 22.2c-9.4 9.4-24.6 9.4-33.9 0L7 273c-9.4-9.4-9.4-24.6 0-33.9L201.4 44.7c9.4-9.4 24.6-9.4 33.9 0l22.2 22.2c9.5 9.5 9.3 25-.4 34.3L136.6 216H424c13.3 0 24 10.7 24 24v32c0 13.3-10.7 24-24 24H136.6l120.5 114.8c9.8 9.3 10 24.8.4 34.3z";n.definition={prefix:e,iconName:t,icon:[r,s,o,l,u]},n.faArrowLeft=n.definition,n.prefix=e,n.iconName=t,n.width=r,n.height=s,n.ligatures=o,n.unicode=l,n.svgPathData=u})(ite);var zLe=["className","direction","children"];function lB(){return lB=Object.assign?Object.assign.bind():function(n){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function HLe(n,e){if(n==null)return{};var t={},r=Object.keys(n),s,o;for(o=0;o=0)&&(t[s]=n[s]);return t}var GLe=function(e){var t=e.className,r=t===void 0?"":t,s=e.direction,o=s===void 0?"right":s,l=e.children,u=ULe(e,zLe),h="".concat(li,"-button--arrow"),f=function(){if(o==="up")return tte.faArrowUp;if(o==="right")return nte.faArrowRight;if(o==="down")return rte.faArrowDown;if(o==="left")return ite.faArrowLeft}();return yt.createElement(X4,lB({},u,{className:Ps(h,r),icon:yt.createElement(g_,{icon:f})}),l)},ste={};(function(n){Object.defineProperty(n,"__esModule",{value:!0});var e="fas",t="ellipsis-v",r=192,s=512,o=[],l="f142",u="M96 184c39.8 0 72 32.2 72 72s-32.2 72-72 72-72-32.2-72-72 32.2-72 72-72zM24 80c0 39.8 32.2 72 72 72s72-32.2 72-72S135.8 8 96 8 24 40.2 24 80zm0 352c0 39.8 32.2 72 72 72s72-32.2 72-72-32.2-72-72-72-72 32.2-72 72z";n.definition={prefix:e,iconName:t,icon:[r,s,o,l,u]},n.faEllipsisV=n.definition,n.prefix=e,n.iconName=t,n.width=r,n.height=s,n.ligatures=o,n.unicode=l,n.svgPathData=u})(ste);var ote={};(function(n){Object.defineProperty(n,"__esModule",{value:!0});var e="fas",t="paper-plane",r=512,s=512,o=[],l="f1d8",u="M476 3.2L12.5 270.6c-18.1 10.4-15.8 35.6 2.2 43.2L121 358.4l287.3-253.2c5.5-4.9 13.3 2.6 8.6 8.3L176 407v80.5c0 23.6 28.5 32.9 42.5 15.8L282 426l124.6 52.2c14.2 6 30.4-2.9 33-18.2l72-432C515 7.8 493.3-6.8 476 3.2z";n.definition={prefix:e,iconName:t,icon:[r,s,o,l,u]},n.faPaperPlane=n.definition,n.prefix=e,n.iconName=t,n.width=r,n.height=s,n.ligatures=o,n.unicode=l,n.svgPathData=u})(ote);var WLe=["className","children"];function uB(){return uB=Object.assign?Object.assign.bind():function(n){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function jLe(n,e){if(n==null)return{};var t={},r=Object.keys(n),s,o;for(o=0;o=0)&&(t[s]=n[s]);return t}var YLe=function(e){var t=e.className,r=t===void 0?"":t,s=e.children,o=VLe(e,WLe),l="".concat(li,"-button--send");return yt.createElement(X4,uB({},o,{className:Ps(l,r),icon:yt.createElement(g_,{icon:ote.faPaperPlane})}),s)},ate={};(function(n){Object.defineProperty(n,"__esModule",{value:!0});var e="fas",t="paperclip",r=448,s=512,o=[],l="f0c6",u="M43.246 466.142c-58.43-60.289-57.341-157.511 1.386-217.581L254.392 34c44.316-45.332 116.351-45.336 160.671 0 43.89 44.894 43.943 117.329 0 162.276L232.214 383.128c-29.855 30.537-78.633 30.111-107.982-.998-28.275-29.97-27.368-77.473 1.452-106.953l143.743-146.835c6.182-6.314 16.312-6.422 22.626-.241l22.861 22.379c6.315 6.182 6.422 16.312.241 22.626L171.427 319.927c-4.932 5.045-5.236 13.428-.648 18.292 4.372 4.634 11.245 4.711 15.688.165l182.849-186.851c19.613-20.062 19.613-52.725-.011-72.798-19.189-19.627-49.957-19.637-69.154 0L90.39 293.295c-34.763 35.56-35.299 93.12-1.191 128.313 34.01 35.093 88.985 35.137 123.058.286l172.06-175.999c6.177-6.319 16.307-6.433 22.626-.256l22.877 22.364c6.319 6.177 6.434 16.307.256 22.626l-172.06 175.998c-59.576 60.938-155.943 60.216-214.77-.485z";n.definition={prefix:e,iconName:t,icon:[r,s,o,l,u]},n.faPaperclip=n.definition,n.prefix=e,n.iconName=t,n.width=r,n.height=s,n.ligatures=o,n.unicode=l,n.svgPathData=u})(ate);var XLe=["className","children"];function cB(){return cB=Object.assign?Object.assign.bind():function(n){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function JLe(n,e){if(n==null)return{};var t={},r=Object.keys(n),s,o;for(o=0;o=0)&&(t[s]=n[s]);return t}var qLe=function(e){var t=e.className,r=t===void 0?"":t,s=e.children,o=KLe(e,XLe),l="".concat(li,"-button--attachment");return yt.createElement(X4,cB({},o,{className:Ps(l,r),icon:yt.createElement(g_,{icon:ate.faPaperclip})}),s)},QLe=["onClick","children","className"];function hB(){return hB=Object.assign?Object.assign.bind():function(n){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function eNe(n,e){if(n==null)return{};var t={},r=Object.keys(n),s,o;for(o=0;o=0)&&(t[s]=n[s]);return t}var ez=function(e){var t=e.onClick,r=t===void 0?function(){}:t,s=e.children,o=s===void 0?void 0:s,l=e.className,u=ZLe(e,QLe),h="".concat(li,"-conversation-header__back");return yt.createElement("div",hB({},u,{className:Ps(h,l)}),typeof o<"u"?o:yt.createElement(GLe,{direction:"left",onClick:r}))};ez.displayName="ConversationHeader.Back";var tNe=["children","className"];function dB(){return dB=Object.assign?Object.assign.bind():function(n){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function rNe(n,e){if(n==null)return{};var t={},r=Object.keys(n),s,o;for(o=0;o=0)&&(t[s]=n[s]);return t}var tz=function(e){var t=e.children,r=t===void 0?void 0:t,s=e.className,o=nNe(e,tNe),l="".concat(li,"-conversation-header__actions");return yt.createElement("section",dB({},o,{className:Ps(l,s)}),r)};tz.displayName="ConversationHeader.Actions";var iNe=["userName","info","children","className"];function fB(){return fB=Object.assign?Object.assign.bind():function(n){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function oNe(n,e){if(n==null)return{};var t={},r=Object.keys(n),s,o;for(o=0;o=0)&&(t[s]=n[s]);return t}var nz=function(e){var t=e.userName,r=t===void 0?"":t,s=e.info,o=s===void 0?"":s,l=e.children,u=l===void 0?void 0:l,h=e.className,f=sNe(e,iNe),g="".concat(li,"-conversation-header__content");return yt.createElement("div",fB({},f,{className:Ps(g,h)}),typeof u<"u"?u:yt.createElement(yt.Fragment,null,yt.createElement("div",{className:"".concat(li,"-conversation-header__user-name")},r),yt.createElement("div",{className:"".concat(li,"-conversation-header__info")},o)))};nz.displayName="ConversationHeader.Content";var aNe=["children","className"];function pB(){return pB=Object.assign?Object.assign.bind():function(n){for(var e=1;en.length)&&(e=n.length);for(var t=0,r=new Array(e);t=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function pNe(n,e){if(n==null)return{};var t={},r=Object.keys(n),s,o;for(o=0;o=0)&&(t[s]=n[s]);return t}var GC=function(e){var t=e.children,r=t===void 0?void 0:t,s=e.className,o=fNe(e,aNe),l="".concat(li,"-conversation-header"),u=HC(r,[ez,UC,Iee,nz,tz]),h=lNe(u,5),f=h[0],g=h[1],y=h[2],b=h[3],w=h[4];return yt.createElement("div",pB({},o,{className:Ps(l,s)}),f,g&&yt.createElement("div",{className:"".concat(l,"__avatar")},g),!g&&y&&yt.createElement("div",{className:"".concat(l,"__avatar")},y),b,w)};GC.displayName="ConversationHeader";GC.Back=ez;GC.Actions=tz;GC.Content=nz;/*! +}`;function bLe(){var n=Nee,e=Dee,t=Bm.familyPrefix,r=Bm.replacementClass,s=yLe;if(t!==n||r!==e){var o=new RegExp("\\.".concat(n,"\\-"),"g"),l=new RegExp("\\--".concat(n,"\\-"),"g"),u=new RegExp("\\.".concat(e),"g");s=s.replace(o,".".concat(t,"-")).replace(l,"--".concat(t,"-")).replace(u,".".concat(r))}return s}var TLe=function(){function n(){FOe(this,n),this.definitions={}}return zOe(n,[{key:"add",value:function(){for(var t=this,r=arguments.length,s=new Array(r),o=0;o1&&arguments[1]!==void 0?arguments[1]:{},r=(e||{}).icon?e:A9(e||{}),s=t.mask;return s&&(s=(s||{}).icon?s:A9(s||{})),n(r,Yo({},t,{mask:s}))}}var xLe=new TLe,I9=!1,sB={transform:function(e){return vLe(e)}},$Le=ELe(function(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=e.transform,r=t===void 0?rw:t,s=e.symbol,o=s===void 0?!1:s,l=e.mask,u=l===void 0?null:l,h=e.maskId,f=h===void 0?null:h,g=e.title,y=g===void 0?null:g,b=e.titleId,w=b===void 0?null:b,C=e.classes,M=C===void 0?[]:C,A=e.attributes,k=A===void 0?{}:A,L=e.styles,P=L===void 0?{}:L;if(n){var D=n.prefix,z=n.iconName,U=n.icon;return wLe(Yo({type:"icon"},n),function(){return SLe(),Bm.autoA11y&&(y?k["aria-labelledby"]="".concat(Bm.replacementClass,"-title-").concat(w||kR()):(k["aria-hidden"]="true",k.focusable="false")),mLe({icons:{main:M9(U),mask:u?M9(u.icon):{found:!1,width:null,height:null,icon:{}}},prefix:D,iconName:z,transform:Yo({},rw,r),symbol:o,title:y,maskId:f,titleId:w,extra:{attributes:k,styles:P,classes:M}})})}});function R9(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),t.push.apply(t,r)}return t}function $y(n){for(var e=1;e=0)&&(t[s]=n[s]);return t}function Qee(n,e){if(n==null)return{};var t=CLe(n,e),r,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(s=0;s=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function oB(n){return MLe(n)||ALe(n)||ILe(n)||RLe()}function MLe(n){if(Array.isArray(n))return aB(n)}function ALe(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function ILe(n,e){if(n){if(typeof n=="string")return aB(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);if(t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set")return Array.from(n);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return aB(n,e)}}function aB(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=new Array(e);t2&&arguments[2]!==void 0?arguments[2]:{};if(typeof e=="string")return e;var r=(e.children||[]).map(function(h){return ete(n,h)}),s=Object.keys(e.attributes||{}).reduce(function(h,f){var g=e.attributes[f];switch(f){case"class":h.attrs.className=g,delete e.attributes.class;break;case"style":h.attrs.style=DLe(g);break;default:f.indexOf("aria-")===0||f.indexOf("data-")===0?h.attrs[f.toLowerCase()]=g:h.attrs[Zee(f)]=g}return h},{attrs:{}}),o=t.style,l=o===void 0?{}:o,u=Qee(t,LLe);return s.attrs.style=$y($y({},s.attrs.style),l),n.apply(void 0,[e.tag,$y($y({},s.attrs),u)].concat(oB(r)))}var tte=!1;try{tte=!0}catch{}function PLe(){if(!tte&&console&&typeof console.error=="function"){var n;(n=console).error.apply(n,arguments)}}function k9(n){if(n&&OR(n)==="object"&&n.prefix&&n.iconName&&n.icon)return n;if(sB.icon)return sB.icon(n);if(n===null)return null;if(n&&OR(n)==="object"&&n.prefix&&n.iconName)return n;if(Array.isArray(n)&&n.length===2)return{prefix:n[0],iconName:n[1]};if(typeof n=="string")return{prefix:"fas",iconName:n}}function CN(n,e){return Array.isArray(e)&&e.length>0||!Array.isArray(e)&&e?iw({},n,e):{}}var BLe=["forwardedRef"];function g_(n){var e=n.forwardedRef,t=Qee(n,BLe),r=t.icon,s=t.mask,o=t.symbol,l=t.className,u=t.title,h=t.titleId,f=t.maskId,g=k9(r),y=CN("classes",[].concat(oB(kLe(t)),oB(l.split(" ")))),b=CN("transform",typeof t.transform=="string"?sB.transform(t.transform):t.transform),w=CN("mask",k9(s)),C=$Le(g,$y($y($y($y({},y),b),w),{},{symbol:o,title:u,titleId:h,maskId:f}));if(!C)return PLe("Could not find icon",g),null;var M=C.abstract,A={ref:e};return Object.keys(t).forEach(function(k){g_.defaultProps.hasOwnProperty(k)||(A[k]=t[k])}),FLe(M[0],A)}g_.displayName="FontAwesomeIcon";g_.propTypes={beat:Qt.bool,border:Qt.bool,beatFade:Qt.bool,bounce:Qt.bool,className:Qt.string,fade:Qt.bool,flash:Qt.bool,mask:Qt.oneOfType([Qt.object,Qt.array,Qt.string]),maskId:Qt.string,fixedWidth:Qt.bool,inverse:Qt.bool,flip:Qt.oneOf([!0,!1,"horizontal","vertical","both"]),icon:Qt.oneOfType([Qt.object,Qt.array,Qt.string]),listItem:Qt.bool,pull:Qt.oneOf(["right","left"]),pulse:Qt.bool,rotation:Qt.oneOf([0,90,180,270]),shake:Qt.bool,size:Qt.oneOf(["2xs","xs","sm","lg","xl","2xl","1x","2x","3x","4x","5x","6x","7x","8x","9x","10x"]),spin:Qt.bool,spinPulse:Qt.bool,spinReverse:Qt.bool,symbol:Qt.oneOfType([Qt.bool,Qt.string]),title:Qt.string,titleId:Qt.string,transform:Qt.oneOfType([Qt.string,Qt.object]),swapOpacity:Qt.bool};g_.defaultProps={border:!1,className:"",mask:null,maskId:null,fixedWidth:!1,inverse:!1,flip:!1,icon:null,listItem:!1,pull:null,pulse:!1,rotation:null,size:null,spin:!1,spinPulse:!1,spinReverse:!1,beat:!1,fade:!1,beatFade:!1,bounce:!1,shake:!1,symbol:!1,title:"",titleId:null,transform:null,swapOpacity:!1};var FLe=ete.bind(null,yt.createElement),nte={};(function(n){Object.defineProperty(n,"__esModule",{value:!0});var e="fas",t="arrow-up",r=448,s=512,o=[],l="f062",u="M34.9 289.5l-22.2-22.2c-9.4-9.4-9.4-24.6 0-33.9L207 39c9.4-9.4 24.6-9.4 33.9 0l194.3 194.3c9.4 9.4 9.4 24.6 0 33.9L413 289.4c-9.5 9.5-25 9.3-34.3-.4L264 168.6V456c0 13.3-10.7 24-24 24h-32c-13.3 0-24-10.7-24-24V168.6L69.2 289.1c-9.3 9.8-24.8 10-34.3.4z";n.definition={prefix:e,iconName:t,icon:[r,s,o,l,u]},n.faArrowUp=n.definition,n.prefix=e,n.iconName=t,n.width=r,n.height=s,n.ligatures=o,n.unicode=l,n.svgPathData=u})(nte);var rte={};(function(n){Object.defineProperty(n,"__esModule",{value:!0});var e="fas",t="arrow-right",r=448,s=512,o=[],l="f061",u="M190.5 66.9l22.2-22.2c9.4-9.4 24.6-9.4 33.9 0L441 239c9.4 9.4 9.4 24.6 0 33.9L246.6 467.3c-9.4 9.4-24.6 9.4-33.9 0l-22.2-22.2c-9.5-9.5-9.3-25 .4-34.3L311.4 296H24c-13.3 0-24-10.7-24-24v-32c0-13.3 10.7-24 24-24h287.4L190.9 101.2c-9.8-9.3-10-24.8-.4-34.3z";n.definition={prefix:e,iconName:t,icon:[r,s,o,l,u]},n.faArrowRight=n.definition,n.prefix=e,n.iconName=t,n.width=r,n.height=s,n.ligatures=o,n.unicode=l,n.svgPathData=u})(rte);var ite={};(function(n){Object.defineProperty(n,"__esModule",{value:!0});var e="fas",t="arrow-down",r=448,s=512,o=[],l="f063",u="M413.1 222.5l22.2 22.2c9.4 9.4 9.4 24.6 0 33.9L241 473c-9.4 9.4-24.6 9.4-33.9 0L12.7 278.6c-9.4-9.4-9.4-24.6 0-33.9l22.2-22.2c9.5-9.5 25-9.3 34.3.4L184 343.4V56c0-13.3 10.7-24 24-24h32c13.3 0 24 10.7 24 24v287.4l114.8-120.5c9.3-9.8 24.8-10 34.3-.4z";n.definition={prefix:e,iconName:t,icon:[r,s,o,l,u]},n.faArrowDown=n.definition,n.prefix=e,n.iconName=t,n.width=r,n.height=s,n.ligatures=o,n.unicode=l,n.svgPathData=u})(ite);var ste={};(function(n){Object.defineProperty(n,"__esModule",{value:!0});var e="fas",t="arrow-left",r=448,s=512,o=[],l="f060",u="M257.5 445.1l-22.2 22.2c-9.4 9.4-24.6 9.4-33.9 0L7 273c-9.4-9.4-9.4-24.6 0-33.9L201.4 44.7c9.4-9.4 24.6-9.4 33.9 0l22.2 22.2c9.5 9.5 9.3 25-.4 34.3L136.6 216H424c13.3 0 24 10.7 24 24v32c0 13.3-10.7 24-24 24H136.6l120.5 114.8c9.8 9.3 10 24.8.4 34.3z";n.definition={prefix:e,iconName:t,icon:[r,s,o,l,u]},n.faArrowLeft=n.definition,n.prefix=e,n.iconName=t,n.width=r,n.height=s,n.ligatures=o,n.unicode=l,n.svgPathData=u})(ste);var zLe=["className","direction","children"];function lB(){return lB=Object.assign?Object.assign.bind():function(n){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function HLe(n,e){if(n==null)return{};var t={},r=Object.keys(n),s,o;for(o=0;o=0)&&(t[s]=n[s]);return t}var GLe=function(e){var t=e.className,r=t===void 0?"":t,s=e.direction,o=s===void 0?"right":s,l=e.children,u=ULe(e,zLe),h="".concat(li,"-button--arrow"),f=function(){if(o==="up")return nte.faArrowUp;if(o==="right")return rte.faArrowRight;if(o==="down")return ite.faArrowDown;if(o==="left")return ste.faArrowLeft}();return yt.createElement(X4,lB({},u,{className:Ps(h,r),icon:yt.createElement(g_,{icon:f})}),l)},ote={};(function(n){Object.defineProperty(n,"__esModule",{value:!0});var e="fas",t="ellipsis-v",r=192,s=512,o=[],l="f142",u="M96 184c39.8 0 72 32.2 72 72s-32.2 72-72 72-72-32.2-72-72 32.2-72 72-72zM24 80c0 39.8 32.2 72 72 72s72-32.2 72-72S135.8 8 96 8 24 40.2 24 80zm0 352c0 39.8 32.2 72 72 72s72-32.2 72-72-32.2-72-72-72-72 32.2-72 72z";n.definition={prefix:e,iconName:t,icon:[r,s,o,l,u]},n.faEllipsisV=n.definition,n.prefix=e,n.iconName=t,n.width=r,n.height=s,n.ligatures=o,n.unicode=l,n.svgPathData=u})(ote);var ate={};(function(n){Object.defineProperty(n,"__esModule",{value:!0});var e="fas",t="paper-plane",r=512,s=512,o=[],l="f1d8",u="M476 3.2L12.5 270.6c-18.1 10.4-15.8 35.6 2.2 43.2L121 358.4l287.3-253.2c5.5-4.9 13.3 2.6 8.6 8.3L176 407v80.5c0 23.6 28.5 32.9 42.5 15.8L282 426l124.6 52.2c14.2 6 30.4-2.9 33-18.2l72-432C515 7.8 493.3-6.8 476 3.2z";n.definition={prefix:e,iconName:t,icon:[r,s,o,l,u]},n.faPaperPlane=n.definition,n.prefix=e,n.iconName=t,n.width=r,n.height=s,n.ligatures=o,n.unicode=l,n.svgPathData=u})(ate);var WLe=["className","children"];function uB(){return uB=Object.assign?Object.assign.bind():function(n){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function jLe(n,e){if(n==null)return{};var t={},r=Object.keys(n),s,o;for(o=0;o=0)&&(t[s]=n[s]);return t}var YLe=function(e){var t=e.className,r=t===void 0?"":t,s=e.children,o=VLe(e,WLe),l="".concat(li,"-button--send");return yt.createElement(X4,uB({},o,{className:Ps(l,r),icon:yt.createElement(g_,{icon:ate.faPaperPlane})}),s)},lte={};(function(n){Object.defineProperty(n,"__esModule",{value:!0});var e="fas",t="paperclip",r=448,s=512,o=[],l="f0c6",u="M43.246 466.142c-58.43-60.289-57.341-157.511 1.386-217.581L254.392 34c44.316-45.332 116.351-45.336 160.671 0 43.89 44.894 43.943 117.329 0 162.276L232.214 383.128c-29.855 30.537-78.633 30.111-107.982-.998-28.275-29.97-27.368-77.473 1.452-106.953l143.743-146.835c6.182-6.314 16.312-6.422 22.626-.241l22.861 22.379c6.315 6.182 6.422 16.312.241 22.626L171.427 319.927c-4.932 5.045-5.236 13.428-.648 18.292 4.372 4.634 11.245 4.711 15.688.165l182.849-186.851c19.613-20.062 19.613-52.725-.011-72.798-19.189-19.627-49.957-19.637-69.154 0L90.39 293.295c-34.763 35.56-35.299 93.12-1.191 128.313 34.01 35.093 88.985 35.137 123.058.286l172.06-175.999c6.177-6.319 16.307-6.433 22.626-.256l22.877 22.364c6.319 6.177 6.434 16.307.256 22.626l-172.06 175.998c-59.576 60.938-155.943 60.216-214.77-.485z";n.definition={prefix:e,iconName:t,icon:[r,s,o,l,u]},n.faPaperclip=n.definition,n.prefix=e,n.iconName=t,n.width=r,n.height=s,n.ligatures=o,n.unicode=l,n.svgPathData=u})(lte);var XLe=["className","children"];function cB(){return cB=Object.assign?Object.assign.bind():function(n){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function JLe(n,e){if(n==null)return{};var t={},r=Object.keys(n),s,o;for(o=0;o=0)&&(t[s]=n[s]);return t}var qLe=function(e){var t=e.className,r=t===void 0?"":t,s=e.children,o=KLe(e,XLe),l="".concat(li,"-button--attachment");return yt.createElement(X4,cB({},o,{className:Ps(l,r),icon:yt.createElement(g_,{icon:lte.faPaperclip})}),s)},QLe=["onClick","children","className"];function hB(){return hB=Object.assign?Object.assign.bind():function(n){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function eNe(n,e){if(n==null)return{};var t={},r=Object.keys(n),s,o;for(o=0;o=0)&&(t[s]=n[s]);return t}var ez=function(e){var t=e.onClick,r=t===void 0?function(){}:t,s=e.children,o=s===void 0?void 0:s,l=e.className,u=ZLe(e,QLe),h="".concat(li,"-conversation-header__back");return yt.createElement("div",hB({},u,{className:Ps(h,l)}),typeof o<"u"?o:yt.createElement(GLe,{direction:"left",onClick:r}))};ez.displayName="ConversationHeader.Back";var tNe=["children","className"];function dB(){return dB=Object.assign?Object.assign.bind():function(n){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function rNe(n,e){if(n==null)return{};var t={},r=Object.keys(n),s,o;for(o=0;o=0)&&(t[s]=n[s]);return t}var tz=function(e){var t=e.children,r=t===void 0?void 0:t,s=e.className,o=nNe(e,tNe),l="".concat(li,"-conversation-header__actions");return yt.createElement("section",dB({},o,{className:Ps(l,s)}),r)};tz.displayName="ConversationHeader.Actions";var iNe=["userName","info","children","className"];function fB(){return fB=Object.assign?Object.assign.bind():function(n){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function oNe(n,e){if(n==null)return{};var t={},r=Object.keys(n),s,o;for(o=0;o=0)&&(t[s]=n[s]);return t}var nz=function(e){var t=e.userName,r=t===void 0?"":t,s=e.info,o=s===void 0?"":s,l=e.children,u=l===void 0?void 0:l,h=e.className,f=sNe(e,iNe),g="".concat(li,"-conversation-header__content");return yt.createElement("div",fB({},f,{className:Ps(g,h)}),typeof u<"u"?u:yt.createElement(yt.Fragment,null,yt.createElement("div",{className:"".concat(li,"-conversation-header__user-name")},r),yt.createElement("div",{className:"".concat(li,"-conversation-header__info")},o)))};nz.displayName="ConversationHeader.Content";var aNe=["children","className"];function pB(){return pB=Object.assign?Object.assign.bind():function(n){for(var e=1;en.length)&&(e=n.length);for(var t=0,r=new Array(e);t=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function pNe(n,e){if(n==null)return{};var t={},r=Object.keys(n),s,o;for(o=0;o=0)&&(t[s]=n[s]);return t}var GC=function(e){var t=e.children,r=t===void 0?void 0:t,s=e.className,o=fNe(e,aNe),l="".concat(li,"-conversation-header"),u=HC(r,[ez,UC,Ree,nz,tz]),h=lNe(u,5),f=h[0],g=h[1],y=h[2],b=h[3],w=h[4];return yt.createElement("div",pB({},o,{className:Ps(l,s)}),f,g&&yt.createElement("div",{className:"".concat(l,"__avatar")},g),!g&&y&&yt.createElement("div",{className:"".concat(l,"__avatar")},y),b,w)};GC.displayName="ConversationHeader";GC.Back=ez;GC.Actions=tz;GC.Content=nz;/*! * perfect-scrollbar v1.5.0 * Copyright 2020 Hyunje Jun, MDBootstrap and Contributors * Licensed under MIT - */function s_(n){return getComputedStyle(n)}function Wp(n,e){for(var t in e){var r=e[t];typeof r=="number"&&(r=r+"px"),n.style[t]=r}return n}function WA(n){var e=document.createElement("div");return e.className=n,e}var O9=typeof Element<"u"&&(Element.prototype.matches||Element.prototype.webkitMatchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector);function Cy(n,e){if(!O9)throw new Error("No element matching method supported");return O9.call(n,e)}function sw(n){n.remove?n.remove():n.parentNode&&n.parentNode.removeChild(n)}function L9(n,e){return Array.prototype.filter.call(n.children,function(t){return Cy(t,e)})}var Lh={main:"ps",rtl:"ps__rtl",element:{thumb:function(e){return"ps__thumb-"+e},rail:function(e){return"ps__rail-"+e},consuming:"ps__child--consume"},state:{focus:"ps--focus",clicking:"ps--clicking",active:function(e){return"ps--active-"+e},scrolling:function(e){return"ps--scrolling-"+e}}},lte={x:null,y:null};function ute(n,e){var t=n.element.classList,r=Lh.state.scrolling(e);t.contains(r)?clearTimeout(lte[e]):t.add(r)}function cte(n,e){lte[e]=setTimeout(function(){return n.isAlive&&n.element.classList.remove(Lh.state.scrolling(e))},n.settings.scrollingThreshold)}function mNe(n,e){ute(n,e),cte(n,e)}var WC=function(e){this.element=e,this.handlers={}},hte={isEmpty:{configurable:!0}};WC.prototype.bind=function(e,t){typeof this.handlers[e]>"u"&&(this.handlers[e]=[]),this.handlers[e].push(t);var r=["touchstart","wheel","touchmove"];r.indexOf(e)!==-1?this.element.addEventListener(e,t,{passive:!1}):this.element.addEventListener(e,t,!1)};WC.prototype.unbind=function(e,t){var r=this;this.handlers[e]=this.handlers[e].filter(function(s){return t&&s!==t?!0:(r.element.removeEventListener(e,s,!1),!1)})};WC.prototype.unbindAll=function(){for(var e in this.handlers)this.unbind(e)};hte.isEmpty.get=function(){var n=this;return Object.keys(this.handlers).every(function(e){return n.handlers[e].length===0})};Object.defineProperties(WC.prototype,hte);var vE=function(){this.eventElements=[]};vE.prototype.eventElement=function(e){var t=this.eventElements.filter(function(r){return r.element===e})[0];return t||(t=new WC(e),this.eventElements.push(t)),t};vE.prototype.bind=function(e,t,r){this.eventElement(e).bind(t,r)};vE.prototype.unbind=function(e,t,r){var s=this.eventElement(e);s.unbind(t,r),s.isEmpty&&this.eventElements.splice(this.eventElements.indexOf(s),1)};vE.prototype.unbindAll=function(){this.eventElements.forEach(function(e){return e.unbindAll()}),this.eventElements=[]};vE.prototype.once=function(e,t,r){var s=this.eventElement(e),o=function l(u){s.unbind(t,l),r(u)};s.bind(t,o)};function VA(n){if(typeof window.CustomEvent=="function")return new CustomEvent(n);var e=document.createEvent("CustomEvent");return e.initCustomEvent(n,!1,!1,void 0),e}function LR(n,e,t,r,s,o){r===void 0&&(r=!0),s===void 0&&(s=!1);var l;if(e==="top")l=["contentHeight","containerHeight","scrollTop","y","up","down"];else if(e==="left")l=["contentWidth","containerWidth","scrollLeft","x","left","right"];else throw new Error("A proper axis should be provided");gNe(n,t,l,r,s,o)}function gNe(n,e,t,r,s,o){var l=t[0],u=t[1],h=t[2],f=t[3],g=t[4],y=t[5];r===void 0&&(r=!0),s===void 0&&(s=!1);var b=n.element;n.reach[f]=null;var w=o===!0?n[l]!==n[u]:!0;w&&b[h]<1&&(n.reach[f]="start"),w&&b[h]>n[l]-n[u]-1&&(n.reach[f]="end"),e&&(b.dispatchEvent(VA("ps-scroll-"+f)),e<0?b.dispatchEvent(VA("ps-scroll-"+g)):e>0&&b.dispatchEvent(VA("ps-scroll-"+y)),r&&mNe(n,f)),n.reach[f]&&(e||s)&&b.dispatchEvent(VA("ps-"+f+"-reach-"+n.reach[f]))}function ic(n){return parseInt(n,10)||0}function _Ne(n){return Cy(n,"input,[contenteditable]")||Cy(n,"select,[contenteditable]")||Cy(n,"textarea,[contenteditable]")||Cy(n,"button,[contenteditable]")}function vNe(n){var e=s_(n);return ic(e.width)+ic(e.paddingLeft)+ic(e.paddingRight)+ic(e.borderLeftWidth)+ic(e.borderRightWidth)}var Bx={isWebKit:typeof document<"u"&&"WebkitAppearance"in document.documentElement.style,supportsTouch:typeof window<"u"&&("ontouchstart"in window||"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>0||window.DocumentTouch&&document instanceof window.DocumentTouch),supportsIePointer:typeof navigator<"u"&&navigator.msMaxTouchPoints,isChrome:typeof navigator<"u"&&/Chrome/i.test(navigator&&navigator.userAgent)};function wv(n){var e=n.element,t=Math.floor(e.scrollTop),r=e.getBoundingClientRect();n.containerWidth=Math.round(r.width),n.containerHeight=Math.round(r.height),n.contentWidth=e.scrollWidth,n.contentHeight=e.scrollHeight,e.contains(n.scrollbarXRail)||(L9(e,Lh.element.rail("x")).forEach(function(s){return sw(s)}),e.appendChild(n.scrollbarXRail)),e.contains(n.scrollbarYRail)||(L9(e,Lh.element.rail("y")).forEach(function(s){return sw(s)}),e.appendChild(n.scrollbarYRail)),!n.settings.suppressScrollX&&n.containerWidth+n.settings.scrollXMarginOffset=n.railXWidth-n.scrollbarXWidth&&(n.scrollbarXLeft=n.railXWidth-n.scrollbarXWidth),n.scrollbarYTop>=n.railYHeight-n.scrollbarYHeight&&(n.scrollbarYTop=n.railYHeight-n.scrollbarYHeight),yNe(e,n),n.scrollbarXActive?e.classList.add(Lh.state.active("x")):(e.classList.remove(Lh.state.active("x")),n.scrollbarXWidth=0,n.scrollbarXLeft=0,e.scrollLeft=n.isRtl===!0?n.contentWidth:0),n.scrollbarYActive?e.classList.add(Lh.state.active("y")):(e.classList.remove(Lh.state.active("y")),n.scrollbarYHeight=0,n.scrollbarYTop=0,e.scrollTop=0)}function N9(n,e){return n.settings.minScrollbarLength&&(e=Math.max(e,n.settings.minScrollbarLength)),n.settings.maxScrollbarLength&&(e=Math.min(e,n.settings.maxScrollbarLength)),e}function yNe(n,e){var t={width:e.railXWidth},r=Math.floor(n.scrollTop);e.isRtl?t.left=e.negativeScrollAdjustment+n.scrollLeft+e.containerWidth-e.contentWidth:t.left=n.scrollLeft,e.isScrollbarXUsingBottom?t.bottom=e.scrollbarXBottom-r:t.top=e.scrollbarXTop+r,Wp(e.scrollbarXRail,t);var s={top:r,height:e.railYHeight};e.isScrollbarYUsingRight?e.isRtl?s.right=e.contentWidth-(e.negativeScrollAdjustment+n.scrollLeft)-e.scrollbarYRight-e.scrollbarYOuterWidth-9:s.right=e.scrollbarYRight-n.scrollLeft:e.isRtl?s.left=e.negativeScrollAdjustment+n.scrollLeft+e.containerWidth*2-e.contentWidth-e.scrollbarYLeft-e.scrollbarYOuterWidth:s.left=e.scrollbarYLeft+n.scrollLeft,Wp(e.scrollbarYRail,s),Wp(e.scrollbarX,{left:e.scrollbarXLeft,width:e.scrollbarXWidth-e.railBorderXWidth}),Wp(e.scrollbarY,{top:e.scrollbarYTop,height:e.scrollbarYHeight-e.railBorderYWidth})}function bNe(n){n.element,n.event.bind(n.scrollbarY,"mousedown",function(e){return e.stopPropagation()}),n.event.bind(n.scrollbarYRail,"mousedown",function(e){var t=e.pageY-window.pageYOffset-n.scrollbarYRail.getBoundingClientRect().top,r=t>n.scrollbarYTop?1:-1;n.element.scrollTop+=r*n.containerHeight,wv(n),e.stopPropagation()}),n.event.bind(n.scrollbarX,"mousedown",function(e){return e.stopPropagation()}),n.event.bind(n.scrollbarXRail,"mousedown",function(e){var t=e.pageX-window.pageXOffset-n.scrollbarXRail.getBoundingClientRect().left,r=t>n.scrollbarXLeft?1:-1;n.element.scrollLeft+=r*n.containerWidth,wv(n),e.stopPropagation()})}function TNe(n){D9(n,["containerWidth","contentWidth","pageX","railXWidth","scrollbarX","scrollbarXWidth","scrollLeft","x","scrollbarXRail"]),D9(n,["containerHeight","contentHeight","pageY","railYHeight","scrollbarY","scrollbarYHeight","scrollTop","y","scrollbarYRail"])}function D9(n,e){var t=e[0],r=e[1],s=e[2],o=e[3],l=e[4],u=e[5],h=e[6],f=e[7],g=e[8],y=n.element,b=null,w=null,C=null;function M(L){L.touches&&L.touches[0]&&(L[s]=L.touches[0].pageY),y[h]=b+C*(L[s]-w),ute(n,f),wv(n),L.stopPropagation(),L.preventDefault()}function A(){cte(n,f),n[g].classList.remove(Lh.state.clicking),n.event.unbind(n.ownerDocument,"mousemove",M)}function k(L,P){b=y[h],P&&L.touches&&(L[s]=L.touches[0].pageY),w=L[s],C=(n[r]-n[t])/(n[o]-n[u]),P?n.event.bind(n.ownerDocument,"touchmove",M):(n.event.bind(n.ownerDocument,"mousemove",M),n.event.once(n.ownerDocument,"mouseup",A),L.preventDefault()),n[g].classList.add(Lh.state.clicking),L.stopPropagation()}n.event.bind(n[l],"mousedown",function(L){k(L)}),n.event.bind(n[l],"touchstart",function(L){k(L,!0)})}function SNe(n){var e=n.element,t=function(){return Cy(e,":hover")},r=function(){return Cy(n.scrollbarX,":focus")||Cy(n.scrollbarY,":focus")};function s(o,l){var u=Math.floor(e.scrollTop);if(o===0){if(!n.scrollbarYActive)return!1;if(u===0&&l>0||u>=n.contentHeight-n.containerHeight&&l<0)return!n.settings.wheelPropagation}var h=e.scrollLeft;if(l===0){if(!n.scrollbarXActive)return!1;if(h===0&&o<0||h>=n.contentWidth-n.containerWidth&&o>0)return!n.settings.wheelPropagation}return!0}n.event.bind(n.ownerDocument,"keydown",function(o){if(!(o.isDefaultPrevented&&o.isDefaultPrevented()||o.defaultPrevented)&&!(!t()&&!r())){var l=document.activeElement?document.activeElement:n.ownerDocument.activeElement;if(l){if(l.tagName==="IFRAME")l=l.contentDocument.activeElement;else for(;l.shadowRoot;)l=l.shadowRoot.activeElement;if(_Ne(l))return}var u=0,h=0;switch(o.which){case 37:o.metaKey?u=-n.contentWidth:o.altKey?u=-n.containerWidth:u=-30;break;case 38:o.metaKey?h=n.contentHeight:o.altKey?h=n.containerHeight:h=30;break;case 39:o.metaKey?u=n.contentWidth:o.altKey?u=n.containerWidth:u=30;break;case 40:o.metaKey?h=-n.contentHeight:o.altKey?h=-n.containerHeight:h=-30;break;case 32:o.shiftKey?h=n.containerHeight:h=-n.containerHeight;break;case 33:h=n.containerHeight;break;case 34:h=-n.containerHeight;break;case 36:h=n.contentHeight;break;case 35:h=-n.contentHeight;break;default:return}n.settings.suppressScrollX&&u!==0||n.settings.suppressScrollY&&h!==0||(e.scrollTop-=h,e.scrollLeft+=u,wv(n),s(u,h)&&o.preventDefault())}})}function wNe(n){var e=n.element;function t(l,u){var h=Math.floor(e.scrollTop),f=e.scrollTop===0,g=h+e.offsetHeight===e.scrollHeight,y=e.scrollLeft===0,b=e.scrollLeft+e.offsetWidth===e.scrollWidth,w;return Math.abs(u)>Math.abs(l)?w=f||g:w=y||b,w?!n.settings.wheelPropagation:!0}function r(l){var u=l.deltaX,h=-1*l.deltaY;return(typeof u>"u"||typeof h>"u")&&(u=-1*l.wheelDeltaX/6,h=l.wheelDeltaY/6),l.deltaMode&&l.deltaMode===1&&(u*=10,h*=10),u!==u&&h!==h&&(u=0,h=l.wheelDelta),l.shiftKey?[-h,-u]:[u,h]}function s(l,u,h){if(!Bx.isWebKit&&e.querySelector("select:focus"))return!0;if(!e.contains(l))return!1;for(var f=l;f&&f!==e;){if(f.classList.contains(Lh.element.consuming))return!0;var g=s_(f);if(h&&g.overflowY.match(/(scroll|auto)/)){var y=f.scrollHeight-f.clientHeight;if(y>0&&(f.scrollTop>0&&h<0||f.scrollTop0))return!0}if(u&&g.overflowX.match(/(scroll|auto)/)){var b=f.scrollWidth-f.clientWidth;if(b>0&&(f.scrollLeft>0&&u<0||f.scrollLeft0))return!0}f=f.parentNode}return!1}function o(l){var u=r(l),h=u[0],f=u[1];if(!s(l.target,h,f)){var g=!1;n.settings.useBothWheelAxes?n.scrollbarYActive&&!n.scrollbarXActive?(f?e.scrollTop-=f*n.settings.wheelSpeed:e.scrollTop+=h*n.settings.wheelSpeed,g=!0):n.scrollbarXActive&&!n.scrollbarYActive&&(h?e.scrollLeft+=h*n.settings.wheelSpeed:e.scrollLeft-=f*n.settings.wheelSpeed,g=!0):(e.scrollTop-=f*n.settings.wheelSpeed,e.scrollLeft+=h*n.settings.wheelSpeed),wv(n),g=g||t(h,f),g&&!l.ctrlKey&&(l.stopPropagation(),l.preventDefault())}}typeof window.onwheel<"u"?n.event.bind(e,"wheel",o):typeof window.onmousewheel<"u"&&n.event.bind(e,"mousewheel",o)}function ENe(n){if(!Bx.supportsTouch&&!Bx.supportsIePointer)return;var e=n.element;function t(C,M){var A=Math.floor(e.scrollTop),k=Math.ceil(e.scrollLeft),L=Math.abs(C),P=Math.abs(M);if(!n.settings.wheelPropagation)return!0;if(P>L){if(n.settings.suppressScrollY)return!1;if(M>0)return A!==0;if(M<0)return AP){if(n.settings.suppressScrollX)return!1;if(C>0)return k!==0;if(M<0)return k0&&(k.scrollTop>0&&A<0||k.scrollTop0))return!0}if(M&&L.overflowX.match(/(scroll|auto)/)){var D=k.scrollWidth-k.clientWidth;if(D>0&&(k.scrollLeft>0&&M<0||k.scrollLeft0))return!0}k=k.parentNode}return!1}function b(C){if(f(C)){var M=h(C),A={pageX:M.pageX,pageY:M.pageY},k=A.pageX-s.pageX,L=A.pageY-s.pageY;if(y(C.target,k,L))return;r(k,L),s=A;var P=new Date().getTime(),D=P-o;D>0&&(l.x=k/D,l.y=L/D,o=P),C.cancelable&&t(k,L)&&C.preventDefault()}}function w(){n.settings.swipeEasing&&(clearInterval(u),u=setInterval(function(){if(n.isInitialized){clearInterval(u);return}if(!l.x&&!l.y){clearInterval(u);return}if(Math.abs(l.x)<.01&&Math.abs(l.y)<.01){clearInterval(u);return}r(l.x*30,l.y*30),l.x*=.8,l.y*=.8},10))}Bx.supportsTouch?(n.event.bind(e,"touchstart",g),n.event.bind(e,"touchmove",b),n.event.bind(e,"touchend",w)):Bx.supportsIePointer&&(window.PointerEvent?(n.event.bind(e,"pointerdown",g),n.event.bind(e,"pointermove",b),n.event.bind(e,"pointerup",w)):window.MSPointerEvent&&(n.event.bind(e,"MSPointerDown",g),n.event.bind(e,"MSPointerMove",b),n.event.bind(e,"MSPointerUp",w)))}var xNe=function(){return{handlers:["click-rail","drag-thumb","keyboard","wheel","touch"],maxScrollbarLength:null,minScrollbarLength:null,scrollingThreshold:1e3,scrollXMarginOffset:0,scrollYMarginOffset:0,suppressScrollX:!1,suppressScrollY:!1,swipeEasing:!0,useBothWheelAxes:!1,wheelPropagation:!0,wheelSpeed:1}},$Ne={"click-rail":bNe,"drag-thumb":TNe,keyboard:SNe,wheel:wNe,touch:ENe},VC=function(e,t){var r=this;if(t===void 0&&(t={}),typeof e=="string"&&(e=document.querySelector(e)),!e||!e.nodeName)throw new Error("no element is specified to initialize PerfectScrollbar");this.element=e,e.classList.add(Lh.main),this.settings=xNe();for(var s in t)this.settings[s]=t[s];this.containerWidth=null,this.containerHeight=null,this.contentWidth=null,this.contentHeight=null;var o=function(){return e.classList.add(Lh.state.focus)},l=function(){return e.classList.remove(Lh.state.focus)};this.isRtl=s_(e).direction==="rtl",this.isRtl===!0&&e.classList.add(Lh.rtl),this.isNegativeScroll=function(){var f=e.scrollLeft,g=null;return e.scrollLeft=-1,g=e.scrollLeft<0,e.scrollLeft=f,g}(),this.negativeScrollAdjustment=this.isNegativeScroll?e.scrollWidth-e.clientWidth:0,this.event=new vE,this.ownerDocument=e.ownerDocument||document,this.scrollbarXRail=WA(Lh.element.rail("x")),e.appendChild(this.scrollbarXRail),this.scrollbarX=WA(Lh.element.thumb("x")),this.scrollbarXRail.appendChild(this.scrollbarX),this.scrollbarX.setAttribute("tabindex",0),this.event.bind(this.scrollbarX,"focus",o),this.event.bind(this.scrollbarX,"blur",l),this.scrollbarXActive=null,this.scrollbarXWidth=null,this.scrollbarXLeft=null;var u=s_(this.scrollbarXRail);this.scrollbarXBottom=parseInt(u.bottom,10),isNaN(this.scrollbarXBottom)?(this.isScrollbarXUsingBottom=!1,this.scrollbarXTop=ic(u.top)):this.isScrollbarXUsingBottom=!0,this.railBorderXWidth=ic(u.borderLeftWidth)+ic(u.borderRightWidth),Wp(this.scrollbarXRail,{display:"block"}),this.railXMarginWidth=ic(u.marginLeft)+ic(u.marginRight),Wp(this.scrollbarXRail,{display:""}),this.railXWidth=null,this.railXRatio=null,this.scrollbarYRail=WA(Lh.element.rail("y")),e.appendChild(this.scrollbarYRail),this.scrollbarY=WA(Lh.element.thumb("y")),this.scrollbarYRail.appendChild(this.scrollbarY),this.scrollbarY.setAttribute("tabindex",0),this.event.bind(this.scrollbarY,"focus",o),this.event.bind(this.scrollbarY,"blur",l),this.scrollbarYActive=null,this.scrollbarYHeight=null,this.scrollbarYTop=null;var h=s_(this.scrollbarYRail);this.scrollbarYRight=parseInt(h.right,10),isNaN(this.scrollbarYRight)?(this.isScrollbarYUsingRight=!1,this.scrollbarYLeft=ic(h.left)):this.isScrollbarYUsingRight=!0,this.scrollbarYOuterWidth=this.isRtl?vNe(this.scrollbarY):null,this.railBorderYWidth=ic(h.borderTopWidth)+ic(h.borderBottomWidth),Wp(this.scrollbarYRail,{display:"block"}),this.railYMarginHeight=ic(h.marginTop)+ic(h.marginBottom),Wp(this.scrollbarYRail,{display:""}),this.railYHeight=null,this.railYRatio=null,this.reach={x:e.scrollLeft<=0?"start":e.scrollLeft>=this.contentWidth-this.containerWidth?"end":null,y:e.scrollTop<=0?"start":e.scrollTop>=this.contentHeight-this.containerHeight?"end":null},this.isAlive=!0,this.settings.handlers.forEach(function(f){return $Ne[f](r)}),this.lastScrollTop=Math.floor(e.scrollTop),this.lastScrollLeft=e.scrollLeft,this.event.bind(this.element,"scroll",function(f){return r.onScroll(f)}),wv(this)};VC.prototype.update=function(e){this.isAlive&&(this.negativeScrollAdjustment=this.isNegativeScroll?this.element.scrollWidth-this.element.clientWidth:0,Wp(this.scrollbarXRail,{display:"block"}),Wp(this.scrollbarYRail,{display:"block"}),this.railXMarginWidth=ic(s_(this.scrollbarXRail).marginLeft)+ic(s_(this.scrollbarXRail).marginRight),this.railYMarginHeight=ic(s_(this.scrollbarYRail).marginTop)+ic(s_(this.scrollbarYRail).marginBottom),Wp(this.scrollbarXRail,{display:"none"}),Wp(this.scrollbarYRail,{display:"none"}),wv(this),LR(this,"top",0,!1,!0,e),LR(this,"left",0,!1,!0,e),Wp(this.scrollbarXRail,{display:""}),Wp(this.scrollbarYRail,{display:""}))};VC.prototype.onScroll=function(e){this.isAlive&&(wv(this),LR(this,"top",this.element.scrollTop-this.lastScrollTop),LR(this,"left",this.element.scrollLeft-this.lastScrollLeft),this.lastScrollTop=Math.floor(this.element.scrollTop),this.lastScrollLeft=this.element.scrollLeft)};VC.prototype.destroy=function(){this.isAlive&&(this.event.unbindAll(),sw(this.scrollbarX),sw(this.scrollbarY),sw(this.scrollbarXRail),sw(this.scrollbarYRail),this.removePsClasses(),this.element=null,this.scrollbarX=null,this.scrollbarY=null,this.scrollbarXRail=null,this.scrollbarYRail=null,this.isAlive=!1)};VC.prototype.removePsClasses=function(){this.element.className=this.element.className.split(" ").filter(function(e){return!e.match(/^ps([-_].+|)$/)}).join(" ")};function Jw(n){"@babel/helpers - typeof";return Jw=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Jw(n)}var CNe=["className","style","option","options","containerRef","onScrollY","onScrollX","onScrollUp","onScrollDown","onScrollLeft","onScrollRight","onYReachStart","onYReachEnd","onXReachStart","onXReachEnd","component","onSync","children"];function mB(){return mB=Object.assign?Object.assign.bind():function(n){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function ANe(n,e){if(n==null)return{};var t={},r=Object.keys(n),s,o;for(o=0;o=0)&&(t[s]=n[s]);return t}function INe(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function P9(n,e){for(var t=0;t0&&arguments[0]!==void 0?arguments[0]:{};Object.keys(II).forEach(function(o){var l=r.props[II[o]],u=s[II[o]];if(l!==u){if(u){var h=r._handlerByEvent[o];r._container.removeEventListener(o,h,!1),r._handlerByEvent[o]=null}if(l){var f=function(){return l(r._container)};r._container.addEventListener(o,f,!1),r._handlerByEvent[o]=f}}})}},{key:"_updateClassName",value:function(){var r=this.props.className,s=this._container.className.split(" ").filter(function(o){return o.match(/^ps([-_].+|)$/)}).join(" ");this._container&&(this._container.className="scrollbar-container".concat(r?" ".concat(r):"").concat(s?" ".concat(s):""))}},{key:"updateScroll",value:function(){var r=this.props.onSync;typeof r=="function"?r(this._ps):this._ps.update()}},{key:"handleRef",value:function(r){var s,o;this._container=r,(s=(o=this.props).containerRef)===null||s===void 0||s.call(o,r)}},{key:"render",value:function(){var r=this.props;r.className;var s=r.style;r.option,r.options,r.containerRef,r.onScrollY,r.onScrollX,r.onScrollUp,r.onScrollDown,r.onScrollLeft,r.onScrollRight,r.onYReachStart,r.onYReachEnd,r.onXReachStart,r.onXReachEnd;var o=r.component;r.onSync;var l=r.children,u=MNe(r,CNe),h=typeof o>"u"?"div":o;return yt.createElement(h,mB({style:s,ref:this.handleRef},u),l)}}]),e}(pe.Component);function aC(n){"@babel/helpers - typeof";return aC=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},aC(n)}var PNe=["className","variant","children"];function _B(){return _B=Object.assign?Object.assign.bind():function(n){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function HNe(n,e){if(n==null)return{};var t={},r=Object.keys(n),s,o;for(o=0;o=0)&&(t[s]=n[s]);return t}var B9=function(e){var t=e.className,r=t===void 0?void 0:t,s=e.variant,o=s===void 0?"default":s,l=e.children,u=UNe(e,PNe),h="".concat(li,"-loader"),f=yt.Children.count(l)>0?"".concat(h,"--content"):"";return yt.createElement("div",_B({},u,{className:Ps(h,f,BNe({},"".concat(h,"--variant-").concat(o),o!=="default"),r),role:"status"}),l)};function lC(n){"@babel/helpers - typeof";return lC=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},lC(n)}var GNe=["className","children","blur","grayscale"];function vB(){return vB=Object.assign?Object.assign.bind():function(n){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function YNe(n,e){if(n==null)return{};var t={},r=Object.keys(n),s,o;for(o=0;o=0)&&(t[s]=n[s]);return t}var XNe=function(e){var t=e.className,r=t===void 0?"":t,s=e.children,o=s===void 0?void 0:s,l=e.blur,u=l===void 0?!1:l,h=e.grayscale,f=h===void 0?!1:h,g=jNe(e,GNe),y="".concat(li,"-overlay"),b="".concat(y,"--blur"),w="".concat(y,"--grayscale");return yt.createElement("div",vB({},g,{className:Ps(y,F9({},b,u),F9({},w,f),r)}),yt.createElement("div",{className:"".concat(y,"__content")},o))},KNe=["sender","sentTime","children","className"];function yB(){return yB=Object.assign?Object.assign.bind():function(n){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function qNe(n,e){if(n==null)return{};var t={},r=Object.keys(n),s,o;for(o=0;o=0)&&(t[s]=n[s]);return t}var rz=function(e){var t=e.sender,r=t===void 0?"":t,s=e.sentTime,o=s===void 0?"":s,l=e.children,u=l===void 0?void 0:l,h=e.className,f=JNe(e,KNe),g="".concat(li,"-message__header");return yt.createElement("div",yB({},f,{className:Ps(g,h)}),typeof u<"u"?u:yt.createElement(yt.Fragment,null,yt.createElement("div",{className:"".concat(li,"-message__sender-name")},r),yt.createElement("div",{className:"".concat(li,"-message__sent-time")},o)))};rz.displayName="Message.Header";var QNe=["sender","sentTime","children","className"];function bB(){return bB=Object.assign?Object.assign.bind():function(n){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function eDe(n,e){if(n==null)return{};var t={},r=Object.keys(n),s,o;for(o=0;o=0)&&(t[s]=n[s]);return t}var iz=function(e){var t=e.sender,r=t===void 0?"":t,s=e.sentTime,o=s===void 0?"":s,l=e.children,u=l===void 0?void 0:l,h=e.className,f=ZNe(e,QNe),g="".concat(li,"-message__footer");return yt.createElement("div",bB({},f,{className:Ps(g,h)}),typeof u<"u"?u:yt.createElement(yt.Fragment,null,yt.createElement("div",{className:"".concat(li,"-message__sender-name")},r),yt.createElement("div",{className:"".concat(li,"-message__sent-time")},o)))};iz.displayName="Message.Footer";var sz=function(e){var t=e.children,r=e.className,s="".concat(li,"-message__custom-content");return yt.createElement("div",{className:Ps(s,r)},t)};sz.displayName="Message.CustomContent";var DR=function(e){var t=e.src,r=e.width,s=e.height,o=e.alt,l=e.className,u="".concat(li,"-message__image-content"),h={width:typeof r=="number"?"".concat(r,"px"):typeof r=="string"?r:void 0,height:typeof s=="number"?"".concat(s,"px"):typeof s=="string"?s:void 0};return yt.createElement("div",{className:Ps(u,l)},yt.createElement("img",{src:t,style:h,alt:o}))};DR.displayName="Message.ImageContent";var PR=function(e){var t=e.html,r=e.className,s="".concat(li,"-message__html-content"),o=function(){return{__html:t}};return yt.createElement("div",{className:Ps(s,r),dangerouslySetInnerHTML:o()})};PR.displayName="Message.HtmlContent";var BR=function(e){var t=e.text,r=e.className,s=e.children,o="".concat(li,"-message__text-content"),l=s??t;return yt.createElement("div",{className:Ps(o,r)},l)};BR.displayName="Message.TextContent";var tDe=["model","avatarSpacer","avatarPosition","type","payload","children","className"];function TB(){return TB=Object.assign?Object.assign.bind():function(n){for(var e=1;en.length)&&(e=n.length);for(var t=0,r=new Array(e);t=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function cDe(n,e){if(n==null)return{};var t={},r=Object.keys(n),s,o;for(o=0;o=0)&&(t[s]=n[s]);return t}var Ev=function(e){var t,r,s=e.model,o=s.message,l=o===void 0?"":o,u=s.sentTime,h=u===void 0?"":u,f=s.sender,g=f===void 0?"":f,y=s.direction,b=y===void 0?1:y,w=s.position,C=s.type,M=s.payload,A=e.avatarSpacer,k=A===void 0?!1:A,L=e.avatarPosition,P=L===void 0?void 0:L,D=e.type,z=D===void 0?"html":D,U=e.payload,V=e.children,H=e.className,oe=uDe(e,tDe),le="".concat(li,"-message"),Z=HC(V,[UC,rz,iz,PR,BR,DR,sz]),q=iDe(Z,7),he=q[0],ae=q[1],ue=q[2],ge=q[3],we=q[4],J=q[5],re=q[6],ie=function(){if(b===0||b==="incoming")return"".concat(le,"--incoming");if(b===1||b==="outgoing")return"".concat(le,"--outgoing")}(),fe=function(Re){var Qe="".concat(le,"--avatar-");if(Re===0||Re==="top-left"||Re==="tl")return"".concat(Qe,"tl");if(Re===1||Re==="top-right"||Re==="tr")return"".concat(Qe,"tr");if(Re===2||Re==="bottom-right"||Re==="br")return"".concat(Qe,"br");if(Re===3||Re==="bottom-left"||Re==="bl")return"".concat(Qe,"bl");if(Re===4||Re==="center-left"||Re==="cl")return"".concat(Qe,"cl");if(Re===5||Re==="center-right"||Re==="cr")return"".concat(Qe,"cr")}(P),Te=function(Re){var Qe="".concat(li,"-message--");if(Re==="single"||Re===0)return"".concat(Qe,"single");if(Re==="first"||Re===1)return"".concat(Qe,"first");if(Re==="normal"||Re===2)return"";if(Re==="last"||Re===3)return"".concat(Qe,"last")}(w),Fe=function(){return(g==null?void 0:g.length)>0&&(h==null?void 0:h.length)>0?"".concat(g,": ").concat(h):(g==null?void 0:g.length)>0&&(typeof h>"u"||(h==null?void 0:h.length)===0)?g:null}(),Ie=(t=(r=ge??we)!==null&&r!==void 0?r:J)!==null&&t!==void 0?t:re,Je=Ie??function(){var Re=C??z,Qe=M??l,nt=Qe??U,ft=qw(nt)==="object"?Mee(nt):"";if(Re==="html"&&ft!=="Message.CustomContent")return yt.createElement(PR,{html:nt});if(Re==="text")return yt.createElement(BR,{text:nt});if(Re==="image")return yt.createElement(DR,nt);if(Re==="custom"||ft==="Message.CustomContent")return nt}();return yt.createElement("section",TB({},oe,{"aria-label":Fe,className:Ps(le,ie,z9({},"".concat(le,"--avatar-spacer"),k),Te,fe,H)},z9({},"data-".concat(li,"-message"),"")),typeof he<"u"&&yt.createElement("div",{className:"".concat(le,"__avatar")},he),yt.createElement("div",{className:"".concat(le,"__content-wrapper")},ae,yt.createElement("div",{className:"".concat(le,"__content")},Je),ue))};Ev.Header=rz;Ev.HtmlContent=PR;Ev.TextContent=BR;Ev.ImageContent=DR;Ev.CustomContent=sz;Ev.Footer=iz;var hDe=["children","className"];function SB(){return SB=Object.assign?Object.assign.bind():function(n){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function fDe(n,e){if(n==null)return{};var t={},r=Object.keys(n),s,o;for(o=0;o=0)&&(t[s]=n[s]);return t}var oz=function(e){var t=e.children,r=t===void 0?void 0:t,s=e.className,o=dDe(e,hDe),l="".concat(li,"-message-group__header");return yt.createElement("div",SB({},o,{className:Ps(l,s)}),r)};oz.displayName="MessageGroup.Header";var pDe=["children","className"];function wB(){return wB=Object.assign?Object.assign.bind():function(n){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function gDe(n,e){if(n==null)return{};var t={},r=Object.keys(n),s,o;for(o=0;o=0)&&(t[s]=n[s]);return t}var az=function(e){var t=e.children,r=t===void 0?void 0:t,s=e.className,o=mDe(e,pDe),l="".concat(li,"-message-group__footer");return yt.createElement("div",wB({},o,{className:Ps(l,s)}),r)};az.displayName="MessageGroup.Footer";var _De=["children","className"];function EB(){return EB=Object.assign?Object.assign.bind():function(n){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function yDe(n,e){if(n==null)return{};var t={},r=Object.keys(n),s,o;for(o=0;o=0)&&(t[s]=n[s]);return t}var lz=function(e){var t=e.children,r=t===void 0?void 0:t,s=e.className,o=vDe(e,_De),l="".concat(li,"-message-group");return yt.createElement("div",EB({},o,{className:Ps("".concat(l,"__messages"),s)}),r)};lz.displayName="MessageGroup.Messages";function uC(n){"@babel/helpers - typeof";return uC=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},uC(n)}var bDe=["direction","avatarPosition","sender","sentTime","children","className"];function xB(){return xB=Object.assign?Object.assign.bind():function(n){for(var e=1;en.length)&&(e=n.length);for(var t=0,r=new Array(e);t=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function IDe(n,e){if(n==null)return{};var t={},r=Object.keys(n),s,o;for(o=0;o=0)&&(t[s]=n[s]);return t}var $2=function(e){var t=e.direction,r=t===void 0?"incoming":t,s=e.avatarPosition,o=s===void 0?void 0:s,l=e.sender,u=l===void 0?"":l,h=e.sentTime,f=h===void 0?"":h,g=e.children,y=e.className,b=ADe(e,bDe),w="".concat(li,"-message-group"),C=function(){if(r===0||r==="incoming")return"".concat(w,"--incoming");if(r===1||r==="outgoing")return"".concat(w,"--outgoing")}(),M=function(){var V="".concat(w,"--avatar-");if(typeof o=="string"&&(o==="tl"||o==="top-left"||o==="tr"||o==="top-right"||o==="bl"||o==="bottom-right"||o==="br"||o==="bottom-right"||o==="cl"||o==="center-left"||o==="cr"||o==="center-right"))return"".concat(V).concat(o)}(),A=HC(g,[UC,oz,az,lz]),k=EDe(A,4),L=k[0],P=k[1],D=k[2],z=k[3],U=function(){return u.length>0&&f.length>0?"".concat(u,": ").concat(f):u.length>0&&f.length===0?u:null}();return yt.createElement("section",xB({"aria-label":U},b,{className:Ps(w,C,M,y)},TDe({},"data-".concat(li,"-message-group"),"")),typeof L<"u"&&yt.createElement("div",{className:"".concat(w,"__avatar")},L),yt.createElement("div",{className:"".concat(w,"__content")},P,z,D))};$2.Header=oz;$2.Footer=az;$2.Messages=lz;var RDe=["content","as","children","className"];function $B(){return $B=Object.assign?Object.assign.bind():function(n){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function ODe(n,e){if(n==null)return{};var t={},r=Object.keys(n),s,o;for(o=0;o=0)&&(t[s]=n[s]);return t}var LDe=function(e){var t=e.content,r=t===void 0?void 0:t,s=e.as,o=s===void 0?"div":s,l=e.children,u=l===void 0?void 0:l,h=e.className,f=kDe(e,RDe),g="".concat(li,"-message-separator"),y=function(){return typeof o=="string"&&o.length>0?o:"div"}();return yt.createElement(y,$B({},f,{className:Ps(g,h)}),kOe(u)===!0?r:u)},NDe=["className","children"];function CB(){return CB=Object.assign?Object.assign.bind():function(n){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function PDe(n,e){if(n==null)return{};var t={},r=Object.keys(n),s,o;for(o=0;o=0)&&(t[s]=n[s]);return t}var C2=function(e){var t=e.className,r=e.children,s=DDe(e,NDe);return yt.createElement("div",CB({},s,{className:t}),r)};C2.displayName="MessageList.Content";var BDe=["children","typingIndicator","loading","loadingMore","loadingMorePosition","onYReachStart","onYReachEnd","className","disableOnYReachWhenNoScroll","scrollBehavior","autoScrollToBottom","autoScrollToBottomOnMount"];function Qw(n){"@babel/helpers - typeof";return Qw=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Qw(n)}function cC(){return cC=Object.assign?Object.assign.bind():function(n){for(var e=1;en.length)&&(e=n.length);for(var t=0,r=new Array(e);t=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function VDe(n,e){if(n==null)return{};var t={},r=Object.keys(n),s,o;for(o=0;o=0)&&(t[s]=n[s]);return t}function jDe(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function W9(n,e){for(var t=0;t=1?r.preventScrollTop===!1&&(s.scrollTop=Math.round(s.scrollTop)-l):s.scrollTop=s.scrollTop-l,r.lastClientHeight=s.clientHeight,r.scrollRef.current.updateScroll()}r.resizeTicking=!1}),r.resizeTicking=!0)}),r1(BS(r),"isSticked",function(){var s=r.containerRef.current;return s.scrollHeight===Math.round(s.scrollTop+s.clientHeight)}),r1(BS(r),"handleScroll",function(){r.scrollTicking===!1&&(window.requestAnimationFrame(function(){r.noScroll===!1?r.preventScrollTop=r.isSticked():r.noScroll=!1,r.scrollTicking=!1}),r.scrollTicking=!0)}),r1(BS(r),"getLastMessageOrGroup",function(){var s=r.containerRef.current.querySelector("[data-".concat(li,"-message-list]>[data-").concat(li,"-message]:last-of-type,[data-").concat(li,"-message-list]>[data-").concat(li,"-message-group]:last-of-type")),o=s==null?void 0:s.querySelector("[data-".concat(li,"-message]:last-of-type"));return{lastElement:s,lastMessageInGroup:o}}),r.scrollPointRef=yt.createRef(),r.containerRef=yt.createRef(),r.scrollRef=yt.createRef(),r.lastClientHeight=0,r.preventScrollTop=!1,r.resizeObserver=void 0,r.scrollTicking=!1,r.resizeTicking=!1,r.noScroll=void 0,r}return YDe(e,[{key:"getSnapshotBeforeUpdate",value:function(){var r=this.containerRef.current,s=Math.round(r.scrollTop+r.clientHeight),o=r.scrollHeight===s||r.scrollHeight+1===s||r.scrollHeight-1===s;return{sticky:o,clientHeight:r.clientHeight,scrollHeight:r.scrollHeight,lastMessageOrGroup:this.getLastMessageOrGroup(),diff:r.scrollHeight-r.scrollTop}}},{key:"componentDidMount",value:function(){this.props.autoScrollToBottomOnMount===!0&&this.scrollToEnd(this.props.scrollBehavior),this.lastClientHeight=this.containerRef.current.clientHeight,window.addEventListener("resize",this.handleResize),typeof window.ResizeObserver=="function"&&(this.resizeObserver=new ResizeObserver(this.handleContainerResize),this.resizeObserver.observe(this.containerRef.current)),this.containerRef.current.addEventListener("scroll",this.handleScroll)}},{key:"componentDidUpdate",value:function(r,s,o){var l=this.props.autoScrollToBottom;if(typeof o<"u"){var u=this.containerRef.current,h=this.getLastMessageOrGroup(),f=h.lastElement,g=h.lastMessageInGroup;if(f===o.lastMessageOrGroup.lastElement&&(typeof g>"u"||g===o.lastMessageOrGroup.lastMessageInGroup)&&(u.scrollTop=u.scrollHeight-o.diff+(this.lastClientHeight-u.clientHeight)),o.sticky===!0)l===!0&&this.scrollToEnd(this.props.scrollBehavior),this.preventScrollTop=!0;else if(o.clientHeight"u"||g===o.lastMessageOrGroup.lastMessageInGroup)&&u.scrollTop===0&&u.scrollHeight>o.scrollHeight&&(u.scrollTop=u.scrollHeight-o.scrollHeight);this.lastClientHeight=o.clientHeight}}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this.handleResize),typeof this.resizeObserver<"u"&&this.resizeObserver.disconnect(),this.containerRef.current.removeEventListener("scroll",this.handleScroll)}},{key:"scrollToEnd",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props.scrollBehavior,s=this.containerRef.current,o=this.scrollPointRef.current,l=s.getBoundingClientRect(),u=o.getBoundingClientRect(),h=u.top+s.scrollTop-l.top;s.scrollBy?s.scrollBy({top:h,behavior:r}):s.scrollTop=h,this.lastClientHeight=s.clientHeight,this.noScroll=!0}},{key:"render",value:function(){var r=this,s=this.props,o=s.children,l=s.typingIndicator,u=s.loading,h=s.loadingMore,f=s.loadingMorePosition,g=s.onYReachStart,y=s.onYReachEnd,b=s.className,w=s.disableOnYReachWhenNoScroll;s.scrollBehavior,s.autoScrollToBottom,s.autoScrollToBottomOnMount;var C=WDe(s,BDe),M="".concat(li,"-message-list"),A=HC(o,[C2]),k=FDe(A,1),L=k[0];return yt.createElement("div",cC({},C,{className:Ps(M,b)}),h&&yt.createElement("div",{className:Ps("".concat(M,"__loading-more"),r1({},"".concat(M,"__loading-more--bottom"),f==="bottom"))},yt.createElement(B9,null)),u&&yt.createElement(XNe,null,yt.createElement(B9,null)),yt.createElement(pte,cC({onYReachStart:g,onYReachEnd:y,onSync:function(D){return D.update(w)},className:"".concat(M,"__scroll-wrapper"),ref:this.scrollRef,containerRef:function(D){return r.containerRef.current=D},options:{suppressScrollX:!0}},r1({},"data-".concat(li,"-message-list"),""),{style:{overscrollBehaviorY:"none",overflowAnchor:"auto",touchAction:"none"}}),L||o,yt.createElement("div",{className:"".concat(M,"__scroll-to"),ref:this.scrollPointRef})),typeof l<"u"&&yt.createElement("div",{className:"".concat(M,"__typing-indicator-container")},l))}}]),e}(yt.Component);uz.displayName="MessageList";function QDe(n,e){var t=pe.useRef(),r=function(o){return t.current.scrollToEnd(o)};return pe.useImperativeHandle(e,function(){return{scrollToBottom:r}}),yt.createElement(uz,cC({ref:t},n))}var yE=pe.forwardRef(QDe);yE.propTypes={children:Aee([Ev,$2,LDe,C2]),typingIndicator:qt.node,loading:qt.bool,loadingMore:qt.bool,loadingMorePosition:qt.oneOf(["top","bottom"]),onYReachStart:qt.func,onYReachEnd:qt.func,disableOnYReachWhenNoScroll:qt.bool,autoScrollToBottom:qt.bool,autoScrollToBottomOnMount:qt.bool,scrollBehavior:qt.oneOf(["auto","smooth"]),className:qt.string};yE.defaultProps={typingIndicator:void 0,loading:!1,loadingMore:!1,loadingMorePosition:"top",disableOnYReachWhenNoScroll:!1,autoScrollToBottom:!0,autoScrollToBottomOnMount:!0,scrollBehavior:"auto"};uz.defaultProps=yE.defaultProps;yE.Content=C2;function Zw(n){"@babel/helpers - typeof";return Zw=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Zw(n)}function ZDe(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function V9(n,e){for(var t=0;t"u"||r.value!==s.current.innerHTML?!0:l!==r.placeholder||u!==r.disabled||h!==r.activateAfterChange}},{key:"componentDidUpdate",value:function(){var r=this.msgRef,s=this.props,o=s.value,l=s.activateAfterChange;o!==r.current.innerHTML&&(r.current.innerHTML=typeof o=="string"?o:""),sPe(r.current,l)}},{key:"render",value:function(){var r=this.msgRef,s=this.handleInput,o=this.handleKeyPress,l=this.innerHTML,u=this.props,h=u.placeholder,f=u.disabled,g=u.className,y=typeof h=="string"?h:"";return yt.createElement("div",{ref:r,className:g,contentEditable:f===!1,disabled:f,"data-placeholder":y,onInput:s,onKeyPress:o,dangerouslySetInnerHTML:l()})}}]),e}(pe.Component);function eE(n){"@babel/helpers - typeof";return eE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},eE(n)}var aPe=["fancyScroll","children","forwardedRef"],lPe=["value","onSend","onChange","autoFocus","placeholder","fancyScroll","className","activateAfterChange","disabled","sendDisabled","sendOnReturnDisabled","attachDisabled","sendButton","attachButton","onAttachClick"];function uPe(n,e,t){return e=bte(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function IB(n,e){return fPe(n)||dPe(n,e)||hPe(n,e)||cPe()}function cPe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hPe(n,e){if(n){if(typeof n=="string")return j9(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);if(t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set")return Array.from(n);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return j9(n,e)}}function j9(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=new Array(e);t=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function pPe(n,e){if(n==null)return{};var t={},r=Object.keys(n),s,o;for(o=0;o=0)&&(t[s]=n[s]);return t}function mPe(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function Y9(n,e){for(var t=0;t0){r===void 0&&ie(""),typeof P>"u"&&Ie(!0);var He=Re();o(re,He[0],He[1],He[2])}},nt=function(He){He.key==="Enter"&&He.shiftKey===!1&&z===!1&&(He.preventDefault(),Qe())},ft=function(He,rt,it){ie(He),typeof P>"u"&&Ie(rt.length===0),typeof ue.current.updateScroll=="function"&&ue.current.updateScroll();var Nt=Re();u(He,rt,it,Nt[2])},lt="".concat(li,"-message-input"),ze=typeof y=="string"?y:"";return yt.createElement("div",yw({},ae,{className:Ps(lt,uPe({},"".concat(lt,"--disabled"),L),C)}),Z===!0&&yt.createElement("div",{className:"".concat(lt,"__tools")},yt.createElement(qLe,{onClick:he,disabled:L===!0||V===!0})),yt.createElement("div",{className:"".concat(lt,"__content-editor-wrapper")},yt.createElement(wPe,{fancyScroll:w,ref:ue,className:"".concat(lt,"__content-editor-container")},yt.createElement(oPe,{ref:ge,className:"".concat(lt,"__content-editor"),disabled:L,placeholder:ze,onKeyPress:nt,onChange:ft,activateAfterChange:A,value:re}))),oe===!0&&yt.createElement("div",{className:"".concat(lt,"__tools")},yt.createElement(YLe,{onClick:Qe,disabled:L===!0||Fe===!0})))}var M2=pe.forwardRef(EPe);M2.displayName="MessageInput";M2.propTypes={value:qt.string,placeholder:qt.string,disabled:qt.bool,sendOnReturnDisabled:qt.bool,sendDisabled:qt.bool,fancyScroll:qt.bool,activateAfterChange:qt.bool,autoFocus:qt.bool,onChange:qt.func,onSend:qt.func,className:qt.string,sendButton:qt.bool,attachButton:qt.bool,attachDisabled:qt.bool,onAttachClick:qt.func};var xPe=["className","children"];function kB(){return kB=Object.assign?Object.assign.bind():function(n){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function CPe(n,e){if(n==null)return{};var t={},r=Object.keys(n),s,o;for(o=0;o=0)&&(t[s]=n[s]);return t}var Ste=function(e){var t=e.className,r=e.children,s=$Pe(e,xPe),o="".concat(li,"-input-toolbox");return yt.createElement("div",kB({},s,{className:Ps(o,t)}),r)};Ste.displayName="InputToolbox";var MPe=["children","className"];function OB(){return OB=Object.assign?Object.assign.bind():function(n){for(var e=1;en.length)&&(e=n.length);for(var t=0,r=new Array(e);t=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function NPe(n,e){if(n==null)return{};var t={},r=Object.keys(n),s,o;for(o=0;o=0)&&(t[s]=n[s]);return t}var DPe=function(e){var t=e.children,r=t===void 0?void 0:t,s=e.className,o=LPe(e,MPe),l="".concat(li,"-chat-container"),u=HC(r,[GC,yE,M2,Ste]),h=APe(u,4),f=h[0],g=h[1],y=h[2],b=h[3];return yt.createElement("div",OB({},o,{className:Ps(l,s)}),f,g,y,b)},G1="".concat(li,"-conversation");function hC(n){"@babel/helpers - typeof";return hC=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},hC(n)}var PPe=["children","className","visible"];function LB(){return LB=Object.assign?Object.assign.bind():function(n){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function HPe(n,e){if(n==null)return{};var t={},r=Object.keys(n),s,o;for(o=0;o=0)&&(t[s]=n[s]);return t}var GPe=function(e){var t=e.children,r=e.className,s=e.visible,o=UPe(e,PPe);return yt.createElement("div",LB({},o,{className:Ps("".concat(G1,"__operations"),BPe({},"".concat(G1,"__operations--visible"),s),r)}),yt.Children.count(t)>0?t:yt.createElement(g_,{icon:ste.faEllipsisV}))};GPe.displayName="Conversation.Operations";var WPe=["lastSenderName","info","name","children","className"];function NB(){return NB=Object.assign?Object.assign.bind():function(n){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function jPe(n,e){if(n==null)return{};var t={},r=Object.keys(n),s,o;for(o=0;o=0)&&(t[s]=n[s]);return t}var YPe=function(e){var t=e.name;return yt.createElement(yt.Fragment,null,yt.createElement("div",{className:"".concat(G1,"__last-sender")},t),":")},XPe=function(e){var t=e.info;return yt.createElement("div",{className:"".concat(G1,"__info-content")},t)},KPe=function(e){var t=e.lastSenderName,r=e.info,s=e.name,o=e.children,l=e.className,u=VPe(e,WPe),h=DB(t);return yt.createElement("div",NB({},u,{className:Ps("".concat(G1,"__content"),l)}),yt.Children.count(o)>0?o:yt.createElement(yt.Fragment,null,yt.createElement("div",{className:"".concat(G1,"__name")},s),yt.createElement("div",{className:"".concat(G1,"__info")},h!=="undefined"?yt.createElement(yt.Fragment,null,h==="string"?yt.createElement(YPe,{name:t}):t," "):null,typeof r<"u"&&yt.createElement(XPe,{info:r}))))};KPe.displayName="Conversation.Content";/*! + */function s_(n){return getComputedStyle(n)}function Wp(n,e){for(var t in e){var r=e[t];typeof r=="number"&&(r=r+"px"),n.style[t]=r}return n}function WA(n){var e=document.createElement("div");return e.className=n,e}var L9=typeof Element<"u"&&(Element.prototype.matches||Element.prototype.webkitMatchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector);function Cy(n,e){if(!L9)throw new Error("No element matching method supported");return L9.call(n,e)}function sw(n){n.remove?n.remove():n.parentNode&&n.parentNode.removeChild(n)}function N9(n,e){return Array.prototype.filter.call(n.children,function(t){return Cy(t,e)})}var Lh={main:"ps",rtl:"ps__rtl",element:{thumb:function(e){return"ps__thumb-"+e},rail:function(e){return"ps__rail-"+e},consuming:"ps__child--consume"},state:{focus:"ps--focus",clicking:"ps--clicking",active:function(e){return"ps--active-"+e},scrolling:function(e){return"ps--scrolling-"+e}}},ute={x:null,y:null};function cte(n,e){var t=n.element.classList,r=Lh.state.scrolling(e);t.contains(r)?clearTimeout(ute[e]):t.add(r)}function hte(n,e){ute[e]=setTimeout(function(){return n.isAlive&&n.element.classList.remove(Lh.state.scrolling(e))},n.settings.scrollingThreshold)}function mNe(n,e){cte(n,e),hte(n,e)}var WC=function(e){this.element=e,this.handlers={}},dte={isEmpty:{configurable:!0}};WC.prototype.bind=function(e,t){typeof this.handlers[e]>"u"&&(this.handlers[e]=[]),this.handlers[e].push(t);var r=["touchstart","wheel","touchmove"];r.indexOf(e)!==-1?this.element.addEventListener(e,t,{passive:!1}):this.element.addEventListener(e,t,!1)};WC.prototype.unbind=function(e,t){var r=this;this.handlers[e]=this.handlers[e].filter(function(s){return t&&s!==t?!0:(r.element.removeEventListener(e,s,!1),!1)})};WC.prototype.unbindAll=function(){for(var e in this.handlers)this.unbind(e)};dte.isEmpty.get=function(){var n=this;return Object.keys(this.handlers).every(function(e){return n.handlers[e].length===0})};Object.defineProperties(WC.prototype,dte);var vE=function(){this.eventElements=[]};vE.prototype.eventElement=function(e){var t=this.eventElements.filter(function(r){return r.element===e})[0];return t||(t=new WC(e),this.eventElements.push(t)),t};vE.prototype.bind=function(e,t,r){this.eventElement(e).bind(t,r)};vE.prototype.unbind=function(e,t,r){var s=this.eventElement(e);s.unbind(t,r),s.isEmpty&&this.eventElements.splice(this.eventElements.indexOf(s),1)};vE.prototype.unbindAll=function(){this.eventElements.forEach(function(e){return e.unbindAll()}),this.eventElements=[]};vE.prototype.once=function(e,t,r){var s=this.eventElement(e),o=function l(u){s.unbind(t,l),r(u)};s.bind(t,o)};function VA(n){if(typeof window.CustomEvent=="function")return new CustomEvent(n);var e=document.createEvent("CustomEvent");return e.initCustomEvent(n,!1,!1,void 0),e}function LR(n,e,t,r,s,o){r===void 0&&(r=!0),s===void 0&&(s=!1);var l;if(e==="top")l=["contentHeight","containerHeight","scrollTop","y","up","down"];else if(e==="left")l=["contentWidth","containerWidth","scrollLeft","x","left","right"];else throw new Error("A proper axis should be provided");gNe(n,t,l,r,s,o)}function gNe(n,e,t,r,s,o){var l=t[0],u=t[1],h=t[2],f=t[3],g=t[4],y=t[5];r===void 0&&(r=!0),s===void 0&&(s=!1);var b=n.element;n.reach[f]=null;var w=o===!0?n[l]!==n[u]:!0;w&&b[h]<1&&(n.reach[f]="start"),w&&b[h]>n[l]-n[u]-1&&(n.reach[f]="end"),e&&(b.dispatchEvent(VA("ps-scroll-"+f)),e<0?b.dispatchEvent(VA("ps-scroll-"+g)):e>0&&b.dispatchEvent(VA("ps-scroll-"+y)),r&&mNe(n,f)),n.reach[f]&&(e||s)&&b.dispatchEvent(VA("ps-"+f+"-reach-"+n.reach[f]))}function ic(n){return parseInt(n,10)||0}function _Ne(n){return Cy(n,"input,[contenteditable]")||Cy(n,"select,[contenteditable]")||Cy(n,"textarea,[contenteditable]")||Cy(n,"button,[contenteditable]")}function vNe(n){var e=s_(n);return ic(e.width)+ic(e.paddingLeft)+ic(e.paddingRight)+ic(e.borderLeftWidth)+ic(e.borderRightWidth)}var Bx={isWebKit:typeof document<"u"&&"WebkitAppearance"in document.documentElement.style,supportsTouch:typeof window<"u"&&("ontouchstart"in window||"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>0||window.DocumentTouch&&document instanceof window.DocumentTouch),supportsIePointer:typeof navigator<"u"&&navigator.msMaxTouchPoints,isChrome:typeof navigator<"u"&&/Chrome/i.test(navigator&&navigator.userAgent)};function wv(n){var e=n.element,t=Math.floor(e.scrollTop),r=e.getBoundingClientRect();n.containerWidth=Math.round(r.width),n.containerHeight=Math.round(r.height),n.contentWidth=e.scrollWidth,n.contentHeight=e.scrollHeight,e.contains(n.scrollbarXRail)||(N9(e,Lh.element.rail("x")).forEach(function(s){return sw(s)}),e.appendChild(n.scrollbarXRail)),e.contains(n.scrollbarYRail)||(N9(e,Lh.element.rail("y")).forEach(function(s){return sw(s)}),e.appendChild(n.scrollbarYRail)),!n.settings.suppressScrollX&&n.containerWidth+n.settings.scrollXMarginOffset=n.railXWidth-n.scrollbarXWidth&&(n.scrollbarXLeft=n.railXWidth-n.scrollbarXWidth),n.scrollbarYTop>=n.railYHeight-n.scrollbarYHeight&&(n.scrollbarYTop=n.railYHeight-n.scrollbarYHeight),yNe(e,n),n.scrollbarXActive?e.classList.add(Lh.state.active("x")):(e.classList.remove(Lh.state.active("x")),n.scrollbarXWidth=0,n.scrollbarXLeft=0,e.scrollLeft=n.isRtl===!0?n.contentWidth:0),n.scrollbarYActive?e.classList.add(Lh.state.active("y")):(e.classList.remove(Lh.state.active("y")),n.scrollbarYHeight=0,n.scrollbarYTop=0,e.scrollTop=0)}function D9(n,e){return n.settings.minScrollbarLength&&(e=Math.max(e,n.settings.minScrollbarLength)),n.settings.maxScrollbarLength&&(e=Math.min(e,n.settings.maxScrollbarLength)),e}function yNe(n,e){var t={width:e.railXWidth},r=Math.floor(n.scrollTop);e.isRtl?t.left=e.negativeScrollAdjustment+n.scrollLeft+e.containerWidth-e.contentWidth:t.left=n.scrollLeft,e.isScrollbarXUsingBottom?t.bottom=e.scrollbarXBottom-r:t.top=e.scrollbarXTop+r,Wp(e.scrollbarXRail,t);var s={top:r,height:e.railYHeight};e.isScrollbarYUsingRight?e.isRtl?s.right=e.contentWidth-(e.negativeScrollAdjustment+n.scrollLeft)-e.scrollbarYRight-e.scrollbarYOuterWidth-9:s.right=e.scrollbarYRight-n.scrollLeft:e.isRtl?s.left=e.negativeScrollAdjustment+n.scrollLeft+e.containerWidth*2-e.contentWidth-e.scrollbarYLeft-e.scrollbarYOuterWidth:s.left=e.scrollbarYLeft+n.scrollLeft,Wp(e.scrollbarYRail,s),Wp(e.scrollbarX,{left:e.scrollbarXLeft,width:e.scrollbarXWidth-e.railBorderXWidth}),Wp(e.scrollbarY,{top:e.scrollbarYTop,height:e.scrollbarYHeight-e.railBorderYWidth})}function bNe(n){n.element,n.event.bind(n.scrollbarY,"mousedown",function(e){return e.stopPropagation()}),n.event.bind(n.scrollbarYRail,"mousedown",function(e){var t=e.pageY-window.pageYOffset-n.scrollbarYRail.getBoundingClientRect().top,r=t>n.scrollbarYTop?1:-1;n.element.scrollTop+=r*n.containerHeight,wv(n),e.stopPropagation()}),n.event.bind(n.scrollbarX,"mousedown",function(e){return e.stopPropagation()}),n.event.bind(n.scrollbarXRail,"mousedown",function(e){var t=e.pageX-window.pageXOffset-n.scrollbarXRail.getBoundingClientRect().left,r=t>n.scrollbarXLeft?1:-1;n.element.scrollLeft+=r*n.containerWidth,wv(n),e.stopPropagation()})}function TNe(n){P9(n,["containerWidth","contentWidth","pageX","railXWidth","scrollbarX","scrollbarXWidth","scrollLeft","x","scrollbarXRail"]),P9(n,["containerHeight","contentHeight","pageY","railYHeight","scrollbarY","scrollbarYHeight","scrollTop","y","scrollbarYRail"])}function P9(n,e){var t=e[0],r=e[1],s=e[2],o=e[3],l=e[4],u=e[5],h=e[6],f=e[7],g=e[8],y=n.element,b=null,w=null,C=null;function M(L){L.touches&&L.touches[0]&&(L[s]=L.touches[0].pageY),y[h]=b+C*(L[s]-w),cte(n,f),wv(n),L.stopPropagation(),L.preventDefault()}function A(){hte(n,f),n[g].classList.remove(Lh.state.clicking),n.event.unbind(n.ownerDocument,"mousemove",M)}function k(L,P){b=y[h],P&&L.touches&&(L[s]=L.touches[0].pageY),w=L[s],C=(n[r]-n[t])/(n[o]-n[u]),P?n.event.bind(n.ownerDocument,"touchmove",M):(n.event.bind(n.ownerDocument,"mousemove",M),n.event.once(n.ownerDocument,"mouseup",A),L.preventDefault()),n[g].classList.add(Lh.state.clicking),L.stopPropagation()}n.event.bind(n[l],"mousedown",function(L){k(L)}),n.event.bind(n[l],"touchstart",function(L){k(L,!0)})}function SNe(n){var e=n.element,t=function(){return Cy(e,":hover")},r=function(){return Cy(n.scrollbarX,":focus")||Cy(n.scrollbarY,":focus")};function s(o,l){var u=Math.floor(e.scrollTop);if(o===0){if(!n.scrollbarYActive)return!1;if(u===0&&l>0||u>=n.contentHeight-n.containerHeight&&l<0)return!n.settings.wheelPropagation}var h=e.scrollLeft;if(l===0){if(!n.scrollbarXActive)return!1;if(h===0&&o<0||h>=n.contentWidth-n.containerWidth&&o>0)return!n.settings.wheelPropagation}return!0}n.event.bind(n.ownerDocument,"keydown",function(o){if(!(o.isDefaultPrevented&&o.isDefaultPrevented()||o.defaultPrevented)&&!(!t()&&!r())){var l=document.activeElement?document.activeElement:n.ownerDocument.activeElement;if(l){if(l.tagName==="IFRAME")l=l.contentDocument.activeElement;else for(;l.shadowRoot;)l=l.shadowRoot.activeElement;if(_Ne(l))return}var u=0,h=0;switch(o.which){case 37:o.metaKey?u=-n.contentWidth:o.altKey?u=-n.containerWidth:u=-30;break;case 38:o.metaKey?h=n.contentHeight:o.altKey?h=n.containerHeight:h=30;break;case 39:o.metaKey?u=n.contentWidth:o.altKey?u=n.containerWidth:u=30;break;case 40:o.metaKey?h=-n.contentHeight:o.altKey?h=-n.containerHeight:h=-30;break;case 32:o.shiftKey?h=n.containerHeight:h=-n.containerHeight;break;case 33:h=n.containerHeight;break;case 34:h=-n.containerHeight;break;case 36:h=n.contentHeight;break;case 35:h=-n.contentHeight;break;default:return}n.settings.suppressScrollX&&u!==0||n.settings.suppressScrollY&&h!==0||(e.scrollTop-=h,e.scrollLeft+=u,wv(n),s(u,h)&&o.preventDefault())}})}function wNe(n){var e=n.element;function t(l,u){var h=Math.floor(e.scrollTop),f=e.scrollTop===0,g=h+e.offsetHeight===e.scrollHeight,y=e.scrollLeft===0,b=e.scrollLeft+e.offsetWidth===e.scrollWidth,w;return Math.abs(u)>Math.abs(l)?w=f||g:w=y||b,w?!n.settings.wheelPropagation:!0}function r(l){var u=l.deltaX,h=-1*l.deltaY;return(typeof u>"u"||typeof h>"u")&&(u=-1*l.wheelDeltaX/6,h=l.wheelDeltaY/6),l.deltaMode&&l.deltaMode===1&&(u*=10,h*=10),u!==u&&h!==h&&(u=0,h=l.wheelDelta),l.shiftKey?[-h,-u]:[u,h]}function s(l,u,h){if(!Bx.isWebKit&&e.querySelector("select:focus"))return!0;if(!e.contains(l))return!1;for(var f=l;f&&f!==e;){if(f.classList.contains(Lh.element.consuming))return!0;var g=s_(f);if(h&&g.overflowY.match(/(scroll|auto)/)){var y=f.scrollHeight-f.clientHeight;if(y>0&&(f.scrollTop>0&&h<0||f.scrollTop0))return!0}if(u&&g.overflowX.match(/(scroll|auto)/)){var b=f.scrollWidth-f.clientWidth;if(b>0&&(f.scrollLeft>0&&u<0||f.scrollLeft0))return!0}f=f.parentNode}return!1}function o(l){var u=r(l),h=u[0],f=u[1];if(!s(l.target,h,f)){var g=!1;n.settings.useBothWheelAxes?n.scrollbarYActive&&!n.scrollbarXActive?(f?e.scrollTop-=f*n.settings.wheelSpeed:e.scrollTop+=h*n.settings.wheelSpeed,g=!0):n.scrollbarXActive&&!n.scrollbarYActive&&(h?e.scrollLeft+=h*n.settings.wheelSpeed:e.scrollLeft-=f*n.settings.wheelSpeed,g=!0):(e.scrollTop-=f*n.settings.wheelSpeed,e.scrollLeft+=h*n.settings.wheelSpeed),wv(n),g=g||t(h,f),g&&!l.ctrlKey&&(l.stopPropagation(),l.preventDefault())}}typeof window.onwheel<"u"?n.event.bind(e,"wheel",o):typeof window.onmousewheel<"u"&&n.event.bind(e,"mousewheel",o)}function ENe(n){if(!Bx.supportsTouch&&!Bx.supportsIePointer)return;var e=n.element;function t(C,M){var A=Math.floor(e.scrollTop),k=Math.ceil(e.scrollLeft),L=Math.abs(C),P=Math.abs(M);if(!n.settings.wheelPropagation)return!0;if(P>L){if(n.settings.suppressScrollY)return!1;if(M>0)return A!==0;if(M<0)return AP){if(n.settings.suppressScrollX)return!1;if(C>0)return k!==0;if(M<0)return k0&&(k.scrollTop>0&&A<0||k.scrollTop0))return!0}if(M&&L.overflowX.match(/(scroll|auto)/)){var D=k.scrollWidth-k.clientWidth;if(D>0&&(k.scrollLeft>0&&M<0||k.scrollLeft0))return!0}k=k.parentNode}return!1}function b(C){if(f(C)){var M=h(C),A={pageX:M.pageX,pageY:M.pageY},k=A.pageX-s.pageX,L=A.pageY-s.pageY;if(y(C.target,k,L))return;r(k,L),s=A;var P=new Date().getTime(),D=P-o;D>0&&(l.x=k/D,l.y=L/D,o=P),C.cancelable&&t(k,L)&&C.preventDefault()}}function w(){n.settings.swipeEasing&&(clearInterval(u),u=setInterval(function(){if(n.isInitialized){clearInterval(u);return}if(!l.x&&!l.y){clearInterval(u);return}if(Math.abs(l.x)<.01&&Math.abs(l.y)<.01){clearInterval(u);return}r(l.x*30,l.y*30),l.x*=.8,l.y*=.8},10))}Bx.supportsTouch?(n.event.bind(e,"touchstart",g),n.event.bind(e,"touchmove",b),n.event.bind(e,"touchend",w)):Bx.supportsIePointer&&(window.PointerEvent?(n.event.bind(e,"pointerdown",g),n.event.bind(e,"pointermove",b),n.event.bind(e,"pointerup",w)):window.MSPointerEvent&&(n.event.bind(e,"MSPointerDown",g),n.event.bind(e,"MSPointerMove",b),n.event.bind(e,"MSPointerUp",w)))}var xNe=function(){return{handlers:["click-rail","drag-thumb","keyboard","wheel","touch"],maxScrollbarLength:null,minScrollbarLength:null,scrollingThreshold:1e3,scrollXMarginOffset:0,scrollYMarginOffset:0,suppressScrollX:!1,suppressScrollY:!1,swipeEasing:!0,useBothWheelAxes:!1,wheelPropagation:!0,wheelSpeed:1}},$Ne={"click-rail":bNe,"drag-thumb":TNe,keyboard:SNe,wheel:wNe,touch:ENe},VC=function(e,t){var r=this;if(t===void 0&&(t={}),typeof e=="string"&&(e=document.querySelector(e)),!e||!e.nodeName)throw new Error("no element is specified to initialize PerfectScrollbar");this.element=e,e.classList.add(Lh.main),this.settings=xNe();for(var s in t)this.settings[s]=t[s];this.containerWidth=null,this.containerHeight=null,this.contentWidth=null,this.contentHeight=null;var o=function(){return e.classList.add(Lh.state.focus)},l=function(){return e.classList.remove(Lh.state.focus)};this.isRtl=s_(e).direction==="rtl",this.isRtl===!0&&e.classList.add(Lh.rtl),this.isNegativeScroll=function(){var f=e.scrollLeft,g=null;return e.scrollLeft=-1,g=e.scrollLeft<0,e.scrollLeft=f,g}(),this.negativeScrollAdjustment=this.isNegativeScroll?e.scrollWidth-e.clientWidth:0,this.event=new vE,this.ownerDocument=e.ownerDocument||document,this.scrollbarXRail=WA(Lh.element.rail("x")),e.appendChild(this.scrollbarXRail),this.scrollbarX=WA(Lh.element.thumb("x")),this.scrollbarXRail.appendChild(this.scrollbarX),this.scrollbarX.setAttribute("tabindex",0),this.event.bind(this.scrollbarX,"focus",o),this.event.bind(this.scrollbarX,"blur",l),this.scrollbarXActive=null,this.scrollbarXWidth=null,this.scrollbarXLeft=null;var u=s_(this.scrollbarXRail);this.scrollbarXBottom=parseInt(u.bottom,10),isNaN(this.scrollbarXBottom)?(this.isScrollbarXUsingBottom=!1,this.scrollbarXTop=ic(u.top)):this.isScrollbarXUsingBottom=!0,this.railBorderXWidth=ic(u.borderLeftWidth)+ic(u.borderRightWidth),Wp(this.scrollbarXRail,{display:"block"}),this.railXMarginWidth=ic(u.marginLeft)+ic(u.marginRight),Wp(this.scrollbarXRail,{display:""}),this.railXWidth=null,this.railXRatio=null,this.scrollbarYRail=WA(Lh.element.rail("y")),e.appendChild(this.scrollbarYRail),this.scrollbarY=WA(Lh.element.thumb("y")),this.scrollbarYRail.appendChild(this.scrollbarY),this.scrollbarY.setAttribute("tabindex",0),this.event.bind(this.scrollbarY,"focus",o),this.event.bind(this.scrollbarY,"blur",l),this.scrollbarYActive=null,this.scrollbarYHeight=null,this.scrollbarYTop=null;var h=s_(this.scrollbarYRail);this.scrollbarYRight=parseInt(h.right,10),isNaN(this.scrollbarYRight)?(this.isScrollbarYUsingRight=!1,this.scrollbarYLeft=ic(h.left)):this.isScrollbarYUsingRight=!0,this.scrollbarYOuterWidth=this.isRtl?vNe(this.scrollbarY):null,this.railBorderYWidth=ic(h.borderTopWidth)+ic(h.borderBottomWidth),Wp(this.scrollbarYRail,{display:"block"}),this.railYMarginHeight=ic(h.marginTop)+ic(h.marginBottom),Wp(this.scrollbarYRail,{display:""}),this.railYHeight=null,this.railYRatio=null,this.reach={x:e.scrollLeft<=0?"start":e.scrollLeft>=this.contentWidth-this.containerWidth?"end":null,y:e.scrollTop<=0?"start":e.scrollTop>=this.contentHeight-this.containerHeight?"end":null},this.isAlive=!0,this.settings.handlers.forEach(function(f){return $Ne[f](r)}),this.lastScrollTop=Math.floor(e.scrollTop),this.lastScrollLeft=e.scrollLeft,this.event.bind(this.element,"scroll",function(f){return r.onScroll(f)}),wv(this)};VC.prototype.update=function(e){this.isAlive&&(this.negativeScrollAdjustment=this.isNegativeScroll?this.element.scrollWidth-this.element.clientWidth:0,Wp(this.scrollbarXRail,{display:"block"}),Wp(this.scrollbarYRail,{display:"block"}),this.railXMarginWidth=ic(s_(this.scrollbarXRail).marginLeft)+ic(s_(this.scrollbarXRail).marginRight),this.railYMarginHeight=ic(s_(this.scrollbarYRail).marginTop)+ic(s_(this.scrollbarYRail).marginBottom),Wp(this.scrollbarXRail,{display:"none"}),Wp(this.scrollbarYRail,{display:"none"}),wv(this),LR(this,"top",0,!1,!0,e),LR(this,"left",0,!1,!0,e),Wp(this.scrollbarXRail,{display:""}),Wp(this.scrollbarYRail,{display:""}))};VC.prototype.onScroll=function(e){this.isAlive&&(wv(this),LR(this,"top",this.element.scrollTop-this.lastScrollTop),LR(this,"left",this.element.scrollLeft-this.lastScrollLeft),this.lastScrollTop=Math.floor(this.element.scrollTop),this.lastScrollLeft=this.element.scrollLeft)};VC.prototype.destroy=function(){this.isAlive&&(this.event.unbindAll(),sw(this.scrollbarX),sw(this.scrollbarY),sw(this.scrollbarXRail),sw(this.scrollbarYRail),this.removePsClasses(),this.element=null,this.scrollbarX=null,this.scrollbarY=null,this.scrollbarXRail=null,this.scrollbarYRail=null,this.isAlive=!1)};VC.prototype.removePsClasses=function(){this.element.className=this.element.className.split(" ").filter(function(e){return!e.match(/^ps([-_].+|)$/)}).join(" ")};function Jw(n){"@babel/helpers - typeof";return Jw=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Jw(n)}var CNe=["className","style","option","options","containerRef","onScrollY","onScrollX","onScrollUp","onScrollDown","onScrollLeft","onScrollRight","onYReachStart","onYReachEnd","onXReachStart","onXReachEnd","component","onSync","children"];function mB(){return mB=Object.assign?Object.assign.bind():function(n){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function ANe(n,e){if(n==null)return{};var t={},r=Object.keys(n),s,o;for(o=0;o=0)&&(t[s]=n[s]);return t}function INe(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function B9(n,e){for(var t=0;t0&&arguments[0]!==void 0?arguments[0]:{};Object.keys(II).forEach(function(o){var l=r.props[II[o]],u=s[II[o]];if(l!==u){if(u){var h=r._handlerByEvent[o];r._container.removeEventListener(o,h,!1),r._handlerByEvent[o]=null}if(l){var f=function(){return l(r._container)};r._container.addEventListener(o,f,!1),r._handlerByEvent[o]=f}}})}},{key:"_updateClassName",value:function(){var r=this.props.className,s=this._container.className.split(" ").filter(function(o){return o.match(/^ps([-_].+|)$/)}).join(" ");this._container&&(this._container.className="scrollbar-container".concat(r?" ".concat(r):"").concat(s?" ".concat(s):""))}},{key:"updateScroll",value:function(){var r=this.props.onSync;typeof r=="function"?r(this._ps):this._ps.update()}},{key:"handleRef",value:function(r){var s,o;this._container=r,(s=(o=this.props).containerRef)===null||s===void 0||s.call(o,r)}},{key:"render",value:function(){var r=this.props;r.className;var s=r.style;r.option,r.options,r.containerRef,r.onScrollY,r.onScrollX,r.onScrollUp,r.onScrollDown,r.onScrollLeft,r.onScrollRight,r.onYReachStart,r.onYReachEnd,r.onXReachStart,r.onXReachEnd;var o=r.component;r.onSync;var l=r.children,u=MNe(r,CNe),h=typeof o>"u"?"div":o;return yt.createElement(h,mB({style:s,ref:this.handleRef},u),l)}}]),e}(me.Component);function aC(n){"@babel/helpers - typeof";return aC=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},aC(n)}var PNe=["className","variant","children"];function _B(){return _B=Object.assign?Object.assign.bind():function(n){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function HNe(n,e){if(n==null)return{};var t={},r=Object.keys(n),s,o;for(o=0;o=0)&&(t[s]=n[s]);return t}var F9=function(e){var t=e.className,r=t===void 0?void 0:t,s=e.variant,o=s===void 0?"default":s,l=e.children,u=UNe(e,PNe),h="".concat(li,"-loader"),f=yt.Children.count(l)>0?"".concat(h,"--content"):"";return yt.createElement("div",_B({},u,{className:Ps(h,f,BNe({},"".concat(h,"--variant-").concat(o),o!=="default"),r),role:"status"}),l)};function lC(n){"@babel/helpers - typeof";return lC=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},lC(n)}var GNe=["className","children","blur","grayscale"];function vB(){return vB=Object.assign?Object.assign.bind():function(n){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function YNe(n,e){if(n==null)return{};var t={},r=Object.keys(n),s,o;for(o=0;o=0)&&(t[s]=n[s]);return t}var XNe=function(e){var t=e.className,r=t===void 0?"":t,s=e.children,o=s===void 0?void 0:s,l=e.blur,u=l===void 0?!1:l,h=e.grayscale,f=h===void 0?!1:h,g=jNe(e,GNe),y="".concat(li,"-overlay"),b="".concat(y,"--blur"),w="".concat(y,"--grayscale");return yt.createElement("div",vB({},g,{className:Ps(y,z9({},b,u),z9({},w,f),r)}),yt.createElement("div",{className:"".concat(y,"__content")},o))},KNe=["sender","sentTime","children","className"];function yB(){return yB=Object.assign?Object.assign.bind():function(n){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function qNe(n,e){if(n==null)return{};var t={},r=Object.keys(n),s,o;for(o=0;o=0)&&(t[s]=n[s]);return t}var rz=function(e){var t=e.sender,r=t===void 0?"":t,s=e.sentTime,o=s===void 0?"":s,l=e.children,u=l===void 0?void 0:l,h=e.className,f=JNe(e,KNe),g="".concat(li,"-message__header");return yt.createElement("div",yB({},f,{className:Ps(g,h)}),typeof u<"u"?u:yt.createElement(yt.Fragment,null,yt.createElement("div",{className:"".concat(li,"-message__sender-name")},r),yt.createElement("div",{className:"".concat(li,"-message__sent-time")},o)))};rz.displayName="Message.Header";var QNe=["sender","sentTime","children","className"];function bB(){return bB=Object.assign?Object.assign.bind():function(n){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function eDe(n,e){if(n==null)return{};var t={},r=Object.keys(n),s,o;for(o=0;o=0)&&(t[s]=n[s]);return t}var iz=function(e){var t=e.sender,r=t===void 0?"":t,s=e.sentTime,o=s===void 0?"":s,l=e.children,u=l===void 0?void 0:l,h=e.className,f=ZNe(e,QNe),g="".concat(li,"-message__footer");return yt.createElement("div",bB({},f,{className:Ps(g,h)}),typeof u<"u"?u:yt.createElement(yt.Fragment,null,yt.createElement("div",{className:"".concat(li,"-message__sender-name")},r),yt.createElement("div",{className:"".concat(li,"-message__sent-time")},o)))};iz.displayName="Message.Footer";var sz=function(e){var t=e.children,r=e.className,s="".concat(li,"-message__custom-content");return yt.createElement("div",{className:Ps(s,r)},t)};sz.displayName="Message.CustomContent";var DR=function(e){var t=e.src,r=e.width,s=e.height,o=e.alt,l=e.className,u="".concat(li,"-message__image-content"),h={width:typeof r=="number"?"".concat(r,"px"):typeof r=="string"?r:void 0,height:typeof s=="number"?"".concat(s,"px"):typeof s=="string"?s:void 0};return yt.createElement("div",{className:Ps(u,l)},yt.createElement("img",{src:t,style:h,alt:o}))};DR.displayName="Message.ImageContent";var PR=function(e){var t=e.html,r=e.className,s="".concat(li,"-message__html-content"),o=function(){return{__html:t}};return yt.createElement("div",{className:Ps(s,r),dangerouslySetInnerHTML:o()})};PR.displayName="Message.HtmlContent";var BR=function(e){var t=e.text,r=e.className,s=e.children,o="".concat(li,"-message__text-content"),l=s??t;return yt.createElement("div",{className:Ps(o,r)},l)};BR.displayName="Message.TextContent";var tDe=["model","avatarSpacer","avatarPosition","type","payload","children","className"];function TB(){return TB=Object.assign?Object.assign.bind():function(n){for(var e=1;en.length)&&(e=n.length);for(var t=0,r=new Array(e);t=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function cDe(n,e){if(n==null)return{};var t={},r=Object.keys(n),s,o;for(o=0;o=0)&&(t[s]=n[s]);return t}var Ev=function(e){var t,r,s=e.model,o=s.message,l=o===void 0?"":o,u=s.sentTime,h=u===void 0?"":u,f=s.sender,g=f===void 0?"":f,y=s.direction,b=y===void 0?1:y,w=s.position,C=s.type,M=s.payload,A=e.avatarSpacer,k=A===void 0?!1:A,L=e.avatarPosition,P=L===void 0?void 0:L,D=e.type,z=D===void 0?"html":D,U=e.payload,V=e.children,H=e.className,oe=uDe(e,tDe),le="".concat(li,"-message"),Z=HC(V,[UC,rz,iz,PR,BR,DR,sz]),q=iDe(Z,7),he=q[0],ae=q[1],ue=q[2],ge=q[3],we=q[4],J=q[5],re=q[6],se=function(){if(b===0||b==="incoming")return"".concat(le,"--incoming");if(b===1||b==="outgoing")return"".concat(le,"--outgoing")}(),fe=function(Re){var Ze="".concat(le,"--avatar-");if(Re===0||Re==="top-left"||Re==="tl")return"".concat(Ze,"tl");if(Re===1||Re==="top-right"||Re==="tr")return"".concat(Ze,"tr");if(Re===2||Re==="bottom-right"||Re==="br")return"".concat(Ze,"br");if(Re===3||Re==="bottom-left"||Re==="bl")return"".concat(Ze,"bl");if(Re===4||Re==="center-left"||Re==="cl")return"".concat(Ze,"cl");if(Re===5||Re==="center-right"||Re==="cr")return"".concat(Ze,"cr")}(P),Te=function(Re){var Ze="".concat(li,"-message--");if(Re==="single"||Re===0)return"".concat(Ze,"single");if(Re==="first"||Re===1)return"".concat(Ze,"first");if(Re==="normal"||Re===2)return"";if(Re==="last"||Re===3)return"".concat(Ze,"last")}(w),Fe=function(){return(g==null?void 0:g.length)>0&&(h==null?void 0:h.length)>0?"".concat(g,": ").concat(h):(g==null?void 0:g.length)>0&&(typeof h>"u"||(h==null?void 0:h.length)===0)?g:null}(),Ie=(t=(r=ge??we)!==null&&r!==void 0?r:J)!==null&&t!==void 0?t:re,qe=Ie??function(){var Re=C??z,Ze=M??l,rt=Ze??U,ft=qw(rt)==="object"?Aee(rt):"";if(Re==="html"&&ft!=="Message.CustomContent")return yt.createElement(PR,{html:rt});if(Re==="text")return yt.createElement(BR,{text:rt});if(Re==="image")return yt.createElement(DR,rt);if(Re==="custom"||ft==="Message.CustomContent")return rt}();return yt.createElement("section",TB({},oe,{"aria-label":Fe,className:Ps(le,se,U9({},"".concat(le,"--avatar-spacer"),k),Te,fe,H)},U9({},"data-".concat(li,"-message"),"")),typeof he<"u"&&yt.createElement("div",{className:"".concat(le,"__avatar")},he),yt.createElement("div",{className:"".concat(le,"__content-wrapper")},ae,yt.createElement("div",{className:"".concat(le,"__content")},qe),ue))};Ev.Header=rz;Ev.HtmlContent=PR;Ev.TextContent=BR;Ev.ImageContent=DR;Ev.CustomContent=sz;Ev.Footer=iz;var hDe=["children","className"];function SB(){return SB=Object.assign?Object.assign.bind():function(n){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function fDe(n,e){if(n==null)return{};var t={},r=Object.keys(n),s,o;for(o=0;o=0)&&(t[s]=n[s]);return t}var oz=function(e){var t=e.children,r=t===void 0?void 0:t,s=e.className,o=dDe(e,hDe),l="".concat(li,"-message-group__header");return yt.createElement("div",SB({},o,{className:Ps(l,s)}),r)};oz.displayName="MessageGroup.Header";var pDe=["children","className"];function wB(){return wB=Object.assign?Object.assign.bind():function(n){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function gDe(n,e){if(n==null)return{};var t={},r=Object.keys(n),s,o;for(o=0;o=0)&&(t[s]=n[s]);return t}var az=function(e){var t=e.children,r=t===void 0?void 0:t,s=e.className,o=mDe(e,pDe),l="".concat(li,"-message-group__footer");return yt.createElement("div",wB({},o,{className:Ps(l,s)}),r)};az.displayName="MessageGroup.Footer";var _De=["children","className"];function EB(){return EB=Object.assign?Object.assign.bind():function(n){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function yDe(n,e){if(n==null)return{};var t={},r=Object.keys(n),s,o;for(o=0;o=0)&&(t[s]=n[s]);return t}var lz=function(e){var t=e.children,r=t===void 0?void 0:t,s=e.className,o=vDe(e,_De),l="".concat(li,"-message-group");return yt.createElement("div",EB({},o,{className:Ps("".concat(l,"__messages"),s)}),r)};lz.displayName="MessageGroup.Messages";function uC(n){"@babel/helpers - typeof";return uC=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},uC(n)}var bDe=["direction","avatarPosition","sender","sentTime","children","className"];function xB(){return xB=Object.assign?Object.assign.bind():function(n){for(var e=1;en.length)&&(e=n.length);for(var t=0,r=new Array(e);t=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function IDe(n,e){if(n==null)return{};var t={},r=Object.keys(n),s,o;for(o=0;o=0)&&(t[s]=n[s]);return t}var $2=function(e){var t=e.direction,r=t===void 0?"incoming":t,s=e.avatarPosition,o=s===void 0?void 0:s,l=e.sender,u=l===void 0?"":l,h=e.sentTime,f=h===void 0?"":h,g=e.children,y=e.className,b=ADe(e,bDe),w="".concat(li,"-message-group"),C=function(){if(r===0||r==="incoming")return"".concat(w,"--incoming");if(r===1||r==="outgoing")return"".concat(w,"--outgoing")}(),M=function(){var V="".concat(w,"--avatar-");if(typeof o=="string"&&(o==="tl"||o==="top-left"||o==="tr"||o==="top-right"||o==="bl"||o==="bottom-right"||o==="br"||o==="bottom-right"||o==="cl"||o==="center-left"||o==="cr"||o==="center-right"))return"".concat(V).concat(o)}(),A=HC(g,[UC,oz,az,lz]),k=EDe(A,4),L=k[0],P=k[1],D=k[2],z=k[3],U=function(){return u.length>0&&f.length>0?"".concat(u,": ").concat(f):u.length>0&&f.length===0?u:null}();return yt.createElement("section",xB({"aria-label":U},b,{className:Ps(w,C,M,y)},TDe({},"data-".concat(li,"-message-group"),"")),typeof L<"u"&&yt.createElement("div",{className:"".concat(w,"__avatar")},L),yt.createElement("div",{className:"".concat(w,"__content")},P,z,D))};$2.Header=oz;$2.Footer=az;$2.Messages=lz;var RDe=["content","as","children","className"];function $B(){return $B=Object.assign?Object.assign.bind():function(n){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function ODe(n,e){if(n==null)return{};var t={},r=Object.keys(n),s,o;for(o=0;o=0)&&(t[s]=n[s]);return t}var LDe=function(e){var t=e.content,r=t===void 0?void 0:t,s=e.as,o=s===void 0?"div":s,l=e.children,u=l===void 0?void 0:l,h=e.className,f=kDe(e,RDe),g="".concat(li,"-message-separator"),y=function(){return typeof o=="string"&&o.length>0?o:"div"}();return yt.createElement(y,$B({},f,{className:Ps(g,h)}),kOe(u)===!0?r:u)},NDe=["className","children"];function CB(){return CB=Object.assign?Object.assign.bind():function(n){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function PDe(n,e){if(n==null)return{};var t={},r=Object.keys(n),s,o;for(o=0;o=0)&&(t[s]=n[s]);return t}var C2=function(e){var t=e.className,r=e.children,s=DDe(e,NDe);return yt.createElement("div",CB({},s,{className:t}),r)};C2.displayName="MessageList.Content";var BDe=["children","typingIndicator","loading","loadingMore","loadingMorePosition","onYReachStart","onYReachEnd","className","disableOnYReachWhenNoScroll","scrollBehavior","autoScrollToBottom","autoScrollToBottomOnMount"];function Qw(n){"@babel/helpers - typeof";return Qw=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Qw(n)}function cC(){return cC=Object.assign?Object.assign.bind():function(n){for(var e=1;en.length)&&(e=n.length);for(var t=0,r=new Array(e);t=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function VDe(n,e){if(n==null)return{};var t={},r=Object.keys(n),s,o;for(o=0;o=0)&&(t[s]=n[s]);return t}function jDe(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function V9(n,e){for(var t=0;t=1?r.preventScrollTop===!1&&(s.scrollTop=Math.round(s.scrollTop)-l):s.scrollTop=s.scrollTop-l,r.lastClientHeight=s.clientHeight,r.scrollRef.current.updateScroll()}r.resizeTicking=!1}),r.resizeTicking=!0)}),i1(BS(r),"isSticked",function(){var s=r.containerRef.current;return s.scrollHeight===Math.round(s.scrollTop+s.clientHeight)}),i1(BS(r),"handleScroll",function(){r.scrollTicking===!1&&(window.requestAnimationFrame(function(){r.noScroll===!1?r.preventScrollTop=r.isSticked():r.noScroll=!1,r.scrollTicking=!1}),r.scrollTicking=!0)}),i1(BS(r),"getLastMessageOrGroup",function(){var s=r.containerRef.current.querySelector("[data-".concat(li,"-message-list]>[data-").concat(li,"-message]:last-of-type,[data-").concat(li,"-message-list]>[data-").concat(li,"-message-group]:last-of-type")),o=s==null?void 0:s.querySelector("[data-".concat(li,"-message]:last-of-type"));return{lastElement:s,lastMessageInGroup:o}}),r.scrollPointRef=yt.createRef(),r.containerRef=yt.createRef(),r.scrollRef=yt.createRef(),r.lastClientHeight=0,r.preventScrollTop=!1,r.resizeObserver=void 0,r.scrollTicking=!1,r.resizeTicking=!1,r.noScroll=void 0,r}return YDe(e,[{key:"getSnapshotBeforeUpdate",value:function(){var r=this.containerRef.current,s=Math.round(r.scrollTop+r.clientHeight),o=r.scrollHeight===s||r.scrollHeight+1===s||r.scrollHeight-1===s;return{sticky:o,clientHeight:r.clientHeight,scrollHeight:r.scrollHeight,lastMessageOrGroup:this.getLastMessageOrGroup(),diff:r.scrollHeight-r.scrollTop}}},{key:"componentDidMount",value:function(){this.props.autoScrollToBottomOnMount===!0&&this.scrollToEnd(this.props.scrollBehavior),this.lastClientHeight=this.containerRef.current.clientHeight,window.addEventListener("resize",this.handleResize),typeof window.ResizeObserver=="function"&&(this.resizeObserver=new ResizeObserver(this.handleContainerResize),this.resizeObserver.observe(this.containerRef.current)),this.containerRef.current.addEventListener("scroll",this.handleScroll)}},{key:"componentDidUpdate",value:function(r,s,o){var l=this.props.autoScrollToBottom;if(typeof o<"u"){var u=this.containerRef.current,h=this.getLastMessageOrGroup(),f=h.lastElement,g=h.lastMessageInGroup;if(f===o.lastMessageOrGroup.lastElement&&(typeof g>"u"||g===o.lastMessageOrGroup.lastMessageInGroup)&&(u.scrollTop=u.scrollHeight-o.diff+(this.lastClientHeight-u.clientHeight)),o.sticky===!0)l===!0&&this.scrollToEnd(this.props.scrollBehavior),this.preventScrollTop=!0;else if(o.clientHeight"u"||g===o.lastMessageOrGroup.lastMessageInGroup)&&u.scrollTop===0&&u.scrollHeight>o.scrollHeight&&(u.scrollTop=u.scrollHeight-o.scrollHeight);this.lastClientHeight=o.clientHeight}}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this.handleResize),typeof this.resizeObserver<"u"&&this.resizeObserver.disconnect(),this.containerRef.current.removeEventListener("scroll",this.handleScroll)}},{key:"scrollToEnd",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props.scrollBehavior,s=this.containerRef.current,o=this.scrollPointRef.current,l=s.getBoundingClientRect(),u=o.getBoundingClientRect(),h=u.top+s.scrollTop-l.top;s.scrollBy?s.scrollBy({top:h,behavior:r}):s.scrollTop=h,this.lastClientHeight=s.clientHeight,this.noScroll=!0}},{key:"render",value:function(){var r=this,s=this.props,o=s.children,l=s.typingIndicator,u=s.loading,h=s.loadingMore,f=s.loadingMorePosition,g=s.onYReachStart,y=s.onYReachEnd,b=s.className,w=s.disableOnYReachWhenNoScroll;s.scrollBehavior,s.autoScrollToBottom,s.autoScrollToBottomOnMount;var C=WDe(s,BDe),M="".concat(li,"-message-list"),A=HC(o,[C2]),k=FDe(A,1),L=k[0];return yt.createElement("div",cC({},C,{className:Ps(M,b)}),h&&yt.createElement("div",{className:Ps("".concat(M,"__loading-more"),i1({},"".concat(M,"__loading-more--bottom"),f==="bottom"))},yt.createElement(F9,null)),u&&yt.createElement(XNe,null,yt.createElement(F9,null)),yt.createElement(mte,cC({onYReachStart:g,onYReachEnd:y,onSync:function(D){return D.update(w)},className:"".concat(M,"__scroll-wrapper"),ref:this.scrollRef,containerRef:function(D){return r.containerRef.current=D},options:{suppressScrollX:!0}},i1({},"data-".concat(li,"-message-list"),""),{style:{overscrollBehaviorY:"none",overflowAnchor:"auto",touchAction:"none"}}),L||o,yt.createElement("div",{className:"".concat(M,"__scroll-to"),ref:this.scrollPointRef})),typeof l<"u"&&yt.createElement("div",{className:"".concat(M,"__typing-indicator-container")},l))}}]),e}(yt.Component);uz.displayName="MessageList";function QDe(n,e){var t=me.useRef(),r=function(o){return t.current.scrollToEnd(o)};return me.useImperativeHandle(e,function(){return{scrollToBottom:r}}),yt.createElement(uz,cC({ref:t},n))}var yE=me.forwardRef(QDe);yE.propTypes={children:Iee([Ev,$2,LDe,C2]),typingIndicator:Qt.node,loading:Qt.bool,loadingMore:Qt.bool,loadingMorePosition:Qt.oneOf(["top","bottom"]),onYReachStart:Qt.func,onYReachEnd:Qt.func,disableOnYReachWhenNoScroll:Qt.bool,autoScrollToBottom:Qt.bool,autoScrollToBottomOnMount:Qt.bool,scrollBehavior:Qt.oneOf(["auto","smooth"]),className:Qt.string};yE.defaultProps={typingIndicator:void 0,loading:!1,loadingMore:!1,loadingMorePosition:"top",disableOnYReachWhenNoScroll:!1,autoScrollToBottom:!0,autoScrollToBottomOnMount:!0,scrollBehavior:"auto"};uz.defaultProps=yE.defaultProps;yE.Content=C2;function Zw(n){"@babel/helpers - typeof";return Zw=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Zw(n)}function ZDe(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function j9(n,e){for(var t=0;t"u"||r.value!==s.current.innerHTML?!0:l!==r.placeholder||u!==r.disabled||h!==r.activateAfterChange}},{key:"componentDidUpdate",value:function(){var r=this.msgRef,s=this.props,o=s.value,l=s.activateAfterChange;o!==r.current.innerHTML&&(r.current.innerHTML=typeof o=="string"?o:""),sPe(r.current,l)}},{key:"render",value:function(){var r=this.msgRef,s=this.handleInput,o=this.handleKeyPress,l=this.innerHTML,u=this.props,h=u.placeholder,f=u.disabled,g=u.className,y=typeof h=="string"?h:"";return yt.createElement("div",{ref:r,className:g,contentEditable:f===!1,disabled:f,"data-placeholder":y,onInput:s,onKeyPress:o,dangerouslySetInnerHTML:l()})}}]),e}(me.Component);function eE(n){"@babel/helpers - typeof";return eE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},eE(n)}var aPe=["fancyScroll","children","forwardedRef"],lPe=["value","onSend","onChange","autoFocus","placeholder","fancyScroll","className","activateAfterChange","disabled","sendDisabled","sendOnReturnDisabled","attachDisabled","sendButton","attachButton","onAttachClick"];function uPe(n,e,t){return e=Tte(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function IB(n,e){return fPe(n)||dPe(n,e)||hPe(n,e)||cPe()}function cPe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hPe(n,e){if(n){if(typeof n=="string")return Y9(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);if(t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set")return Array.from(n);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Y9(n,e)}}function Y9(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=new Array(e);t=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function pPe(n,e){if(n==null)return{};var t={},r=Object.keys(n),s,o;for(o=0;o=0)&&(t[s]=n[s]);return t}function mPe(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function X9(n,e){for(var t=0;t0){r===void 0&&se(""),typeof P>"u"&&Ie(!0);var He=Re();o(re,He[0],He[1],He[2])}},rt=function(He){He.key==="Enter"&&He.shiftKey===!1&&z===!1&&(He.preventDefault(),Ze())},ft=function(He,it,st){se(He),typeof P>"u"&&Ie(it.length===0),typeof ue.current.updateScroll=="function"&&ue.current.updateScroll();var Nt=Re();u(He,it,st,Nt[2])},ut="".concat(li,"-message-input"),ze=typeof y=="string"?y:"";return yt.createElement("div",yw({},ae,{className:Ps(ut,uPe({},"".concat(ut,"--disabled"),L),C)}),Z===!0&&yt.createElement("div",{className:"".concat(ut,"__tools")},yt.createElement(qLe,{onClick:he,disabled:L===!0||V===!0})),yt.createElement("div",{className:"".concat(ut,"__content-editor-wrapper")},yt.createElement(wPe,{fancyScroll:w,ref:ue,className:"".concat(ut,"__content-editor-container")},yt.createElement(oPe,{ref:ge,className:"".concat(ut,"__content-editor"),disabled:L,placeholder:ze,onKeyPress:rt,onChange:ft,activateAfterChange:A,value:re}))),oe===!0&&yt.createElement("div",{className:"".concat(ut,"__tools")},yt.createElement(YLe,{onClick:Ze,disabled:L===!0||Fe===!0})))}var M2=me.forwardRef(EPe);M2.displayName="MessageInput";M2.propTypes={value:Qt.string,placeholder:Qt.string,disabled:Qt.bool,sendOnReturnDisabled:Qt.bool,sendDisabled:Qt.bool,fancyScroll:Qt.bool,activateAfterChange:Qt.bool,autoFocus:Qt.bool,onChange:Qt.func,onSend:Qt.func,className:Qt.string,sendButton:Qt.bool,attachButton:Qt.bool,attachDisabled:Qt.bool,onAttachClick:Qt.func};var xPe=["className","children"];function kB(){return kB=Object.assign?Object.assign.bind():function(n){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function CPe(n,e){if(n==null)return{};var t={},r=Object.keys(n),s,o;for(o=0;o=0)&&(t[s]=n[s]);return t}var wte=function(e){var t=e.className,r=e.children,s=$Pe(e,xPe),o="".concat(li,"-input-toolbox");return yt.createElement("div",kB({},s,{className:Ps(o,t)}),r)};wte.displayName="InputToolbox";var MPe=["children","className"];function OB(){return OB=Object.assign?Object.assign.bind():function(n){for(var e=1;en.length)&&(e=n.length);for(var t=0,r=new Array(e);t=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function NPe(n,e){if(n==null)return{};var t={},r=Object.keys(n),s,o;for(o=0;o=0)&&(t[s]=n[s]);return t}var DPe=function(e){var t=e.children,r=t===void 0?void 0:t,s=e.className,o=LPe(e,MPe),l="".concat(li,"-chat-container"),u=HC(r,[GC,yE,M2,wte]),h=APe(u,4),f=h[0],g=h[1],y=h[2],b=h[3];return yt.createElement("div",OB({},o,{className:Ps(l,s)}),f,g,y,b)},W1="".concat(li,"-conversation");function hC(n){"@babel/helpers - typeof";return hC=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},hC(n)}var PPe=["children","className","visible"];function LB(){return LB=Object.assign?Object.assign.bind():function(n){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function HPe(n,e){if(n==null)return{};var t={},r=Object.keys(n),s,o;for(o=0;o=0)&&(t[s]=n[s]);return t}var GPe=function(e){var t=e.children,r=e.className,s=e.visible,o=UPe(e,PPe);return yt.createElement("div",LB({},o,{className:Ps("".concat(W1,"__operations"),BPe({},"".concat(W1,"__operations--visible"),s),r)}),yt.Children.count(t)>0?t:yt.createElement(g_,{icon:ote.faEllipsisV}))};GPe.displayName="Conversation.Operations";var WPe=["lastSenderName","info","name","children","className"];function NB(){return NB=Object.assign?Object.assign.bind():function(n){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function jPe(n,e){if(n==null)return{};var t={},r=Object.keys(n),s,o;for(o=0;o=0)&&(t[s]=n[s]);return t}var YPe=function(e){var t=e.name;return yt.createElement(yt.Fragment,null,yt.createElement("div",{className:"".concat(W1,"__last-sender")},t),":")},XPe=function(e){var t=e.info;return yt.createElement("div",{className:"".concat(W1,"__info-content")},t)},KPe=function(e){var t=e.lastSenderName,r=e.info,s=e.name,o=e.children,l=e.className,u=VPe(e,WPe),h=DB(t);return yt.createElement("div",NB({},u,{className:Ps("".concat(W1,"__content"),l)}),yt.Children.count(o)>0?o:yt.createElement(yt.Fragment,null,yt.createElement("div",{className:"".concat(W1,"__name")},s),yt.createElement("div",{className:"".concat(W1,"__info")},h!=="undefined"?yt.createElement(yt.Fragment,null,h==="string"?yt.createElement(YPe,{name:t}):t," "):null,typeof r<"u"&&yt.createElement(XPe,{info:r}))))};KPe.displayName="Conversation.Content";/*! * Font Awesome Free 5.15.4 by @fontawesome - https://fontawesome.com * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) - */var JPe={prefix:"fas",iconName:"search",icon:[512,512,[],"f002","M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z"]},qPe={prefix:"fas",iconName:"times",icon:[352,512,[],"f00d","M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"]};function dC(n){"@babel/helpers - typeof";return dC=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},dC(n)}var QPe=["placeholder","value","onChange","onClearClick","className","disabled"];function PB(){return PB=Object.assign?Object.assign.bind():function(n){for(var e=1;en.length)&&(e=n.length);for(var t=0,r=new Array(e);t=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function oBe(n,e){if(n==null)return{};var t={},r=Object.keys(n),s,o;for(o=0;o=0)&&(t[s]=n[s]);return t}var aBe=function(e,t){return typeof t>"u"?pe.useState(e):[t,function(){}]};function lBe(n,e){var t=n.placeholder,r=t===void 0?"":t,s=n.value,o=s===void 0?void 0:s,l=n.onChange,u=l===void 0?function(){}:l,h=n.onClearClick,f=h===void 0?function(){}:h,g=n.className,y=n.disabled,b=y===void 0?!1:y,w=sBe(n,QPe),C="".concat(li,"-search"),M=pe.useMemo(function(){return typeof o<"u"},[]),A=aBe("",o),k=q9(A,2),L=k[0],P=k[1],D=pe.useState(M?L.length>0:!1),z=q9(D,2),U=z[0],V=z[1];if(M!==typeof o<"u")throw"Search: Changing from controlled to uncontrolled component and vice versa is not allowed";var H=pe.useRef(void 0),oe=function(){typeof H.current<"u"&&H.current.focus()};pe.useImperativeHandle(e,function(){return{focus:oe}});var le=function(he){var ae=he.target.value;V(ae.length>0),M===!1&&P(ae),u(ae)},Z=function(){M===!1&&P(""),V(!1),f()};return yt.createElement("div",PB({},w,{className:Ps(C,J9({},"".concat(C,"--disabled"),b),g)}),yt.createElement(g_,{icon:JPe,className:"".concat(C,"__search-icon")}),yt.createElement("input",{ref:H,type:"text",className:"".concat(C,"__input"),placeholder:r,onChange:le,disabled:b,value:L}),yt.createElement(g_,{icon:qPe,className:Ps("".concat(C,"__clear-icon"),J9({},"".concat(C,"__clear-icon--active"),U)),onClick:Z}))}var wte=pe.forwardRef(lBe);wte.displayName="Search";wte.propTypes={placeholder:qt.string,value:qt.string,onChange:qt.func,onClearClick:qt.func,className:qt.string,disabled:qt.bool};function fC(n){"@babel/helpers - typeof";return fC=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},fC(n)}var uBe=["className","children","size","selected","onChange","itemsTabIndex"];function BB(){return BB=Object.assign?Object.assign.bind():function(n){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function pBe(n,e){if(n==null)return{};var t={},r=Object.keys(n),s,o;for(o=0;o=0)&&(t[s]=n[s]);return t}function mBe(n,e){var t=n.className,r=n.children,s=n.size,o=n.selected,l=n.onChange,u=l===void 0?AI:l,h=n.itemsTabIndex,f=fBe(n,uBe),g="".concat(li,"-status-list"),y=pe.useRef();pe.useImperativeHandle(e,function(){return{focus:function(C){var M=Array.from(y.current.querySelectorAll("li")),A=M.filter(function(k){return k.parentNode===y.current});typeof A[C]<"u"&&A[C].focus()}}});var b=h;return yt.createElement("ul",BB({ref:y},f,{className:Ps(g,t,cBe({},"".concat(g,"--").concat(s),s))}),yt.Children.map(r,function(w){var C={};o&&(C.selected=w.props.status===o),u&&(C.onClick=function(k){u(w.props.status),w.onClick&&w.onClick(k)});var M=function(L){u&&L.key==="Enter"&&L.shiftKey===!1&&L.altKey===!1&&u(w.props.status)},A=function(){if(typeof b=="number")return b>0?b++:b}();return yt.createElement("li",{tabIndex:A,onKeyPress:M},yt.cloneElement(w,C))}))}var Ete=pe.forwardRef(mBe);Ete.displayName="StatusList";Ete.propTypes={children:Aee([Cee]),selected:qt.oneOf(xee),size:qt.oneOf($ee),itemsTabIndex:qt.number,className:qt.string,onChange:qt.func};const RI=n=>n.includes("[Need Help]")?"Please help me.":n.includes("[Done]")?"Next phase.":n.replaceAll("","").replaceAll("","").replace("[Summary]","Summary: "),gBe=n=>{let e=[],t=n.split(""),r=RI(t.shift()).trim();return t.forEach(s=>{if(s.includes("")){let o=s.split("");e.push(o[0].trim()),o[1].length>0&&(r=r.concat(" ",RI(o[1]).trim()))}else r=r.concat(" ",RI(s.trim()))}),[r,e]};function _Be(n){let e=Bn(qi(o=>o.chatMessageHistory)),t=Bn(qi(o=>o.addMessageToHistory)),r=e.length,s=gBe(e[r-1].content);return De.jsxs(DPe,{style:{height:"100%"},children:[De.jsxs(yE,{children:[e.map((o,l)=>{if(l!=0)return l0&&De.jsx("div",{style:{paddingTop:"5px",paddingBottom:"5px"},children:s[1].map((o,l)=>De.jsx(qp,{text:o,clickFunction:()=>t(o)},l))}),De.jsx("div",{style:{right:0,bottom:5,position:"absolute"},children:De.jsx(qp,{text:"Next Phase",clickFunction:()=>t("[Done]")},"next-phase-btn")})]}),De.jsx(M2,{placeholder:"Type message here",attachButton:!1,onSend:t})]})}const AN=pr("div")(({theme:n})=>({textAlign:"center",height:"100%"}));function vBe(n){return De.jsxs(L1,{orientation:"vertical",style:{height:"100%",width:"100vw"},children:[De.jsx(Z0,{flex:.65,children:De.jsxs(L1,{orientation:"horizontal",children:[De.jsx(Z0,{flex:.3,children:De.jsx(AN,{style:{width:"100%"},children:De.jsx(mOe,{})})}),De.jsx(kf,{propagate:!0}),De.jsx(Z0,{flex:.7,children:De.jsx(AN,{style:{width:"100%",height:"100%"},children:De.jsx(_Be,{})})})]})}),De.jsx(kf,{propagate:!0}),De.jsx(Z0,{flex:.35,children:De.jsxs(L1,{orientation:"horizontal",children:[De.jsx(Z0,{children:De.jsx(AN,{children:De.jsx(zF,{isPlanningScreen:!0})})}),De.jsx(kf,{propagate:!0}),De.jsx(Z0,{children:De.jsx("div",{style:{textAlign:"center",height:"100%",alignItems:"center",display:"flex"},children:De.jsx(oc,{container:!0,alignItems:"center",children:De.jsx(oc,{item:!0,xs:12,alignItems:"center",children:De.jsx("img",{style:{alignContent:"center",width:"70%",height:"70%"},src:WK})})})})})]})})]})}function yBe(n){const e=Bn(t=>t.updateScreen);return De.jsxs(oc,{container:!0,direction:"row",justifyContent:"center",spacing:2,style:{height:"100%",textAlign:"center",alignContent:"center",backgroundColor:"#E4E5F1",marginTop:0},children:[De.jsx(oc,{item:!0,xs:1}),De.jsx(oc,{item:!0,xs:3,children:De.jsx(qp,{text:yX,clickFunction:()=>e(rF),style:{padding:"50px"}})}),De.jsx(oc,{item:!0,xs:2}),De.jsx(oc,{item:!0,xs:3,children:De.jsx(qp,{text:bX,clickFunction:()=>e(fw),style:{padding:"50px"}})}),De.jsx(oc,{item:!0,xs:1})]})}const IN=pr("div")(({theme:n})=>({textAlign:"center",height:"100%"}));Zg.common.defineBlocks(Oie);Object.assign(Cw.javascriptGenerator.forBlock,ik);function bBe(){const n=Bn(qi(o=>o.llmMode)),e=Bn(qi(o=>o.llmProcessing)),t=Bn(qi(o=>o.headerHeight)),r=Bn(o=>o.fullScreenPanel),s=Bn(o=>o.screenToShow);return De.jsxs(Ey,{width:"100vw",height:`calc(100vh - ${t}px)`,padding:0,children:[De.jsx(pve,{}),s===nF&&De.jsx(yBe,{}),s===rF&&De.jsx(vBe,{}),s===fw&&r&&De.jsx(KH,{style:{width:"100vw"}}),s===fw&&!r&&De.jsxs(L1,{orientation:"vertical",style:{height:"100%",width:"100vw"},children:[De.jsx(Z0,{flex:.55,children:De.jsxs(IN,{style:{width:"100%",height:"100%"},children:[r&&De.jsx(KH,{}),!r&&De.jsx($ve,{})]})}),De.jsx(kf,{propagate:!0}),De.jsx(Z0,{flex:.45,children:De.jsxs(L1,{orientation:"horizontal",children:[De.jsx(Z0,{children:De.jsx(IN,{children:!n&&De.jsx(uOe,{})})}),De.jsx(kf,{propagate:!0}),De.jsx(Z0,{children:De.jsx(IN,{children:!n&&De.jsx(zF,{})})})]})})]}),De.jsx(OF,{style:{color:"#fff",zIndex:1500},open:e,children:De.jsx("img",{src:Cve,style:{width:"10%"}})}),De.jsx(dOe,{}),De.jsx(pOe,{})]})}kN.createRoot(document.getElementById("root")).render(De.jsx(yt.StrictMode,{children:De.jsx(bBe,{})})); + */var JPe={prefix:"fas",iconName:"search",icon:[512,512,[],"f002","M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z"]},qPe={prefix:"fas",iconName:"times",icon:[352,512,[],"f00d","M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"]};function dC(n){"@babel/helpers - typeof";return dC=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},dC(n)}var QPe=["placeholder","value","onChange","onClearClick","className","disabled"];function PB(){return PB=Object.assign?Object.assign.bind():function(n){for(var e=1;en.length)&&(e=n.length);for(var t=0,r=new Array(e);t=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function oBe(n,e){if(n==null)return{};var t={},r=Object.keys(n),s,o;for(o=0;o=0)&&(t[s]=n[s]);return t}var aBe=function(e,t){return typeof t>"u"?me.useState(e):[t,function(){}]};function lBe(n,e){var t=n.placeholder,r=t===void 0?"":t,s=n.value,o=s===void 0?void 0:s,l=n.onChange,u=l===void 0?function(){}:l,h=n.onClearClick,f=h===void 0?function(){}:h,g=n.className,y=n.disabled,b=y===void 0?!1:y,w=sBe(n,QPe),C="".concat(li,"-search"),M=me.useMemo(function(){return typeof o<"u"},[]),A=aBe("",o),k=Q9(A,2),L=k[0],P=k[1],D=me.useState(M?L.length>0:!1),z=Q9(D,2),U=z[0],V=z[1];if(M!==typeof o<"u")throw"Search: Changing from controlled to uncontrolled component and vice versa is not allowed";var H=me.useRef(void 0),oe=function(){typeof H.current<"u"&&H.current.focus()};me.useImperativeHandle(e,function(){return{focus:oe}});var le=function(he){var ae=he.target.value;V(ae.length>0),M===!1&&P(ae),u(ae)},Z=function(){M===!1&&P(""),V(!1),f()};return yt.createElement("div",PB({},w,{className:Ps(C,q9({},"".concat(C,"--disabled"),b),g)}),yt.createElement(g_,{icon:JPe,className:"".concat(C,"__search-icon")}),yt.createElement("input",{ref:H,type:"text",className:"".concat(C,"__input"),placeholder:r,onChange:le,disabled:b,value:L}),yt.createElement(g_,{icon:qPe,className:Ps("".concat(C,"__clear-icon"),q9({},"".concat(C,"__clear-icon--active"),U)),onClick:Z}))}var Ete=me.forwardRef(lBe);Ete.displayName="Search";Ete.propTypes={placeholder:Qt.string,value:Qt.string,onChange:Qt.func,onClearClick:Qt.func,className:Qt.string,disabled:Qt.bool};function fC(n){"@babel/helpers - typeof";return fC=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},fC(n)}var uBe=["className","children","size","selected","onChange","itemsTabIndex"];function BB(){return BB=Object.assign?Object.assign.bind():function(n){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function pBe(n,e){if(n==null)return{};var t={},r=Object.keys(n),s,o;for(o=0;o=0)&&(t[s]=n[s]);return t}function mBe(n,e){var t=n.className,r=n.children,s=n.size,o=n.selected,l=n.onChange,u=l===void 0?AI:l,h=n.itemsTabIndex,f=fBe(n,uBe),g="".concat(li,"-status-list"),y=me.useRef();me.useImperativeHandle(e,function(){return{focus:function(C){var M=Array.from(y.current.querySelectorAll("li")),A=M.filter(function(k){return k.parentNode===y.current});typeof A[C]<"u"&&A[C].focus()}}});var b=h;return yt.createElement("ul",BB({ref:y},f,{className:Ps(g,t,cBe({},"".concat(g,"--").concat(s),s))}),yt.Children.map(r,function(w){var C={};o&&(C.selected=w.props.status===o),u&&(C.onClick=function(k){u(w.props.status),w.onClick&&w.onClick(k)});var M=function(L){u&&L.key==="Enter"&&L.shiftKey===!1&&L.altKey===!1&&u(w.props.status)},A=function(){if(typeof b=="number")return b>0?b++:b}();return yt.createElement("li",{tabIndex:A,onKeyPress:M},yt.cloneElement(w,C))}))}var xte=me.forwardRef(mBe);xte.displayName="StatusList";xte.propTypes={children:Iee([Mee]),selected:Qt.oneOf($ee),size:Qt.oneOf(Cee),itemsTabIndex:Qt.number,className:Qt.string,onChange:Qt.func};const RI=n=>n.includes("[Need Help]")?"Please help me.":n.includes("[Done]")?"Next phase.":n.replaceAll("","").replaceAll("","").replace("[Summary]","Summary: "),gBe=n=>{let e=[],t=n.split(""),r=RI(t.shift()).trim();return t.forEach(s=>{if(s.includes("")){let o=s.split("");e.push(o[0].trim()),o[1].length>0&&(r=r.concat(" ",RI(o[1]).trim()))}else r=r.concat(" ",RI(s.trim()))}),[r,e]};function _Be(n){let e=Bn(qi(o=>o.chatMessageHistory)),t=Bn(qi(o=>o.addMessageToHistory)),r=e.length,s=gBe(e[r-1].content);return Ne.jsxs(DPe,{style:{height:"100%"},children:[Ne.jsxs(yE,{children:[e.map((o,l)=>{if(l!=0)return l0&&Ne.jsx("div",{style:{paddingTop:"5px",paddingBottom:"5px"},children:s[1].map((o,l)=>Ne.jsx(qp,{text:o,clickFunction:()=>t(o)},l))}),Ne.jsx("div",{style:{right:0,bottom:5,position:"absolute"},children:Ne.jsx(qp,{text:"Next Phase",clickFunction:()=>t("[Done]")},"next-phase-btn")})]}),Ne.jsx(M2,{placeholder:"Type message here",attachButton:!1,onSend:t})]})}const AN=pr("div")(({theme:n})=>({textAlign:"center",height:"100%"}));function vBe(n){return Ne.jsxs(N1,{orientation:"vertical",style:{height:"100%",width:"100vw"},children:[Ne.jsx(Z0,{flex:.65,children:Ne.jsxs(N1,{orientation:"horizontal",children:[Ne.jsx(Z0,{flex:.3,children:Ne.jsx(AN,{style:{width:"100%"},children:Ne.jsx(mOe,{})})}),Ne.jsx(kf,{propagate:!0}),Ne.jsx(Z0,{flex:.7,children:Ne.jsx(AN,{style:{width:"100%",height:"100%"},children:Ne.jsx(_Be,{})})})]})}),Ne.jsx(kf,{propagate:!0}),Ne.jsx(Z0,{flex:.35,children:Ne.jsxs(N1,{orientation:"horizontal",children:[Ne.jsx(Z0,{children:Ne.jsx(AN,{children:Ne.jsx(zF,{isPlanningScreen:!0})})}),Ne.jsx(kf,{propagate:!0}),Ne.jsx(Z0,{children:Ne.jsx("div",{style:{textAlign:"center",height:"100%",alignItems:"center",display:"flex"},children:Ne.jsx(oc,{container:!0,alignItems:"center",children:Ne.jsx(oc,{item:!0,xs:12,alignItems:"center",children:Ne.jsx("img",{style:{alignContent:"center",width:"70%",height:"70%"},src:VK})})})})})]})})]})}function yBe(n){const e=Bn(t=>t.updateScreen);return Ne.jsxs(oc,{container:!0,direction:"row",justifyContent:"center",spacing:2,style:{height:"100%",textAlign:"center",alignContent:"center",backgroundColor:"#E4E5F1",marginTop:0},children:[Ne.jsx(oc,{item:!0,xs:1}),Ne.jsx(oc,{item:!0,xs:3,children:Ne.jsx(qp,{text:bX,clickFunction:()=>e(rF),style:{padding:"50px"}})}),Ne.jsx(oc,{item:!0,xs:2}),Ne.jsx(oc,{item:!0,xs:3,children:Ne.jsx(qp,{text:TX,clickFunction:()=>e(fw),style:{padding:"50px"}})}),Ne.jsx(oc,{item:!0,xs:1})]})}const IN=pr("div")(({theme:n})=>({textAlign:"center",height:"100%"}));Zg.common.defineBlocks(Lie);Object.assign(Cw.javascriptGenerator.forBlock,ik);function bBe(){const n=Bn(qi(o=>o.llmMode)),e=Bn(qi(o=>o.llmProcessing)),t=Bn(qi(o=>o.headerHeight)),r=Bn(o=>o.fullScreenPanel),s=Bn(o=>o.screenToShow);return Ne.jsxs(Ey,{width:"100vw",height:`calc(100vh - ${t}px)`,padding:0,children:[Ne.jsx(pve,{}),s===nF&&Ne.jsx(yBe,{}),s===rF&&Ne.jsx(vBe,{}),s===fw&&r&&Ne.jsx(JH,{style:{width:"100vw"}}),s===fw&&!r&&Ne.jsxs(N1,{orientation:"vertical",style:{height:"100%",width:"100vw"},children:[Ne.jsx(Z0,{flex:.55,children:Ne.jsxs(IN,{style:{width:"100%",height:"100%"},children:[r&&Ne.jsx(JH,{}),!r&&Ne.jsx($ve,{})]})}),Ne.jsx(kf,{propagate:!0}),Ne.jsx(Z0,{flex:.45,children:Ne.jsxs(N1,{orientation:"horizontal",children:[Ne.jsx(Z0,{children:Ne.jsx(IN,{children:!n&&Ne.jsx(uOe,{})})}),Ne.jsx(kf,{propagate:!0}),Ne.jsx(Z0,{children:Ne.jsx(IN,{children:!n&&Ne.jsx(zF,{})})})]})})]}),Ne.jsx(OF,{style:{color:"#fff",zIndex:1500},open:e,children:Ne.jsx("img",{src:Cve,style:{width:"10%"}})}),Ne.jsx(dOe,{}),Ne.jsx(pOe,{})]})}kN.createRoot(document.getElementById("root")).render(Ne.jsx(yt.StrictMode,{children:Ne.jsx(bBe,{})})); diff --git a/index.html b/index.html index cfac83b4..65639af7 100644 --- a/index.html +++ b/index.html @@ -25,7 +25,7 @@ Learn how to configure a non-root public URL by running `npm run build`. --> Misty Programming - +